diff --git a/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_content_list.json b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3233a8244fd8fad198635406b2b0cf1cfd30e5a9 --- /dev/null +++ b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aada9b00499ee0a972f402b5142e78ce2c0974c59804188ec52c5e43276355af +size 171583 diff --git a/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_model.json b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b3de3d570a53c3cf505da50ad377912c823d301a --- /dev/null +++ b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df452c5b144c682008601b7d0e95bbf949a6b202033af93d1ace43da1d47dcdc +size 206634 diff --git a/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_origin.pdf b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9f3db0b48224322db42397d0b0aea98a9d70d694 --- /dev/null +++ b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/1d9a9f73-d210-4c75-a063-a17b93efb60b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3742f8112bc33e43312ecf19ae36f3b831d2dea7402fd0091a937f6114512e9 +size 39566689 diff --git a/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/full.md b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e863b431d4eecbbb1f8b7214d01f4f7cf996e241 --- /dev/null +++ b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/full.md @@ -0,0 +1,658 @@ +# HyPoGen: OPTIMIZATION-BIASED HYPERNETWORKS FOR GENERALIZABLE POLICY GENERATION + +Hanxiang Ren*† + +ZJU & HKU + +Li Sun* + +HKU + +Xulong Wang + +ZJU + +Pei Zhou + +HKU + +Zewen Wu + +HKU & Transcengram + +Siyan Dong + +HKU + +Difan Zou + +HKU + +Youyi Zheng + +ZJU + +Yanchao Yang + +HKU + +# ABSTRACT + +Policy learning through behavior cloning poses significant challenges, particularly when demonstration data is limited. In this work, we present HyPoGen, a novel optimization-biased hypernetwork for policy generation. The proposed hypernetwork learns to synthesize optimal policy parameters solely from task specifications – without accessing training data – by modeling policy generation as an approximation of the optimization process executed over a finite number of steps and assuming these specifications serve as a sufficient representation of the demonstration data. By incorporating structural designs that bias the hypernetwork towards optimization, we can improve its generalization capability while only training on source task demonstrations. During the feed-forward prediction pass, the hypernetwork effectively performs an optimization in the latent (compressed) policy space, which is then decoded into policy parameters for action prediction. Experimental results on locomotion and manipulation benchmarks show that HyPoGen significantly outperforms state-of-the-art methods in generating policies for unseen target tasks without any demonstrations, achieving higher success rates and underscoring the potential of optimization-biased hypernetworks in advancing generalizable policy generation. Our code and data are available at: https://github.com/ReNginx/HyPoGen. + +# 1 INTRODUCTION + +Behavior cloning (BC) (Pomerleau, 1991) is highly promising in real-world applications, as it trains agents directly from expert demonstrations, which can be more easily acquired in certain scenarios than designing a proper reward function for Reinforcement Learning (RL). Moreover, BC alleviates the complexity in training for long-horizon tasks that may exist in infinite-dimensional spaces. + +While BC can bypass the challenges of reward function design and RL training difficulties by learning directly from expert demonstrations, it comes with its own limitations: (i) Substantial data requirement. Gathering sufficient high-quality expert data is time-consuming and labor-intensive, as it requires days, if not months, of manual recording of numerous instances of the desired behavior (spatial-temporal trajectories). This process can be particularly burdensome in complex or hazardous tasks. (ii) Insufficient generalization ability. Policies trained in one environment often fail to perform well in different ones due to overfitting to specific scene variations and task dynamics encountered during training (Zhang et al., 2018; Song et al., 2020). Such a lack of generalization limits the policy's applicability in complex, real-world scenarios with varying conditions. + +In response to these challenges, recent work attempts to enhance the generalization capability through Hypernetworks (Ha et al., 2017; Rezaei-Shoshtari et al., 2023). These networks learn a mapping from the task embedding (specification) space to the parameter space of target (policy) networks, enabling capturing the similarity between different tasks, which is crucial for transferability, and promoting better utilization of limited demonstrations. + +![](images/830062804117d2b89fa719729e07d9670d645421b71664cc715327d13ca54927.jpg) +Figure 1: Policy generation networks are trained on source (seen) task specifications with corresponding demonstrations using behavior cloning, and then directly applied to target (unseen) task specifications to generate policy network parameters for action prediction. By introducing optimization inductive biases into the proposed hypernetwork HyPoGen, we can achieve better performance on out-of-domain specifications without resorting to additional demonstration collection and training. + +Despite their success, previous works usually employ hypernetworks in a target-network-agnostic manner, typically by structuring them as multi-layer perceptrons (MLPs), and are subject to several limitations: (i) Overfitting risk: Training a hypernetwork to map a task embedding to the set of parameters of a policy network faces the same problem of overfitting to the tasks being learned, similar to the generalization difficulty encountered in supervised learning. (ii) Disregard for the optimization process: These hypernetworks do not account for the fact that the optimal weights of a target network are the result of optimization through (stochastic) gradient descent. (iii) Ignorance of target network structure: The hypernetworks predict different parts of the policy network simultaneously and do not utilize the information flow induced by the structure of the target network. + +These issues hinder the deployment of hypernetworks at a large scale for generalizable policy synthesis, for which we attempt to investigate and propose a potentially in-principle solution. Generalization from completely unrelated tasks, like piano playing to pizza cooking, is exceptionally challenging. A more achievable type of generalization occurs in tasks with similar characteristics, such as an agent learning to handle objects of various shapes or operate under unseen dynamics. In such cases, tasks are defined by environmental and embodiment parameters (specification) that help the agent leverage and generalize through sharable characteristics across different tasks. + +To address these issues, we present HyPoGen, a method that biases Hypernetworks for Policy Generation from task specifications. HyPoGen employs inductive biases in both the optimization process and the interdependencies within the target network structure to facilitate generalizable policy synthesis. Our approach imitates the iterative optimization in the latent parameter space, updating policy network parameters solely based on task specifications rather than relying on manually collected demonstration data. To further bias the hypernetwork training towards optimization with structural information of the policy network, HyPoGen mimics the interdependent gradient computation (involved in the backward propagation) during the (forward) synthesis procedure in the latent parameter space. This is achieved by predicting the neural "gradients" of each conceptual network block according to the chain rule relationship. The predicted latent parameters can then be decoded back to the original parameter space, enabling action prediction when loaded into the target policy network. + +We conduct an extensive evaluation within both locomotion and manipulation environments. Our proposed method, trained on the DeepMind Control Suite (Tunyasuvunakool et al., 2020) and ManiSkill (Mu et al., 2021), outperforms state-of-the-art (SOTA) methods in both settings. HyPoGen achieves a significant enhancement in success rate for various stiffness and arm lengths in ManiSkill environments. Furthermore, our experiments validate that HyPoGen performs optimization based solely on task specifications without actual demonstration data. In summary, our main contributions include: + +- We propose a novel hypernetwork architecture termed HyPoGen that integrates the inductive bias of the optimization process of the target network under behavior cloning. +- We introduce an effective approach for learning (latent) neural gradient updates, explicitly modeling the interdependencies of gradients across different target network blocks. +- We comprehensively benchmark our approach against previous methods in both locomotion and manipulation tasks, demonstrating its superiority in generalizable policy generation. + +# 2 RELATED WORK + +Behavior cloning and policy generation BC (Bain & Sammut, 1995) enables efficient learning and replication of policies through expert demonstration data. Due to its ability to directly imitate demonstrated behavior without requiring fine-grained reward functions or extensive interactions with the environment, BC has shown remarkable effectiveness when combined with RL tasks (Lee & Zhang, 2021; Goecks et al., 2019; Kumar et al., 2022; Rajeswaran et al., 2017; Nair et al., 2018). For instance, it has been used to pre-train Q-functions by minimizing the temporal difference (TD) error between the demonstrated expert policy and the optimal policy (Hester et al., 2018), or to guide exploration through reward and policy shaping (Subramanian et al., 2016; Brys et al., 2015). Current behavior guidance methods strive to explore strategies beyond the original demonstrations (Gao et al., 2018; Brown et al., 2020), but generalization remains a fundamental challenge. + +A primary issue of BC is the lack of generalization to unseen scenarios due to distributional mismatch (Ross et al., 2011). Given the high cost of collecting extensive demonstration data, efforts are made to learn generalizable policies with a limited number of demonstrations (Kim et al., 2013; Mandlekar et al., 2020; Prados et al., 2024). Several methods achieve better generalization by exploring perturbations in the policy parameter space (Such et al., 2017), known as evolutionary algorithms (Salimans et al., 2017). Further approaches add noise to the parameters and optimize through policy gradient descent to facilitate exploration (Plappert et al., 2017; Cao et al., 2020). Other works focus on generalizing to long-horizon, multi-stage tasks by leveraging the compositionality of a small set of given demonstrations (Mandlekar et al., 2020). They learn goal-directed policies from stochastic rollouts during the behavior cloning phase to achieve controllable behaviors. However, existing works still struggle with contextual variations and perform poorly in zero-shot settings. + +Hypernetworks (Ha et al., 2017), generally speaking, use a neural network to generate the weights of a target network. During training, only the learnable hypernetwork weights are optimized. One of the noticeable merits of hypernetworks is the parameter efficiency. It achieves this by generating weights of multiple target networks on related tasks, performing well in soft-weight sharing (Chauhan et al., 2023b; Von Oswald et al., 2019; Navon et al., 2021; Zhao et al., 2020) and weight compression (Ha et al., 2017). Hypernetworks hold a good connection with meta-learning, primarily due to their intrinsic capability to facilitate the learning-to-learn process. Research such as (Sendera et al., 2023; Przewieżlikowski et al., 2022) employs hypernetworks to encapsulate the inner-update loop within the MAML framework (Mishra et al., 2017). These approaches help position hypernetworks as a meta-optimizer, a concept that has also inspired the methodology adopted in our study. + +In the field of multi-task RL and meta-RL, which focus on policy generation and generalization, hypernetworks have achieved successful applications in areas such as morphology control (Xiong et al., 2023; 2024), episodic memory (BG et al., 2024), context-aware response (Beukman et al., 2024), and dynamics model generation (Xian et al., 2021). For instance, using an MLP-based hypernetwork to learn a universal policy for different robotic morphologies can maintain computational efficiency while achieving inference performance comparable to that of Transformers (Xiong et al., 2024). Other approaches demonstrate that when incorporating contextual information into policy adaptation, generating the weights of decision adapters with a hypernetwork can effectively circumvent the computational constraints caused by the expansion of learnable parameters (Beukman et al., 2024). As far as we observe, these methods (Xian et al., 2021; Beck et al., 2023) focus on the combination of the hypernetworks and zero-shot contextual RL. However, our method focuses on the hypernetwork structure and explicit modeling of the optimization procedure of the target network for achieving generalizable policy generation. + +Learned Optimizers In this work, we design the hypernetwork to work like an optimizer. This is in concept similar to learned optimizers (LO) (Harrison et al., 2022; Bengio et al., 2013; Runarsson & Jonsson, 2000; Andrychowicz et al., 2016; Wichrowska et al., 2017). LO are models designed to enhance the efficiency and effectiveness of optimization processes. Unlike traditional hand-crafted algorithms such as SGD or Adam, LO leverages meta-learning to learn optimization strategies directly. Their primary goal is to generalize across tasks and outperform standard optimizers by adapting to specific problem structures. A key distinction is that LO is meta-learned and requires tuning on novel tasks. In contrast, our proposed structure predicts the update scheme directly from task specifications, eliminating the need for any data at test time. + +![](images/b22a6af635ffb538dde1801771e736e21a6e48539f6155e36bdefb29374dbc58.jpg) +(a) + +![](images/fcc5d8eb3e4f747572f354121c5f772dcdf693cb426534eefc41f05eaa2aa450.jpg) +(b) +Figure 2: (a) Given expert demonstrations $\mathcal{D}(\mathcal{M})$ , one can always achieve the optimal policy $\theta^{*}$ via BC with stochastic gradient descent (SGD), which also defines the generalization upper bound in the context of BC for task $\mathcal{M}$ . (b) Due to the lack of demonstrations, conventional hypernetworks generate parameters $\hat{\theta}$ for the task $\mathcal{M}$ , by supervised learning the mapping from task to parameters, subject to overfitting given infinite solution space. (c) Even without actual demonstrations, we propose that the task $\mathcal{M}$ is informative of the data, and can thus be used to guide the iterative update for predicting the optimal parameters $\hat{\theta}^{*}$ (as in (a), Sec. 4.1), which in turn constrains the solution space and promotes prediction as optimization (from the task instead of data, Sec. 4.2). (d) With the proposed architectural inductive bias, the hypernetwork in (c) is indeed performing iterative optimization (action prediction loss is decreasing) as the iteration (block) number increases. $^1$ + +![](images/e8b1526166fd25aeb3ad162573f0228f45e67412634e73844e0a93cfa80334da.jpg) +(c) + +![](images/2352a83fd2034daedebb65f9a493e8332a3e523ce2998acc547581afd2690dfa.jpg) +(d) + +# 3 POLICY GENERATION WITH HYPERNETWORKS + +Given a Markov Decision Process (MDP) $\mathcal{M} = (\mathcal{S},\mathcal{A},\mathcal{T},R,\gamma)$ where $\mathcal{S}$ is the state space, $\mathcal{A}$ is the action space, $\mathcal{T}:S\times \mathcal{A}\to p(S)$ is the transition function, $R:S\times \mathcal{A}\rightarrow \mathbb{R}$ is the reward function, and $\gamma \in [0,1]$ is the discount factor, an optimal control policy $\pi :S\to p(\mathcal{A})$ is supposed to maximize the expected (discounted) return in the context of reinforcement learning (RL). Typically, the policy network $\pi$ is a multi-layer perceptron (MLP) (Rakelly et al., 2019; Sarafian et al., 2021; Rezaei-Shoshtari et al., 2023; Beck et al., 2023). However, training a policy network with RL is challenging (Ibarz et al., 2021), e.g., due to large exploration space and optimization difficulties. + +To resolve the training difficulties in RL, behavior cloning (BC) trains a policy network in a supervised manner with a dataset of expert demonstrations $\mathcal{D} = \{(s_t^i,a_t^i)\}_{i = 1}^{N_d}$ with $N_{d}$ being the number of demonstrations and $s_t^i,a_t^i$ being the state and action at time $t$ respectively. The optimal policy can then be obtained by minimizing the action prediction loss $\mathcal{L}(\theta ,\mathcal{D}) = \sum_{i,t}\ell (\pi (s_t^i;\theta),a_t^i)$ , with $\ell$ as a discrepancy metric and $\theta \in \Theta$ as the parameters of policy network $\pi$ . Despite the stability and efficiency of the training procedure, BC relies heavily on expert data and may not generalize to unseen task specifications. To generalize, one has to collect demonstrations covering all different situations, which is time-consuming and costly, especially for real-world applications. + +Problem formulation. We aim to maximize the utilization of the limited demonstrations for BC by developing a mechanism that can automatically synthesize the "optimal" policy network (parameters) from a novel specification of a given task. Specifically, for source task set $S$ and target task set $T$ , we denote the source tasks characterized by the corresponding MDP as $\mathcal{M}_S = \{\mathcal{M}_j | \mathcal{M}_j = (\mathcal{S}_j, \mathcal{A}_j, \mathcal{T}_j, R_j, \gamma), j \in S\}$ , and similarly the target tasks are $\mathcal{M}_T = \{\mathcal{M}_j | j \in T\}$ , with $\mathcal{M}_S \cap \mathcal{M}_T = \emptyset$ , e.g., differing in environmental settings or dynamics. Moreover, for source task $\mathcal{M}_j \in \mathcal{M}_S$ , there exists a collection of demonstrations $\mathcal{D}_j$ , whereas for the target tasks in $\mathcal{M}_T$ , no demonstrations are available. Our goal is to train a network with $\Omega$ as parameters, $\mathcal{H}^\Omega: \mathcal{M} \to \Theta$ , to produce the weights $\theta$ of the policy network $\pi$ after consuming the task specification $\mathcal{M}$ , such that $\pi(\cdot; \mathcal{H}(\mathcal{M}))$ minimizes the BC loss derived with the demonstrations $\mathcal{D}(\mathcal{M})$ . + +Formally, the neural network $\mathcal{H}$ functions as a hypernetwork (Ha et al., 2017), and can be trained by minimizing the following: + +$$ +\mathcal {L} \left(\Omega , \left\{\left(\mathcal {M} _ {j}, \mathcal {D} _ {j}\right) \right\} _ {j \in S}\right) = \sum_ {j} \sum_ {i, t} \ell \left(\pi \left(s _ {t} ^ {i, j}; \mathcal {H} \left(\mathcal {M} _ {j}\right)\right), a _ {t} ^ {i, j}\right), \tag {1} +$$ + +where $j$ is the task (specification) index and $i, t$ go through different demonstrations and time steps within a task. After training, the hypernetwork $\mathcal{H}$ should be able to synthesize the optimal parameters for each source task (specification) in $\mathcal{M}_S$ , i.e., $\mathcal{L}(\Omega, \{(\mathcal{M}_j, \mathcal{D}_j)\}_{j \in S})$ is minimal. Note that without demonstrations for the target tasks $\mathcal{M}_T$ , the performance of the synthesized policy networks fully + +![](images/c5786a31e88a42ba2236d73cdbe9470e6d40d6694cccabfae11a2c73885efb5f.jpg) +Figure 3: The overall pipeline of the proposed HyPoGen. Top: HyPoGen uses an iterative update scheme (Eq. 6) to generate the policy network parameters $\theta$ from the task specification $\mathcal{M}$ . Bottom: inside each hypernet block, we calculate the neural "gradients" for each block of the policy network in a way resembling the backpropagation process (Eq. 7, 8). + +depends on the generalization capability of $\mathcal{H}$ while only being trained on the source tasks $\mathcal{M}_S$ and the demonstrations $\{\mathcal{D}_j|j\in S\}$ . Next, we elaborate on the generalization gap of $\mathcal{H}$ as a mapping from the task specification to the optimal parameters, and how we can improve the generalization by injecting an inductive bias into its structure that encourages optimization instead of memorization. + +# 4 HYPERNETWORKS AS OPTIMIZATION WITHOUT DATA + +Motivation. As pointed out by (Heckel & Yilmaz, 2021; Nakkiran et al., 2021), an optimization process with a proper number of steps tends to yield parameters that generalize better than a model directly memorizing the training set. Currently, the architecture of hypernetworks is dominated by MLPs, especially those focusing on policy generation (Chauhan et al., 2023a). While an MLP is capable of mapping a task specification to the parameters of a policy network, it remains a very naive approach, offering limited generalization ability due to its lack of inductive bias. Building on this insight, we propose a novel hypernetwork to function as an iterative optimization process, rather than simply memorizing the best parameters for each training task. This operation is similar to the task-specific training with SGD and thus could potentially induce better generalization performance due to 1) this inductive bias constrains the search space for the hypernetwork, thus, less prone to overfitting to the training tasks; and 2) optimization is a low-degree-of-freedom operation and, if learned, will approach the upper bound set by task-specific training using demonstrations. Next, we will first introduce the designing principle in Sec. 4.1; and then we detail the proposed hypernetwork with the introduced bias in Sec. 4.2. An overview of the motivation is presented in Fig. 2, which also shows evidence that the proposed hypernetwork is performing optimization when checking the action prediction loss. + +# 4.1 BIASING HYPERNETWORKS TOWARDS OPTIMIZATION + +The overall pipeline of the proposed HyPoGen is illustrated in Fig. 3. In this section, we start by deriving the gradient formula for target networks on a given datapoint (Eq. 3, 4), and then we argue that the dependency on specific data can be resolved (Eq. 5). Finally, we present the model structure that incorporates the optimization inductive bias targeting MLP-based policy networks (Eq. 6, 7, 8). + +Since most policy networks are MLPs due to their training efficiency and scalability, and without loss of generality, we can put a policy into the following format: + +$$ +\pi (s; \theta) = \mathrm {h} _ {N} ^ {\theta_ {N}} \circ \mathrm {h} _ {N - 1} ^ {\theta_ {N - 1}} \circ \mathrm {h} _ {N - 2} ^ {\theta_ {N - 2}} \circ \dots \circ \mathrm {h} _ {2} ^ {\theta_ {2}} \circ \mathrm {h} _ {1} ^ {\theta_ {1}} (s), \tag {2} +$$ + +where $\theta = \{\theta_{n}\}_{n = 1}^{N}$ and $N$ is the number of layers (or blocks) in the policy network $\pi$ . Please note that each layer $\mathbf{h}$ does not need to be a fully connected layer, e.g., $\mathbf{h}$ can be a block of layers or + +a sub-network. The grouping of the parameters of a policy network into the format presented in Eq. 2 depends on its actual topology, and we mainly experiment with the MLP structure, given its popularity in the policy learning literature. + +Furthermore, to fit a single data point $(s,a)$ under the $\ell_2$ distance, a gradient step updates the policy network parameters as: + +$$ +\theta^ {k + 1} = \theta^ {k} + \lambda \cdot (\pi (s; \theta^ {k}) - a) \cdot \frac {\partial \pi (s ; \theta^ {k})}{\partial \theta} \tag {3} +$$ + +where, $\lambda \cdot (\pi (s;\theta^k) - a)$ denotes the effective stepsize and $\partial \pi (s;\theta^k) / \partial \theta$ can be computed using the chain rule: + +$$ +\frac {\partial \pi (s ; \theta^ {k})}{\partial \theta_ {n}} = \left(\prod_ {m = 1} ^ {N - n} \frac {\partial \mathrm {h} _ {N - m + 1} \left(z _ {N - m} ; \theta_ {N - m + 1} ^ {k}\right)}{\partial z _ {N - m}}\right) \frac {\partial \mathrm {h} _ {n} \left(z _ {n - 1} ; \theta_ {n} ^ {k}\right)}{\partial \theta_ {n}}, \tag {4} +$$ + +with $z_{n} = \mathrm{h}(z_{n - 1};\theta_{n})$ the activation of the $n$ -th layer (block). Please note that even though Eq. 3 and Eq. 4 are instantiated with a single state-action pair, the counterparts computed with a dataset of demonstrations share a similar format. Therefore, we proceed to describe the proposed hypernetwork architecture without further laboring. + +# 4.2 NEURAL ESTIMATION OF POLICY UPDATES WITHOUT DATA + +Accurate computation of the updates in Eq. 3, 4 for deriving the optimal policy is difficult due to the lack of demonstration data for the target tasks, for example, both $\lambda \cdot (\pi (s;\theta^k) - a)$ and $\partial \pi (s;\theta^k) / \partial \theta$ in Eq. 3 are data-dependent. However, it is possible to approximate these updates (at least theoretically), if we treat the specification $\mathcal{M}$ of a target task as a sufficient representation of its demonstrations. + +More specifically, the update of the policy parameters over all demonstrations is + +$$ +\Delta \theta = \mathbb {E} _ {(s, a) \sim p (\mathcal {D} (\mathcal {M}))} \left[ \lambda \cdot \left(\pi (s; \theta) - a\right) \cdot \frac {\partial \pi (s ; \theta)}{\partial \theta} \right] = F \left(\theta , p (\mathcal {D} (\mathcal {M}))\right), \tag {5} +$$ + +Note that the expectation is taken over the distribution of training demonstrations $\mathcal{D}(\mathcal{M})$ , which is defined by the task specification $\mathcal{M}$ . The update of the policy parameters can be seen as a function $F$ that only depends on the policy network parameters $\theta$ and the distribution of the demonstrations $p(\mathcal{D}(\mathcal{M}))$ . + +With the above reasoning, it is sufficient to use an encoded representation of the task specification $\phi(\mathcal{M})$ to represent $p(\mathcal{D}(\mathcal{M}))$ and estimate the policy updates $\Delta \theta = F(\theta, \phi(\mathcal{M}))$ . We use the same task encoder as in previous works (Rezaei-Shoshtari et al., 2023; Sarafian et al., 2021), though these works directly map the task specification to policy parameters. Taking this ground, we propose the following hypernetwork that leverages the structures presented in Eq. 3, 4 for promoting the optimization generalization, as well as tackling the lack of demonstration at test time. + +Iterative policy update with "neural gradients". Inspired by Eq. 3, 5 and the above reasoning, we propose network modules $\lambda$ and $\psi$ , such that the output of the proposed hypernetwork is as follows: + +$$ +\mathcal {H} (\mathcal {M}) = \theta^ {K}, \text {a n d} \theta^ {k} = \theta^ {k - 1} + \lambda^ {k} \left(\theta^ {k - 1}, \phi (\mathcal {M})\right) \cdot \psi^ {k} \left(\theta^ {k - 1}, \phi (\mathcal {M})\right), \tag {6} +$$ + +where $\lambda^k$ and $\psi^k$ estimate the "stepsize" (i.e., $\lambda \cdot (\pi(s; \theta) - a)$ ) and "gradient" of the $k$ -th policy update from the task embedding (specification) $\phi(\mathcal{M})$ . The total number of updates is $K$ , and $\theta^0$ is a set of learnable parameters. To improve the training efficiency, we also compress/recover the policy network parameters via an encoder and a decoder so that the hypernetwork $\mathcal{H}$ can perform the policy generation in a latent space. (details can be found in Sec. A.2). + +We further incorporate the optimization inductive bias from Eq. 4 into the structure of $\psi$ to estimate the corresponding terms. Let $\nabla_{z}\mathrm{h}_{n}(z_{n - 1};\theta_{n}) = \partial \mathrm{h}_{n}(z_{n - 1};\theta_{n}) / \partial z_{n - 1}$ and $\nabla_{\theta}\mathrm{h}_n(z_{n - 1};\theta_n) =$ $\partial \mathrm{h}_n(z_{n - 1};\theta_n) / \partial \theta_n$ represent the gradients with respect to the activations and parameters, respectively. Then, we divide gradient estimation function $\psi$ into two sub-networks $\psi_{n}^{z}$ and $\psi_{n}^{\theta}$ , implemented by MLPs, to estimate $\nabla_{z}\mathrm{h}_{n},\nabla_{\theta}\mathrm{h}_{n}$ respectively. Moreover, we instantiate another series of MLPs $\phi_n^z,n = 1\dots N$ that compute the pseudo estimation of the activation $z_{n}$ 's, i.e., $\hat{z}_n = \phi_n^z\circ \phi_{n - 1}^z\circ \dots \circ \phi_1^z (\phi (\mathcal{M}))$ . One could also make the estimation of $\hat{z}_n$ s dependent on the current estimate of the latent parameters, but we omit the dependence for clarity and leave the necessity to experimental justifications. + +With these, the neural estimate of $\nabla_z\mathrm{h}_n$ and $\nabla_{\theta}\mathrm{h}_n$ for each iteration $k$ are computed as: + +$$ +\hat {\nabla} _ {z} \mathrm {h} _ {n} = \psi_ {n} ^ {z} \left(\hat {z} _ {n - 1}, \theta_ {n}\right) \text {a n d} \hat {\nabla} _ {\theta} \mathrm {h} _ {n} = \psi_ {n} ^ {\theta} \left(\hat {z} _ {n - 1}, \theta_ {n}\right), \tag {7} +$$ + +with the superscript $k$ omitted for clarity, and now we have the output of $\psi$ as: + +$$ +\psi (\theta , \phi (\mathcal {M})) = \left\{\left(\prod_ {m = 1} ^ {N - n} \hat {\nabla} _ {z} \mathrm {h} _ {N - m + 1}\right) \hat {\nabla} _ {\theta} \mathrm {h} _ {n} \right\} _ {n = 1} ^ {N}, \tag {8} +$$ + +which is the neural counterpart of the gradient computation illustrated in Eq. 4. Given these structural designs, we can denote the proposed policy-generation hypernetwork as $\mathcal{H} = \{\{\lambda^k\}_{k=1}^K, \phi, \{\phi_n^z, \psi_n^z, \psi_n^\theta\}_{n=1}^N, \theta^0\}$ , which are the learnable parameters. + +Training loss. Finally, we can train the proposed hypernetwork $\mathcal{H}$ for policy generation (HyPoGen) using the demonstrations of source tasks $\{\mathcal{M}_j,\mathcal{D}_j\}_{j\in S}$ by minimizing the BC loss presented in Eq. 1 in an end-to-end manner. Next, we study the effectiveness and generalization of the proposed hypernetwork in synthesizing policies for target tasks (from only the task specifications) without accessing any demonstrations. + +# 5 EXPERIMENTS + +The experiments are designed to evaluate the generalization capabilities of existing policy generation methods and to demonstrate the effectiveness of our proposed method, which biases the hypernetwork towards optimization. We leverage two sets of tasks for evaluation. The first set is derived from MuJoCo environments, which provide a robust platform for concept verification and are widely used by existing methods. The second set of tasks is sourced from the ManiSkill environment, which includes replicas of real robot arms and is more closely aligned with real-world scenarios. By conducting experiments in both MuJoCo and ManiSkill environments, we aim to comprehensively evaluate our methods, demonstrating their versatility in handling + +![](images/d172ece003458b33a0d8382065800f75c45b6d8a43b9381b92541a103ad20bf1.jpg) +Figure 4: Our model shows better generalization than the baseline HyperZero (details in Sec. 5.2). + +Experiments are conducted individually on five selected representative tasks. Each task is varied by a group of specifications. It is important to emphasize that we focus on the generalization among different specifications within each task, rather than developing a generic policy generation for drastically different tasks. For each task, we split the specifications into a training set, denoted as $\mathcal{M}_S$ , and a test set, denoted as $\mathcal{M}_T$ , and $\mathcal{M}_S \cap \mathcal{M}_T = \emptyset$ . The methods are trained on the expert trajectories from $\mathcal{M}_S$ , and during test time, we roll out a policy for each specification in $\mathcal{M}_T$ and report the average of their performance (on the designated specification). Experimentally, instead of using the full MDP $\mathcal{M}$ as input, we omit the common component in $\mathcal{M}$ and use the task specification (length/target speed, etc.) as the input. + +# 5.1 ENVIRONMENT SETUP + +MuJoCo. Following HyperZero Rezaei-Shoshtari et al. (2023), we use three environments from DeepMind Control Suite Tunyasuvunakool et al. (2020) (a wrapper of the MuJoCo environment Todorov et al. (2012)) for evaluation: Cheetah, Walker, and Finger. For each task, we examine three types of specifications: (1) the desired speed of the object, (2) the torso length of the object, and (3) the combinations of speed and length. + +ManiSkill. We utilize the ManiSkill2 environment Mu et al. (2021); Gu et al. (2023) to validate the real-world applicability. We select two tasks, LiftCube and Pick&PlaceCube, and conduct experiments using the Franka Panda robotic arm. We examine four types of specifications: (1) the size of the target cube, (2) the stiffness of the controller, (3) the damping of the controller, and (4) the arm length of the robot. The detailed settings of the task specifications can be found in Sec. B.1. + +Data collection and evaluation protocols. For MuJoCo Environments, we pre-train a TD3 Fujimoto et al. (2018) agent on each specification separately for $1 \times 10^{6}$ steps as the expert. For each specification, 10 trajectories of length 1000 are collected as the demonstration. We randomly split the specifications into training and test sets using a $20\%$ to $80\%$ ratio. At test time, we evaluate the performance by calculating the average reward of roll-out policies. The training/test splitting process is repeated five times, and the average is calculated to reduce the effects of randomness. + +For Maniskill Environments, we pre-train a PPO agent Schulman et al. (2017) for $4 \times 10^{6}$ steps and collect 1000 successful trajectories for each specification. We uniformly sample $30\%$ of the data for training, and use the remaining $70\%$ for testing. At test time, we calculate the average success rate and the average episode length for evaluation. + +Baselines. For a fair comparison, all methods (including ours) use the same policy network architecture and specification encoder. The baselines are summarized as follows: + +1. Specification conditioned policy (Cond Policy): This method aims to learn a general policy for all specifications. First, the network encodes the task specification using an encoder. It then takes the concatenation of the encoded specification and the state as input to predict the action. +2. Specification conditioned policy with UVFA Schaul et al. (2015): This method predicts actions and values under the UVFA framework. It first predicts the action in a similar way to specification-conditioned policy. Besides, it adds an extra branch to predict the action-value functions $Q(s, \hat{a})$ where $s$ is the current state and $\hat{a}$ is the predicted action, effectively utilizing the action-value in the expert rollouts as an extra supervision signal. +3. Specification conditioned Meta Policy: This method trains the policy network with the MAML Finn et al. (2017) framework. It aims to learn a set of weights that could adapt to different specifications. It predicts action similarly to specification-conditioned policy but trains differently through an inner-outer loop process, where the inner loop adapts the model to the support set, and the outer loop optimizes the model's initial parameters for rapid adaptation. Note that this method requires few-shot fine-tuning at test time. +4. PEARL Rakelly et al. (2019): Unlike other baselines, this method does not require access to contextual information. It instead keeps a replay buffer and uses it to generate an environment descriptor via a variational inference approach. This way, it can effectively leverage past experience and enable efficient off-policy learning. Note that this method also requires few-shot fine-tuning at test time. +5. HyperZero Rezaei-Shoshtari et al. (2023): It uses an MLP-based hypernetwork to predict the weight of policy networks. The hypernet takes the encoded specification as input and outputs the policy network parameters. + +We conduct zero-shot policy generation evaluations for Cond Policy, UVFA, HyperZero, and our method. In contrast, the evaluations for Meta Policy and PEARL are carried out in a few-shot transfer setting. More specifically, these two methods are fine-tuned using expert trajectories from the test specifications $M_T$ , thus breaking the no test-time demonstration assumption. + +Implementation details of HyPoGen. We apply the same task encoder design as in HyperZero (Rezaei-Shoshtari et al., 2023), which consists of 6 Res-Blocks. Following (Rezaei-Shoshtari et al., 2023), the policy networks are implemented as two-layer MLPs with hidden dimension 256 for MuJoCo and three-layer MLPs with hidden dimension 256 for ManiSkills. The input and output dimensions are specified by the task. + +We use $K = 8$ hypernet blocks and apply Adam (Kingma & Ba, 2015) optimizer with learning rate $1 \times 10^{-4}$ . We train our model on an NVIDIA 4090 GPU with a batch size of 512 for 2000 epochs (approximately 11 hours); we use the same hyperparameters in ManiSkill except for training 1000 epochs (approximately 10 hours). We detail our hyperparameters in Sec. B.2. + +# 5.2 QUALITATIVE RESULTS + +To intuitively illustrate the generalization ability of our method, we compare its performance with HyperZero (Rezaei-Shoshtari et al., 2023) on the Cheetah environment in MuJoCo. Both methods + +Table 1: Comparison of the average reward achieved by different methods on the MuJoCo tasks. The bold and underline numbers indicate the best and second-best results. + +
Reward ↑ +MethodCheetahFingerWalker
speedlengthspeed&lengthspeedlengthspeed&lengthspeedlengthspeed&length
Cond Policy433.24574.70356.68379.66409.30289.58151.95336.71186.15
UVFA396.86588.56340.78383.65422.62287.43115.60294.87177.81
Meta Policy337.35579.41199.63125.89217.58114.7844.5446.2244.44
PEARL177.16705.07214.65121.49160.42152.8852.0654.1353.03
HyperZero695.73895.46602.39596.80536.56353.68328.48642.22393.93
HyPoGen(Ours)819.23926.90623.76835.21657.12365.85436.26706.16409.88
Expert Rollout869.59963.07927.12975.71959.42913.40722.68897.11814.43
+ +Table 2: Comparison of the success rate (\%) and episode length (#steps) on the ManiSkill tasks. For each specification, we roll out 100 trajectories and compute the average success rate and episode length. Again, **bold** and **underline** numbers indicate the best and second-best results. + +
% Rate ↑, #Steps ↓LiftCubePick&PlaceCube
Methodcube sizestiffnessdampingarm lengthcube sizestiffnessdampingarm length
Cond Policy89.93, 32.090.00, 200.0056.28, 94.2769.36, 71.4069.81, 75.062.20, 196.5639.26, 131.4143.77, 123.02
UVFA90.27, 32.400.00, 200.0078.67, 53.5372.18, 66.1171.75, 71.910.00, 200.0029.53, 146.6836.85, 134.42
Meta Policy84.67, 41.140.00, 200.000.06, 199.9076.45, 56.9512.62, 177.890.22, 199.770.21, 199.648.15, 185.68
PEARL84.47, 41.6059.87, 86.7035.67, 132.2378.73, 52.8621.06, 163.2824.44, 156.2212.58, 177.5416.08, 171.93
HyperZero86.60, 38.240.00, 200.0031.33, 140.9063.64, 81.5925.87, 155.270.00, 200.000.00, 200.0013.92, 174.91
HyPoGen(Ours)85.87, 39.3797.20, 16.7293.28, 24.7885.73, 39.4472.87, 68.9778.33, 58.7641.26, 125.9952.54, 106.75
Expert Rollout94.13, 22.8696.73, 17.8897.28, 16.3093.64, 24.7469.87, 73.2675.92, 62.6573.72, 66.1954.77, 101.14
+ +are trained on target speeds 1 and 10 and tested on speeds from 2 to 9, with reward curves shown in Fig. 4. These experiments show that even though the different tasks are varied by a single parameter (i.e., speed), transferring between them is challenging. While both methods perform similarly on training tasks, HyperZero's performance degrades significantly on unseen tasks with larger train-test gaps, whereas HyPoGen maintains stable performance, showing superior generalization. + +# 5.3 COMPARISONS + +MuJoCo. The test-time average rewards obtained from different methods are reported in Tab. 1. We can observe that the rewards obtained from conditioned policies (Cond Policy and UVFA) are considerably lower than those from the expert. This suggests that the effectiveness of using specifications as network input (condition) is limited. The two few-shot fine-tuning methods, Meta Policy and PEARL, also perform much worse than the expert rollout. HyperZero outperforms all other baselines, illustrating that hypernetwork is a more powerful policy generation paradigm than the conditioning methods. Our method yields the best results across all tasks and specifications, demonstrating the advantage of incorporating optimization inductive bias over direct policy generation. Please refer to Sec. C.1 for detailed results in each specification and Tab. 13 in the appendix for the standard deviation of the results. + +ManiSkill. We report the average success rate and episode length in Tab. 2, and the standard deviation of episode length in Tab. 14 in the appendix. The max step of a trial is set to 200. All methods can achieve high success rates across different cube size specifications. We contend that this task is relatively simple, as it primarily involves controlling the clamp's opening width, which is nearly linear to the cube size. In more challenging scenarios where controller stiffness, damping, and arm length are varied, a linear relationship is no longer valid. As a result, the performances of different methods vary and degenerate. In the most challenging stiffness specifications, the conditional policy methods, the meta-learning baseline, and HyperZero fail to learn a reasonable policy. In contrast, the proposed method HyPoGen is able to generate policies that achieve high success rates and low episode length, demonstrating its superior generalization ability. Additionally, in-depth experiments in Sec. C.3 verified that the poor performance of the baselines is attributed not to a lack of capacity, but to their inductive bias, further highlighting HyPoGen's superior generalization. + +# 5.4 ANALYSIS + +In this section, we perform analysis and ablation studies to validate our model from different aspects. By default, we use the task Cheetah from MuJoCo, with different speed specifications. + +Does HyPoGen actually perform optimization? Since we aim at biasing the hypernetwork towards optimization, one may be interested in knowing: (1) if HyPoGen simply remembers a fixed set of parameters for each specification, and (2) will the "neural gradients" work in a similar way to ordinary gradients? i.e., if they are really optimizing the BC loss. + +For the first question, We fix the input specification $M$ and examine the response of HyPoGen with various input weights $\theta^0$ . Specifically, we replace the values of $\theta^0$ with uniformly random values within the range of $[-0.1, 0.1]$ , and then com + +Table 3: Statistics of the generated parameters by HyPoGen. We report the average magnitude of the parameters and their standard deviation. + +
MagnitudeStd.
fc1.weight43.929.32
fc1.bias6.172.20
fc2.weight9.315.53
fc2.bias0.440.31
+ +pare the outputs of $\theta^K$ for different initial values of $\theta^0$ . The statistics of weights and biases in $\theta^K$ are reported in Tab. 3. It is clear that the differences are significant, indicating that HyPoGen is not simply memorizing a certain set of fixed parameters for a given task specification. + +As for the second question, since HyPoGen requires significantly fewer update steps than conventional gradient descent (8 versus thousands), the "neural gradient" encapsulates much more informa + +Table 4: BC loss after each "gradient" update. + +
#Updates12345678
Loss@Cheetah71.4961.1346.3040.6421.9511.213.191.61
Loss@LiftCube9.0415.2022.9722.681.4180.9480.6440.123
+ +tion than the local gradient. Therefore, it is not appropriate to directly compare the values of neural gradients with conventional ones. Instead, we report the BC loss after each optimization step (i.e. $\mathrm{BCLoss}(\theta^k)$ ). The results in Tab. 4 show that BC loss is constantly decreasing after each update, verifying the effectiveness of HyPoGen in predicting neural "gradients" that optimize the weights of the network. Thus, HyPoGen not only generates different updates for different input weights, but also "optimizes" in the right direction. + +Does the optimization-based hypernetwork improve training convergence? We compare our method with HyperZero, examining how much reward (test-time) they can achieve when trained with the same epochs, and how many epochs each requires to achieve the same reward. The results are reported in Tab. 5. Our method achieves a higher reward with the same number of epochs. Besides, + +Table 5: Convergence property at certain epochs or reward. + +
250 epochs600 reward
HyperZero571.3394
HyPoGen732.974
+ +our method requires much fewer epochs of training to reach a given reward value. These results demonstrate the superior training efficiency of our method. Due to limited space, please refer to Sec. C for more experimental analysis. + +# 6 DISCUSSION + +We propose a novel hypernetwork, HyPoGen, which explicitly models the gradient-based optimization process in the architecture for policy synthesis, capitalizing on the generalization capability of test-time optimization. Additionally, we introduce an effective building block to mimic the interdependencies of the gradient flow while training the policies. This structural design further enhances the interpretability and generalizability of the proposed hypernetwork. Through comprehensive benchmarking, we demonstrate the superiority of our method in terms of generalization under limited learning budgets (both demonstration and computation) and the effectiveness of each proposed component. Our work not only contributes to the development of more efficient and generalizable policy learning algorithms but also provides insights for future research in the area of hypernetworks. However, generating policies without seeing demonstration data for completely different tasks remains challenging and is not fully resolved by our method. Future work may explore different optimization techniques and more sophisticated building blocks that can better generalize across a more diverse range of tasks. + +# 7 REPRODUCIBILITY STATEMENT + +We have made significant efforts to ensure the reproducibility of our work. The code, datasets, and instructions necessary to replicate our experiments are publicly available at https://github.com/ReNginx/HyPoGen. We hope these resources will assist future research in both reproducing and building upon our work. + +# 8 ACKNOWLEDGMENT + +This work is supported by the Early Career Scheme of the Research Grants Council (grant # 27207224), the HKU-100 Award, a donation from the Musketeers Foundation, the HKU Seed Fund for PI Research, and in part by the JC STEM Lab of Autonomous Intelligent Systems funded by The Hong Kong Jockey Club Charities Trust. Difan Zou and Youyi Zheng would like to thank the support by the NSFC Grant (No. 62172363, No. 62306252) and Guangdong NSF Grant (No. 2024A1515012444). Siyan Dong would like to thank the Institute of Data Science at HKU for a postdoctoral scholarship. The authors would also like to thank the HKU-Shanghai ICRC for providing valuable computing resources. + +# REFERENCES + +Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, Brendan Shillingford, and Nando De Freitas. Learning to learn by gradient descent by gradient descent. Advances in neural information processing systems, 29, 2016. +Michael Bain and Claude Sammut. A framework for behavioural cloning. In Machine Intelligence 15, pp. 103-129, 1995. +Jacob Beck, Matthew Thomas Jackson, Risto Vuorio, and Shimon Whiteson. Hypernetworks in meta-reinforcement learning. In Karen Liu, Dana Kulic, and Jeff Ichnowski (eds.), Proceedings of The 6th Conference on Robot Learning, volume 205 of Proceedings of Machine Learning Research, pp. 1478-1487. PMLR, 14-18 Dec 2023. +Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Optimality in Biological and Artificial Networks?, pp. 265-287. Routledge, 2013. +Michael Beukman, Devon Jarvis, Richard Klein, Steven James, and Benjamin Rosman. Dynamics generalisation in reinforcement learning via adaptive context-aware policies. Advances in Neural Information Processing Systems, 36, 2024. +Prasanna Kumar BG, Yash Upadhyay, Nunna Vishnu Teja, Penta Aravinda Swamy, et al. Advanced multi-task reinforcement learning utilising task-adaptive episodic memory with hypernetwork integration. In 2024 2nd International Conference on Intelligent Data Communication Technologies and Internet of Things (IDCIoT), pp. 635-640. IEEE, 2024. +Daniel S Brown, Wonjoon Goo, and Scott Niekum. Better-than-demonstrator imitation learning via automatically-ranked demonstrations. In Conference on robot learning, pp. 330-359. PMLR, 2020. +Tim Brys, Anna Harutyunyan, Halit Bener Suay, Sonia Chernova, Matthew E Taylor, and Ann Nowé. Reinforcement learning from demonstration through shaping. In Twenty-fourth international joint conference on artificial intelligence, 2015. +Junjie Cao, Weiwei Liu, Yong Liu, and Jian Yang. Generalize robot learning from demonstration to variant scenarios with evolutionary policy gradient. Frontiers in Neurorobotics, 14:21, 2020. +Vinod Kumar Chauhan, Jiandong Zhou, Ping Lu, Soheila Molaei, and David A Clifton. A brief review of hypernetworks in deep learning. arXiv preprint arXiv:2306.06955, 2023a. +Vinod Kumar Chauhan, Jiandong Zhou, Soheila Molaei, Ghadeer Ghosheh, and David A Clifton. Dynamic inter-treatment information sharing for heterogeneous treatment effects estimation. arXiv preprint arXiv:2305.15984, 2023b. + +Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference on machine learning, pp. 1126-1135. PMLR, 2017. +Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In International conference on machine learning, pp. 1587-1596. PMLR, 2018. +Yang Gao, Huazhe Xu, Ji Lin, Fisher Yu, Sergey Levine, and Trevor Darrell. Reinforcement learning from imperfect demonstrations. arXiv preprint arXiv:1802.05313, 2018. +Vinicius G Goecks, Gregory M Greillion, Vernon J Lawhern, John Valasek, and Nicholas R Waytowich. Integrating behavior cloning and reinforcement learning for improved performance in dense and sparse reward environments. arXiv preprint arXiv:1910.04281, 2019. +Jiayuan Gu, Fanbo Xiang, Xuanlin Li, Zhan Ling, Xiqiang Liu, Tongzhou Mu, Yihe Tang, Stone Tao, Xinyue Wei, Yunchao Yao, Xiaodi Yuan, Pengwei Xie, Zhiao Huang, Rui Chen, and Hao Su. Maniskill2: A unified benchmark for generalizable manipulation skills. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023. URL https://openreview.net/pdf?id=b_CQDy9vrD1. +David Ha, Andrew M. Dai, and Quoc V. Le. Hypernetworks. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id=rkpAcel1x. +James Harrison, Luke Metz, and Jascha Sohl-Dickstein. A closer look at learned optimization: Stability, robustness, and inductive biases. In Sanmi Koyejo, S. Mohamed, A. Agarwal, Danielle Belgrave, K. Cho, and A. Oh (eds.), Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022, 2022. URL http://papers.nips.cc/paper_files/paper/2022/bitstream/184c1e18d00d7752805324da48ad25be-Abstract-Conference.html. +Reinhard Heckel and Fatih Furkan Yilmaz. Early stopping in deep networks: Double descent and how to eliminate it. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview.net/forum?id=t1V90jvZbw. +Todd Hester, Matej Vecerik, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Dan Horgan, John Quan, Andrew Sendonaris, Ian Osband, et al. Deep q-learning from demonstrations. In Proceedings of the AAAI conference on artificial intelligence, volume 32, 2018. +Julian Ibarz, Jie Tan, Chelsea Finn, Mrinal Kalakrishnan, Peter Pastor, and Sergey Levine. How to train your robot with deep reinforcement learning: lessons we have learned. The International Journal of Robotics Research, 40(4-5):698-721, 2021. +Beomjoon Kim, Amir-massoud Farahmand, Joelle Pineau, and Doina Precup. Learning from limited demonstrations. Advances in Neural Information Processing Systems, 26, 2013. +Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), ICLR (Poster), 2015. +Aviral Kumar, Joey Hong, Anikait Singh, and Sergey Levine. When should we prefer offline reinforcement learning over behavioral cloning? arXiv preprint arXiv:2204.05618, 2022. +Zachary E Lee and K Max Zhang. Generalized reinforcement learning for building control using behavioral cloning. Applied Energy, 304:117602, 2021. +Ajay Mandlekar, Danfei Xu, Roberto Martín-Martín, Silvio Savarese, and Li Fei-Fei. Learning to generalize across long-horizon tasks from human demonstrations. arXiv preprint arXiv:2003.06085, 2020. +Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and P. Abbeel. A simple neural attentive meta-learner. In International Conference on Learning Representations, 2017. + +Tongzhou Mu, Zhan Ling, Fanbo Xiang, Derek Yang, Xuanlin Li, Stone Tao, Zhiao Huang, Zhiwei Jia, and Hao Su. Maniskill: Generalizable manipulation skill benchmark with large-scale demonstrations. In Joaquin Vanschoren and Sai-Kit Yeung (eds.), Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual, 2021. URL https://datasets-benchmarks-proceedings.neurips.cc/paper/2021/ hash/eda80a3d5b344bc40f3bc04f65b7a357-Abstract-round2.html. +Ashvin Nair, Bob McGrew, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Overcoming exploration in reinforcement learning with demonstrations. In 2018 IEEE international conference on robotics and automation (ICRA), pp. 6292-6299. IEEE, 2018. +Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. Journal of Statistical Mechanics: Theory and Experiment, 2021(12):124003, 2021. +Aviv Navon, Aviv Shamsian, Ethan Fetaya, and Gal Chechik. Learning the pareto front with hypernetworks. In International Conference on Learning Representations, 2021. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32, 2019. +Matthias Plappert, Rein Houthooft, Prafulla Dhariwal, Szymon Sidor, Richard Y Chen, Xi Chen, Tamim Asfour, Pieter Abbeel, and Marcin Andrychowicz. Parameter space noise for exploration. arXiv preprint arXiv:1706.01905, 2017. +Dean A. Pomerleau. Efficient training of artificial neural networks for autonomous navigation. Neural Computation, 3:88-97, 1991. URL https://api(semanticscholar.org/CorpusID:7813587. +Adrian Prados, Santiago Garrido, and Ramon Barber. Learning and generalization of taskparameterized skills through few human demonstrations. Engineering Applications of Artificial Intelligence, 133:108310, 2024. +Marcin Przewieźlikowski, Przemysław Przybysz, Jacek Tabor, M Zięba, and Przemysław Spurek. Hypermaml: Few-shot adaptation of deep models with hypernetworks. arXiv preprint arXiv:2205.15745, 2022. +Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning complex dexterous manipulation with deep reinforcement learning and demonstrations. arXiv preprint arXiv:1709.10087, 2017. +Kate Rakelly, Aurick Zhou, Chelsea Finn, Sergey Levine, and Deirdre Quillen. Efficient off-policy meta-reinforcement learning via probabilistic context variables. In International conference on machine learning, pp. 5331-5340. PMLR, 2019. +Sahand Rezaei-Shoshtari, Charlotte Morissette, Francois R Hogan, Gregory Dudek, and David Meger. Hypernetworks for zero-shot transfer in reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pp. 9579-9587, 2023. +Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627-635. JMLR Workshop and Conference Proceedings, 2011. +Thomas Philip Runarsson and Magnus Thor Jonsson. Evolution and design of distributed learning rules. In 2000 IEEE Symposium on Combinations of Evolutionary Computation and Neural Networks. Proceedings of the First IEEE Symposium on Combinations of Evolutionary Computation and Neural Networks (Cat. No. 00, pp. 59-63. IEEE, 2000. +Tim Salimans, Jonathan Ho, Xi Chen, Szymon Sidor, and Ilya Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. arXiv preprint arXiv:1703.03864, 2017. + +Elad Sarafian, Shai Keynan, and Sarit Kraus. Recomposing the reinforcement learning building blocks with hypernetworks. In International Conference on Machine Learning, pp. 9301-9312. PMLR, 2021. +Tom Schaul, Daniel Horgan, Karol Gregor, and David Silver. Universal value function approximators. In International conference on machine learning, pp. 1312-1320. PMLR, 2015. +John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. ArXiv, abs/1707.06347, 2017. URL https://api.sementicscholar.org/CorpusID:28695052. +Marcin Sendera, Marcin Przewieźlikowski, Konrad Karanowski, Maciej Zięba, Jacek Tabor, and Przemysław Spurek. Hypershot: Few-shot learning by kernel hypernetworks. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 2469-2478, 2023. +Xingyou Song, Yiding Jiang, Stephen Tu, Yilun Du, and Behnam Neyshabur. Observational overfitting in reinforcement learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. +Kaushik Subramanian, Charles L Isbell Jr, and Andrea L Thomaz. Exploration from demonstration for interactive reinforcement learning. In Proceedings of the 2016 international conference on autonomous agents & multiagent systems, pp. 447-456, 2016. +Felipe Petroski Such, Vashisht Madhavan, Edoardo Conti, Joel Lehman, Kenneth O Stanley, and Jeff Clune. Deep neuroevolution: Genetic algorithms are a competitive alternative for training deep neural networks for reinforcement learning. arXiv preprint arXiv:1712.06567, 2017. +Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026-5033. IEEE, 2012. doi: 10.1109/IROS.2012.6386109. +Saran Tunyasuvunakool, Alistair Muldal, Yotam Doron, Siqi Liu, Steven Bohez, Josh Merel, Tom Erez, Timothy Lillicrap, Nicolas Heess, and Yuval Tassa. dm_control: Software and tasks for continuous control. Software Impacts, 6:100022, 2020. ISSN 2665-9638. +Johannes Von Oswald, Christian Henning, Benjamin F Grewe, and João Sacramento. Continual learning with hypernetworks. arXiv preprint arXiv:1906.00695, 2019. +Olga Wichrowska, Niru Maheswaranathan, Matthew W Hoffman, Sergio Gomez Colmenarejo, Misha Denil, Nando Freitas, and Jascha Sohl-Dickstein. Learned optimizers that scale and generalize. In International conference on machine learning, pp. 3751-3760. PMLR, 2017. +Zhou Xian, Shamit Lal, Hsiao-Yu Tung, Emmanouil Antonios Platanios, and Katerina Fragkiadaki. Hyperdynamics: Meta-learning object and agent dynamics with hypernetworks. arXiv preprint arXiv:2103.09439, 2021. +Zheng Xiong, Jacob Beck, and Shimon Whiteson. Universal morphology control via contextual modulation. In International Conference on Machine Learning, pp. 38286-38300. PMLR, 2023. +Zheng Xiong, Risto Vuorio, Jacob Beck, Matthieu Zimmer, Kun Shao, and Shimon Whiteson. Distilling morphology-conditioned hypernetworks for efficient universal morphology control. arXiv preprint arXiv:2402.06570, 2024. +Chiyuan Zhang, Oriol Vinyals, Rémi Munos, and Samy Bengio. A study on overfitting in deep reinforcement learning. CoRR, abs/1804.06893, 2018. +Dominic Zhao, Seijin Kobayashi, João Sacramento, and Johannes von Oswald. Meta-learning via hypernetworks. In 4th Workshop on Meta-Learning at NeurIPS 2020 (MetaLearn 2020). NeurIPS, 2020. + +# A MORE DETAILS OF THE METHOD + +# A.1 WHY AN MLP CAN BE APPLIED AS A GRADIENT APPROXIMATOR FOR MLPS + +We show that $\frac{\partial\mathcal{L}}{\partial W}$ , $\frac{\partial\mathcal{L}}{\partial b}$ , where $W,b$ are the weight and bias of an MLP layer, are very close to the form of MLP in this section. + +The forward process of an MLP layer is: + +$$ +z _ {n} = \sigma \left(W _ {n} z _ {n - 1} + b _ {n}\right) \tag {9} +$$ + +where $z_{n}$ is the hidden variable, and $\sigma$ is the activation function. + +By taking the derivatives, we have + +$$ +\frac {\partial z _ {n}}{\partial W _ {n}} = \Lambda_ {n} \left(z _ {n - 1}\right) \left(z _ {n - 1}\right) ^ {T} \tag {10} +$$ + +$$ +\frac {\partial z _ {n}}{\partial b _ {n}} = \Lambda_ {n} \left(z _ {n - 1}\right) \tag {11} +$$ + +where + +$$ +\Lambda_ {n} \left(z _ {n - 1}\right) = \operatorname {d i a g} \left(\sigma^ {\prime} \left(W _ {n} z _ {n - 1} + b _ {n}\right)\right) \tag {12} +$$ + +To get from $\frac{\partial z_n}{\partial W_n}$ to $\frac{\partial\mathcal{L}}{\partial W_n}$ , we apply the chain rules. + +$$ +\frac {\partial \mathcal {L}}{\partial W _ {n}} = \frac {\partial \mathcal {L}}{\partial z _ {N}} \frac {\partial z _ {N}}{\partial z _ {N - 1}} \dots \frac {\partial z _ {n + 1}}{\partial z _ {n}} \frac {\partial z _ {n}}{\partial W _ {n}} \tag {13} +$$ + +$$ += \frac {\partial \mathcal {L}}{\partial z _ {N}} \prod_ {i = n + 1} ^ {N} \frac {\partial z _ {i}}{\partial z _ {i - 1}} \frac {\partial z _ {n}}{\partial W _ {n}} \tag {14} +$$ + +And $\frac{\partial z_n}{\partial z_{n - 1}}$ can also be calculated from the forward process + +$$ +\frac {\partial z _ {n}}{\partial z _ {n - 1}} = \Lambda_ {n} \left(z _ {n 1}\right) W _ {n} \tag {15} +$$ + +Note that (Eq. 12) is just the output of another MLP with a different final activation. And other operations in (Eq. 10, 11, 14, 15) are fundamentally linear in nature. This linearity implies that the forms of these gradient expressions bear a strong resemblance to those typically encountered in MLP. As mentioned above, it is reasonable to use an MLP as a gradient approximator for MLPs. + +# A.2 OPTIMIZATION IN THE LATENT PARAMETER SPACE + +To ease training and memory consumption, the proposed hypernetwork predicts the policy updates in a latent space. Specifically, we employ a layer-level encoder $E_{\theta_n}$ to compress each layer of the target network $\theta$ into a latent space before feeding them into the hypernet blocks. During the optimization process, parameters are consistently updated within the latent space. After the optimization process, a layer-level decoder $D_{\theta_n}$ is utilized to reconstruct the latent representation back into the parameter space of $\theta$ . This approach ensures that the size of our optimization network parameters does not expand significantly with an increase in the target network parameters, thereby enhancing the model's applicability. For ease of understanding, we have not illustrated these less critical details in Fig. 3. + +# B ADDITIONAL EXPERIMENTAL DETAILS + +# B.1 DETAILED SPECIFICATIONS OF EACH TASK + +# B.1.1 MuJoCo + +Desired speed. Tab. 6 shows the desired speed specifications we used for each task. The default value is utilized in the experiments that involve changing torso length. Conversely, during the torso length experiments, the default value of the desired speed is applied. + +Table 6: Details of desired speed specifications. + +
EnvironmentRangeNo. of SamplesDefault Value
Cheetah[-10, 0), (0, 10], increment 0.540+10
Walker[-5, 0), (0, 5], increment 0.2540+1
Finger[-15, 0), (0, 15], increment 1.030+15
+ +Table 7: Details of torso length specifications. + +
EnvironmentRangeNo. of SamplesDefault Value
Cheetah[0.3, 0.7], increment 0.01410.5
Walker[0.1, 0.5], increment 0.01410.3
Finger[0.1, 0.4], increment 0.01310.16
+ +Table 8: Details of speed and length specifications. + +
EnvironmentRange of Speed ParameterRange of Length ParameterNo. of Samples
Cheetah[+1, +10], increment 1.0[0.3, 0.7], increment 0.0510 × 9 grid
Walker[+1, +5], increment 0.5[0.1, 0.5], increment 0.059 × 9 grid
Finger[+1, +15], increment 1.0[0.1, 0.4], increment 0.0515 × 7 grid
+ +Torso length. In all environments, the torso length parameter refers to the geometric size of the torso of the controlled object. Different sizes change the physical properties such as mass, center of gravity, etc. A complete list of torso lengths we used is shown in Tab. 7. + +Desired speed and torso length. Now, we list all the parameters in the experiments of jointly changing speed and length parameters in Tab. 8. + +# B.1.2 MANISKILL. + +The specifications for ManiSkill are shown in Tab. 9. Note that the term "arm length" represents the ratio of the arm length to its original length. + +Table 9: Details of task specifications in ManiSkill Environment. + +
SpecificationRange of ParametersNo. of SamplesDefault Value
Cube Size[0.01, 0.03], increment 0.001210.02
Controller Stiffness[500, 1500], increment 50211000
Controller Damping[50, 150], increment 1021100
Arm Length[0.5, 2.0], increment 0.1161.0
+ +# B.2 ADDITIONAL IMPLEMENTATION DETAILS + +We implemented our method in PyTorchPaszke et al. (2019) and the hyperparameters are reported in Tab. 10, Tab. 11, and Tab. 12. + +Table 10: Hyperparameters of TD3. + +
HyperparameterSetting
Learning rate1 × 10-4
OptimizerAdam
Mini-batch size256
Actor update frequency2
Target networks update frequency2
Target networks soft-update0.01
Target policy smoothing stddev. clip0.3
Hidden dim.256
Replay buffer capacity106
Discount0.99
Seed frames4000
Exploration steps2000
Exploration stddev. schedulelinear(1.0, 0.1, 1e6)
+ +Table 11: Hyperparameters of PPO. + +
HyperparameterSetting
Learning rate3 × 10-4
OptimizerAdam
Mini-batch size400
Gamma0.85
Target KL0.09
Value function coefficient0.5
Clip Range0.2
Lambda Gae0.95
Max Grad Norm0.5
+ +Table 12: Hyperparameters of HyPoGen. + +
HyperparameterSetting
Learning rate1 × 10-4
OptimizerAdam
Mini-batch size512
Hidden dim. of target policy networks256
Task embedding dim.256
Weight embedding dim.256
No. Layers K8
No. MLP layers in Hypernet Blocks2
MLP hidden dim. in Hypernet Blocks128
+ +# C MORE COMPARISON AND ANALYSIS + +# C.1 DETAILED COMPARISON ON EACH SPECIFICATION + +We showcase the rewards and their standard deviations of the rollout policies in MuJoCo in Fig. 5, Fig. 6, and Fig. 7. + +We also show the success rate curves of different specifications in ManiSkill in Fig. 8, 9 + +![](images/a6c5ccb0ed9c7836f2a3d84a697980c3c91b9979812eb187bc788d26118d9597.jpg) +(a) Cheetah + +![](images/011ff1420ee311b90e71ab1181d2216e5db6c42dea86594246f85365d1eb47ed.jpg) +(b) Finger +Figure 5: Average reward and std curves on generalization to different desired speed specifications. The solid lines present the mean, and the shaded region presents the standard deviation. Our method achieves the best results in most cases. + +![](images/9a7c2798a222605349e2572104cd251e48f9a78496317095861c9d8c21bb5f98.jpg) +(c) Walker + +![](images/e042ac3340493c5499e70c4362d1f54471099803fa76610a42a84549169eed2f.jpg) +(a) Cheetah +Figure 6: Average reward and std curves on generalization to different torso length specifications. Our method achieves the best results in most cases. + +![](images/1ec82a1ae0b81147b0ef2bd619998de0371add44406e767aacc2720bddb3ae7c.jpg) +(b) Finger + +![](images/595717c1647fd77867c0645eac57c9ecfbab284f594acd951ad5213a6daf067d.jpg) +(c) Walker + +![](images/39416d59124a2782644d256bce18cf458e3d2850145af0f9332e986b432af80f.jpg) +(a) Cheetah +Figure 7: 3D reward surfaces on generalization to different speed and length specifications. Our method achieves the best results in most cases. + +![](images/58d20c29afeda7b0b6927fbaa4ba700149aa77d15cb8ec792be3357ffc1fc3ec.jpg) +(b) Finger + +![](images/2a1bc84ed5e88c93d75159d43a35e237f42647bc91036a6d0b09e8f922eb8c4a.jpg) +(c) Walker + +![](images/9c054c260a8e52c92064227dec937824a8ce42eee83c1d1f42277a2ef2deaea5.jpg) +(a) Cube size + +![](images/33b9cc84bfdce7ea65ddcebc4b1a4a3fe64253a1eac006133d5e1ddf533a2ff4.jpg) +(b) Stiffness + +![](images/a7f21a8c49001af24dbec681f26ce1775789d0c42d2e71a3f296342fc031a4da.jpg) +(c) Damping +Figure 8: The success rate curve of different specifications on LiftCube task of Maniskill Environment. + +![](images/28b6660d4ab7ea225db4af9ad3b46e0ae14c2b41083f1ffa8936d1817f3030df.jpg) +(d) Length + +![](images/17b7e25cf50004d5c5b55757b08be62bd0c4562eeacb342c4df9088e1ef208c5.jpg) +(a) Cube size + +![](images/590a3295352f0cc45ba4201e4a5332cc65e2128d856fbdddb678705d3c02de91.jpg) +(b) Stiffness +Figure 9: The success rate curve of different specifications on PickCube task of Maniskill Environment. + +![](images/4c380f117a30932de11083efb1f0c3a2c8be4c2ea0a26064c1847169b1422c0c.jpg) +(c) Damping + +![](images/ca83b104ccfc3047c35c821426d6474e33b3bf3709f99a83d30751dde8e64001.jpg) +(d) Length + +# C.2 STANDARD DEVIATION OF MAIN EXPERIMENTS + +Below, we report the standard deviation of the rewards in MuJoCo environments in Tab. 13, and the standard deviation of episode length in ManiSkill in Tab. 14. + +Table 13: Standard deviations on MuJoCo. The mean values are reported in Tab. 1 in the paper. + +
MethodCheetahFingerWalker
speedlengthsspeed&lengthspeedlengthsspeed&lengthspeedlengthsspeed&length
Cond Policy92.76146.0688.43116.61104.4267.42101.47181.09136.32
UVFA86.59165.4884.68100.03111.4563.0479.65145.64125.10
Meta Policy51.64128.3429.2923.8250.8716.5821.2619.8517.03
PEARL19.39118.1130.7711.3338.7933.1620.5721.6721.83
HyperZero84.08103.30137.36107.90115.0080.67140.51195.85191.87
HyPoGen81.6272.92100.69113.11114.7680.12236.77202.12205.29
Expert Rollout2.273.169.164.5110.1215.569.6317.2118.64
+ +Table 14: Standard deviations of episode length on Maniskill. The mean values are reported in Tab. 2 in the paper. + +
MethodLift CubePick&Place Cube
cube sizestiffnessdampingarm lengthcube sizestiffnessdampingarm length
Cond Policy49.530.0054.0261.6178.1519.7970.0372.09
UVFA49.570.0052.1568.6474.700.0064.1065.76
Meta Policy64.010.000.9769.1253.251.243.0340.19
PEARL65.4238.8918.4070.5264.2371.2230.3652.70
HyperZero58.620.0047.4468.7651.380.000.0035.00
HyPoGen61.4424.8341.4254.9875.3871.2076.2582.52
Expert Rollout35.0137.3347.2825.2960.8966.0261.7766.11
+ +# C.3 ANALYSIS OF POOR PERFORMANCE OF BASELINES IN MANISKILL + +To further analyze whether the poor performance of baselines is due to the lack of generalization ability or simply the model's capacity. First, we report the model size of each method in Tab. 15. Then, we report the original baselines' training performance in Tab. 16, and the training/test performance of the baselines with equal capacity to our models in Tab. 17. From these two tables, along with Tab.2, we can see that even without a capacity increase, some methods can already fit well on the training data. For example, HyperZero on the Pick&Place cube size task achieves a $78.20\%$ success rate compared to $25.87\%$ at test time, and its performance drops from $92\%$ to $31\%$ on the LiftCube damping task. Additionally, the performance of Cond Policy drops from $63\%$ to $39\%$ . + +In theory, increasing the model capacity should make it easier to overfit. However, due to learning difficulty, the training performance actually decreased. For example, from Tab. 16 and Tab. 17, HyperZero dropped from $86\%$ to $69\%$ on the LiftCube arm-length task. When learning is not an issue, we observe that training performance improves, but generalization does not improve or even worsens. This is evidenced by Cond Policy's performance on the Pick&Place Cube arm-length task, where training performance increased from $47\%$ to $61\%$ , but test performance dropped from $43\%$ to $26\%$ . + +These results and observations confirm that the proposed architecture design ensures the robustness of the learning process and eliminates the difficulty of training when capacity is increased. Moreover, it ensures that increased capacity does not incur overfitting and generalization issues, while this property is not observed with other models. + +Table 15: Comparison of parameter sizes for different methods (Original vs Augmented), in Millions. + +
Cond PolicyUVFAMeta PolicyPEARLHyperZeroHyPoGen(8 blocks)
Original0.70.70.70.725.170.0
Augmented64.163.864.164.172.070.0
+ +Table 16: Training-time success rate of baselines with original model size in Maniskill environments. + +
MethodLift CubePick&Place Cube
cube sizestiffnessdampingarm lengthcube sizestiffnessdampingarm length
Cond Policy94.670.0098.3389.8086.602.5663.0046.67
UVFA94.170.0097.3389.0087.400.0068.5049.00
Meta Policy83.830.000.0077.2017.000.560.0011.33
PEARL79.1764.3391.6784.2027.6027.7837.0022.67
HyperZero92.670.0092.0086.0078.200.000.003.00
HyPoGen89.3396.5096.3385.6082.4081.3368.0068.67
Expert Rollout96.0095.3390.7598.5087.0082.3358.2584.00
+ +Table 17: Training/test-time success rate of baselines with equal model size to ours in Maniskill environments. + +
MethodLift CubePick&Place Cube
cube sizestiffnessdampingarm lengthcube sizestiffnessdampingarm length
Cond Policy95.56 / 28.670.00 / 0.0063.33 / 14.6389.17 / 56.3682.22 / 26.674.44 / 1.1132.22 / 9.6560.83 / 26.67
UVFA95.56 / 28.890.00 / 0.0064.44 / 16.4883.33 / 58.1881.11 / 23.964.44 / 1.7815.56 / 7.0238.33 / 18.21
Meta Policy0.00 / 0.220.00 / 0.000.00 / 0.001.67 / 1.211.11 / 0.421.11 / 0.000.00 / 0.180.00 / 0.00
PEARL0.00 / 0.000.00 / 0.220.00 / 0.745.00 / 1.210.00 / 0.622.22 / 0.000.00 / 0.880.83 / 0.00
HyperZero94.44 / 28.000.00 / 0.0063.33 / 22.2269.17 / 32.7377.78 / 25.620.00 / 0.000.00 / 0.0021.67 / 8.46
HyPoGen89.33 / 85.8796.50 / 97.2096.33 / 93.2885.60 / 85.7382.40 / 72.8781.33 / 78.3368.00 / 41.2668.67 / 52.54
Expert Rollout96.00 / 94.1395.33 / 96.7390.75 / 97.2898.50 / 93.6487.00 / 69.8782.33 / 75.9258.25 / 73.7284.00 / 54.77
+ +# C.4 ADDITIONAL ANALYSIS + +Scalability: can HyPoGen generate deeper target networks? We conducted experiments on deeper policy networks, and the results show that our method consistently outperforms the SOTA method HyperZero, as reported in Tab. 18. + +In the comparisons section, we use two-layer and three-layer MLPs for MuJoCo and ManiSkill, respectively. Here, we gradually increase the number of layers in the policy networks. As the number of layers (i.e., the number of parameters to be generated by the hypernet) increases, the learn + +Table 18: Comparison of HyPoGen and HyperZero with different layers in target networks. + +
#Layers23467
HyperZero695.7704.5434.4528.6509.3
HyPoGen819.2821.9819.1665.6622.5
+ +ing difficulty of the hypernet also increases. As observed from the table, our method consistently surpasses HyperZero in terms of obtained rewards at test time. + +Generalization ability w.r.t. the amount of training data. We compare our method with HyperZero to emphasize our generalization ability. In the experiment, we split $50\%$ of the task specifications for testing and vary the fractions of the remaining specifications for training. The fractions range from $5\%$ to $50\%$ . The results are reported in Tab. 19. Our method achieves constantly better results than HyperZero. Note that as the fraction decreases, our method exhibits more significant improvements. It further demonstrates the strong generalization ability of our model. + +Table 19: Zero-shot transfer with different amounts of training data. + +
HyperZeroHyPoGen (ours)
5%385.90644.85
10%557.98756.13
20%668.13754.88
30%813.14841.12
50%854.27884.44
+ +Analysis on hyperparameters. We show more results on the influence of hyperparameters in our model. We first validate the proper number of hypernet blocks (i.e., the optimization steps) in Tab. 20. We can observe that the performance reaches the peak when $K = 8$ . In Tab. 21, we present the results of different MLP layers inside each hypernet block. The performance achieves the highest when the number of layers is set to 2. We also examine the feature dimensions of hidden layers in the hypernet block. The results are reported in Tab. 22. When setting the hidden dimension as 128, the network produces the best result. + +Table 20: Performance with different optimization steps (No. of hypernet blocks). + +
KReward and Std.
1746.06 ± 83.54
3775.55 ± 68.26
5825.76 ± 76.61
8856.88 ± 61.73
10832.76 ± 78.50
20817.9 ± 60.92
+ +Table 21: Performance with different number of layers in each hypernet block. + +
No. MLP LayersReward and Std.
2856.88 ± 61.73
3795 ± 70.39
5834.99 ± 78.62
8752.74 ± 119.31
10772.82 ± 117.64
+ +Table 22: Performance with different hidden dimensions in hypernet block. + +
Hidden DimensionReward and Std.
16847.83 ± 59.95
32817.12 ± 67.35
64840.02 ± 61.24
128856.88 ± 61.73
256834.5 ± 80.36
+ +# C.5 STANDARD DEVIATION OF THE SUCCESS RATE ON MANISKILL + +The standard deviations of success rate in the Manskill environment are shown in Tab. 23. The proposed method has the same deviation level as other baseline methods but is higher in the mean value. + +Table 23: Average and standard deviations of success rate on Maniskill. + +
MethodLift CubePick&Place Cube
cube sizestiffnessdampingarm lengthcube sizestiffnessdampingarm length
Cond Policy89.93 ± 8.000.00 ± 0.0056.28 ± 10.0069.36 ± 14.0069.81 ± 18.002.20 ± 2.0039.26 ± 17.0043.77 ± 17.00
UVFA90.27 ± 8.000.00 ± 0.0078.67 ± 10.0072.18 ± 15.0071.75 ± 17.000.00 ± 0.0029.53 ± 14.0036.85 ± 14.006
Meta Policy84.67 ± 12.000.00 ± 0.000.06 ± 0.0076.45 ± 15.0012.62 ± 10.000.22 ± 0.000.21 ± 0.008.15 ± 7.00
PEARL84.47 ± 12.0059.87 ± 5.0035.67 ± 3.0078.73 ± 15.0021.06 ± 15.0024.44 ± 16.0012.58 ± 8.0016.08 ± 12.00
HyperZero86.60 ± 11.000.00 ± 0.0031.33 ± 10.0063.64 ± 14.0025.87 ± 10.000.00 ± 0.000.00 ± 0.0013.92 ± 6.00
HyPoGen85.87 ± 11.0097.20 ± 3.0093.28 ± 6.0085.73 ± 10.0072.87 ± 17.0078.33 ± 15.0041.26 ± 18.0052.54 ± 20.00
+ +# C.6 STANDARD DEVIATIONS ON SUCCESS EPISODES + +To align with established work Rezaei-Shoshtari et al. (2023), the result is shown in Tab. 1, 2 count in the failure episodes, which increases the variance reported in Tab.13, 14. + +In Tab. 24, 25, we report the average of only success episodes2. As shown in the table, the standard deviations are of a reasonable scale relative to the averages. + +Table 24: Average and standard deviations of rewards on MuJoCo on success episodes. + +
MethodCheetahFingerWalker
speedlengthsspeed&lengthspeedlengthsspeed&lengthspeedlengthsspeed&length
Cond Policy510.50609.70370.11378.38441.97301.73604.32315.07384.91
± 83.8± 130.1± 78.2± 118.2± 91.2± 61.6± 50.9± 108.0± 80.0
UVFA452.58657.83358.22385.83462.36292.53504.84244.98370.07
± 89.7± 161.0± 82.0± 100.7± 93.5± 54.5± 52.7± 97.3± 73.3
Meta Policy355.62697.48232.19122.97174.37123.8384.5692.1381.74
±44.3±93.1±30.8±21.9± 31.9±20.6± 13.3± 6.2± 9.6
PEARL296.29816.72217.93121.06132.60135.1979.3979.0874.83
± 22.6± 69.1± 25.1± 11.2± 30.6± 26.9± 6.8± 10.8± 8.0
HyperZero772.16917.14626.06618.75565.97384.97764.24508.74537.99
± 72.9± 84.2± 129.2± 109.9± 105.7± 76.9± 67.5± 80.5± 112.6
HyPoGen845.81949.86653.53854.99697.78396.76839.94636.54601.73
± 67.7± 49.7± 91.4± 111.8± 103.2± 79.2± 92.9± 66.1± 92.0
+ +Table 25: Average and standard deviations of episode length on Maniskill on success episodes. + +
MethodLift CubePick&Place Cube
cube sizestiffnessdampingarm&lengthcube sizestiffnessdampingarm&length
Cond Policy13.46 ± 7.090.00 ± 0.000.00 ± 0.000.00 ± 0.0021.03 ± 10.130.00 ± 0.0032.57 ± 14.2726.22 ± 18.96
UVFA14.56 ± 9.890.00 ± 0.0014.10 ± 2.2315.99 ± 6.7321.80 ± 9.800.00 ± 0.0025.33 ± 12.5423.28 ± 11.84
Meta Policy12.45 ± 4.140.00 ± 0.000.00 ± 0.0013.11 ± 2.580.00 ± 0.000.00 ± 0.000.00 ± 0.000.00 ± 0.00
PEARL12.60 ± 5.910.00 ± 0.00126.11 ± 0.7913.28 ± 4.2246.72 ± 13.2833.36 ± 8.42134.20 ± 4.7165.95 ± 11.32
HyperZero13.31 ± 7.990.00 ± 0.000.00 ± 0.0014.49 ± 3.820.00 ± 0.000.00 ± 0.000.00 ± 0.000.00 ± 0.00
HyPoGen13.05 ± 7.6511.41 ± 1.5612.18 ± 2.1412.68 ± 3.6720.43 ± 9.9419.55 ± 9.3523.98 ± 11.7823.46 ± 14.02
+ +# C.7 IN AND OUT-OF-TRAINING-DISTRIBUTION PERFORMANCE + +To better evaluate the generalization ability of the proposed methods, we evaluate all methods within one standard deviation of training distribution (in-distribution) and outside of that (out-of-distribution). With the result shown in Tab. 26, 27, 28, 29. Our proposed method exhibits superior performance over baseline methods in both in-distribution and out-distribution settings. This further highlights the strong generalization ability of the proposed method. + +Table 26: The in-distribution average and standard deviations of rewards on MuJoCo. + +
MethodCheetahFingerWalker
speedlengthsspeed&lengthspeedlengthsspeed&lengthspeedlengthsspeed&length
Cond Policy521.81627.72330.69399.36433.41318.38324.24654.04400.58
± 85.4± 131.5± 70.6± 129.4± 102.2± 59.1± 57.6± 110.1± 84.3
UVFA459.27647.27332.11433.02466.93318.38244.27519.03378.95
± 85.3± 157.6± 78.2± 109.8± 96.6± 59.1± 48.3± 104.5± 72.7
Meta Policy308.15702.66188.45126.04165.49122.8188.7186.0582.95
± 39.3± 89.4± 25.8± 24.4± 34.2± 19.7± 10.4± 6.4± 11.0
PEARL251.10819.34210.16118.19137.03130.7378.3779.3177.15
± 18.0± 70.2± 21.7± 10.8± 35.7± 25.8± 6.25± 10.8± 8.6
HyperZero796.92941.41640.15691.46585.75446.38555.23792.82596.58
± 67.7± 72.1± 136.9± 121.6± 115.5± 92.2± 74.8± 79.8± 108.7
HyPoGen837.94956.45653.97880.00706.10459.51621.51706.10645.18
± 63.5± 44.8± 90.8± 103.1± 106.3± 93.5± 95.2± 106.3± 97.5
+ +Table 27: The out-of-distribution average and standard deviations of rewards on MuJoCo. + +
MethodCheetahFingerWalker
speedlengthsspeed&lengthspeedlengthsspeed&lengthspeedlengthsspeed&length
Cond Policy488.88574.32427.34343.66460.60236.09294.89486.90321.78
± 80.8± 127.2± 89.3± 99.8± 67.3± 44.6± 36.2± 103.1± 62.6
UVFA440.42676.61394.64308.00453.66236.09247.72477.46340.54
± 97.8± 167.2± 87.2± 85.7± 87.6± 44.6± 69.2± 83.5± 75.6
Meta Policy429.27687.59297.92117.87190.76125.8898.1881.8678.68
± 52.0± 100.2± 38.3± 17.8± 27.7± 22.3± 18.3± 5.8± 5.9
PEARL374.23811.10229.90125.88124.18144.4780.1679.5670.50
± 30.5± 66.7± 30.3± 11.9± 21.1± 29.1± 7.55± 10.8± 7.0
HyperZero721.07866.78605.16486.52530.86253.91380.68702.61400.35
± 83.6± 109.4± 117.9± 88.6± 88.3± 44.1± 47.2± 82.1± 121.8
HyPoGen857.70936.57652.87812.36682.02260.78663.83682.02487.32
± 74.0± 59.5± 92.3± 126.6± 97.4± 48.3± 88.7± 97.4± 77.4
+ +Table 28: The in-distribution success rate and esepisode length on Maniskill. + +
MethodLift CubePick&Place Cube
cube sizestiffnessdampingarm&lengthcube sizestiffnessdampingarm&length
Cond Policy93.42, 12.770.00, 0.0095.00, 10.8966.30, 13.4572.20, 21.242.19, 41.0060.75, 17.8261.00, 23.82
UVFA92.75, 13.830.00, 0.0092.80, 10.3969.90, 16.1180.20, 21.870.00, 0.0065.00, 16.5052.00, 20.21
Meta Policy85.58, 11.650.00, 0.000.00, 0.0078.20, 13.1315.10, 22.860.28, 8.000.25, 5.7511.50, 20.12
PEARL85.00, 12.0159.56, 11.3493.80, 10.2080.00, 13.3725.70, 23.3125.15, 21.5032.00, 21.2725.60, 22.87
HyperZero88.58, 12.830.00, 0.0079.60, 10.9061.10, 14.5540.20, 32.400.00, 0.000.00, 0.0021.33, 14.13
HyPoGen89.25, 12.6497.00, 11.4695.60, 10.5384.30, 12.5781.90, 19.7579.75, 19.8169.00, 17.6765.17, 21.15
+ +Table 29: The out-of-distribution success rate and episode length on Maniskill. + +
MethodLift CubePick&Place Cube
cube sizestiffnessdampingarm&lengthcube sizestiffnessdampingarm&length
Cond Policy76.00, 16.230.00, 0.0041.38, 14.92100.00, 14.0665.83, 20.682.22, 24.3333.53, 36.5129.00, 28.28
UVFA80.33, 17.490.00, 0.0073.23, 15.5295.00, 14.7457.67, 21.670.00, 0.0020.07, 27.6823.86, 25.92
Meta Policy81.00, 15.630.00, 0.000.08, 1.8559.00, 12.928.50, 16.800.00, 0.000.20, 4.405.29, 19.12
PEARL82.33, 14.9561.11, 6.7386.50, 9.5466.00, 12.3320.00, 28.6230.00, 21.2835.75, 21.4916.20, 28.61
HyperZero78.67, 15.250.00, 0.0012.77, 10.7989.00, 13.822.00, 9.400.00, 0.000.00, 0.007.57, 15.36
HyPoGen72.33, 14.7198.00, 11.2192.38, 12.81100.00, 13.7557.83, 21.5772.67, 18.5233.87, 25.6641.71, 25.45
+ +# D VISUALIZATION + +Due to the page limit, we only present quantitative evaluations in the experiment section. Here, we visualize the results in the simulation environments and qualitatively compare our method with the baselines. The visual results of MuJoCo tasks are shown in Fig. 10, 11, 12, 13, 14, and 15. As seen in Fig. 10, our method can obtain more stable results with different speeds. When the target speed is -5.0 or -8.0 (the first and second rows), our method has a faster actual speed (better performance). Meanwhile, HyperZero is unable to maintain balance when the speed is 5.0 (the third row). In Fig. 11, HyperZero struggles to maintain balance, while our method generates reasonable results. In the Finger Spin environment in Fig 12, HyperZero stagnates for a long time when the speed equals -5.0 and 5.0. On the contrary, our method works well for all settings, demonstrating its generalization ability and stability. The same as the results of different speeds, in different torso lengths, the results (in Fig. 13, 14, and 15) demonstrate generalization and stability of our method. Our method encounters fewer failures. and also guides the agents to act at a faster speed. The visual results on ManiSkill tasks are shown in Fig 16, 17, 18, 19, 20, 21, 22, and 23. Please turn to the next page to see the visual results. + +![](images/68ae0a34204f0db369ceed698bf0f5921983c64a71bd30dab1174f78bca93e4c.jpg) +Figure 10: Comparison in Cheetah environment with different speeds. + +![](images/5c9bebf30783e4bea1970231d484f0a45cc9e3651499b2062d2aa91a44f9381c.jpg) +Figure 11: Comparison in Walker environment with different speeds. + +![](images/60062b5b811a9483db61d3614f99ba6ff723f07fdad9deec69deb7fbd3bab325.jpg) +Figure 12: Comparison in Finger environment with different speeds. + +![](images/165d2573140d0e66a1a01f88e3d2065daa3325c609047d7a3875e2ae2936dc99.jpg) +Figure 13: Comparison in Cheetah environment with different torso lengths. + +![](images/ed4d1de3e67bb053d29318710d52148e98a1f05fe15719d82a43d77274329b1e.jpg) +Figure 14: Comparison in Walker environment with different torso lengths. + +![](images/bb6b6198d9898288427446581c88a35ac12b89b92f8ffabd916fcc685bea058d.jpg) +Figure 15: Comparison in Finger environment with different torso lengths. + +![](images/49f2abe1d7f081d9e91c22cd7f7a545fb4f9e8acf4af4fd48d4d1c169d6a5068.jpg) +Figure 16: Comparison in LiftCube with different cube sizes. + +![](images/33b6c0c630632bbcdbe006e78621c53ecf792b00a4081ed9792e4927a8fc8ec2.jpg) +Figure 17: Comparison in LiftCube with different controller stiffness. + +![](images/41ea9e1356cb1dcaea4f3ae23741ac05f86f8e2e48be4d4778ab98c8e503140a.jpg) +Figure 18: Comparison in LiftCube with different controller damping. + +![](images/ef52092df557f89566a7c44bcbca1cc54e5c53283d9b331ded6d163a56fefe73.jpg) +Figure 19: Comparison in LiftCube with different arm lengths. + +![](images/7190b58225760c2ebf9504dc06ae9a1bec2198dde155eb94a8759786c71a5914.jpg) +Figure 20: Comparison in PickCube with different cube sizes. + +![](images/739e73fd450f64add87ad156f52ceec85f2252ca5435a424f1420ee7444bde72.jpg) +Figure 21: Comparison in PickCube with different controller stiffness. + +![](images/f319a7cf8a93bfd7d84cc6204b62c6ef302b0da5fee781c8c5be24170865fa72.jpg) +Figure 22: Comparison in PickCube with different controller damping. + +![](images/58e3ab9cc4adeea7707a7ae772d33d0e73d0820d23cce25abf0b798cb071ed49.jpg) +Figure 23: Comparison in PickCube with different arm lengths. \ No newline at end of file diff --git a/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/images.zip b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fbe4b1661a4059b52802c8e7b90a9b539f4ae439 --- /dev/null +++ b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16098631bd707eab9564f98ea4f71de57785827c40acea507c47a83e1f8341ae +size 4475337 diff --git a/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/layout.json b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d6579e849b597cfeaa0d29c8486150c736d08910 --- /dev/null +++ b/ICLR/2025/HyPoGen_ Optimization-Biased Hypernetworks for Generalizable Policy Generation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a86e420adb93a67d1bfc4a65e87c47cd4c30a89a987aa7d70d1a80448d220e80 +size 843896 diff --git a/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_content_list.json b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4b6e73ee279e678686d5965a835a6561fb4cedcd --- /dev/null +++ b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d1e3a55f00ca426d1117b1f6a971713d346b84c09c060b1db53b7c11311cc94 +size 203582 diff --git a/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_model.json b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6d08359e1b9086dd65edda0760cbfaed085ddf17 --- /dev/null +++ b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35568278195ccf50894665d860c0f1edc4df639b0d4838e601f2e764ccd628f3 +size 224735 diff --git a/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_origin.pdf b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9910651843d4dadd8d52271d7d5adae65e036cfa --- /dev/null +++ b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/a94db92b-071b-4d44-ba8c-2906f2303949_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de1b3c7e4ea378c9b014ae9b611b9a3814dcf87082d7afe32ef48d0ba844ceb3 +size 47096504 diff --git a/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/full.md b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/full.md new file mode 100644 index 0000000000000000000000000000000000000000..404125f52dd1013b6f4ecc71ee1c9bcbdd9814c7 --- /dev/null +++ b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/full.md @@ -0,0 +1,982 @@ +# HYBRID REGULARIZATION IMPROVES DIFFUSION-BASED INVERSE PROBLEM SOLVING + +Hongkun Dou $^{1}$ , Zeyu Li $^{1}$ , Jinyang Du $^{1,3}$ , Lijun Yang $^{1}$ , Wen Yao $^{2,*}$ & Yue Deng $^{1,3,*}$ + +$^{1}$ Beihang University $^{2}$ Chinese Academy of Military Science +3 Beijing Zhongguancun Academy + +{douhk, lizeyu123478,dujinyang, yanglijun, ydeng}@buaa.edu.cn, wendy0782@126.com + +# ABSTRACT + +Diffusion models, recognized for their effectiveness as generative priors, have become essential tools for addressing a wide range of visual challenges. Recently, there has been a surge of interest in leveraging Denoising processes for Regularization (DR) to solve inverse problems. However, existing methods often face issues such as mode collapse, which results in excessive smoothing and diminished diversity. In this study, we perform a comprehensive analysis to pinpoint the root causes of gradient inaccuracies inherent in DR. Drawing on insights from diffusion model distillation, we propose a novel approach called Consistency Regularization (CR), which provides stabilized gradients without the need for ODE simulations. Building on this, we introduce Hybrid Regularization (HR), a unified framework that combines the strengths of both DR and CR, harnessing their synergistic potential. Our approach proves to be effective across a broad spectrum of inverse problems, encompassing both linear and nonlinear scenarios, as well as various measurement noise statistics. Experimental evaluations on benchmark datasets, including FFHQ and ImageNet, demonstrate that our proposed framework not only achieves highly competitive results compared to state-of-the-art methods but also offers significant reductions in wall-clock time and memory consumption. Code is available at https://github.com/deng-ai-lab/HRDIS. + +# 1 INTRODUCTION + +Diffusion models (Ho et al., 2020; Song et al., 2020b), celebrated for their ability to model complex high-dimensional distributions, are increasingly applied across a broad spectrum of fields. These applications span from image generation (Dhariwal & Nichol, 2021; Sahara et al., 2022b; Rombach et al., 2022), and video synthesis (Cho et al., 2024; Ho et al., 2022; Ruhling Cachay et al., 2024) to molecular design (Guan et al., 2023; Hoogeboom et al., 2022; Xu et al., 2022), and protein generation (Wu et al., 2024a; Trippe et al., 2022; Watson et al., 2023). The wealth of knowledge accumulated within pre-trained diffusion models, derived from vast datasets, empowers their utilization as powerful prior models. This capability is particularly valuable for reconstructing accurate outputs from incomplete measurement signals. + +Recent research has highlighted the potential of diffusion models as general-purpose posterior samplers in solving inverse problems. For instance, Kawar et al. (2022) pioneered DDRM, innovatively integrating the observation into the inverse denoising process within the spectral domain through singular value decomposition. In a similar vein, Wang et al. (2022) introduced DDNM, which methodically adjusts the inverse diffusion process to align with the observation's null space. Despite their novelty, these approaches are limited to addressing linear degenerations and often result in low-fidelity images in practical applications. To improve upon these limitations, subsequent innovations like DPS (Chung et al., 2022) and IIGDM (Song et al., 2022) have been developed, focusing on approximating the score of posterior distributions to achieve image restoration. However, their dependence on an unimodal estimation for clean samples has led to issues with precision. Additionally, the requirement + +![](images/712da2a6e7ee0709666421de52d4cedb1a353d98cdf15bb55ed8df94c888d1c8.jpg) +Figure 1: Comparison between RED-diff (Mardani et al., 2024) and our proposed HRDIS for image inpainting (left), super-resolution (middle) and nonlinear deblurring (right) tasks. RED-diff adopts the denoising process for regularization, which frequently leads to blurry and detail-lacking reconstructions, particularly when addressing intricate image inversion challenges. In contrast, HRDIS consistently outperforms RED-diff, showcasing notably improved results. + +to compute the Jacobian matrix of the score network with DPS and IIGDM introduces significant computational demands and potential instability, posing challenges for efficient implementation. + +RED-diff (Mardani et al., 2024) provides a novel perspective to addressing diffusion-based inverse problems, conceptualizing them within a variational objective framework. This framework employs a denoising process as a regularization technique to alleviate the ill-posedness of the inverse problem. Such an optimization-based approach circumvents the necessity for backpropagation through the score network, facilitating compatibility with existing efficient stochastic optimization methods. Despite these advantages, RED-diff encounters practical challenges, notably a mode-seek tendency that often leads inversion results to converge on feature-averaged estimation (see Figure 1). + +In this study, we investigate the underlying issues of RED-diff, particularly optimization challenges caused by gradient inaccuracy, which we attribute to its reliance on single-step denoising estimation as a bootstrap target. Drawing upon principles for the distillation of diffusion models (Song et al., 2023b; Song & Dhariwal, 2023), we develop the Consistency Regularization (CR) technique. This approach enables more stable gradient provision, facilitating the regularization of the target signal for recovery, and obviates the need for computationally intensive simulation of ordinary differential equations (ODEs). Building on this foundation, we further introduce a comprehensive Hybrid Regularization (HR) framework. It provides a unification of RED-diff and CR, amalgamating their benefits to enhance the performance of inverse problem solving markedly. + +We introduce our framework, Hybrid Regularization for Diffusion-based Inverse problem Solving (HRDIS), which serves as a versatile solution for addressing a wide range of inverse problems. We evaluate HRDIS across various tasks, encompassing both linear ( inpainting, super-resolution, and compressed sensing) and nonlinear ( phase retrieval, high dynamic range, and nonlinear deblurring) scenarios, using two widely recognized benchmark datasets: FFHQ (Karras et al., 2019) and ImageNet (Deng et al., 2009). Additionally, we demonstrate the framework's adaptability to various noise types. Our results show that HRDIS achieves performance that matches or exceeds state-of-the-art methods, while significantly reducing wall-clock time and memory usage. + +# 2 BACKGROUND + +# 2.1 SCORE-BASED DIFFUSION MODELS + +The diffusion model (Ho et al., 2020; Song et al., 2020b) introduces a forward stochastic differential equation (SDE), denoted as $\{\mathbf{x}_t\}_{t\in [0,1]}$ , which gradually perturbs the initial data $\mathbf{x}_0\sim p_{\mathrm{data}}$ into noise: + +$$ +\mathrm {d} \mathbf {x} = \mathbf {f} (\mathbf {x}, t) \mathrm {d} t + g (t) \mathrm {d} \mathbf {w}, \tag {1} +$$ + +where $\mathbf{f}(\cdot, t)$ and $g(t)$ represent the drift and diffusion coefficients, respectively, and $\mathbf{w}$ is the standard Wiener process. We denote the marginal probability densities w.r.t $\mathbf{x}_t$ as $p_t(\cdot)$ . By selecting appropriate coefficients, we can reparameterize $\mathbf{x}_t = \alpha_t\mathbf{x}_0 + \sigma_t\epsilon$ , where $\epsilon \sim \mathcal{N}(\mathbf{0},\mathbf{I})$ and obtain a standard + +Gaussian density at $t = 1$ . The forward SDE above is coupled with a probability flow (PF) ODE, which can be expressed as: + +$$ +\mathrm {d} \mathbf {x} = \left[ \mathbf {f} (\mathbf {x}, t) - \frac {1}{2} g ^ {2} (t) \nabla_ {\mathbf {x}} \log p _ {t} (\mathbf {x}) \right] \mathrm {d} t, \tag {2} +$$ + +The above equation introduces a time-dependent score function $\nabla_{\mathbf{x}}\log p_t(\mathbf{x})$ , which can be approximated minimizing denoising score matching (Hyvarinen & Dayan, 2005) objectives using a neural network $\epsilon_{\theta}$ , + +$$ +\min _ {\theta} \mathbb {E} _ {t, \mathbf {x} _ {0} \sim p _ {\text {d a t a}}, \epsilon \sim \mathcal {N} (\mathbf {0}, I)} \| \epsilon_ {\theta} \left(\alpha_ {t} \mathbf {x} _ {0} + \sigma_ {t} \epsilon , t\right) - \epsilon \| _ {2} ^ {2}. \tag {3} +$$ + +After training, we can approximate $\nabla_{\mathbf{x}}\log p_t(\mathbf{x})\approx -\epsilon_\theta (\mathbf{x},t) / \sigma_t$ and simulate such ODE in reverse time to sample from the underlying distribution $p_{\mathrm{data}}$ . + +Given that simulating the ODE can be computationally intensive, often requiring hundreds of iterations, consistency distillation (CD) (Song et al., 2023b) has recently been introduced to learn a direct mapping from noise to data. This mapping is parameterized as $f_{\phi}(\cdot ,\cdot)$ and is trained to maintain self-consistency: + +$$ +\min _ {\phi} \| f _ {\phi} \left(\mathbf {x} _ {t + \varepsilon}, t + \varepsilon\right) - \operatorname {s g} \left(f _ {\phi} \left(\mathbf {x} _ {t}, t\right)\right) \| _ {2} ^ {2} \tag {4} +$$ + +where $\varepsilon > 0$ , and $\mathrm{sg}(\cdot)$ denotes the stop-gradient operator. Here, $\mathbf{x}_{t + \varepsilon}$ and $\mathbf{x}_t$ are two adjacent points on the same PF ODE trajectory. As the model easily learns the cases for small $t$ , this loss function propagates the endpoint of the trajectory toward $t = 1$ , promoting a one-step approximation of the ODE solution. + +# 2.2 DIFFUSION MODELS FOR INVERSE PROBLEMS + +The inverse problem arises in various applications across diverse domains. Formally, the general model for the inverse problem can be expressed as: + +$$ +\mathbf {y} = \mathcal {A} \left(\mathbf {x} _ {0}\right) + \boldsymbol {\eta}, \quad \mathbf {y}, \boldsymbol {\eta} \in \mathbb {R} ^ {n}, \mathbf {x} _ {0} \in \mathbb {R} ^ {m}, \tag {5} +$$ + +where $\mathcal{A}(\cdot):\mathbb{R}^m\to \mathbb{R}^n$ is the measurement operator and $\pmb{\eta}$ is the noise in the measurement process. When it is Gaussian noise, $\pmb {\eta}\sim \mathcal{N}(0,\gamma^2\pmb {I})$ , then we have $p(\mathbf{y}|\mathbf{x}_0)\sim \mathcal{N}(\mathcal{A}(\mathbf{x}_0),\gamma^2\mathbf{I})$ . In practical applications, the collection of measurements often results in degradation relative to the original signal. Notably, when $n < m$ , the problem becomes ill-posed, necessitating the incorporation of a regularizer or prior for deriving a meaningful solution. Recent research has demonstrated that diffusion models can serve as plug-and-play generative priors for sampling from posterior distributions, thereby obviating the need for extensive fine-tuning for specific tasks. To address this challenge, several classes of methods have been proposed. One widely used approach is the projection-based methods (Song et al., 2020b; Kawar et al., 2022; Wang et al., 2022), which constrains the reverse-time denoising process to the subspace of measurements. However, these heuristics often fail to harmonize the generated samples with the known region (Lugmayr et al., 2022). + +Alternatively, guidance-based methods have been proposed (Chung et al., 2022; Song et al., 2022). The gradient of the log-likelihood, i.e. $\nabla_{\mathbf{x}_t}\log p(\mathbf{y}|\mathbf{x}_t)$ , is approximated and integrated into Eq. 2 for posterior sampling from the measurement $\mathbf{y}$ . Specifically, in order to obtain $p(\mathbf{y}|\mathbf{x}_t) = \int p(\mathbf{y}|\mathbf{x}_0)p(\mathbf{x}_0|\mathbf{x}_t)\mathrm{d}\mathbf{x}_0$ , DPS (Chung et al., 2022) approximate $p(\mathbf{x}_0|\mathbf{x}_t)$ with an Dirac delta distribution, i.e. $p(\mathbf{x}_0|\mathbf{x}_t)\approx \delta (\mathbf{x}_0 - \hat{\mathbf{x}}_{0|t})$ , where $\hat{\mathbf{x}}_{0|t}\triangleq \mathbb{E}[\mathbf{x}_0|\mathbf{x}_t] = (\mathbf{x}_t - \sigma_t\epsilon_\theta (\mathbf{x}_t,t)) / \alpha_t$ represents the single-step denoising estimation by Tweedie's formula (Robbins, 1992). Thus, we have the following approximation, + +$$ +\nabla_ {\mathbf {x} _ {t}} \log p (\mathbf {y} | \mathbf {x} _ {t}) \approx - \frac {1}{\gamma^ {2}} \nabla_ {\mathbf {x} _ {t}} \| \mathbf {y} - \mathcal {A} (\hat {\mathbf {x}} _ {0 | t}) \| _ {2} ^ {2}. \tag {6} +$$ + +While these methods prove effective and typically produce clear reconstruction results, they are not exempt from limitations. In particular, the gradient backpropagation process of the network $\epsilon_{\theta}$ is computationally expensive and prone to instability. + +Recently, Mardani et al. (2024) introduced an optimization-based method, RED-diff, with promising results. They tackle the problem by treating posterior sampling as a variational optimization task, + +$$ +\min _ {q} D _ {K L} \left(q \left(\mathbf {x} _ {0} \mid \mathbf {y}\right) \| p \left(\mathbf {x} _ {0} \mid \mathbf {y}\right)\right), \tag {7} +$$ + +![](images/96606f5b0a02e3c2827e4c75d67cc859146de30e303ae60161a6fcd1b45fb9aa.jpg) +Figure 2: Comparison of intermediate denoised images $\hat{\mu}_{0|t}$ between DR and CR (Sec. 3.2). The top row displays an equally spaced visualization as $t$ progresses from 1 to 0. The bottom row presents $\hat{\mu}_{0|t}$ across 5 consecutive timesteps. CR demonstrates more consistent generation and captures intricate features at earlier stages than DR. The task is shown $16\times$ super-resolution. + +where $q \triangleq \mathcal{N}(\mu, \rho^2 \pmb{I})$ is the variational distribution. The aforementioned variational objective can be further simplified as: + +$$ +\min _ {\mu} \underbrace {\| \mathbf {y} - \mathcal {A} (\mu) \| _ {2} ^ {2}} _ {\text {r e c o n s t r u c t i o n}} + \underbrace {\mathbb {E} _ {t , \epsilon} [ \rho_ {t} \| \epsilon_ {\theta} (\mu_ {t} , t) - \epsilon \| _ {2} ^ {2} ]} _ {\text {r e g u l a r i z a t i o n}}. \tag {8} +$$ + +where $\mu_t = \alpha_t \mu + \sigma_t \epsilon$ and $\rho_t$ is the weighting function that depends on the timestep. The first term serves as a reconstruction term, ensuring that the reconstruction results align with the observed data. Meanwhile, the second term resembles the score matching objective, serving as a form of regularization to alleviate the ill-posed nature of $\mu$ . We designate this technique as Denoising Regularization (DR). Mardani et al. (2024) also demonstrate that the gradient of DR can bypass the need for the Jacobian matrix of $\epsilon_\theta$ . Consequently, the resulting gradient can be expressed as: + +$$ +\nabla_ {\mu} \mathcal {L} _ {\mathrm {D R}} = \nabla_ {\mu} \| \mathbf {y} - \mathcal {A} (\mu) \| _ {2} ^ {2} + \mathbb {E} _ {t, \epsilon} [ \omega_ {t} (\epsilon_ {\theta} (\mu_ {t}, t) - \epsilon) ], \tag {9} +$$ + +where Mardani et al. (2024) chooses $\omega_{t} = \sigma_{t} / \alpha_{t}$ to balance the two terms. At this juncture, we can integrate the above gradient into an off-the-shelf stochastic optimizer and utilize the optimized $\mu$ as the reconstructed signal. RED-diff boasts memory efficiency, circumventing the need for backpropagation within the neural network. Also, it offers the advantage of utilizing the degraded image as an initial point for optimization, eliminating the necessity of starting with Gaussian noise. However, it is notable that RED-diff encounters challenges related to mode collapse, resulting in blurry outcomes and limited diversity. Furthermore, the convergence of RED-diff typically requires thousands of optimization steps. + +# 3 METHODS + +In this section, we first address the practical challenges in Denoising Regularization (DR) (Sec. 3.1). Building on these findings, we introduce Consistency Regularization (CR) as an alternative approach to overcome the limitations of DR (Sec. 3.2). We then present a unified framework, termed Hybrid Regularization (HR), which seamlessly integrates DR and CR as complementary techniques. Through a comprehensive analysis, we demonstrate how HR effectively leverages the strengths of both DR and CR methodologies to achieve superior performance (Sec. 3.3). + +# 3.1 ANALYSIS OF GRADIENTS IN DR + +Mardani et al. (2024) point out that the gradient of the regularization term in Eq. 9 can also be interpreted as the difference between the predicted clean image and variable $\mu$ . By performing algebraic manipulation, we derive it as follows: + +$$ +\begin{array}{l} \omega_ {t} \left(\epsilon_ {\theta} \left(\mu_ {t}, t\right) - \epsilon\right) = \left(\mu_ {t} - \sigma_ {t} \epsilon\right) / \alpha_ {t} - \left(\mu_ {t} - \sigma_ {t} \epsilon_ {\theta} \left(\mu_ {t}, t\right)\right) / \alpha_ {t} \\ = \mu - \hat {\mu} _ {0 | t} = \nabla_ {\mu} \| \mu - \operatorname {s g} \left(\hat {\mu} _ {0 | t}\right) \| _ {2} ^ {2}, \tag {10} \\ \end{array} +$$ + +where $\hat{\mu}_{0|t} \triangleq \mathbb{E}[\mu|\mu_t]$ represents the single-step denoising estimate at timestep $t$ . This derivation clarifies the mechanism of Denoising Regularization (DR), with $\hat{\mu}_{0|t}$ serving as a bootstrapped + +ground truth. Regularization is achieved by constraining $\mu$ to align with $\hat{\mu}_{0|t}$ during optimization, thus ensuring it remains within the distribution of clean data. + +Despite the effectiveness of this approach, DR has notable limitations. Firstly, the bootstrapped ground truth $\hat{\mu}_{0|t}$ is highly sensitive to $\mu_t$ , and the stochasticity of noise perturbations introduces significant uncertainty, as illustrated in Figure 2. This often results in optimization with inconsistent ground truths, leading to feature-averaged reconstructions. Secondly, it is well established that single-step denoising outputs from diffusion models are often suboptimal, typically lacking in detail and high-frequency components. This limitation further diminishes the performance of RED-diff, resulting in less precise outcomes. + +# 3.2 SELF-CONSISTENCY FOR INVERSE PROBLEM SOLVING + +Given the uncertainty and imprecision of DR, the deterministic process can be employed to achieve more consistent and accurate regularization. A straightforward approach is applying reverse ODE inversion (Su et al., 2022) to encode $\mu$ into noisy data, eliminating the need for random perturbations. Alternatively, we can employ a multi-step solver to obtain a more accurate estimate of $\hat{\mu}_{0|t}$ (Tang et al., 2023). While these methods improve estimation accuracy, they come with a significant trade-off in terms of computational cost. Each iteration of gradient descent requires resource-intensive inversions and multi-step solver executions, substantially increasing the overall computation time. The added computational burden can be prohibitive, particularly in applications where efficiency is crucial for solving inverse problems. + +We observe that the above process can draw inspiration from recent advances in consistency distillation (CD) (Song et al., 2023b), which enable efficient approximation of diffusion ODE without the need for intensive simulations. CD enhances self-consistency by minimizing the difference of outputs between two adjacent points (e.g., $t$ and $t + \varepsilon$ ) on the ODE trajectory (Eq. 4). Given that the output at $t$ is more accurate than at $t + \varepsilon$ , the model can iteratively propagate the trajectory endpoint back to $t = 1$ . Motivated by this concept, we present Consistency Regularization (CR) as the difference between two adjacent outputs. The gradient of this regularization term is expressed as follows: + +$$ +\nabla_ {\mu} \mathcal {L} _ {\mathrm {C R}} = \nabla_ {\mu} \| \mathbf {y} - \mathcal {A} (\mu) \| _ {2} ^ {2} + \mathbb {E} _ {t, \epsilon} [ \hat {\mu} _ {0 | t + \varepsilon} - \hat {\mu} _ {0 | t} ], \tag {11} +$$ + +where $\hat{\mu}_{0|t + \varepsilon} = \mathbb{E}[\mu |\mu_{t + \varepsilon}]$ . The points $\mu_{t + \varepsilon}$ and $\mu_t$ are adjacent, and $\mu_t$ can be computed using the Euler solver as $\mu_t = \alpha_t\hat{\mu}_{0|t + \varepsilon} + \sigma_t\epsilon_\theta (\mu_{t + \varepsilon},t + \varepsilon)$ . The key idea behind Eq. 11 is as follows: the clean image predicted at $t$ has a higher fidelity compared to that at $t + \varepsilon$ . By progressively incorporating more complex features through the difference between these two estimates, the optimized variable incrementally converges toward the real image at $t = 0$ . We can further simplify the regularization term to operate within the noise domain. + +$$ +\begin{array}{l} \hat {\mu} _ {0 | t + \varepsilon} - \hat {\mu} _ {0 | t} = \hat {\mu} _ {0 | t + \varepsilon} - (\mu_ {t} - \sigma_ {t} \epsilon_ {\theta} (\mu_ {t}, t)) / \alpha_ {t} \quad (\text {B r i n g i n} \mu_ {t}) \\ = \omega_ {t} \left(\epsilon_ {\theta} \left(\mu_ {t}, t\right) - \epsilon_ {\theta} \left(\mu_ {t + \varepsilon}, t + \varepsilon\right)\right). \tag {12} \\ \end{array} +$$ + +Note that the gradient computation outlined above necessitates two network inferences. To reduce computational costs, we can adopt the descending sampling strategy for timesteps as proposed by Mardani et al. (2024), using the noise prediction from the previous step $\epsilon_{\theta}(\mu_{t + \varepsilon},t + \varepsilon)$ . As shown in Figure 2, we observe that CR indeed produces more consistent $\hat{\mu}_{0|t}$ compared to DR, and produces intricate structural features at an early stage of optimization. + +# 3.3 HYBRID REGULARIZATION + +The CR method provides sharper and more diverse restoration results; however, we have observed that it occasionally produces oversaturation and artifacts, as illustrated in Figure 3. We hypothesize that this issue arises from the lack of randomness in the noise sampling process within CR. Unlike DR, which introduces fresh noise during the optimization process, CR relies on the noise estimation from previous steps. The importance of random noise in enhancing the robustness and quality of generation has been extensively emphasized in the existing literature on + +![](images/4764c02226e061ed85b007f901193b67c12caa32f8ab587e79c6f64e27a1a407.jpg) +Distorted CR (Eq. 11) HR (Eq. 14) + +![](images/4daf0557018876952990e4e9f0cef1dc00c45ebeb564a63f09cf2147c6903b6a.jpg) + +![](images/e0a09c5004263c8312adc1310a13d02f5969a2cc4fe1084eb35f3ada339704c9.jpg) +Figure 3: Demonstration of the artifacts and oversaturation present in CR. We effectively mitigate these artifacts by incorporating hybrid noise. + +![](images/caad8acbe129121bba680150d4d60d105caace0e9873dd8b44e6274c89127fc2.jpg) + +diffusion models (Karras et al., 2022; Xu et al., 2023; Nie et al., 2023). These findings motivate us to explore the possibility of devising a unified framework that remains compatible with these regularization methods, thereby harnessing the strengths of both approaches. In the following, inspired by the study of solvers for diffusion models, we propose a general framework that we dub Hybrid Regularization (HR). + +The widely used DDIM solver (Song et al., 2020a) can generate sample $\mathbf{x}_t$ from $\mathbf{x}_{t + \varepsilon}$ using the following expression: + +$$ +\mathbf {x} _ {t} = \alpha_ {t} \underbrace {\hat {\mathbf {x}} _ {0 : t + \varepsilon}} _ {\text {p r e d i c t e d} \mathbf {x} _ {0}} + \underbrace {\sqrt {\sigma_ {t} ^ {2} - \beta_ {t} ^ {2}} \epsilon_ {\theta} (\mathbf {x} _ {t + \varepsilon} , t + \varepsilon)} _ {\text {d e t e r m i n i s t i c n o i s e}} + \underbrace {\beta_ {t} \boldsymbol {\epsilon}} _ {\text {r a n d o m n o i s e}} \tag {13} +$$ + +The DDIM procedure begins with estimating $x_0$ using the network, followed by its immediate projection onto the manifold where the noisy data resides at $t$ , according to the forward noisng process (Chung et al., 2023b). Note that the noise can be categorized into two parts: deterministic and random noise. Their total variance $(\sqrt{\sigma_t^2 - \beta_t^2})^2 + \beta_t^2 = \sigma_t^2$ , where $\beta_{t}$ governs the stochasticity of the sampling process. Specifically, when $\beta_{t} = 0$ , the sampling process becomes deterministic. Returning to Eqs. 10 and 12, we observe that the disparity between the two gradients stems from the selection of noise: the former utilizes entirely random noise, while the latter employs deterministic noise predicted by the network. To leverage the benefits of both approaches, we introduce a coefficient $\beta$ to generate a hybrid noise $\epsilon_{\mathrm{hybrid}}$ , maintaining constant total variance. Thus, the gradient can be formulated as follows: + +$$ +\nabla_ {\mu} \mathcal {L} _ {\mathrm {H R}} = \nabla_ {\mu} \| \mathbf {y} - \mathcal {A} (\mu) \| _ {2} ^ {2} + \mathbb {E} _ {t, \epsilon} \left[ \omega_ {t} \left(\epsilon_ {\theta} \left(\mu_ {t}, t\right) - \epsilon_ {\text {h y b r i d}}\right) \right], \tag {14} +$$ + +$$ +\epsilon_ {\text {h y b r i d}} \triangleq \sqrt {1 - \beta} \epsilon_ {\theta} (\mu_ {t + \varepsilon}, t + \varepsilon) + \sqrt {\beta} \epsilon +$$ + +We denote the technique described above as Hybrid Regularization (HR), which constitutes a unified formulation. It is evident that both DR and CR represent extreme cases, where $\beta$ takes values of 1 and 0, respectively. We assume that there exists a sweet spot that can effectively balance these two aspects. In the ablation study detailed in Sec. 4.4, we observe that a $\beta$ value of 0.2 is generally sufficient for our method to perform well across a wide range of experiments, obviating the need for task-specific tuning. Unless otherwise specified, we use $\beta = 0.2$ as the default setting. + +Intuitively, hybrid noise exhibits a stronger correlation with $\epsilon_{\theta}(\mu_t,t)$ compared to entirely random noise. Consequently, HR demonstrates reduced gradient variance, thereby promoting more efficient and stable optimization. Meanwhile, incorporating a small degree of stochasticity aids in contract errors accumulated during the inversion process. Another key parameter is the timestep shift $\varepsilon$ , for which we found that a value around the $10^{-2}$ order of magnitude works well (Appendix C.8). Our final approach, named Hybrid Regularization for Diffusion-based Inverse Problem Solving (HRDIS), is presented in Algorithm 1, with the Adam optimizer (Kingma & Ba, 2014) employed as the default. + +Algorithm 1 Sampling procedure for HRDIS. +Input: observation $\mathbf{y}$ , measurement operator $\mathcal{A}(\cdot)$ , number of iterations $N$ , timesteps sampling strategy $\{s_n\}_{n = 1}^N$ , pretrained model $\epsilon_{\theta}(\cdot ,\cdot),\beta ,\omega_{t}$ +1: Initialize $\mu \leftarrow \mathcal{A}^{-1}(\mathbf{y})$ +2: for $n = 1,\dots ,N$ do +3: $t\gets s_n$ +4: if $n = 1$ then +5: Initialize hybrid noise $\epsilon_{\mathrm{hybrid}}\sim \mathcal{N}(0,I)$ +6: end if +7: Forward perturb $\mu_t\gets \alpha_t\mu +\sigma_t\epsilon_{\mathrm{hybrid}}$ +8: Calculate gradient $d_{\mu}\gets \nabla_{\mu}\| \mathbf{y} - \mathcal{A}(\mu)\| _2^2 +\omega_t(\epsilon_\theta (\mu_t,t) - \epsilon_{\mathrm{hybrid}})$ +9: Optimize mean $\mu \leftarrow$ AdamUpdate $(\mu ,d_{\mu})$ +10: Sample fresh noise $\epsilon \sim \mathcal{N}(0,I)$ +11: Calculate hybrid noise $\epsilon_{\mathrm{hybrid}}\gets \sqrt{1 - \beta}\epsilon_{\theta}(\mu_t,t) + \sqrt{\beta}\epsilon$ +12: end for +Output: $\mu$ + +![](images/9930712dd2a4e99efbc3d5e09ba0517777ad54b37ea60034f563eb6beb3721b1.jpg) + +![](images/f8140629b5c40fc35ad2d2610c552c70931cb2b9bc475b8e0c5b0198b4bc988d.jpg) +Figure 4: Comparison of DDS (Chung et al., 2023b) (top) and HRDIS (bottom) graph models. HRDIS maintains an additional variable that is optimized during the process, enabling flexible initialization. The superscript $(n)$ denotes the optimization step. + +# 3.4 DISCUSSION + +In this subsection, we discuss the differences between the proposed HRDIS framework and existing approximate posterior sampling methods, focusing on DDS (Chung et al., 2023b) as a representative example. We compare the graph model of HRDIS with that of DDS in Figure 4. DDS can be understood as approximate posterior sampling, achieved by gradually guiding the unconditional DDIM sampling process. DDS consists of three main steps: 1) Predict $\hat{\mathbf{x}}_{0|t}$ from $\mathbf{x}_t$ . 2) Solve the optimization problem: $\min_{\hat{\mathbf{x}}_{0|t}^{\prime}}\frac{1}{2}\|\mathbf{y} - \mathcal{A}\hat{\mathbf{x}}_{0|t}^{\prime}\|^2 + \frac{\gamma}{2}\|\hat{\mathbf{x}}_{0|t}^{\prime} - \hat{\mathbf{x}}_{0|t}\|^2$ using the conjugate gradient (CG). 3) Calculate $\mathbf{x}_{t-1}$ using DDIM. Through these steps, DDS iteratively refines the sampling trajectory $\mathbf{x}_t, \mathbf{x}_{t-1}, \ldots, \mathbf{x}_0$ by solving the subproblem in Step 2. In contrast, HRDIS builds on the RED-diff framework and formulates sampling as a stochastic optimization. A key difference is that HRDIS introduces and maintains an additional variable $\mu$ , initialized as $\mathcal{A}^{-1}(\mathbf{y})$ , throughout the optimization. This variable is updated using gradients $\nabla_{\mu}\mathcal{L}_{\mathrm{HR}}$ with an off-the-shelf Adam optimizer. + +These fundamental differences result in notably distinct sampling behaviors. DDS gradually transitions from noise to reconstruction. In contrast, HRDIS exhibits an evolution that bridges the degraded image and the reconstruction, reflecting its unique generative dynamics (see Figure 17). + +# 4 EXPERIMENTS + +We structure our experiments to address the following inquiries. Q1: Does our proposed HRDIS effectively mitigate the issue of generating blurry images, as observed in RED-diff (Mardani et al., 2024), while simultaneously producing sharp and diverse reconstruction outcomes? Q2: How does the performance of HRDIS compare to that of state-of-the-art diffusion model-based inverse problem solvers, such as IIGDM (Song et al., 2022), FPS (Dou & Song, 2024), among others? Furthermore, what is the computational efficiency of our approach compared to these alternatives? Q3: What is the optimal choice for the hyperparameter $\beta$ in regulating stochasticity within the framework of hybrid regularization? + +To address Q1, we examine the inversion results of challenging images within the dataset, assessing whether HRDIS can effectively restore high-frequency details compared to RED-diff. For Q2, we conduct a quantitative comparison of quality and efficiency against state-of-the-art algorithms. Lastly, to explore Q3, we conduct experiments to analyze the hyperparameter $\beta$ selection. + +Experimental Setup: We assess the effectiveness of the proposed HRDIS method across a range of image restoration tasks, encompassing both linear and nonlinear inverse problems such as image inpainting, super-resolution, compressed sensing (CS), phase retrieval, high dynamic range (HDR) tasks, and nonlinear deblurring. Our experiments are conducted on the ImageNet $256 \times 256$ (Deng et al., 2009) and FFHQ $256 \times 256$ (Karras et al., 2019) datasets, with results derived from 1k validation + +Table 1: Quantitative evaluation (FID, LPIPS, CA (unit:%)) of solving linear inverse problems on ImageNet $256\times 256 - 1k$ validation dataset. Bold: best,underline: second best. + +
MethodInpaint (10-20%)Inpaint (20-30%)SR (×4)CS (25%)
LPIPS ↓FID ↓CA ↑LPIPS ↓FID ↓CA ↑LPIPS ↓FID ↓CA ↑LPIPS ↓FID ↓CA ↑
DDRM (Kawar et al., 2022)0.07113.8873.30.12326.0970.20.26547.4365.30.25059.4051.7
DPS (Chung et al., 2022)0.14627.6569.00.18236.6464.60.19737.3567.70.16834.2068.2
IIGDM (Song et al., 2022)0.07312.8573.70.11821.8472.80.15028.9671.80.07522.9873.5
DDNM (Wang et al., 2022)0.07514.0672.00.10626.6167.90.25147.1561.90.24753.1658.4
GDP (Fei et al., 2023)0.07013.9172.50.13527.8367.30.23444.0862.40.28360.0152.3
DDS (Chung et al., 2023b)0.06713.1273.80.13027.6467.90.19841.6262.80.27058.4155.1
FPS (Dou & Song, 2024)0.06513.0773.90.12124.9070.50.18934.8867.80.12432.7667.0
RED-diff (Mardani et al., 2024)0.06713.2073.60.11724.6769.50.24944.1665.80.10829.9069.3
HRDIS (Ours)0.05410.9474.70.09620.1071.30.13733.0168.80.05922.0472.3
+ +images, consistent with previous research standards (Chung et al., 2022; Mardani et al., 2024). We utilize pre-trained diffusion models from (Dhariwal & Nichol, 2021) and (Choi et al., 2021). Our comparative analysis includes benchmark techniques, namely DDRM (Kawar et al., 2022), DPS (Chung et al., 2022), IIGDM (Song et al., 2022), FPS (Dou & Song, 2024) and RED-diff (Mardani et al., 2024). Additional details on the experimental setup can be found in the Appendix B.2. + +# 4.1 LINEAR INVERSE PROBLEMS + +We begin our experiments with image inpainting, using the freeform masks provided by (Saharia et al., 2022a). Specifically, we apply $10\% - 20\%$ and $20\% - 30\%$ masks on the ImageNet dataset and employ the more challenging $30\% - 40\%$ mask on FFHQ. For the super-resolution experiments, we utilize average pooling to perform $4\times$ downsampling on ImageNet and $16\times$ downsampling on FFHQ. In the compressed sensing (CS) task, we adopt an orthogonal sampling matrix applied to the image blocks, with a sampling rate of $25\%$ for ImageNet and $10\%$ for FFHQ. We evaluate our results using two widely adopted metrics: Learned Perceptual Im + +age Patch Similarity (LPIPS) (Zhang et al., 2018) and Fréchet Inception Distance (FID) (Heusel et al., 2017), computed on the test images. Additionally, for the ImageNet dataset, we report classifier accuracy (CA) using a pre-trained ResNet50 (He et al., 2016). + +Tables 1 and 2 present the quantitative outcomes of linear inverse problem solving on ImageNet and FFHQ, respectively. It is evident that HRDIS consistently ranks within the top two across all metrics and significantly outperforms other methods in numerous instances. Particularly noteworthy is HRDIS's exceptional performance in the inpainting and CS task, where it outshines all other techniques. While IIGDM demonstrates superiority in the super-resolution task, HRDIS closely follows as the runner-up. Following the quantitative analysis, we present a visual comparison with RED-diff in Figure 5. It is evident that RED-diff frequently converges to the blurry images, which may not always align with the desired inversion result. In contrast, HRDIS exhibits the ability to generate diverse and plausible restored images across various random seed settings, offering a more flexible and robust solution to the image restoration task. Figures 6 and 7 provide a qualitative comparison with other state-of-the-art inversion methods. Our observations indicate that DDRM tends to generate less realistic results and struggles to guide the reverse diffusion process toward achieving globally harmonious outcomes. Additionally, IIGDM occasionally exhibits instability, particularly evident in challenging samples, attributed to the necessity of backpropagating through the score network, resulting in failures in certain instances. In contrast, HRDIS can effectively recognize context and produce better restorations. See Appendix C.9 for more visualizations. + +The wall-clock time and GPU memory of the different algorithms for the inpainting are reported in Table 3. Our observations reveal that the optimization step of our method can be an order of magnitude fewer than that of RED-diff and FPS. In comparison to state-of-the-art guidance-based methods (DPS, IIGDM), our approach demonstrates exceptional lightweightness and memory efficiency. Although + +![](images/34f98efc373ed9a2b4d6bf78dd5aa5a535986038042092248fdefae5aed03fce.jpg) +Figure 6: Comparison of the proposed HRDIS with alternatives for inpainting (left) and superresolution (right) on ImageNet $256 \times 256$ and FFHQ $256 \times 256$ . + +Table 2: Quantitative evaluation (FID, LPIPS) of solving linear inverse problems on FFHQ ${256} \times {256} - 1\mathrm{k}$ validation dataset. + +
MethodInpaint (30-40%)SR (×16)CS (10%)
LPIPS ↓FID ↓LPIPS ↓FID ↓LPIPS ↓FID ↓
DDRM0.09923.910.32491.440.535130.2
DPS0.13844.750.22042.310.22868.50
IIGDM0.08415.840.18839.330.09133.25
DDNM0.10319.720.21041.500.15456.15
GDP0.11224.380.23743.510.26791.84
DDS0.10922.120.21341.810.25685.96
FPS0.09321.150.22845.900.17960.73
RED-diff0.08617.380.28673.390.18462.19
HRDIS (Ours)0.08215.420.21340.970.08835.27
+ +Table 3: Comparison of wall-clock time and memory consumption, measured on a single RTX 3090 GPU. + +
MethodImageNetFFHQ
Time (s/img)MemoryTime (s/img)Memory
DDRM104.4G42.5G
DPS2748.7G566.0G
IIGDM338.8G66.1G
DDNM134.6G52.7G
GDP844.3G332.4G
DDS134.6G52.7G
FPS955.2G353.3G
RED-diff824.3G322.4G
HRDIS (Ours)144.3G52.4G
+ +DDRM is also efficient, its applicability is limited to linear operator $\mathcal{A}(\cdot)$ , and its efficiency is not guaranteed in scenarios where fast singular value decomposition is not feasible. + +# 4.2 NONLINEAR INVERSE PROBLEMS + +We evaluate the nonlinear inverse problem on the FFHQ dataset, beginning with phase retrieval. Given the inherent instability of phase recovery, we follow the strategy employed by Chung et al. (2022), utilizing an oversampling rate of 2.0 and reporting the best results under four random seeds. Next, we address the High Dynamic Range (HDR) task, which incorpo + +Table 4: Quantitative evaluation (FID, LPIPS) of solving nonlinear inverse problems on FFHQ $256\times 256 - 1\mathrm{k}$ validation dataset. + +
MethodPhase retrievalHDRNonlinear deblurring
LPIPS ↓FID ↓LPIPS ↓FID ↓LPIPS ↓FID ↓
DPS0.38754.640.40784.640.27952.58
RED-diff0.46262.470.06318.200.32980.13
HRDIS (Ours)0.08938.340.04413.780.23652.36
+ +rates a truncation function to crop pixel values, represented as $\mathcal{A}(\mathbf{x}) = \mathrm{Clip}(2\mathbf{x}, -1, 1)$ . we adopt a pre-trained network to simulate the blurring degradation operator as described in Tran et al. (2021). Since methods such as DDRM, IIGDM, and FPS are not scalable to these nonlinear challenges, we compare our approach exclusively with DPS and RED-diff. + +Table 4 presents the quantitative metrics for various solvers applied to the nonlinear inverse problem. Notably, the LPIPS scores for phase retrieval are significantly higher than those of the baseline, demonstrating a substantial improvement. Figures 7 and 8 provide qualitative results. We can see that in the phase retrieval task, HRDIS generates reconstructions that closely match the reference image, whereas DPS and RED-diff yield unrealistic outputs. Additionally, DPS encountered challenges with the HDR task, failing to reconstruct the original image accurately. For the nonlinear deblurring task, the RED-diff method exhibited significant gradient variance, leading to a pronounced loss of detail and reduced fidelity. In contrast, our observations indicate that HRDIS consistently generates highly realistic samples, even in these more challenging nonlinear scenarios. + +![](images/e751428641deb1bf655639000b5f58c9473002e1efc98225e5ec81440b7dcdb9.jpg) +Figure 7: Comparison of the proposed HRDIS with alternatives for compressed sensing (left) and phase retrieval (right) on ImageNet $256 \times 256$ and FFHQ $256 \times 256$ . + +![](images/333feff68b52fc8559145f4dbfc0fdd78a27a0aa395727a46a22e708944d44bd.jpg) +Figure 8: Comparison of the proposed HRDIS with alternatives for HDR task (left) and nonlinear deblurring (right) on FFHQ $256 \times 256$ . + +# 4.3 HANDLING VARIOUS NOISE STATISTICS + +As an optimization-based framework, HRDIS is adept at managing various types of noise. In this subsection, we empirically evaluate HRDIS's performance under noisy conditions. To assess its robustness, we apply a freeform mask for inpainting and introduce three types of noise: Gaussian, Poisson, and speckle, into the observations. The results, detailed in Appendix C.2, show that HRDIS consistently outperforms other methods in most scenarios. This demonstrates the framework's robustness and adaptability in handling various measurement statistics. + +# 4.4 ABLATIONS: INFLUENCE OF $\beta$ + +We conduct an ablation analysis to investigate the impact of the parameter $\beta$ within the HRDIS method, focusing on inpainting and superresolution using the ImageNet dataset, as well as nonlinear deblurring on the FFHQ dataset. The quantitative results in Figure 9 indicate that a $\beta$ value of 0.2 consistently achieves lower LPIPS and FID scores across different tasks. As shown in Figure 11 (Appendix C.1), excessively high + +![](images/556ce17ee9eb785929ace23f3f0bebbf377456c154aa2a3e9ec02e9af79391c5.jpg) +Figure 9: Quantitative results for varying values of $\beta \in \{0,0.1,0.2,0.5,1\}$ . + +values of $\beta$ result in over-smoothing, while very low values introduce noticeable artifacts. Notably, $\beta = 0.2$ strikes an optimal balance, effectively reconstructing plausible high-frequency details. + +# 5 CONCLUSION + +This paper addresses the challenges associated with solving diffusion-based inverse problems using Denoising Regularization (DR). To tackle these challenges, we introduce the Consistency Regularization (CR) method, which effectively mitigates the issue of inaccurate gradient estimations. Additionally, we explore the integration of hybrid noise, resulting in the development of a unified HRDIS framework that fosters synergy between the two regularization techniques. The proposed framework is versatile, making it applicable to both linear and nonlinear inverse problems, as well as accommodating diverse measurement statistics. Comprehensive experimental evaluations demonstrate that HRDIS not only surpasses current state-of-the-art methods but also maintains high computational efficiency. + +# ACKNOWLEDGEMENTS + +This work was supported by the National Natural Science Foundation of China under Grant 62325101, 62031001, and also supported by the National Key Laboratory of Unmanned Aerial Vehicle Technology in NPU under Grant WR202403, and supported by the Fundamental Research Funds for the Central Universities. + +# REFERENCES + +Gabriel Cardoso, Yazid Janati El Idrissi, Sylvain Le Corff, and Eric Moulines. Monte carlo guided diffusion for bayesian linear inverse problems. arXiv preprint arXiv:2308.07983, 2023. +Joseph Cho, Fachrina Dewi Puspitasari, Sheng Zheng, Jingyao Zheng, Lik-Hang Lee, Tae-Ho Kim, Choong Seon Hong, and Chaoning Zhang. Sora as an agi world model? a complete survey on text-to-video generation. arXiv preprint arXiv:2403.05131, 2024. +Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. Ilvr: Conditioning method for denoising diffusion probabilistic models. arXiv preprint arXiv:2108.02938, 2021. +Hyungjin Chung, Jeongsol Kim, Michael T McCann, Marc L Klasky, and Jong Chul Ye. Diffusion posterior sampling for general noisy inverse problems. arXiv preprint arXiv:2209.14687, 2022. +Hyungjin Chung, Jeongsol Kim, Sehui Kim, and Jong Chul Ye. Parallel diffusion models of operator and image for blind inverse problems. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6059-6069, 2023a. +Hyungjin Chung, Suhyeon Lee, and Jong Chul Ye. Fast diffusion sampler for inverse problems by geometric decomposition. arXiv preprint arXiv:2303.05754, 2023b. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. +Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in neural information processing systems, 34:8780-8794, 2021. +Zehao Dou and Yang Song. Diffusion posterior sampling for linear inverse problem solving: A filtering perspective. In The Twelfth International Conference on Learning Representations, 2024. +Ben Fei, Zhaoyang Lyu, Liang Pan, Junzhe Zhang, Weidong Yang, Tianyue Luo, Bo Zhang, and Bo Dai. Generative diffusion prior for unified image restoration and enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9935-9946, 2023. +Jiaqi Guan, Wesley Wei Qian, Xingang Peng, Yufeng Su, Jian Peng, and Jianzhu Ma. 3d equivariant diffusion for target-aware molecule generation and affinity prediction. arXiv preprint arXiv:2303.03543, 2023. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017. +Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840-6851, 2020. +Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J Fleet. Video diffusion models. Advances in Neural Information Processing Systems, 35:8633-8646, 2022. + +Emiel Hoogeboom, Victor Garcia Satorras, Clément Vignac, and Max Welling. Equivariant diffusion for molecule generation in 3d. In International conference on machine learning, pp. 8867-8887. PMLR, 2022. +Aapo Hyvarinen and Peter Dayan. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(4), 2005. +Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4401-4410, 2019. +Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. Advances in Neural Information Processing Systems, 35:26565-26577, 2022. +Bahjat Kawar, Michael Elad, Stefano Ermon, and Jiaming Song. Denoising diffusion restoration models. Advances in Neural Information Processing Systems, 35:23593-23606, 2022. +Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +Yixun Liang, Xin Yang, Jiantao Lin, Haodong Li, Xiaogang Xu, and Yingcong Chen. Luciddreamer: Towards high-fidelity text-to-3d generation via interval score matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6517-6526, 2024. +Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. Repaint: Inpainting using denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11461-11471, 2022. +Morteza Mardani, Jiaming Song, Jan Kautz, and Arash Vahdat. A variational perspective on solving inverse problems with diffusion models. In The Twelfth International Conference on Learning Representations, 2024. +Naoki Murata, Koichi Saito, Chieh-Hsin Lai, Yuhta Takida, Toshimitsu Uesaka, Yuki Mitsufuji, and Stefano Ermon. Gibbsddrm: A partially collapsed gibbs sampler for solving blind inverse problems with denoising diffusion restoration. In International Conference on Machine Learning, pp. 25501-25522. PMLR, 2023. +Shen Nie, Hanzhong Allan Guo, Cheng Lu, Yuhao Zhou, Chenyu Zheng, and Chongxuan Li. The blessing of randomness: Sde beats ode in general diffusion-based image editing. arXiv preprint arXiv:2311.01410, 2023. +Ben Poole, Ajay Jain, Jonathan T Barron, and Ben Mildenhall. Dreamfusion: Text-to-3d using 2d diffusion. arXiv preprint arXiv:2209.14988, 2022. +Herbert E Robbins. An empirical bayes approach to statistics. In *Breakthroughs in Statistics: Foundations and basic theory*, pp. 388-394. Springer, 1992. +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. 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. +Litu Rout, Negin Raoof, Giannis Daras, Constantine Caramenis, Alex Dimakis, and Sanjay Shakkottai. Solving linear inverse problems provably via posterior sampling with latent diffusion models. Advances in Neural Information Processing Systems, 36, 2024. +Salva Ruhling Cachay, Bo Zhao, Hailey Joren, and Rose Yu. Dyffusion: A dynamics-informed diffusion model for spatiotemporal forecasting. Advances in Neural Information Processing Systems, 36, 2024. +Chitwan Sahara, William Chan, Huiwen Chang, Chris Lee, Jonathan Ho, Tim Salimans, David Fleet, and Mohammad Norouzi. Palette: Image-to-image diffusion models. In ACM SIGGRAPH 2022 conference proceedings, pp. 1-10, 2022a. + +Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghasemipour, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in neural information processing systems, 35:36479-36494, 2022b. +Yichun Shi, Peng Wang, Jianglong Ye, Mai Long, Kejie Li, and Xiao Yang. Mvdream: Multi-view diffusion for 3d generation. arXiv preprint arXiv:2308.16512, 2023. +Bowen Song, Soo Min Kwon, Zecheng Zhang, Xinyu Hu, Qing Qu, and Liyue Shen. Solving inverse problems with latent diffusion models via hard data consistency. arXiv preprint arXiv:2307.08123, 2023a. +Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020a. +Jiaming Song, Arash Vahdat, Morteza Mardani, and Jan Kautz. Pseudoinverse-guided diffusion models for inverse problems. In International Conference on Learning Representations, 2022. +Yang Song and Prafulla Dhariwal. Improved techniques for training consistency models. arXiv preprint arXiv:2310.14189, 2023. +Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in neural information processing systems, 32, 2019. +Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456, 2020b. +Yang Song, Liyue Shen, Lei Xing, and Stefano Ermon. Solving inverse problems in medical imaging with score-based generative models. arXiv preprint arXiv:2111.08005, 2021. +Yang Song, Prafulla Dhariwal, Mark Chen, and Ilya Sutskever. Consistency models. arXiv preprint arXiv:2303.01469, 2023b. +Xuan Su, Jiaming Song, Chenlin Meng, and Stefano Ermon. Dual diffusion implicit bridges for image-to-image translation. arXiv preprint arXiv:2203.08382, 2022. +Jiaxiang Tang, Jiawei Ren, Hang Zhou, Ziwei Liu, and Gang Zeng. Dreamgaussian: Generative gaussian splatting for efficient 3d content creation. arXiv preprint arXiv:2309.16653, 2023. +Phong Tran, Anh Tuan Tran, Quynh Phung, and Minh Hoai. Explore image deblurring via encoded blur kernel space. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11956-11965, 2021. +Brian L Trippe, Jason Yim, Doug Tischer, David Baker, Tamara Broderick, Regina Barzilay, and Tommi Jaakkola. Diffusion probabilistic modeling of protein backbones in 3d for the motif-scaffolding problem. arXiv preprint arXiv:2206.04119, 2022. +Yinhuai Wang, Jiwen Yu, and Jian Zhang. Zero-shot image restoration using denoising diffusion null-space model. arXiv preprint arXiv:2212.00490, 2022. +Zhengyi Wang, Cheng Lu, Yikai Wang, Fan Bao, Chongxuan Li, Hang Su, and Jun Zhu. Prolificdreamer: High-fidelity and diverse text-to-3d generation with variational score distillation. Advances in Neural Information Processing Systems, 36, 2024. +Joseph L Watson, David Juergens, Nathaniel R Bennett, Brian L Trippe, Jason Yim, Helen E Eisenach, Woody Ahern, Andrew J Borst, Robert J Ragotte, Lukas F Milles, et al. De novo design of protein structure and function with rfdiffusion. Nature, 620(7976):1089-1100, 2023. +Chen Wei, Wenjing Wang, Wenhan Yang, and Jiaying Liu. Deep retina decomposition for low-light enhancement. arXiv preprint arXiv:1808.04560, 2018. +Kevin E Wu, Kevin K Yang, Rianne van den Berg, Sarah Alamdari, James Y Zou, Alex X Lu, and Ava P Amini. Protein structure generation via folding diffusion. Nature Communications, 15(1): 1059, 2024a. + +Luhuan Wu, Brian Trippe, Christian Naesseth, David Blei, and John P Cunningham. Practical and asymptotically exact conditional sampling in diffusion models. Advances in Neural Information Processing Systems, 36, 2024b. +Minkai Xu, Lantao Yu, Yang Song, Chence Shi, Stefano Ermon, and Jian Tang. Geodiff: A geometric diffusion model for molecular conformation generation. arXiv preprint arXiv:2203.02923, 2022. +Tongda Xu, Ziran Zhu, Dailan He, Yuanyuan Wang, Ming Sun, Ning Li, Hongwei Qin, Yan Wang, Jingjing Liu, and Ya-Qin Zhang. Consistency models improve diffusion inverse solvers. arXiv preprint arXiv:2403.12063, 2024. +Yilun Xu, Mingyang Deng, Xiang Cheng, Yonglong Tian, Ziming Liu, and Tommi Jaakkola. Restart sampling for improving generative processes. Advances in Neural Information Processing Systems, 36:76806-76838, 2023. +Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. +Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 586-595, 2018. +Yuanzhi Zhu, Kai Zhang, Jingyun Liang, Jiezhang Cao, Bihan Wen, Radu Timofte, and Luc Van Gool. Denoising diffusion models for plug-and-play image restoration. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1219-1229, 2023. + +# A DISCUSSION + +# A.1 IMPACT STATEMENT + +Our proposed framework presents a novel approach to addressing inverse problems by applying diffusion models. Given its versatility and computational efficiency, we anticipate that our framework will benefit the relevant research community. However, it is crucial to acknowledge the potential misuse of our approach in generating deceptive or malicious content. Additionally, reliance on generative techniques like diffusion models raises concerns regarding inherent biases present in the vast datasets utilized for training. These biases have the potential to manifest in the generated outputs. It may be necessary to establish ethical guidelines and regulations to ensure responsible development and deployment of relevant technologies. + +# A.2 LIMITATIONS AND FUTURE WORKS. + +While our proposed framework demonstrates efficacy in addressing both linear and nonlinear scenarios, its primary limitation arises from the requirement to ascertain the form of the measurement operator or the computational procedure. Consequently, an enticing avenue for future exploration is the extension of our approach to tackling blind inverse problems (Chung et al., 2023a; Murata et al., 2023), where such prior knowledge is unavailable. We provide a preliminary experiment in Appendix C.7. Furthermore, considering the prevalence of diffusion models operating within latent spaces (Rombach et al., 2022), a promising direction for advancement involves extending our methodology to encompass latent diffusion models. Finally, since HRDIS involves stochastic optimization for non-convex problems, its convergence behavior remains an open theoretical question and warrants further investigation. + +# A.3 RELATED WORKS + +Recent research has delved into the utilization of diffusion generation for solving inverse problems preemptively. Earlier studies (Song & Ermon, 2019; Song et al., 2020b; Lugmayr et al., 2022) focused on substituting observational components within the generation process to facilitate tasks like image inpainting. (Song et al., 2021) applied this technique to medical image reconstruction, while DDRM (Kawar et al., 2022) extended it to address more general degeneracies through singular value decomposition. Meanwhile, ILVR (Choi et al., 2021) achieved reference-based generation using a low-pass filter. DDNM (Wang et al., 2022) tackled inverse problem-solving by refining only the zero space during generation. Despite these advancements, these methods often remain confined to linear degeneracies and struggle with producing highly realistic generation results. + +Subsequent research, such as DPS (Chung et al., 2022) and IIGDM (Song et al., 2022), has aligned the generation process with observations by incorporating a guidance term of likelihood, resulting in clearer predictions. However, a drawback of these approaches is the computational expense and instability associated with backpropagating through the score network. Additionally, Zhu et al. (2023) combined diffusion modeling with Half-Quadratic-Splitting for plug-and-play image restoration. There has also been a series of works (Trippe et al., 2022; Wu et al., 2024b; Dou & Song, 2024; Cardoso et al., 2023) has also linked a posteriori sampling of diffusion models to sequential Monte Carlo. These methods typically maintain multiple particles during the generation process and therefore require more memory. PSLD (Rout et al., 2024) and ReSample Song et al. (2023a) explored the use of latent diffusion to solve the inverse problem. More recently, RED-diff (Mardani et al., 2024) offers a new perspective on diffusion-based inverse problem solving by modeling it as a variational problem. Despite its efficacy, RED-diff suffers from mode-collapse. In response to this limitation, we introduce the HRDIS framework in this paper, building upon RED-diff to significantly enhance the accuracy and efficiency of image inversion. Xu et al. (2024) discusses the use of consistency models to improve DPS, although this approach may be limited by the fact that consistency model checkpoints are not widely available. + +Some text-to-3D techniques (Poole et al., 2022; Shi et al., 2023; Liang et al., 2024; Wang et al., 2024) are also pertinent to our work, as they commonly optimize the score distillation loss to generate 3D assets from a 2D prior. This loss bears resemblance to RED-diff. However, our approach diverges in its objective. While text-to-3D efforts focus on lifting a 2D prior to 3D, our focus lies in leveraging a + +diffusion prior to solving inverse problems. Thus, our methodology differs fundamentally in purpose, despite similarities in the optimization paradigm. + +# B ADDITIONAL METHOD DETAILS + +# B.1 ADDITIONAL JUSTIFICATION FOR CR + +We aim to leverage deterministic probability flow to enhance Eq. 10, where the objective is closely linked to the distillation of diffusion models, as both tasks involve fitting the endpoint of the PF ODE provided by the pre-trained diffusion model. However, a nuanced distinction exists between them: Eq. 10 optimizes the image $\mu$ , whereas the distillation process involves optimizing the parameters $\varphi$ of the distillation network $f_{\varphi}(\cdot, \cdot)$ . Specifically, the typical procedure for distilling a pre-trained diffusion model involves simulating an inverse PF ODE to collect $\mathbf{x}_0 \sim p_{\mathrm{data}}$ , which yields training data for distillation. Subsequently, the following loss function is employed for distillation: + +$$ +\min _ {\varphi} \| f _ {\varphi} \left(\mathbf {x} _ {t}, t\right) - \mathbf {x} _ {0} \| _ {2} ^ {2}. \tag {15} +$$ + +To circumvent the need for extensive simulation, Song et al. (2023b) introduces an innovative alternative approach termed Consistency Distillation (CD). Their study reveals the self-consistency property within the ODE trajectories of the diffusion model, wherein points along the same trajectory correspond to identical initial points at $t = 0$ (Figure 10 (a)). Therefore, they propose an indirect distillation method by minimizing predictions at adjacent times (e.g., $t$ and $t + \varepsilon$ ) for single-step generation, + +$$ +\min _ {\varphi} \| f _ {\varphi} \left(\mathbf {x} _ {t + \varepsilon}, t + \varepsilon\right) - \operatorname {s g} \left(f _ {\varphi} \left(\mathbf {x} _ {t}, t\right)\right) \| _ {2} ^ {2}, \tag {16} +$$ + +where $f_{\varphi}(\mathbf{x}_{t + \varepsilon}, t + \varepsilon)$ and $f_{\varphi}(\mathbf{x}_t, t)$ can be viewed as student and teacher predictions, respectively. Since the boundary condition $f_{\varphi}(\mathbf{x}_0, 0) = \mathbf{x}_0$ is satisfied, the prediction $f_{\varphi}(\mathbf{x}_t, t)$ is closer to the ground truth than that at $t + \varepsilon$ . Through iterative propagation, the model aligns the endpoint of the trajectory such that, for any $t$ , $f_{\varphi}(\mathbf{x}_t, t) \approx \mathbf{x}_0$ . + +In the context of diffusion-based inverse problem solving, we aim to penalize $\| \mu -\mathbf{x}_0\| _2^2$ for regularization (Figure 10 (b)). However, obtaining the ideal $x_0$ is often challenging, as it may require inversion and solving the ODE (Su et al., 2022; Liang et al., 2024). Notably, adjacent points of $\mu_t$ are easier to obtain. Thus, we incorporate insights from CD, which rely on the difference between outputs at two points along the same trajectory to iteratively refine $\mu$ . This process enables us to indirectly align $\mu$ with the endpoint of the ODE. + +![](images/274448723499222076091253c249ab45539216ef5f86654c86c6bca1188378f9.jpg) +(a) Diagram for Self-consistency property in CD + +![](images/fa0afd0fee5889868ec254934b9d3173ab29cb7049be8975edfbf6a316419f95.jpg) +(b) Comparison between CD and CR (Sec. 3.2) +Figure 10: Schematic illustrating the motivation for Consistency Regularization (CR). (a) Consistency Distillation (CD) (Song et al., 2023b) is trained to map points on any ODE trajectory (gray dashed line) of diffusion models to the trajectory's origin in a single step, ensuring the self-consistency property is maintained. (b) CR and CD share the same concept of transforming the original objective into a simulation-free objective based on self-consistency. However, they differ in that the former optimizes $\mu$ while the latter optimizes parameter $\varphi$ . + +Table 5: Hyperparameter choice for the proposed method. + +
ProblemInpaintingSRCSPhase retrievalHDRNonlinear deblurring
N150100300500100100
λ11110.510.02
λ20.250.200.200.250.250.25
learning rate0.10.50.50.70.10.1
+ +# B.2 EXPERIMENTAL SETUP + +All experiments, including time and memory calculations, were conducted on a single NVIDIA RTX 3090 GPU. We employed the Adam optimizer (Kingma & Ba, 2014) with momentum parameters set to (0.9, 0.99). The parameter $\beta$ , utilized in synthesizing the hybrid noise, remained fixed at 0.2 throughout our experiments. We also chose descending timestep from $t = 1$ to $t = 0$ as in (Mardani et al., 2024). The denoiser weight $\omega_{t}$ is determined as the inverse signal-to-noise ratio (SNR), $\sigma_t / \alpha_t$ . + +In practice, we introduce two coefficients to balance the reconstruction and regularization terms, + +$$ +\nabla_ {\mu} \mathcal {L} _ {\mathrm {H R}} = \lambda_ {1} \nabla_ {\mu} \| \mathbf {y} - \mathcal {A} (\mu) \| _ {2} ^ {2} + \lambda_ {2} \mathbb {E} _ {t, \varepsilon , \boldsymbol {\epsilon}} [ \omega_ {t} (\boldsymbol {\epsilon} _ {\theta} (\mu_ {t}, t) - \boldsymbol {\epsilon} _ {\text {h y b r i d}}) ], \tag {17} +$$ + +For most tasks, optimizing the number of steps in the range of $N = 100 \sim 150$ produces satisfactory results. For more challenging degenerations, such as compressed sensing and phase retrieval, we use more steps to improve performance further. In addition, for the phase retrieval task, which is particularly sensitive to initial noise, we found that starting with random noise for the first 250 steps, followed by hybrid noise for the remaining 250 steps, significantly improves performance. Table 5 details the selected hyperparameters of our proposed method. + +Below, we give the Pytorch-style pseudocode for our HRDIS implementation. + +```python +Add noise to perturbation 'mu' +noise xt = torch.random_like(mu) +if step == 0: + hybrid_noise = noise_xt +else: + # Synthesize hybrid noise + hybrid_noise = (1 - beta).sqrt() * deter_noise + beta.sqrt() * noise_xt +xt = alpha_t.sqrt() * mu + (1 - alpha_t).sqrt() * hybrid_noise +# Call the denoising model to get the noise 'et' +with torch.no_grad(): + et = model(xt, t).detach() +# Compute reconstruction and regularization terms +e_obs = y_0 - A(mu) +loss_obs = (e_obs**2).mean() / 2 +loss/noise = torch.mul((et - hybrid/noise).detach(), mu).mean() +#Compute the weights of two items +snr_inv = (1 - alpha_t).sqrt() / alpha_t.sqrt() +v_t = lambda_1 +w_t = lambda_2 * snr_inv +loss = w_t * loss/noise + v_t * loss_obs +#Adam step for 'mu' +optimizer.zero_grad() +loss_backward() +optimizer_STEP() +#Store the noise 'et' for the next iteration +deter_noise = et.clone() +step += 1 +``` + +Listing 1: Pseudocode of HRDIS for performing one optimization step. + +For the implementation of baseline methods, including DDRM (Kawar et al., 2022), DPS (Chung et al., 2022), DDNM (Wang et al., 2022), GDP (Fei et al., 2023), DDS (Chung et al., 2023b), FPS (Dou & Song, 2024), and RED-diff (Mardani et al., 2024), we utilized the official repositories provided by the respective authors. However, since no official implementation of IIGDM (Song et al., 2022) was available, we faithfully reproduced it using the pseudo-code provided by the authors. For the hyperparameters, we primarily adhered to the original configurations, with slight fine-tuning to achieve optimal performance. DDRM and IIGDM were configured with 100 steps, while DPS, FPS, and RED-diff required 1000 steps for effective performance. Additionally, we observed that increasing the number of particles in FPS yielded only marginal improvements, so we set it to 1 for our experiments. + +We use the default code and settings of each competitor from their official homepages as below. + +- DDRM (Kawar et al., 2022): https://github.com/bahjat-kawar/ddrm +- DPS (Chung et al., 2022): https://github.com/DPS2022/diffusion-posterior-sampling +- DDNM (Wang et al., 2022): https://github.com/wyhuai/DDNM +GDP (Fei et al., 2023): https://github.com/Fayuben/GenerativeDiffusionPrior +DDS (Chung et al., 2023b): https://github.com/HJ-harry/DDS +- FPS (Dou & Song, 2024): https://github.com/ZehaoDou-official/FPS-SMC-2023 +- RED-diff (Mardani et al., 2024): https://github.com/NVlabs/RED-diff + +# C ADDITIONAL RESULTS + +# C.1 IMPACT OF $\beta$ FOR HYBRID NOISE + +We present the effect of varying $\beta$ on the outputs of different inverse problems in Figure 11. When $\beta$ is set to 0, corresponding to the CR described in Sec. 3.2, we observe the generation of high-frequency information, albeit accompanied by severe artifacts. When $\beta$ is set to 1, the result aligns with the DR used in RED-diff (Mardani et al., 2024), producing a blurry solution. Notably, when $\beta$ is set to 0.2, we identify a sweet spot that effectively balances the two aforementioned aspects, thus unlocking their potential for synergy. + +![](images/587dedc59e64305cecaffaa6439c477198840db01571ea1d9f786c5fb9eb3be1.jpg) +Figure 11: Restoration results for various inverse problems under different $\beta$ . + +# C.2 NOISY INVERSE PROBLEMS + +In this section, we empirically verify the performance of HRDIS under noisy observation conditions. Specifically, we simulate four types of noise: Gaussian noise with standard deviations of 0.05 and 0.1, Poisson noise with the noise level set to 1.0, and speckle noise with a standard deviation of 0.1. + +As an optimization-based framework, HRDIS accommodates noise without requiring modifications to the algorithm. For Gaussian noise with a standard deviation of 0.05, we set the weight $\lambda_{1}$ of the reconstruction term to 0.1, and for other noise types, we reduce $\lambda_{1}$ to 0.05. The ablation study in RED-diff (Mardani et al., 2024) indicated that the method performs optimally when the time-dependent parameter $\omega_{t}$ is set to $\frac{1}{\mathrm{SNR}_t} \coloneqq \sigma_t / \alpha_t$ . While this configuration is effective for HRDIS under noiseless conditions, it presents challenges in noisy settings, as the decreasing $\omega_{t}$ tends toward 0, leading to insufficient regularization and potential overfitting to noisy data. To address this issue, we implemented a clipping mechanism for $\omega_{t}$ (i.e., torchclip $\left(\frac{1}{\mathrm{SNR}_t}, \min = 2.0\right)$ ), ensuring that the regularization term remains effective throughout the optimization process. + +The quantitative results presented in Tables 6 and 7 demonstrate that HRDIS consistently outperforms other methods across most scenarios. Furthermore, qualitative comparisons in Figures 7 to 15 reveal that IIGDM is particularly susceptible to noise, whereas DDRM, though effective at noise removal, often results in blurred reconstructions. Additionally, DPS exhibits instability and is prone to producing artifacts in the presence of Poisson and speckle noise. Overall, our method exhibits strong robustness to various types of noise, confirming its effectiveness across different measurement statistics. + +Table 6: Quantitative evaluation (FID, LPIPS, CA (unit:%)) of solving inpainting problems under Gaussian noise on ImageNet $256 \times 256$ and FFHQ $256 \times 256$ validation dataset. **Bold:** best, **underline:** second best. + +
MethodImageNet 256×256FFHQ 256×256
LPIPS ↓FID ↓CA ↑LPIPS ↓FID ↓
γ = 0.05DDRM (Kawar et al., 2022)0.10930.170.10.13845.1
IIGDM (Song et al., 2022)0.20335.966.30.23644.7
RED-diff (Mardani et al., 2024)0.14330.866.80.18755.9
HRDIS (Ours)0.12929.470.40.15331.1
γ = 0.1DDRM (Kawar et al., 2022)0.17350.263.40.17959.3
IIGDM (Song et al., 2022)0.41262.852.00.44069.6
RED-diff (Mardani et al., 2024)0.27847.960.30.34091.5
HRDIS (Ours)0.19238.365.40.15931.5
+ +Table 7: Quantitative evaluation under Poisson and speckle noise on FFHQ $256\times 256 - 1\mathrm{k}$ validation dataset. Bold: best,underline: second best. + +
MethodPoissonSpeckle
LPIPS ↓FID ↓LPIPS ↓FID ↓
DPS Chung et al. (2022)0.22673.090.24085.41
RED-diff Mardani et al. (2024)0.19258.960.23278.72
HRDIS (Ours)0.14829.130.15230.75
+ +![](images/9e1ddf15c5b86912d105b7faf7f95eb49e2b08d9e50140e122caecee0e8f97b8.jpg) +Figure 12: Comparison of the proposed HRDIS with alternatives under Poisson noise, including DPS (Chung et al., 2022), RED-diff (Mardani et al., 2024) and HRDIS (Ours). + +![](images/9f7a702e90e756c869176422deadbd60233e519fed1cf16dc9559539dc7382b7.jpg) +Figure 13: Comparison of the proposed HRDIS with alternatives under speckle noise, including DPS (Chung et al., 2022), RED-diff (Mardani et al., 2024) and HRDIS (Ours). + +![](images/b2bebc524b07fbe51c66703f503e99424821842aa0a5e4a84ecb55822bc2b574.jpg) +Figure 14: Comparing methods for inpainting problem with Gaussian noise $(\gamma = 0.05)$ , including DDRM (Kawar et al., 2022), IIGDM (Song et al., 2022) and HRDIS (Ours). + +![](images/f84f99fe4e5775e1f2a01a2cda8fad86ce888c1fe5f1d6f039f4e314c51c2d84.jpg) +Figure 15: Comparing methods for inpainting problem with Gaussian noise $(\gamma = 0.1)$ , including DDRM (Kawar et al., 2022), IIGDM (Song et al., 2022) and HRDIS (Ours). + +# C.3 ABLATION FOR COMBINATION OF DR AND DDIM SOLVER + +A straightforward approach is to incorporate existing DDIM solvers (Song et al., 2020a) using hybrid noise to enhance DR. In this subsection, we evaluate this approach. The quantitative results, presented in Table 8, indicate that incorporating DDIM into DR improves the performance of RED-diff, aligning with the conclusions from Sec. 3.1. While the random perturbations in RED-diff introduce uncertainty, the DDIM solver mitigates this issue to some extent. However, DR+DDIM still falls short compared to HRDIS. By providing a smooth interpolation between DR and CR, HRDIS forms a more flexible and synergistic framework. Figure 16 illustrates qualitative comparisons that further highlight the advantages of HRDIS. + +Table 8: Ablation for the combination of DR and DDIM across these tasks: ImageNet256×256-Inpainting, ImageNet256×256-Super Resolution, and FFHQ256×256-Nonlinear Deblurring. + +
MethodInpaintingSuper ResolutionNonlinear Deblurring
LPIPS ↓FID ↓CA ↑LPIPS ↓FID ↓CA ↑LPIPS ↓FID ↓
DR0.11724.669.50.24944.265.80.32980.1
DR+DDIM0.11323.570.40.14135.665.70.29573.7
HRDIS (Ours)0.09620.171.30.13833.068.80.23652.4
+ +![](images/b50d5ca3a1894a6736e90fc63c0c0062d438dbf6a9a2965c503eb8cc62b4e350.jpg) +Figure 16: Ablation for combination of DR and DDIM solver. + +![](images/373f04dad43af5e59f780bcf8b3f6dbb5ef408a46fcf771bb7523bb158d33074.jpg) + +# C.4 COMPARISON WITH DDS + +Here, we show some qualitative comparisons with DDS to demonstrate the advantages of the proposed HRDIS. Among them, Figure 17 shows the evolution of the two methods during the inversion process. Figure 18 shows the results of three linear tasks. + +# C.5 ABLATION FOR REGULARIZATION WITH CONSISTENCY MODELS + +In this subsection, we present an ablation study, exploring the use of the output from the Consistency Model (CM) (Song et al., 2023b) as a regular bootstrap target for regularization. Due to the lack of available checkpoints for benchmark datasets such as ImageNet or FFHQ at a resolution of 256, we conducted experiments using a checkpoint trained on the LSUN bedroom dataset (Yu et al., 2015). Figure 19 provides qualitative results from these experiments. Our findings indicate that incorporating the CM output as a bootstrap target slightly enhances the restoration of high-frequency details, as it offers a more reliable target for regularization. + +![](images/7783f578199056fd381501334fcf2161ac875decbd5da579ea897b6c75541581.jpg) +Figure 17: Visualization of evolution in DDS (Chung et al., 2023b) and HRDIS (Ours) for image inversion. + +![](images/91a93aa518359eda87e3bd9236d55abaee59381d7eac983d0fd5054f8afd8294.jpg) +Figure 18: Qualitative comparison with DDS (Chung et al., 2023b). + +![](images/34a6217238b6c4c67baf26a823dd005c32727b8cc622f7203f2b36488a31a069.jpg) +Figure 19: Qualitative results on inpainting using the output of the CM (Song et al., 2023b) as a regularization term. + +# C.6 FURTHER EXPERIMENTAL RESULTS + +We provide quantitative evaluations based on the standard PSNR and SSIM metrics in Table 9, Table 10 and Table 11. + +Table 9: Quantitative evaluation (PSNR, SSIM) of solving linear inverse problems on ImageNet ${256} \times {256} - 1\mathrm{k}$ validation dataset. Bold: best,underline: second best. + +
MethodInpaint (10-20%)Inpaint (20-30%)SR (×4)CS (25%)
PSNR ↑SSIM ↑PSNR ↑SSIM ↑PSNR ↑SSIM ↑PSNR ↑SSIM ↑
DDRM (Kawar et al., 2022)26.790.91923.740.86026.000.74324.340.656
DPS (Chung et al., 2022)24.350.81221.860.76524.810.71024.530.673
IIGDM (Song et al., 2022)22.980.89620.180.82525.230.73128.580.740
DDNM (Dou & Song, 2024)22.580.89422.540.86521.390.52923.390.588
DDS (Dou & Song, 2024)22.020.80719.260.81522.250.58023.020.569
FPS (Dou & Song, 2024)24.810.84520.760.79324.900.70325.770.690
RED-diff (Mardani et al., 2024)26.600.92123.450.86925.890.74626.010.669
HRDIS (Ours)25.650.91322.120.83525.540.70828.790.807
+ +Table 10: Quantitative evaluation (PSNR, SSIM) of solving linear inverse problems on FFHQ $256 \times 256 - 1k$ validation dataset. + +
MethodInpaint (30-40%)SR (×16)CS (10%)
PSNR ↑SSIM↑PSNR ↑SSIM ↑PSNR ↑SSIM ↑
DDRM23.580.86222.940.67624.340.656
DPS22.970.80420.760.52925.600.707
IIGDM21.850.83321.630.61427.490.779
DDNM20.430.81620.830.57425.130.708
DDS20.070.81020.770.57022.390.609
FPS22.170.82820.950.55325.860.715
RED-diff23.780.86722.640.65426.580.761
HRDIS (Ours)23.060.83721.750.62227.850.802
+ +Table 11: Quantitative evaluation (PSNR, SSIM) of solving nonlinear inverse problems on FFHQ $256\times 256 - 1\mathrm{k}$ validation dataset. + +
MethodPhase retrievalHDRNonlinear deblurring
PSNR ↑SSIM↑PSNR ↑SSIM ↑PSNR ↑SSIM ↑
DPS19.640.50721.190.78021.650.563
RED-diff17.970.48825.970.86919.590.484
HRDIS (Ours)30.080.81427.510.89123.060.597
+ +# C.7 BLIND INVERSE PROBLEM ON REAL-WORLD SAMPLES + +In this subsection, we initially explore the utilization of the proposed HRDIS for blind inverse problem-solving on real-world images. To address the challenge of degradation, we conducted + +additional experiments by incorporating a learnable degradation model. Inspired by the approach presented in GDP (Fei et al., 2023), we assume a simple degradation model defined as: + +$$ +\mathbf {y} = f \mathbf {x} + \mathcal {M} =: \mathcal {A} _ {f, \mathcal {M}} (\mathbf {x}), +$$ + +where $f$ is a scalar and $\mathcal{M}$ is a mask, both of which are initially unknown. These parameters, along with the image $x$ , are optimized alternately using HRDIS. The optimization is performed as follows: 1. Update $f$ and $\mathcal{M}$ : These parameters are updated using the gradient: + +$$ +\nabla_ {f, \mathcal {M}} \| \mathbf {y} - \mathcal {A} _ {f, \mathcal {M}} (\mu) \| ^ {2}. +$$ + +2. Update $\mu$ : The image is updated using the gradient: + +$$ +\nabla_ {\mu} \| \mathbf {y} - \mathcal {A} _ {f, \mathcal {M}} (\mu) \| ^ {2} + \mathbb {E} \left[ \omega_ {t} \left(\boldsymbol {\epsilon} _ {\theta} \left(\mu_ {t}, t\right) - \boldsymbol {\epsilon} _ {\text {h y b r i d}}\right) \right]. +$$ + +We performed preliminary experiments on real-world low-light images from the LOL dataset (Wei et al., 2018). The results in Table 12 demonstrate that HRDIS achieves superior performance compared to $\mathrm{GDP - x_t / x_0}$ (Fei et al., 2023), with the added advantage of reduced computational cost. Specifically, HRDIS requires only about 300 NFE, compared to 1000 NFE for GDP. Figure 20 provides qualitative results that illustrate the effectiveness of HRDIS in reconstructing high-quality images from degraded inputs. These findings highlight HRDIS's potential in addressing blind inverse problems effectively and efficiently. + +![](images/908b7d2813817bc091a22a61bad98832e920c0909b2e62dcdf44e504c06fdf46.jpg) +Figure 20: Qualitative comparison of blind reversal problems. + +Table 12: Quantitative evaluation of blind inverse problem on the LOL dataset. + +
MethodPSNR ↑SSIM↑FID ↓
GDP-x_t7.320.57238.92
GDP-x_013.930.6375.16
HRDIS (Ours)14.250.6574.89
+ +# C.8 ABLATION OF $\varepsilon$ + +To investigate the influence of $\varepsilon$ in the CR term, we conducted an ablation study focusing on inpainting and super-resolution tasks using the FFHQ dataset. The diffusion model operates over a normalized time interval [0, 1], and we evaluated the performance of $\varepsilon$ across several magnitudes. + +The quantitative results of the ablation study are presented in Figure 21. We observed that $\varepsilon$ performs optimally when it is around the order of $10^{-2}$ . Key observations include: + +- When $\varepsilon$ is too small ( $10^{-3}$ ), the CR effect diminishes, resulting in blurred outputs. +- When $\varepsilon$ is too large ( $10^{-1}$ ), the resulting image quality degrades due to the discretization error. + +These findings highlight the importance of carefully selecting $\varepsilon$ to achieve optimal performance. Figure 22 provides qualitative visualizations of the ablation study. These examples clearly demonstrate the impact of different $\varepsilon$ values on the final output. + +![](images/3433dd68aa7b336d6654cf10d84f974bce5ab3090436aadabb6af40122546313.jpg) + +![](images/cd87aee1c119b5d57554235cb753b87d32608198620b76953e18d8078007daf7.jpg) + +![](images/522f2ec77ad1fd6c67b39bc25cc58bdaf8df2af245d8471e2bdf5cd75d735519.jpg) +Figure 21: Quantitative results for varying values of $\varepsilon \in \{0.001, 0.005, 0.007, 0.01, 0.02, 0.05, 0.1\}$ . + +![](images/2915453aa963c2e50ed0170f864e5a1750d1d996eeda0c3b78a0699a4d3eb111.jpg) + +![](images/aff4401fc6f99e464f53a022253092e36bcc9d740c2c2c935c3d1fb10488073d.jpg) +Figure 22: Visualization of the output of different $\varepsilon$ . + +# C.9 ADDITIONAL FIGURES + +In this subsection, we show additional qualitative results for HRDIS. + +![](images/a1b9cfccdc6b74334417f019863c589d8eacecc4eea8a728438b496b13770b53.jpg) +Figure 23: Comparing methods for the image inpainting problem on ImageNet $256 \times 256$ , including DDRM (Kawar et al., 2022), IIGDM (Song et al., 2022) and HRDIS (Ours). + +![](images/5ea7ffb983eb54b0a4fc6e9fd95aa2eb0f002145f882cb139eb0d948353a0de2.jpg) +Figure 24: Comparing methods for the image inpainting problem on FFHQ $256 \times 256$ , including DDRM (Kawar et al., 2022), IIGDM (Song et al., 2022) and HRDIS (Ours). + +![](images/5cb772361ed30e9751ce7157f9c5095924c95df628e073a9d4a23990c0ddc929.jpg) +Figure 25: Comparing methods for the image super-resolution problem on ImageNet $256 \times 256$ , including DDRM (Kawar et al., 2022), IIGDM (Song et al., 2022) and HRDIS (Ours). + +![](images/75edaf295b35f69d475a1fe18419cf1b4442776d51bc76ddd8b3162c00bf6091.jpg) +Figure 26: Comparing methods for the image super-resolution problem on FFHQ $256 \times 256$ , including DDRM (Kawar et al., 2022), IIGDM (Song et al., 2022) and HRDIS (Ours). + +![](images/c81b4dd4286d29b138cbfa3635092b97706f94e611f2bb09b7544c96403bdd9c.jpg) +Distorted + +![](images/6954c8ebaaae9da9cd0e7cc029647727d440fb926e718272f94f4b9fc2cb7109.jpg) +DDRM + +![](images/e58124ab0fecc00cd4d5d62fe3eea6b2cd7b72528f0b1b6d16f72633ce1dc175.jpg) +# + +![](images/93ef4f61292e8f3c0fe812a18b5640c0e4accf0c47067e3fe73ac8ff792fa832.jpg) +HRDIS (Ours) + +![](images/24eb58c1a5930ad9d563a39d4d2ddd84edba4fe577b2d04188d994ed8678ed68.jpg) +Reference + +![](images/c1738e04146bcaf69d67150ff68206ad521915586438e215334761d2267a9370.jpg) + +![](images/2c15f2ea8e17765761c8a3692b268f6951b2a847682eadd64b6c59b34d2d3ae7.jpg) + +![](images/e8f89b59932578b706dfe582d2e7a254ce5676c53578208b0d29f088ddbc88eb.jpg) + +![](images/f5f0719adab9a54e7bc15c7516e902caff1a6132cd9765a3b32d599b694b1c68.jpg) + +![](images/42fa3d4dd6add5eb011810e8bff155dbe590979b96307932db178b4bf98f1720.jpg) + +![](images/512485d9e5e2a482f3b4f731635f15c5eb67a0bfb307657e12d4acd9131683e5.jpg) + +![](images/9ca4424cf042005765b9c293ae028160b872825387a06e3d36e016133f2987b1.jpg) + +![](images/a2874f04caf73ec30283645b12c023fd8ffa2db5b211fcb045e414d1f882bb07.jpg) + +![](images/6fae50bf4b5c106fda22f67485198eebbdb1916069fc069c12185922fa3ca395.jpg) + +![](images/dbce28b75b5748bcf3fef270c2e1110996095d6a2600fc35b2a180256f04b4e4.jpg) + +![](images/62b61a2cc44d5beb5b760eb1c091e1da18746f6157d00f772ed0919d239c8c1d.jpg) + +![](images/4475fd2428b95b6e617626ebff06c79cd384079cdc09b2a165e30ffcda3d1556.jpg) + +![](images/c6a2c404875965a93d0f20d9448ee81b6f07046d85f20b3f4c6ddfaa82d0a467.jpg) + +![](images/c7f50c2a4542958b7194f193f721be3bc2cf08c64e1a6d8e0a046b807b86c41c.jpg) + +![](images/bac377e2867694371c5afcc3dba77305f8a5517cda57b6b85d42899d118c22b1.jpg) + +![](images/4c5361f0b40ec21cf2ad91d9c417839da40ced7ac95ccbbed396f860f5ae8688.jpg) + +![](images/b22ab0ea16e0dffe3b323ce04651f55d3569996ac9157327c36cb21928c8fbd7.jpg) + +![](images/594f8080361c1a7b05394ee222a8497cde83f34542d50f08fb4bd5bad3f66324.jpg) + +![](images/049907f15556274a7d841495ea03a84eaf9b94e6345b2153545d8c79d55044ae.jpg) + +![](images/9cc7bd6db995e50b3f6171c5e1917e9eb845d5c10813442cfbe06eb31df6799e.jpg) + +![](images/1acaf33fa7cbe85ca43f80ffadd303972559a767c8e96748da84a019fb35491b.jpg) + +![](images/f1c6b783c57471175d96e6dfb620dd3593cc344a856762546458286ab22fee5a.jpg) + +![](images/51ad773fca8a98097ae76e6d89dd624c9ece41bfb9f9859e69357c0ca5d8e63d.jpg) + +![](images/0065c0c83f5091152099eea8e1c8693e96c1b7438b6c1b0ece3b66d88b9267b2.jpg) + +![](images/bc652dfaede4ef001be681a515482c111443f582b4f894a015b25efb395e9354.jpg) + +![](images/e00f8b6447d0dc88fbf086ae2af7b22566f65e253a98498e8c63dc60a387b600.jpg) +Figure 27: Comparing methods for the compressed sensing problem on ImageNet $256 \times 256$ , including DDRM (Kawar et al., 2022), IIGDM (Song et al., 2022) and HRDIS (Ours). + +![](images/eab841daa465214f39ee45a373f3b739db5cfc7b0350602f6a47b7319e64e4b5.jpg) + +![](images/5bc7045c30004af617f30b9ea0b0187671f5fa407c585f16b8359e1de77ccddf.jpg) + +![](images/9d6bba5092b668ad099639f2158ac55df03c180b31e0199bfa154acaea04d6bf.jpg) + +![](images/a6b2bec138d0ef8825e620a945cada2c32438942d46e24f66c83fc8abd8420d2.jpg) + +![](images/e21cbf979b1f02893a8829c0c79d4f1414aaf6f6cc3573c6c98905cd53a65ba2.jpg) +Distorted + +![](images/6ebaa4dcc4590985649b5b15dec20f89aea839489257689d47c213e970daed68.jpg) +DDRM + +![](images/a59b4620b22f5401fd7f610e36ddf125b0689b6cfc812e2be8c90b50d17641af.jpg) +# + +![](images/6eb58e1e40ee1a0a39278611b32be8dab953960b85cac5cff4c75aa977aae020.jpg) +Reference + +![](images/04ab82a2a8f94cffe162f9aee1c5f456ab8f95082d737828599f67aa54a6cbba.jpg) + +![](images/c6ca07c4da8c571a51e425bfaea8a16a3876e5688808d72eb667d18091c9643c.jpg) + +![](images/e31e10ad2433f0d55f11f4834662196229b1ac5016788a7db1b094a4e0c07fff.jpg) + +![](images/d5478fe773c8867c144f3c0fb3f8ac122a0eef23b3659a25833a4c190047f83e.jpg) + +![](images/2041d7e51d214ce9dcc48f219158cca942f299ae81dc5e6aecdce327f400894b.jpg) + +![](images/62a8adc48c7d1597bcb0c6dec6f3ed0f5be3b49688a357bdbdc78d45f317c3c3.jpg) + +![](images/c745318df0d7bd6590e76e14d81650767fe926cec1c8ea7b074a5aa4e8d5e738.jpg) + +![](images/329926c1bfa491d2bde209db6ddf1572c7f07898bc7c1f98e842e6c6d79c5439.jpg) + +![](images/d2506045709ab3a2afd6d79cbe980a586875a008a329dc09e6b65f6229510d0e.jpg) + +![](images/6bc2b4885b4a001fb02b4c6ec8f8ac9d98612042651ca23a1e587649c8974251.jpg) + +![](images/488e96e91fd93a6d1fd668b0754c2835fef71ff5c233c851fa5e4e5c0cf5db3c.jpg) + +![](images/08f5725a1650c7e766da44a799d7caaeeb1417613b1441851f28a9136b42421c.jpg) + +![](images/9ae5165c7ab538446de02f8c9166bde1c893a79e9e053c00e8f3eae7a3be317b.jpg) + +![](images/e8f24f2829586a12013747295f7f5499f56eca2680d08bfe8dcdd229f1ce368c.jpg) + +![](images/db777627a1194b236af2f1ce17d566934d0294a226d543ad2d457b0348763bcc.jpg) + +![](images/f9ce609cffc24e9973cdfb2796f6a7e300000ce6ddc954f51ed1c07c8b70343a.jpg) + +![](images/bff4099271c581b75d2e080158b8de2e844ef92d468c2e2cf8c28ddad72a15df.jpg) + +![](images/6626747ad8173b8e95589c057b4275afb7212fdb1eec0f2662222c46e401608d.jpg) + +![](images/99b4be1ee4bbe6983f5ba5b657349495bc8c35bffd850df5f1aac5cda66cb19d.jpg) + +![](images/51692c0e18ccbfc095f409745fb90ebc8c8a7eb7612accd3b79700035f883dfd.jpg) + +![](images/d0984257305532583221e67cce55eef645c3a6ab3def4a8ecfac7172aadcc74a.jpg) + +![](images/9c9d8b89d6c6e16d9f94d43941d83fe87c354a5dfef3e66dfc12003dde8cc997.jpg) + +![](images/63a677f2b1aabf7a2ee2f991c57a6f4fcc2959f7bf240aea591ec299e0186c63.jpg) + +![](images/4ff397ebd556bc3510baf530e15eade294f1ba700113b2c12ebd2f1e9ab7691f.jpg) + +![](images/afb800aefd0d9bd644fa2589da491109f772b3bc7482e3ef2247fefacb703c8b.jpg) + +![](images/ac20e8997c25b8c701f8762803e52d8f2d1d2040ffdbaada4a3f3830d1388102.jpg) +Figure 28: Comparing methods for the compressed sensing problem on FFHQ $256 \times 256$ , including DDRM (Kawar et al., 2022), IIGDM (Song et al., 2022) and HRDIS (Ours). + +![](images/13593903ba33ad6d6773bcbb7361660e8ef3f5bd96ca37f6a31c8e262b548a4d.jpg) + +![](images/a158c2e4530f4b8647556dd02a9643055f4d677c973f7f3f753c83fdf104ace0.jpg) + +![](images/0dde323a0bf56860a564ab10f779ed5ce34995d3dcf0cdea6dee9067119df169.jpg) + +![](images/c97652cecc877a96b85b4160a54dfaf5afdfe1de3ceb0624b97f7a1c2aa7d31b.jpg) + +![](images/b7aa94a0853e03c2b8b11eb50adc0d8190b1d5b966664a7008d374aa82a49c22.jpg) +Distorted + +![](images/83dd51b21c7ba64506e0ec87b9ae082311ddc073e84597e5d1533dd6198a4436.jpg) +DPS + +![](images/5f30a67d497f5e0499c242f26f4ccfab5eaf65be6adbc9acb29d05114022ab3b.jpg) +RED-diff + +![](images/e702246de1de1597cfd3186dcb47fea1095ac881fd54934911b28ca4df452e2a.jpg) +HRDIS (Ours) + +![](images/5700263df93f71ad9f7d677616f0664fe60000ec35b97070092627f22a9441be.jpg) +Reference + +![](images/92f02d8532ac0b8d1c48e7e96b9f908bba47cb3214582b5d421bfc933abc5340.jpg) + +![](images/13f3dd35da7712cd34030a08486470a6510b5ddb8b517fda86cd8d5983312337.jpg) + +![](images/664f230528143fae62e7a3a4432898b26c1b893d80b62aff60a17521e401fa4e.jpg) + +![](images/b5786b06ec31362e55090691eb0c78a03cd42eac27244039cc92ef1c065856f6.jpg) + +![](images/65271a5e0c8054d711660365c09608c7057c2bc6d89eface202a6421d1b2ad60.jpg) + +![](images/8a5a38cea4f8b3127b0be9891512c9dfc49ee6e3f879df12b7fab955222bba55.jpg) + +![](images/37d34b3686ebc714f4f27de940c73db408d18d29b2093479f5c9a09314401344.jpg) + +![](images/bd77f9dfef951e52835ff76e8c99489be4677c94d40bcfc391d045851a5b8c65.jpg) + +![](images/8a16cf807660a5c8b5e98fd66d45b4558491b555fbfd57023131548f5aff75b0.jpg) + +![](images/e2e7bfde1fe4e1d52bc032acdff6dfcb7ff02e4ad86c7ef936b1d16cf74eb2ac.jpg) + +![](images/ca751ef3611cdf2f267b0a93fffe32711a029352fa25bdb0b9c2fbf2e0d08049.jpg) + +![](images/7c6b1386d802ae016a7e5ede492d2e15316ef97ad132f2c15e30053ced256778.jpg) + +![](images/b9b0364e4575dd9a2365d76ad0b91f759bb926f33314eb038def6850cb90bc11.jpg) + +![](images/5495a876502c2cc835edec65ed5d93a3924df435175620772a217af60a806796.jpg) + +![](images/68fc2903bc8a0eb3605f438d30d77dd5d0782cd615819049faa8a9ad44bea5df.jpg) + +![](images/5f348487a219fd0535fe9d7773859a9c46455c7c10a9fc28ef8debe951b72358.jpg) + +![](images/f7f5d08697f827016e34507ca785c57c799b96de1f320bb8ac4bbcb3bac0d540.jpg) + +![](images/d6bb58def3fa0d929ddf508708cb84286527f6985d33893bb31fec8ef66225ef.jpg) + +![](images/a687363c2b18e0b0a691b3e10546944cf7f9a68e7a2ffb4bb7116385bf39d573.jpg) + +![](images/2671c6288d4d34d2ae32901f93dc0e64635f2580beb12b059165227ddfdde3d2.jpg) + +![](images/c8b550b0b2c2ef38b272d94a61ef8cc35c271f843eb8516591aba4c81889aad6.jpg) + +![](images/9a8f4fc4aa26017e00aefc984feeee0fa2903f6cf582ebdb8016863159fad4fb.jpg) + +![](images/6604a6dc76eb2d4a1a9e6c2e040fbd5fad2ccb44f9c3799f3939651e77de74a5.jpg) + +![](images/4b89bc2279259c66c7687ee66b08220bfce244f6b172386b9b0ece5e5b9bb52f.jpg) + +![](images/d7189be1645ede58f95d38a96295bf50b7987512d4e01db4004236e0583de900.jpg) + +![](images/b1319b4961c2764d9faecd0af94b7bd7b1b83a3869b89831eed3f67d082816d9.jpg) +Figure 29: Comparing methods for the phase retrieval problem on FFHQ $256 \times 256$ , including DPS (Chung et al., 2022), RED-diff (Mardani et al., 2024) and HRDIS (Ours). + +![](images/62bfb7f8e14ddad4f22a0224081b89e9ee4eb488aa8e9aca66e3d34c3da39ed6.jpg) + +![](images/b0dc0dec7ec695078273e380171e1152461875880b6dcfb793328591d71987e8.jpg) + +![](images/7f2387ef4aa9aee6fd30393640711201833035edc7f36840babefa485b6947b2.jpg) + +![](images/65f842c4ce84b0da7f52ccf57034c64ee361788c054a61dde6545668823167ef.jpg) + +![](images/8cca5cc8e08470a4726b580e4a35f48ca262044adec5fadce4f6cbef0bf735a8.jpg) +Distorted + +![](images/7afe7ae3c8ec040c50059c013c20509ea8af593c755c60ba12a96be539c5422d.jpg) +DPS + +![](images/9d674a269f8b026e37a543a5a95204e032ecb7703a65df0c21a024e7f947e651.jpg) +RED-diff + +![](images/aa6ff0fc18dfe53f97ac5e4cd81911a29cfe05d931e892ae9a6e93ffef9ecae5.jpg) +HRDIS (Ours) + +![](images/e59b6661e11cf5021f4f2e9e559413c6ea739b7c52af77140acd6108b2f342a4.jpg) +Reference + +![](images/ce1aa078988bd28accc3d6957987b837d6db368c1778ccbe27cae6efa5cb61cb.jpg) + +![](images/726756652887a903f94b6b28833a046a32076dd99d8a7efa9b84c8cd9598c9f5.jpg) + +![](images/36b5ec70448fd4e4f3911cb770477d7ed4c2603402346a10f791a3e92dbfc7ca.jpg) + +![](images/d5fcc4d6df469267155e09bd3b058cb2eb12a340ed852b7f50bf21c894bb2582.jpg) + +![](images/898c9f40e4906a1b0f84a0e6f1b795aebb82377916add21062b4ef31a4890200.jpg) + +![](images/268fcc3c1cb0c788506845aa83e70dde48e390f9d099e5ce1e5e981d227ec2b7.jpg) + +![](images/a5502381a0ecc9cee49b710a9b9a9af31e5df92523bfeed955de2e67f67ed1c2.jpg) + +![](images/3bfb2c241e42287ba85e09e52aa429a1481847081371842e12c23b6de0c53e45.jpg) + +![](images/ecdd99dcb01dd713373821c0ae4933322112503a3e6816e3a96ccc560cc016b6.jpg) + +![](images/dd9f2dc805e442728dcfb321bd6929e0ef8a00f1416bf64db596927d7eba869f.jpg) + +![](images/7f7f3209b615a49718d41a6aba66052218610d8b83dd489c72c328fff00038b3.jpg) + +![](images/f2d4b5ada466cd4755a5d950e4e29cb6abe1220aabd6f3349a0360473d90c510.jpg) + +![](images/95ca5841b10071a3545680167d4667e518a9c0528bd8b7dda02818daacb46cd4.jpg) + +![](images/274b4847186b652cd36a6d1df8fcaca8084c0bc5fadb67cd0ee8092671864ada.jpg) + +![](images/a087f2073bc6695eea72d466d50fc015f90aa682ec6a0c8f2afa295ed08d184a.jpg) + +![](images/5af7a23f6fbbf655cd4eb9807ab31d2f84baa414cc2fd17b265ec0cd2d1ce24c.jpg) + +![](images/95ae43b764354e96ae25f203ee3bb3202c40478f0b3d48d46ce1e7cb2d41147b.jpg) + +![](images/a0a883b8ec6f9e5b64919605beeba3469bde6ee77e1d7fa4b714bba337d3e518.jpg) + +![](images/bf09528f07d9f758880662bb4fd40418450150a643c1acdb13a883d5a7168782.jpg) + +![](images/3887eb99438b179b2ae5539b5bc63cf2a1cf0cc3c68df50d48c8e50d24ad12e8.jpg) + +![](images/fb3880b4365d7d771997cc4950f7e5826ada2012eee7b7e4ed5e9bc5409e4079.jpg) + +![](images/b9b0f92d77c9089b13258be6e3c85e3182acccbfc603872a9848f77111dfa2f6.jpg) + +![](images/e353db6324ef4003d0d2bcbd8cea30fbfbd80b3ac9d8c18a6259206312a358cb.jpg) + +![](images/6f01590b115f521a5ce28a165517b8376c8bbb67d98b4c2dbe558954f0f9e6cb.jpg) + +![](images/a14503c050b8a111c7b2289ef38121eb920de5ac22fcb046c453f604317389f8.jpg) + +![](images/aa51fbb1cd14eb3789f49d94fa2981b0623349dd90741dd179be2fce9af09760.jpg) +Figure 30: Comparing methods for the nonlinear HDR problem on FFHQ $256 \times 256$ , including DPS (Chung et al., 2022), RED-diff (Mardani et al., 2024) and HRDIS (Ours). + +![](images/7e32e206e6da9785cb52940f2a317b5cef3072c8a8edc1ace9951737860da1e4.jpg) + +![](images/9a43b7c1d495cb6ada11e776e4294672b7c154b2665edab0e10ddb9bbad909b9.jpg) + +![](images/8d0237ec0eccee02857f4641bfd4ce41f9dc25bcfd44f1fd1ebb4a8d799bc5bb.jpg) + +![](images/2a932467163427e113c11c265b932e727835ccf3bfc5dcf184408d16971f1743.jpg) + +![](images/60aa91b9fdbc1f31d2fdfa15198222eb76921eada8c46660fcd5b6fc867d31cb.jpg) +Distorted + +![](images/9116a01a3d2d64199a652c61a9d5cb8bc13083b970fe46111cc45e6de5a6a5eb.jpg) +DPS + +![](images/868f47f782f4e93a204f1d7cfc9e3f49076400289b3b0172d7d83adaecb3cde0.jpg) +RED-diff + +![](images/fe9b237c823d2c289a9169e34ae29bbed6162a21ae50d697f58695b6f11c2090.jpg) +HRDIS (Ours) + +![](images/2702667d69af46efd4c961feb753bfe6a9130eb56c62ed5585121475403f37a8.jpg) +Reference + +![](images/c432373d3faf8cefbdde79dc1ebe00fa3a1dc09e9364100ae6864fb13a49f354.jpg) + +![](images/920b4eb037442bf3cdd2d5c8dcf60e667a346325c7a1078aadee9833f20d4b13.jpg) + +![](images/f1825eb8b433e7a74e1e253b337646760c98abd804cb2cc80ace6df8f1263fb9.jpg) + +![](images/e9c09f87e3054f4d91b91e3c60ea1dd131d30c6131df2c0169b17bc169634809.jpg) + +![](images/b5dbac56ddf72ce5658d773b03800874a18894d351fa30117e334e6021225e00.jpg) + +![](images/f7de7d2681793a0c1121ecd8c78e905228886d71a6174529593c1de311ee4255.jpg) + +![](images/83b18a96b9e522399ff251452cf0395c35911d310febd1f849038e71a34588d1.jpg) + +![](images/4afd1e805f54c100f24289c1f8e3b357dbc1a06e12524c64d1accd3988aa5f4a.jpg) + +![](images/e776414f46c6795f09185c365f540054b73184c45706a55a43da213686beca75.jpg) + +![](images/82bb64aafd3bcc0c1e5650304e1a7a01895507e28a8a30a8b8e4bedba2eb406a.jpg) + +![](images/144eb35692186eaaa5a4e9cbe888283664b8a8c4c23888a2128a8afd4f7e3508.jpg) + +![](images/f5535e56437b2a0dbecaa61497acf535779163946ada4abf34bc03e857898347.jpg) + +![](images/7485d91584c44c4eb80fa3c0fab9885ffbb043a74205db80ecbcedc5c14d21e8.jpg) + +![](images/1c6b0bb1f86be515eea65e2613ebd35d69fd252fb164f33b9540f40087703694.jpg) + +![](images/48f26083c413a6eb47747bff0e93d4836300715ac429dc23e71b7e1b9c5cdbe8.jpg) + +![](images/d3fbc42636a64f36b4528dd957e8084b2c56232cdf6ca183db9ad4e6968da9d8.jpg) + +![](images/fcb1570b371056a8e869c595e911fe5e77846ccfa13d9e0cb95c1d2e7ee4dcfe.jpg) + +![](images/e4e853f9a744649ed102ac61ed18116ef112a9f434ada4c362e9a772642c0190.jpg) + +![](images/39a1fdfdbc92f6ad451dea35092eeed26fdc30541117800cda0e9d6d9314ecac.jpg) + +![](images/06011511f8f46827871975e353dff73040f275712e8d6a6fa56f56838afd8821.jpg) + +![](images/81dab87cb695349b9d9ec78d5b5cd473fdf2eb3e2d6571f23721d2fee3077b23.jpg) + +![](images/c51c48a368154626f523edbdef87672e941a462fe3ed3d5c5d2bd4efe14b3f68.jpg) + +![](images/94717196c403593d560fb300a59ec9e69b37f4386db85de67f618c1b89a4d2cc.jpg) + +![](images/0572484169e86126cb3dc53124909615636bb3cec3ba8000accc2ebc3776d902.jpg) + +![](images/508da7d05d5abaa374a98788a8964ce65db16286a26084fa111e53cd1b42a8d3.jpg) + +![](images/78e819e1f6f9ac2ad7a22d8e5a57d1a2d4d62fdd85c2eb7f24930b10e287b299.jpg) +Figure 31: Comparing methods for the nonlinear deblurring problem on FFHQ $256 \times 256$ , including DPS (Chung et al., 2022), RED-diff (Mardani et al., 2024) and HRDIS (Ours). + +![](images/f90983b6386331aa0f3d241a7786fa2e4699a779d1e520bc117cb4e4391bd0fe.jpg) + +![](images/844c707627fe4e8b66cc28cde37f50a23a0800382f9596809785945ba8eedba8.jpg) + +![](images/a29410311fbd10d18bd9efbab565e7c26cafd667eafc13081b8357c6eaa3825e.jpg) + +![](images/0ba85bbfd302ffcb39b641ed963557ffee6791398f3a9d085d77cb7e41a28032.jpg) \ No newline at end of file diff --git a/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/images.zip b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..efabbc0df94db591dc053559cbb5365134b482a3 --- /dev/null +++ b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e289e410b228c4a1e8a6c20f4dfce77a255fff43f0c2d238ac1dcbf9a74ae4d9 +size 4621361 diff --git a/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/layout.json b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b2decee8cbf58e11145b4dc24997968c01fa71a1 --- /dev/null +++ b/ICLR/2025/Hybrid Regularization Improves Diffusion-based Inverse Problem Solving/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47d36bbe8bcd045ab2ba5b7a99f83d980fcf80c4493a1888559fb2d9542e8e0e +size 1147127 diff --git a/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_content_list.json b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..be3af0f447e4b8341e7e8f702d2ece8783f46ff7 --- /dev/null +++ b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9af3c3146e3116ac23ad25dc8519fbe65c937b2046207ec6e9b8d3b5d046747d +size 113958 diff --git a/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_model.json b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ab66a7e2591351c2af7aedcb2e36054962294dbf --- /dev/null +++ b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4de1b8bfabd5c79f14e779682f33b6c3f3e6e997651240fb8f253cfe98699242 +size 145951 diff --git a/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_origin.pdf b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8b20796c3f88341c318a22332da541ef3bd2ad48 --- /dev/null +++ b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/39dd6977-c9f2-4558-9ea1-2e19150ff702_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa106a4cc5cd5deff4d604601f8f08fa0a4a3b7fd6684ca7e5ddbe83b1f50e31 +size 7727046 diff --git a/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/full.md b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c5955e548b6bbb063d5b4537a709c87857dabbc0 --- /dev/null +++ b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/full.md @@ -0,0 +1,460 @@ +![](images/7b2b54023912115b2a86baf085ae2bcd794dd130e66e99f483479bc915491f1b.jpg) + +# HYDRA-SGG: HYBRID RELATION ASSIGNMENT FOR ONE-STAGE SCENE GRAPH GENERATION + +Minghan Chen† Guikun Chen‡ Wenguan Wang‡ Yi Yang‡* + +†ReLER Lab, AAll, University of Technology Sydney + +$\ddagger$ ReLER Lab, CCAI, Zhejiang University + +# ABSTRACT + +DETR introduces a simplified one-stage framework for scene graph generation (SGG) but faces challenges of sparse supervision and false negative samples. The former occurs because each image typically contains fewer than 10 relation annotations, while DETR-based SGG models employ over 100 relation queries. Each ground truth relation is assigned to only one query during training. The latter arises when one ground truth relation may have multiple queries with similar matching scores, leading to suboptimally matched queries being treated as negative samples. To address these, we propose Hydra-SGG, a one-stage SGG method featuring a Hybrid Relation Assignment. This approach combines a One-to-One Relation Assignment with an IoU-based One-to-Many Relation Assignment, increasing positive training samples and mitigating sparse supervision. In addition, we empirically demonstrate that removing self-attention between relation queries leads to duplicate predictions, which actually benefits the proposed One-to-Many Relation Assignment. With this insight, we introduce Hydra Branch, an auxiliary decoder without self-attention layers, to further enhance One-to-Many Relation Assignment by promoting different queries to make the same relation prediction. Hydra-SGG achieves state-of-the-art performance on multiple datasets, including VG150 (16.0 mR@50), Open Images V6 (50.1 weighted score), and GQA (12.7 mR@50). Our code and pre-trained models will be released on Hydra-SGG. + +# 1 INTRODUCTION + +A scene graph is a data structure that describes the entities (objects) in a scene and the relations between these objects [3]. Scene graph generation (SGG) has attracted significant research attention [20, 50, 3, 43, 71] due to its ability to enhance machines' semantic comprehension of visual content. It has been widely adopted in various downstream applications, such as robotic vision and interaction [47, 60, 80, 48], image synthesis and manipulation [79, 10, 22], visual question answering [21, 66, 41], and video understanding [78, 68, 76, 81]. + +Mainstream SGG methods [85, 64, 50, 91, 61, 29, 35] work in a two-stage fashion. First, an off-the-shelf object detector extracts all entities within an image. Then, the extracted entities are permuted, yielding $N(N - 1)$ entity pairs for $N$ detected entities. These entity pairs are + +![](images/189c4eb63a84cccd057495ef6483f47b7f6e512a962437c5e6e1fa1bd558a954.jpg) +Figure 1: Comparison with other SGG methods in mR@50 and training epochs on VG150 [75]. + +used to predict the relationships between the corresponding entities. However, the two-stage methods face a critical limitation: they predict relations for all entity pairs, even though many pairs do + +![](images/12f210965cd0e5816ba50303828ad5c37a298b580cbc7ad6026e99b7c469807a.jpg) +Figure 2: (a) Previous DETR-based SGG methods such as RelTR [7] and SGTR [40] match each GT relation with only one query. (b) Our Hybrid Relation Assignment utilizes both One-to-One and One-to-Many assignments, generating more positive samples and thus accelerating training. + +![](images/f59ac9b5713ec03bef191bda4566d39b4bbc792ceb30a06492eedf51ac710665.jpg) + +not participate in any relations. This incurs heavy computational overhead and time-consuming inference, especially in complex scenes with numerous entities and intricate interactions. + +Recently, the simplicity of DETR-based SGG methods [7, 40] has led to an ongoing paradigm shift apart from the two-stage framework. Specifically, a sequence of visual tokens, mapped from the input image, interacts with a predefined set of relation queries in a Transformer decoder for simultaneous object detection and relation prediction. Then, One-to-One set matching (i.e., Hungarian matching [28]) is used to assign ground truth labels to the predictions (Fig. 2a). This set-prediction framework allows DETR-based SGG models to eliminate hand-designed components, such as Non-Maximum Suppression (NMS), which are commonly used in traditional two-stage methods. + +Unfortunately, one significant drawback of DETR-based SGG models is their slow convergence. For instance, one-stage RelTR [7] requires 150 training epochs to converge, while a recent two-stage method, PE-Net [91], only needs 32 epochs. This drawback can be attributed to the sparse relation supervision induced by Hungarian matching, which assigns each ground truth to only one relation query. The sparsity of relation annotations per image further exacerbates this issue. For instance, VG150 [75] train averages only 5.5 ground truth relation triplets per image [43]. This means that each image provides a mere 5.5 positive relation queries to optimize the loss functions. In the case of RelTR [7], which has 200 predefined relation queries, only $2.75\%$ of these queries are positive samples per optimization step. Consequently, relation queries require more optimization steps to learn due to the limited number of positive samples for training. Furthermore, approximately $50\%$ [26] of the plausible but suboptimally matched queries (i.e., queries with correct subject-object classification and IoU $>0.6$ for both boxes) are simply treated as no-relation due to the One-to-One constraint of Hungarian matching. This constraint discards valuable supervisory signals by treating suboptimal yet informative queries as negative samples. These queries, while not the best matches for ground truth labels, may capture informative relational cues that could contribute to model learning. Simply assigning these queries as negative samples may introduce false negatives, which in turn leads to label noise and performance degradation [45]. + +To accelerate the training of DETR-based SGG models, we introduce Hydra-SGG $^1$ , an efficient framework that addresses the slow convergence problem in one-stage DETR-based SGG models. The cores of Hydra-SGG are Hybrid Relation Assignment and Hydra Branch. Specifically, Hybrid Relation Assignment synergizes One-to-One and One-to-Many Relation Assignment strategies, providing over $50\%$ more positive queries per training step than previous arts such as RelTR [7]. To further enhance this assignment strategy, we introduce an auxiliary branch called Hydra Branch. This branch is specifically designed to encourage different queries to predict duplicated relations by removing self-attention in the decoder, creating a synergistic effect with our Hybrid Relation Assignment. The branch shares all other parameters with the original decoder, and this intentional design choice leads to improved supervision signals during training ( $\S 3.3$ ). + +Hydra-SGG makes three main contributions to the field of SGG: First, we propose an efficient framework that effectively addresses the slow convergence problem in one-stage DETR-based SGG models through a hybrid query-label assignment and synergistic architectural design. Second, our Hybrid Relation Assignment strategy significantly increases relation supervision signals by min + +ing false negative samples to increase positive samples during training, providing over $50\%$ more positive samples per training step. Third, the proposed Hydra Branch complements our assignment strategy by encouraging duplicate relation predictions during training, while maintaining inference efficiency as it shares parameters with the original decoder and is only used during training. Hydra-SGG achieves state-of-the-art performance with remarkable training efficiency, converging $10\times$ faster than existing one-stage SGG counterparts [7, 40, 18]. + +Extensive experiments on three challenging SGG benchmarks, VG150 [75], Open Images V6 [30], and GQA [16], demonstrate the effectiveness of our Hydra-SGG. It achieves 16.0 mR@50 on VG150 test in only 12 epochs (Fig. 1), surpassing the previous state-of-the-art one-stage method SGTR [40] by +4.0 and two-stage method PE-Net [91] by +3.6. + +# 2 RELATED WORK + +Two-stage SGG. Lu et al. [50] first proposed SGG task and designed a two-stage pipeline. Later, many SGG models have been built on it, using various techniques such as recurrent neural networks or its variants [85, 64, 75, 70, 58], visual translation embedding [88, 17], graph neural networks [83, 62, 74, 83, 77], external or internal knowledge integration [6, 12, 84, 1, 42, 82, 35, 4, 72], attention mechanisms [23, 53, 9], and Transformer-based models [51, 7, 40, 61, 8, 29, 59]. + +Despite the promising performance, two-stage SGG methods rely heavily on manually designed modules, such as NMS, anchor generation, and entity pairing generation modules [85, 64, 9]. In addition, their designs typically involve separate stages for detection, pairing, and relation classification, resulting in a complicated pipeline that cannot be trained in a fully end-to-end manner. Furthermore, these methods predict dense entity pairs in inference, leading to high time complexity and computational burden. In contrast, this paper proposes Hydra-SGG, a one-stage SGG method that offers significant advantages over two-stage methods. Hydra-SGG enables end-to-end training and surpasses the performance of two-stage methods. + +One-stage SGG. One-stage methods have gained increasing attention for their simplicity and end-to-end training ability. Early works in this line adopt CNN-based one-stage detectors [46] or query-based sparse R-CNN [67] for direct relationship prediction. Recently, the DETR [2] framework significantly advances SGG and Human-Object Interaction [54, 92, 7, 40, 63, 95, 44, 25, 86, 26, 18, 38, 37, 73]. This framework enables end-to-end training by associating ground truth labels with output queries. Existing DETR-based SGG methods focus on different aspects: SGTR [40] and DSGG [13] explore query designs for relation feature extraction, SpeaQ [26] investigates relation-specific query grouping strategies to improve the specialization and discrimination of queries, while other works focus on architectural innovations [7] and lightweight frameworks [18]. + +However, DETR-based SGG models, while eliminating NMS, face a critical challenge of slow convergence due to sparse relation supervision, requiring significantly more training epochs than two-stage counterparts (e.g., 150 for RelTR [7] vs. 32 for PE-Net [91]). Our proposed Hydra-SGG specifically addresses this limitation through a query-label assignment and architectural design while maintaining the advantages of DETR-based approaches. Hydra-SGG achieves remarkably fast convergence with only 12 epochs, surpassing both one-stage counterparts and two-stage methods to achieve state-of-the-art performance across multiple SGG datasets (16.0 mR@50 on VG150 [75], 50.1 weighted score on Open Images V6 [30], and 12.7 mR@50 on GQA [16]). + +DETR for Object Detection. The introduction of DETR by Carion et al. [2] marks a significant shift away from traditional CNN-based object detection models [57, 55, 56, 45, 14], adopting an end-to-end trainable approach with a novel application of the Transformer architecture and bipartite matching. While DETR streamlines the detection process, it requires 500 epochs to converge [93]. This spurs a wave of research that focuses on improving low training efficacy, including enhancing training signal [5, 15, 19, 94], the adoption of anchor boxes [49, 52], and the leverage of efficient attention mechanism [93, 11]. For instance, Co-DETR [94] introduces extra groups of object queries and DN-DETR [31] utilizes noisy queries to increase positive samples. + +In this paper, we present Hydra-SGG, a framework that addresses the sparse relation supervision challenge inherent in DETR-based SGG models. Our method introduces Hybrid Relation Assignment, which significantly increases the number of positive samples per training iteration, effectively mitigating the sparse relation supervision issue and accelerating the model's convergence. + +# 3 HYDRA-SGG + +§3.1 introduces our baseline model, which employs One-to-One Relation Assignment. Next, §3.2 describes Vanilla Hydra-SGG, which enhances the baseline by introducing a Hybrid Relation Assignment strategy. Finally, §3.3 details the complete Hydra-SGG model, which includes Hydra Branch (HydraBranch), an auxiliary decoder that promotes One-to-Many Relation Assignment. §3.4 performs a statistical analysis to validate our design of Hydra Branch, demonstrating its effectiveness in enhancing the One-to-Many assignment strategy. + +# 3.1 ONE-TO-ONE RELATION ASSIGNMENT BASELINE + +Problem Formulation. Given an input image, SGG models aim to generate a scene graph in the form of relation triplet: $\langle e_{\mathrm{sub}},\rho ,e_{\mathrm{obj}}\rangle$ , where each entity $e_{\mathrm{sub}},e_{\mathrm{obj}}\in \mathcal{E}$ is represented by a category label $c\in \mathcal{C}$ (e.g., cat, people, car) and a bounding box $b$ , and $\rho \in \mathcal{P}$ is a specific relation type (e.g., on, have, ride). In this paper, we distinguish between the terms "relation" and "relation triplet". A relation refers to the interaction or relationship between entities, while a relation triplet represents the complete structure containing the subject $e_{\mathrm{sub}}$ , object $e_{\mathrm{obj}}$ , and their relation $\rho$ + +Baseline Architecture. Our baseline model is composed of a Backbone model, an Encoder, and a RelDecoder (Relation Decoder). The relation queries interact with image tokens extracted from the input image by Backbone and Encoder. The updated queries are processed by box regression, entity classification, and relation classification heads to generate the final predictions. + +- Backbone: Backbone maps an input image into a feature map that has a $H \times W \times C$ dimension, where $H$ and $W$ denote the spatial size of the feature map, while $C$ is the channel dimension (e.g., 2048 or 1024). +- Encoder: Encoder captures comprehensive spatial and contextual information across the image. Before feeding the feature map into Encoder, a $1 \times 1$ conv layer is employed to reduce the dimension of the feature map. The enhanced image tokens are denoted as $\pmb{F} \in \mathbb{R}^{HW \times 256}$ . +- RelDecoder: In RelDecoder, we introduce relation queries $Q_{\mathrm{rel}} \in \mathbb{R}^{N \times 512}$ (■■■), which are formed by concatenating subject queries $Q_{\mathrm{sub}} \in \mathbb{R}^{N \times 256}$ and object queries $Q_{\mathrm{obj}} \in \mathbb{R}^{N \times 256}$ along the channel dimension (i.e., 256). Here $N$ denotes the number of queries. RelDecoder( $Q_{\mathrm{sub}}, Q_{\mathrm{obj}}, F$ ) works as follows: + +$$ +\tilde {\boldsymbol {Q}} _ {\text {s u b}}, \tilde {\boldsymbol {Q}} _ {\text {o b j}} = \operatorname {S A} \left(\left[ \boldsymbol {Q} _ {\text {s u b}}, \boldsymbol {Q} _ {\text {o b j}} \right]\right) \in \mathbb {R} ^ {2 N \times 2 5 6}, +$$ + +$$ +\bar {\boldsymbol {Q}} _ {\mathrm {s u b}} = \operatorname {C A} (\boldsymbol {F}, \tilde {\boldsymbol {Q}} _ {\mathrm {s u b}}) \in \mathbb {R} ^ {N \times 2 5 6}, \tag {1} +$$ + +$$ +\bar {\boldsymbol {Q}} _ {\mathrm {o b j}} = \mathbb {C} \mathbb {A} (\boldsymbol {F}, \tilde {\boldsymbol {Q}} _ {\mathrm {o b j}}) \in \mathbb {R} ^ {N \times 2 5 6}. +$$ + +Specifically, the subject queries $Q_{\mathrm{sub}}$ and object queries $Q_{\mathrm{obj}}$ first interact in a self-attention layer (SA) to obtain updated queries $\tilde{Q}_{\mathrm{sub}}$ and $\tilde{Q}_{\mathrm{obj}}$ . Subsequently, these updated queries interact with image tokens in cross-attention layers (CA). The output subject and object queries are fed into independent box regression heads and classification heads, producing box predictions $\bar{b}_{\mathrm{sub}}, \bar{b}_{\mathrm{obj}} \in \mathbb{R}^{N \times 4}$ and entity class predictions $\bar{p}_{\mathrm{sub}}, \bar{p}_{\mathrm{obj}} \in \mathbb{R}^{N \times |\mathcal{C}|}$ , respectively. The relation predictions $\bar{p}_{\mathrm{rel}} \in \mathbb{R}^{N \times |\mathcal{P}|}$ are obtained by a relation prediction head. For example, with 300 relation queries (i.e., $N = 300$ ) and 50 relation classes (i.e., $|\mathcal{P}| = 50$ ), the output dimension of $\bar{p}_{\mathrm{rel}}$ would be $300 \times 50$ . Finally, the outputs of RelDecoder are combined to generate the predicted relation triplets $\bar{R} = \{\langle (\bar{p}_{\mathrm{sub}}, \bar{b}_{\mathrm{sub}}), \bar{p}_{\mathrm{rel}}, (\bar{p}_{\mathrm{obj}}, \bar{b}_{\mathrm{obj}}) \rangle_n\}_{n=1}^N$ . Note that the $i$ -th subject query is concatenated only with the $i$ -th object query, and there is no permutation process. + +- One-to-One Relation Assignment Loss. In One-to-One Relation Assignment Loss $\mathcal{L}_{\mathrm{o2o}}$ [7, 40], Hungarian matching (HM) is employed to find the optimal correspondence between the predicted relation triplets $\bar{R}$ and the ground truth triplets $R$ . The loss function can be formulated as: + +$$ +\mathcal {L} _ {\mathrm {o 2 o}} = \mathcal {L} _ {\mathrm {H M}} (\bar {\boldsymbol {R}}, \boldsymbol {R}). \tag {2} +$$ + +The classification losses (including entity and relation) and box regression losses are computed between matched predictions and ground truth labels, which is identical with the previous models [7, 40]. The Hungarian matching hyperparameters are the same as RelTR [7]. A detailed + +![](images/867b931e3fc773b5e6a527e3dcb97c735d83ab7e6b89c9d32783233db1b78404.jpg) +Figure 3: Overall pipeline of Hydra-SGG: For simplicity, FFN inside the Transformer layer are omitted. Hydra-SGG incorporates two Transformer decoders: HydraBranch and RelDecoder. HydraBranch shares its parameters with RelDecoder but removes self-attention layers. Hydra-SGG combines One-to-One and One-to-Many assignments in a synergy, generating more supervision signals. + +implementation of the loss function, training strategy, and model architecture is provided in Appendix. The evaluation of our baseline model is given in §4.3. + +# 3.2 VANILLA HYBRID RELATION ASSIGNMENT + +VG150 [75] contains an average of only 5.5 ground truth relation triplets per image in train. Our baseline adopts a One-to-One Relation Assignment and only assigns approximately 5 out of 300 relation queries to match the ground truth relation triplets for each image (i.e., $N = 300$ ). This severe sparse supervision reduces the training efficacy, as only about $2\%$ of queries in each training step match with ground truth labels for learning, while the remaining $98\%$ are treated as negative samples. Consequently, the model requires a significantly higher number of training steps to learn effectively, leading to slow convergence. + +To enrich the relation supervision signals, we propose a Hybrid Relation Assignment. Specifically, we first devise a One-to-Many Relation Assignment $(\circ 2\mathfrak{m})$ and then embed it into the baseline to cooperate with One-to-One Relation Assignment. Given a ground truth triplet $\pmb{r} = \langle (c_{\mathrm{sub}}, b_{\mathrm{sub}}), c_{\mathrm{rel}}, (c_{\mathrm{obj}}, b_{\mathrm{obj}}) \rangle \in \pmb{R}$ and a predicted triplet $\bar{\pmb{r}} = \langle (\bar{p}_{\mathrm{sub}}, \bar{b}_{\mathrm{sub}}), \bar{p}_{\mathrm{rel}}, (\bar{p}_{\mathrm{obj}}, \bar{b}_{\mathrm{obj}}) \rangle \in \bar{\pmb{R}}$ , the One-to-Many Assignment score $S_{\circ 2\mathfrak{m}}$ is calculated by: + +$$ +\mathcal {S} _ {\circ 2 \mathrm {m}} (\boldsymbol {r}, \bar {\boldsymbol {r}}) = \bar {p} _ {\text {s u b}} ^ {[ c _ {\text {s u b}} ]} + \bar {p} _ {\text {o b j}} ^ {[ c _ {\text {o b j}} ]} + \operatorname {I o U} \left(b _ {\text {s u b}}, \bar {b} _ {\text {s u b}}\right) + \operatorname {I o U} \left(b _ {\text {o b j}}, \bar {b} _ {\text {o b j}}\right). \tag {3} +$$ + +$S_{\circ 2\mathrm{m}}$ combines the predicted class probabilities and IoU scores for the subject and object bounding boxes. The notations $\bar{p}_{\mathrm{sub}}^{[c_{\mathrm{sub}}]}$ and $\bar{p}_{\mathrm{obj}}^{[c_{\mathrm{obj}}]}$ represent the probabilities of the ground truth classes for the subject and object, respectively. For example, if the ground truth subject class $c_{\mathrm{sub}}$ is 3, we would extract the probability corresponding to class 3 from $\bar{p}_{\mathrm{sub}}$ . + +Given $M$ ground truth relation triplets and $N$ predicted relation triplets, the final One-to-Many Relation Assignment score matrix, with dimensions $M \times N$ , is computed by applying Eq. 3 to each pair of ground truth and predicted relation triplets. We keep the results with scores greater than a threshold $T$ and select the top 6 queries for each ground truth (see details in §4.3). + +The proposed Vanilla Hydra-SGG applies both One-to-One and One-to-Many Relation Assignment strategies to the same set of predicted relation triplets $\bar{R}$ . These triplets are obtained from the updated queries $Q_{\mathrm{rel}}$ after passing through the model. By combining these two assignment strategies, we can formulate the vanilla version loss function as: + +$$ +\mathcal {L} _ {\text {v a n i l l a}} = \mathcal {L} _ {\mathrm {o} 2 \mathrm {o}} (\bar {\boldsymbol {R}}, \boldsymbol {R}) + \mathcal {L} _ {\mathrm {o} 2 \mathrm {m}} (\bar {\boldsymbol {R}}, \boldsymbol {R}). \tag {4} +$$ + +Our Vanilla Hydra-SGG provides richer relation supervision signals compared to the baseline by harmonizing the supervision of two assignment strategies. Specifically, it increases the number of positive samples by $65.5\%$ in VG150 [75] train and $58.7\%$ in val (Fig. 4a, b). Vanilla Hydra-SGG significantly improves training efficacy and performance ( $\S 4.3$ ). + +![](images/477be71c9352271e270b16c2c9d1fb1da5a42d9f974e974d23a56c7dbf7063ff.jpg) +Figure 4: (a) The average number of positive samples of VG150 train and val for One-to-One and Hybrid Relation Assignment. (b) The percentage increase in positive samples achieved by Hybrid Relation Assignment compared to the One-to-One baseline. (c) ADS on VG150 val. (d)-(e) The visualizations show that for the same group of queries that previously predicted different relations, removing the self-attention layers causes them to make identical predictions. The Q ID column represents the ID of each relation query. + +![](images/e530145fd55cd71cbde6b0d3c04b7d7b52071d5a5d1a835b058ee603a1f8da60.jpg) + +![](images/78b3e3838610aa70cd2a70fe9b007ac91fd40d461d5e434712e98560660e0f14.jpg) + +![](images/5b6115ee963c6a1b711af4c640ba7117fb09da5fbf1830de4940e0c22d2a7486.jpg) + +![](images/a956989e5d967e98db8f0fe6ef927d8affcb17d38ce02be0af536edc217f5e87.jpg) + +# 3.3 COMPLETE HYDRA-SGG + +Each RelDecoder layer contains self- and cross-attention layers, and a point-wise feed-forward network (FFN). The self-attention layer enables inter-query interactions [69], while cross-attention and FFN do not explicitly support query interactions. Previous studies indicate that self-attention helps inhibit duplicate predictions [2, 7]. In this work, we further find that the self-attention layer in RelDecoder is crucial to reduce duplicated relation predictions. + +We introduce a Diversity Score (DS) to quantify the impact of the self-attention layer on the diversity of relation predictions. Specifically, DS is defined as the number of distinct relation categories predicted by the model for a single image. For example, if the model predicts relations for 5 queries as (sit, sit, on, on, has), DS would be 3, as there are 3 distinct relation categories (sit, on, has). We calculate DS using the trained Vanilla Hydra-SGG model, with and without self-attention in the RelDecoder. Let $\mathrm{DS}_{\mathrm{on}}^{(k)}$ and $\mathrm{DS}_{\mathrm{off}}^{(k)}$ represent the DS for the $k$ -th image with self-attention enabled and disabled, respectively. The average DS (ADS) across the dataset is then computed as: + +$$ +\mathrm {A D S} _ {\text {o n}} = \frac {1}{K} \sum_ {k = 1} ^ {K} \mathrm {D S} _ {\text {o n}} ^ {(k)}, \quad \mathrm {A D S} _ {\text {o f f}} = \frac {1}{K} \sum_ {k = 1} ^ {K} \mathrm {D S} _ {\text {o f f}} ^ {(k)}, \tag {5} +$$ + +where $K$ is the total number of images. A higher $\mathrm{ADS}_{\mathrm{on}}$ compared to $\mathrm{ADS}_{\mathrm{off}}$ would indicate that self-attention promotes diverse relation predictions. As shown in Fig. 4c, $\mathrm{ADS}_{\mathrm{off}}$ and $\mathrm{ADS}_{\mathrm{on}}$ of VG150 [75] val are 4.6 and 6.6, respectively. Fig. 4d, e illustrate how the self-attention layer enables diverse relation predictions. Without self-attention, queries converge to the same relation. These examples demonstrate self-attention's role in reducing duplicate relations. + +The above findings reveal critical interactions between self-attention and One-to-Many Relation Assignment: i) Conflict with Self-Attention: Applying One-to-Many Relation Assignment strategy to self-attention-updated relation queries in RelDecoder of Vanilla Hydra-SGG causes a mismatch in optimization objectives, as self-attention promotes diversity while One-to-Many Relation Assignment assigns one ground truth to multiple queries. ii) Benefit without Self-Attention: Conversely, removing self-attention leads to more duplicated relation predictions, potentially synergizing with our One-to-Many Relation Assignment. + +To address this potential conflict and fully harness the benefits of both the self-attention layers and the One-to-Many Relation Assignment strategy, we propose HydraBranch (Hydra Branch, Fig. 3), an auxiliary decoder that shares parameters with RelDecoder but removes the self-attention layers. This multi-branch architecture decouples the learning objectives: the self-attention layers in the main RelDecoder can focus on promoting diversity in relation predictions, while HydraBranch facilitates One-to-Many Relation Assignment. This separation enables each branch to optimize its specific function without compromising the other. + +HydraBranch operates with the main RelDecoder in parallel, processing the same input but without the influence of self-attention layers. Specifically, the initial One-to-Many relation queries $Q_{\mathrm{rel}}^{\mathrm{o2m}}$ (i.e., $Q_{\mathrm{rel}}^{\mathrm{o2m}} = Q_{\mathrm{rel}}$ ) are set to $Q_{\mathrm{rel}}$ (i.e., $Q_{\mathrm{rel}}^{\mathrm{o2m}} = Q_{\mathrm{rel}}$ ) before being sent into HydraBranch. The + +process of HydraBranch $(Q_{\mathrm{sub}}^{02\mathrm{m}}, Q_{\mathrm{obj}}^{02\mathrm{m}}, F)$ is as follows: + +$$ +\bar {Q} _ {\text {s u b}} ^ {\mathrm {o} 2 \mathrm {m}} = \mathrm {C A} \left(\boldsymbol {F}, Q _ {\text {s u b}} ^ {\mathrm {o} 2 \mathrm {m}}\right) \in \mathbb {R} ^ {N \times 2 5 6}, \quad \bar {Q} _ {\text {o b j}} ^ {\mathrm {o} 2 \mathrm {m}} = \mathrm {C A} \left(\boldsymbol {F}, Q _ {\text {o b j}} ^ {\mathrm {o} 2 \mathrm {m}}\right) \in \mathbb {R} ^ {N \times 2 5 6}. \tag {6} +$$ + +The One-to-Many predicted relation triplets $\bar{R}^{\mathrm{o2m}} = \{\langle (\bar{p}_{\mathrm{sub}}^{\mathrm{o2m}},\bar{b}_{\mathrm{sub}}^{\mathrm{o2m}}),\bar{p}_{\mathrm{rel}}^{\mathrm{o2m}},(\bar{p}_{\mathrm{obj}}^{\mathrm{o2m}},\bar{b}_{\mathrm{obj}}^{\mathrm{o2m}})\rangle_{n}\}_{n = 1}^{N}$ are derived in the same manner as $\bar{R}$ and share prediction heads with $\bar{R}$ . Compared with Eq. 1, subject and object queries do not interact in a self-attention layer before they are sent into subsequent cross-attention layers. We apply One-to-Many Relation Assignment described in Eq. 3 to $\bar{R}^{\mathrm{o2m}}$ and $\pmb{R}$ . Hybrid Relation Assignment Loss is then given by: + +$$ +\mathcal {L} _ {\text {H y d r a}} = \mathcal {L} _ {\circ 2 \circ} (\bar {\boldsymbol {R}}, \boldsymbol {R}) + \mathcal {L} _ {\circ 2 \mathrm {m}} (\bar {\boldsymbol {R}} ^ {\circ 2 \mathrm {m}}, \boldsymbol {R}). \tag {7} +$$ + +By incorporating HydraBranch, the complete version of Hydra-SGG achieves 10.6 and 16.0 on mR@20 and mR@50, respectively, in just 12 training epochs, further boosting the performance compared to the vanilla version (§4.3). Note that HydraBranch is used only in training and discarded in inference, thus bringing no extra parameters or delay. + +# 3.4 STATISTICAL ANALYSIS OF HYDRA BRANCH + +To quantify how Hydra Branch enhances the One-to-Many assignment strategy, we analyze the Euclidean distances between query embedding pairs. Using 5,000 images from the VG150 val set, we compute pairwise distances for all 300 queries per image (totaling $\binom{300}{2} = 44,850$ pairs per image) in two conditions: with and without self-attention layers. The removal of self-attention reduces the mean query distance from 7.55 to 7.23 (5% decrease). A paired t-test confirms statistical significance ( $t = 54.502$ , $p < 0.001$ ), with a Cohen's $d$ effect size of 0.771 - approaching the threshold for a large effect ( $d = 0.8$ ). These results demonstrate that Hydra Branch promotes query similarity through self-attention removal, thereby facilitating One-to-Many assignment. + +# 4 EXPERIMENT + +# 4.1 EXPERIMENTAL SETUP + +Datasets. We conduct experiments on three datasets: + +- Visual Genome (VG150) [27, 75] contains 150 entity and 50 relation categories. It is split into 57,723 training, 5,000 validation, and 26,446 testing images. +- Open Images V6 [30] features 288 entity and 30 relation categories, including 126,368 training, 1,813 validation, and 5,322 testing images with relation annotations. +- GQA [16] encompasses 200 entity and 100 relation types, with a split of 52,623 training, 5,000 validation, and 8,209 testing images annotated for SGG tasks. + +Evaluation Metrics. We focus on the scene graph detection (SGDet) setting on VG150 [27], GQA [16] and Open Images V6 [30] datasets. For VG150 and GQA, we report $\mathrm{Recall}@\mathbf{k}$ ( $\mathbf{R}@\mathbf{k}$ ), mean $\mathrm{Recall}@\mathbf{k}$ [6, 64] ( $\mathrm{mR}@\mathbf{k}$ ), and F-Recall [87] performance. $\mathrm{mR}@\mathbf{K}$ calculates $\mathbf{R}@\mathbf{K}$ for each predicate individually, then averages these values. It is important to note that recall metrics are more influenced by dataset bias [3], whereas mean recall provides a more holistic evaluation of the model's performance. F-Recall is the harmonic average of Recall and mean Recall. For Open Images V6, we follow evaluation protocols [30]: Recall@50, the weighted mean Average Precision (wmAP) for relationship detection (wmAPrel), and phrase detection (wmAPphr). The overall score, denoted as $\mathrm{score}_{\mathrm{wtd}}$ , is calculated as a weighted average of these metrics: $0.2 \times \mathrm{R} @ 50 + 0.4 \times \mathrm{wmAP}_{\mathrm{rel}} + 0.4 \times \mathrm{wmAP}_{\mathrm{phr}}$ . + +Competitors. Hydra-SGG is compared with methods from two categories: (1) Two-stage SGG methods, including MOTIFS [85], VCTree-TDE [65], BGNN [39], PE-Net [91], IS-GGT [29], VETO [61], UniVRD [90], DRM [32], CFA [34], and SHA [9]; (2) One-stage methods including SGTR [40], SSR-CNN [67], ISG [24], RelTR [7], DSGG [13], SpeaQ [26], and EGTR [18]. + +Table 1: SGDet evaluation on VG150 [27] test (§4.2). ${}^{ + }$ : detector pre-trained on VG150. FPS (Frames Per Second) indicates inference speed. F-Recall of Hydra-SGG is calculated based on the best results. + +
MethodBackbone# EpochFPS# ParamR@20/50/100mR@20/50/100F@20/50/100
Two-stage methods
MOTIFS [85] [CVPR2018]ResNeXt101-FPN--369.9M25.1 / 32.1 / 36.94.1 / 5.5 / 6.87.1 / 9.2 / 11.7
VCTree-TDE [65] [CVPR2020]ResNeXt101-FPN--361.3M14.3 / 19.6 / -6.3 / 9.3 / 11.18.8 / 12.4 / -
BGNN [39] [CVPR2021]ResNeXt101-FPN--341.9M23.3 / 31.0 / 35.87.5 / 10.7 / 12.711.3 / 15.5 / 19.0
PE-Net [91] [CVPR2023]ResNeXt101-FPN32+--- / 30.7 / 35.2- / 12.4 / 14.5- / 17.7 / 21.2
IS-GGT [29] [CVPR2023]ResNet10170--- / - / -- / 9.1 / 11.3- / - / -
VETO [61] [ICCV2023]ResNeXt101-FPN33+--- / 27.5 / 31.5- / 8.1 / 9.5- / 12.5 / 14.6
UniVRD [90] [ICCV2023]CLIP ViT-B---- / - / -- / 9.6 / 12.1- / - / -
DRM [32] [CVPR2024]ResNeXt101-FPN---- / 34.0 / 38.9- / 9.0 / 11.2- / 14.2 / 17.4
One-stage methods
SGTR [40] [CVPR2022]ResNet101123+-117.1M- / 25.1 / 26.6- / 12.0 / 14.6- / 16.2 / 18.9
SSR-CNN [67] [CVPR2022]ResNet101--274.3M25.8 / 32.7 / 36.96.1 / 8.4 / 10.09.9 / 13.4 / 15.7
ISG [24] [NeurIPS2022]ResNet10152-93.5M- / 29.5 / 32.1- / 7.4 / 8.4- / 11.8 / 13.3
RelTR [7] [TPAM12023]ResNet501506.563.7M21.2 / 27.5 / 30.76.8 / 10.8 / 12.310.3 / 15.5 / 17.6
DSGG [13] [CVPR2024]-60--- / 32.9 / 38.5- / 13.0 / 17.3- / 18.6 / 23.9
SpeaQ [26] [CVPR2024]ResNet10152--- / 32.9 / 36.0- / 11.8 / 14.1- / 17.4 / 20.3
EGTR [18] [CVPR2024]ResNet50275+7.742.5M23.5 / 30.2 / 34.35.5 / 7.9 / 10.18.9 / 12.5 / 15.6
Ours
Hydra-SGG [ICLR2025]ResNet50125.367.6M21.9 / 28.6 / 33.4 ±0.1 / ±0.2 / ±0.310.3 / 15.9 / 19.4 ±0.2 / ±0.2 / ±0.214.0 / 20.5 / 24.7
+ +Table 2: Evaluation on Open Images V6 [30] test (§4.2).+: detector pre-trained on Open Images V6. + +
MethodBackbone# Epoch# ParamR@50wmAPrelwmAPphrscorewd
Two-stage methods
Motifs [85] [CVPR2018]ResNeXt101-FPN-369.9M71.629.931.638.9
BGNN [39] [CVPR2021]ResNeXt101-FPN-341.9M75.035.534.242.1
PE-Net [91] [CVPR2023]ResNeXt101-FPN--76.535.434.944.9
One-stage methods
SGTR [40] [CVPR2022]ResNet101123+117.1M59.937.038.742.3
RelTR [7] [TPAMI2023]ResNet5015063.7M71.734.237.543.0
EGTR [18] [CVPR2024]ResNet50275+42.5M75.042.041.948.6
Ours
Hydra-SGG [ICLR2025]ResNet50767.6M76.0±0.242.8±0.244.1±0.250.0±0.2
+ +# 4.2 QUANTITATIVE COMPARISON RESULT + +VG150 [75] test. Table 1 reports the comparison results on VG150 test. Hydra-SGG demonstrates outstanding performance on challenging SGDet, achieving mR@20 and mR@50 scores of 10.6 and 16.0, respectively, setting a new state-of-the-art. Hydra-SGG achieves this performance with significantly shorter training time, requiring only 12 epochs. This training time is substantially shorter compared to SpeaQ [26], EGTR [18], and DSGG [13], with reductions of 40, 263, and 48 epochs, respectively. Despite the shorter training, Hydra-SGG outperforms these methods by +4.2, +8.1, and +3.0 on the mR@50. Furthermore, it even outperforms the state-of-the-art two-stage model, PE-Net [91], by a margin of 3.6 on the mR@50 metric. We speculate that the significant improvement in mR can be attributed to our One-to-Many Assignment strategy, which ensures balanced supervision across both rare and common relations by allocating a fixed number of six queries per relation category (§ 3.2). For instance, in an image containing ten "on" relations and two "sit" relations, while One-to-One Assignment would allocate ten queries to "on" and only two to "sit", our approach assigns six queries to each, resulting in a $60\%$ increase for common relations and a substantial $300\%$ increase for rare relations. + +Open Images V6 [30] test. As shown in Table 2, Hydra-SGG achieves SOTA in only 7 epochs while SGTR [40], RelTR [7] and EGTR [18] require 119, 150, and 275 epochs. Although Open Images V6 contains more than 120,000 images, its scenes are not as complex as those in VG150 [75]. Training Hydra-SGG for 7 epochs is sufficient to achieve good performance. + +GQA [16] test. Our experimental results demonstrate that Hydra-SGG achieves SOTA mean Recall performance on GQA. As shown in Table 3, Hydra-SGG achieves 12.7 and 15.9 for mR@50 and mR@100 respectively, surpassing previous best results. Our model employs the relatively + +Table 3: Evaluation on GQA [16] test (§4.2). + +
MethodBackboneR@50/100mR@50/100
SHA [9][CVPR2022]ResNeXt101-FPN25.5 / 29.16.6 / 7.8
VETO [61][ICCV2023]ResNeXt101-FPN26.1 / 29.07.0 / 8.1
CFA [34][ICCV2023]ResNeXt101-FPN-10.8 / 12.6
Ours
Hydra-SGG [ICLR2025]ResNet5023.1 / 26.8 ±0.3 / ±0.312.5 / 15.6 ±0.2 / ±0.3
+ +lightweight ResNet50 as its backbone, in contrast to the heavier ResNeXt101 used by other methods. + +Table 4: A set of ablative experiments about on VG150 [27] test (§4.3). The adopted hyperparameters are marked in red. + +
MethodmR@20mR@50# Epoch
Baseline8.712.950
Vanilla Hydra-SGG9.9 (+1.2)14.9 (+2.0)12
Hydra-SGG10.6 (+1.9)16.0 (+3.1)12
+ +(a) Key Components + +
MethodTotal training timemR@20mR@50
RelTR [7]50.0h (150 epochs)6.810.8
Baseline16.7h (50 epochs)8.712.9
Hydra-SGG12.0h (12 epochs)10.616.0
+ +(b) Training Time + +
TmR@20mR@50mR@100
0.310.414.918.9
0.410.616.019.7
0.59.415.519.6
0.610.314.919.1
+ +(c) Threshold $T$ + +
# EpochmR@20mR@50mR@100
1010.015.418.6
1210.616.019.7
2111.616.119.7
2410.415.219.9
+ +(d) Training Epoch + +
# QuerymR@20mR@50mR@100
1008.814.117.8
2009.915.318.4
30010.616.019.7
40010.615.518.9
+ +(e) Number of Relation Queries + +
Loss Ratio (1-to-1 : 1-to-M)mR@50mR@100
1 : 0.514.618.9
1 : 0.815.619.4
1 : 116.019.7
1 : 1.515.418.7
1 : 215.619.5
1 : 315.419.3
+ +(f) Loss Weights Between One-to-One (1-to-1) and One-to-Many (1-to-M) Losses. + +
MethodmR@50mR@100
TDE [65][CVPR2020]9.211.1
NICE [33][CVPR2022]10.412.7
IETrans [87][ECCV2022]12.515.0
CFA [34][ICCV2023]12.314.6
VETO [61][ICCV2023]10.613.8
NICEST [36][TPAMI2024]10.412.4
Hydra-SGG [ICLR2025]16.019.7
+ +(g) Comparisons with Unbiasing Methods. + +Comparisons with Unbiasing Methods. As shown in Table 4g, Hydra-SGG achieves very competitive performance on VG150 compared to these specialized debiasing methods, including TDE [65], NICE [33], IETrans [87], CFA [34], VETO [61], and NICEST [36]. + +# 4.3 DIAGNOSTIC EXPERIMENT + +Key Components. We first investigate the effectiveness of our core Hybrid Relation Assignment ( $\S 3.2$ ) and Hydra Branch ( $\S 3.3$ ) in Table 4a. The first row gives the score of our baseline model ( $\S 3.1$ ). The second row corresponds to the result of Vanilla Hydra-SGG, which directly applies Hybrid Relation Assignment into RelDecoder. The third row lists the results of the complete Hydra-SGG model. Our results show that taking the proposed Hybrid Relation Assignment in the baseline model improves the mean recall and achieves $9.9 / 14.9 \, \text{mR} @ 20 / \text{mR} @ 50$ . Furthermore, the integration of Hydra Branch with Hybrid Relation Assignment yields a synergistic effect, boosting performance substantially. Specifically, Hydra Branch increases $\text{mR} @ 20$ from 9.9 to 10.6 and $\text{mR} @ 50$ from 14.9 to 16.0, highlighting the complementary nature of these two strategies. + +Training Efficacy. In Table 4b, we compare the training time costs on VG150 [75]. All models are trained on eight NVIDIA RTX 4090 GPUs with a ResNet50 backbone. Our model achieves 16.0 mR@50 in 12 hours, whereas RelTR takes 50 hours to achieve 6.8 mR@50. This demonstrates the superior training efficacy of Hydra-SGG. + +Threshold $T$ . We next study the influence of the threshold $T$ in One-to-Many Relation Assignment in Table 4c. The threshold $T$ controls the quality and quantity of positive relation queries. A higher value of $T$ keeps only the high-quality positive relation queries but at the cost of reducing their number. Conversely, lowering $T$ yields more positive samples, but their quality may decrease. This trade-off between quality and quantity directly affects the final performance of the model. Experimental results show optimal performance at $T = 0.4$ , yielding mR@20 of 10.6 and mR@50 of 16.0. As we increase $T$ to 0.5 and 0.6, the performance gradually decreases. This suggests that while maintaining high-quality positive samples is important, having a sufficient number of them is also crucial for the model to learn effectively. + +Training Epochs. We further investigate the influence of training epochs on the performance. As presented in Table 4d, Hydra-SGG achieves state-of-the-art mean Recalls in just 12 epochs, demonstrating its fast convergence. We observe further improvements when increasing the epochs to 21, i.e., $10.6\mathrm{mR}@20$ and $16.0\mathrm{mR}@50$ respectively. However, the performance decreases at epoch 24, with $\mathrm{mR}@20$ and $\mathrm{mR}@50$ dropping to 10.4 and 15.2, respectively. This reduction in performance can be attributed to overfitting. + +![](images/d37b1b2fae3f20507bb2dfac8ab153c113c7337acdec3e045cf570d125d39751.jpg) + +![](images/bf4f50c38c5294ccb0084ac0e03ae5eeb6e542d6a71fb45a224b73c356373f04.jpg) + +![](images/d0bcf1a4327a1045a7e5d32dcd8cd0c15d21e80315f5e4dd658f6c32142232fb.jpg) + +![](images/fa8846305218cbb1d0a4598820f91bdc5e007ec3b84ee4357a1cf48cc9eda51f.jpg) + +![](images/dad06863b7754151beb23af4403021d7cc78f9f53c0a8abae783292e536dab09.jpg) +(e) Usplash Image 1 + +![](images/1b41d9a0701105b47de56f8967c8e1667fb76262b812a10060a2362e70625f69.jpg) +Figure 5: Qualitative results §4.4. (a)-(d) compare Hydra-SGG and RelTR [7] on a VG150 [27] val image. We use the same color for each entity category, and the color of a predicate matches that of its subject. Differences are highlighted with red dashed rectangles $\square$ . (e)-(g) show scene graphs generated by Hydra-SGG from images sourced from Unsplash, a platform for freely-usable images. These images are real-world, "in the wild" scenarios, demonstrating our model's capability to handle diverse and unseen visual content. + +![](images/7b378f53ebfdc5eb8de3194126750652b4d120b7151d156a32b54e52c69b9851.jpg) +(f) Usplash Image 2 + +![](images/5a90a4cda3702facb05b8bdce50875dc5aebea48213307a048394f12853eeb45.jpg) + +![](images/55ab63d36b3552897e1f02e17572af0bc9135d2cb19bf8db79bf5d6f704b9ff6.jpg) +(g) Usplash Image 3 + +![](images/974da9f6d4a0280dd17f626a9d56d9bae93c19c2b66c7a65a4bfd4af7b1461ad.jpg) + +Number of Relation Queries. Lastly, we studied the effect of the number of relation queries on model performance, as shown in Table 4e. The performance with 200 queries and 400 queries is inferior to that with 300 queries. The model achieved $\mathrm{mR}@20/50$ of 9.9/15.3 with 200 queries, and 10.6/15.5 with 400 queries. In contrast, with 300 queries, the model reached its highest performance, with $10.6\mathrm{mR}@20$ and $16.0\mathrm{mR}@50$ . We hypothesize that using 200 queries may be insufficient to capture the diversity of relationships within the data. On the other hand, using 400 queries could introduce excessive noise and false positives, thereby reducing the overall precision of the model. + +Impact of Loss Weights. As shown in Table 4f, we conducted an ablation study to investigate the effect of different loss weights between One-to-One and One-to-Many losses. With a 1:1 loss ratio, the model achieves the best results (mR@50: 16.0, mR@100: 19.7). When the One-to-Many loss weight is reduced (e.g., 1:0.5), the model fails to fully utilize the additional positive samples available. Conversely, increasing this weight excessively (e.g., 1:3) leads to an overemphasis on One-to-Many triplets, which typically have lower quality compared to One-to-One triplets. This quality difference arises from the fundamental nature of the assignments: One-to-One assignment matches each relation label with its optimal query exclusively, while One-to-Many assignment matches a relation label with multiple queries meeting certain criteria. + +# 4.4 QUALITATIVE COMPARISON RESULT + +In Fig. 5a-d, we visualize the generated scene graph results on the image of VG150 [27] val. Both Hydra-SGG and RelTR [7] detect plausible relations, but these relations were not annotated, so these reasonable predictions become false negatives. Our Hydra-SGG detects more fine-grained relations such as rock-on-mountain and logo-on-shirt, while RelTR fails to detect such relations. In Fig. 5e-g, we visualize generated scene graph results on unseen Unsplash images. + +# 5 CONCLUSION + +This paper introduces Hydra-SGG, a one-stage DETR-based scene graph generation (SGG) model that addresses the slow convergence issue in existing DETR-based SGG models. The key contributions of our work are as follows: i) We propose a Hybrid Relation Assignment, which combines One-to-One and One-to-Many Relation Assignment strategies to increase relation supervision signals. ii) We introduce a Hydra Branch, an auxiliary decoder that encourages relation queries to predict duplicate relations, further enhancing the proposed One-to-Many Relation Assignment. These innovations work in synergy to significantly accelerate the learning process. Consequently, Hydra-SGG achieves state-of-the-art results on VG150 [75], GQA [16], and Open Images V6 [30] in just 12, 12, and 7 training epochs, demonstrating remarkable performance and efficiency. + +# REFERENCES + +[1] Stephan Baier, Yunpu Ma, and Volker Tresp. Improving visual relationship detection using semantic modeling of scene descriptions. In ECCV, pp. 53-68, 2017. +[2] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, pp. 213-229, 2020. +[3] Xiaojun Chang, Pengzhen Ren, Pengfei Xu, Zhihui Li, Xiaojiang Chen, and Alex Hauptmann. A comprehensive survey of scene graphs: Generation and application. TPAMI, 45(1):1-26, 2021. +[4] Guikun Chen, Jin Li, and Wenguan Wang. Scene graph generation with role-playing large language models. In NeurIPS, 2024. +[5] Qiang Chen, Xiaokang Chen, Jian Wang, Shan Zhang, Kun Yao, Haocheng Feng, Junyu Han, Errui Ding, Gang Zeng, and Jingdong Wang. Group detr: Fast detr training with group-wise one-to-many assignment. In ICCV, pp. 6633-6642, 2023. +[6] Tianshui Chen, Weihao Yu, Riquan Chen, and Liang Lin. Knowledge-embedded routing network for scene graph generation. In CVPR, pp. 6163-6171, 2019. +[7] Yuren Cong, Michael Ying Yang, and Bodo Rosenhahn. Reltr: Relation transformer for scene graph generation. TPAMI, 2023. +[8] Qi Dong, Zhuowen Tu, Haofu Liao, Yuting Zhang, Vijay Mahadevan, and Stefano Soatto. Visual relationship detection using part-and-sum transformers with composite queries. In ICCV, pp. 3550-3559, 2021. +[9] Xingning Dong, Tian Gan, Xuemeng Song, Jianlong Wu, Yuan Cheng, and Liqiang Nie. Stacked hybrid-attention and group collaborative learning for unbiased scene graph generation. In CVPR, pp. 19427–19436, 2022. +[10] Azade Farshad, Yousef Yeganeh, Yu Chi, Chengzhi Shen, Böjrn Ommer, and Nassir Navab. Scenegenie: Scene graph guided diffusion models for image synthesis. In ICCV, pp. 88-98, 2023. +[11] Peng Gao, Minghang Zheng, Xiaogang Wang, Jifeng Dai, and Hongsheng Li. Fast convergence of detr with spatially modulated co-attention. In ICCV, pp. 3621–3630, 2021. +[12] Jiuxiang Gu, Handong Zhao, Zhe Lin, Sheng Li, Jianfei Cai, and Mingyang Ling. Scene graph generation with external knowledge and image reconstruction. In CVPR, pp. 1969-1978, 2019. +[13] Zeeshan Hayden and Xuming He. Dsgg: Dense relation transformer for an end-to-end scene graph generation. In CVPR, pp. 28317-28326, 2024. +[14] Kaiming He, Georgia Gkioxari, Piotr Dólar, and Ross Girshick. Mask r-cnn. In ICCV, pp. 2961-2969, 2017. +[15] Zhengdong Hu, Yifan Sun, Jingdong Wang, and Yi Yang. Dac-detr: Divide the attention layers and conquer. In NeurIPS, 2024. +[16] Drew A Hudson and Christopher D Manning. Gqa: A new dataset for real-world visual reasoning and compositional question answering. In CVPR, pp. 6700-6709, 2019. +[17] Zih-Siou Hung, Arun Mallya, and Svetlana Lazebnik. Contextual translation embedding for visual relationship detection and scene graph generation. TPAMI, 43(11):3820-3832, 2020. +[18] Jinbae Im, JeongYeon Nam, Nokyung Park, Hyungmin Lee, and Seunghyun Park. Egtr: Extracting graph from transformer for scene graph generation. In CVPR, pp. 24229-24238, 2024. +[19] Ding Jia, Yuhui Yuan, Haodi He, Xiaopei Wu, Haojun Yu, Weihong Lin, Lei Sun, Chao Zhang, and Han Hu. Detrs with hybrid matching. In CVPR, pp. 19702-19712, 2023. + +[20] Justin Johnson, Ranjay Krishna, Michael Stark, Li-Jia Li, David Shamma, Michael Bernstein, and Li Fei-Fei. Image retrieval using scene graphs. In CVPR, pp. 3668-3678, 2015. +[21] Justin Johnson, Bharath Hariharan, Laurens Van Der Maaten, Judy Hoffman, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Inferring and executing programs for visual reasoning. In ICCV, pp. 2989–2998, 2017. +[22] Justin Johnson, Agrim Gupta, and Li Fei-Fei. Image generation from scene graphs. In CVPR, pp. 1219–1228, 2018. +[23] Deunsol Jung, Sanghyun Kim, Won Hwa Kim, and Minsu Cho. Devil's on the edges: Selective quad attention for scene graph generation. In CVPR, pp. 18664-18674, 2023. +[24] Siddhesh Khandelwal and Leonid Sigal. Iterative scene graph generation. In NeurIPS, 2022. +[25] Bumsoo Kim, Junhyun Lee, Jaewoo Kang, Eun-Sol Kim, and Hyunwoo J Kim. Hotr: End-to-end human-object interaction detection with transformers. In CVPR, pp. 74-83, 2021. +[26] Jongha Kim, Jihwan Park, Jinyoung Park, Jinyoung Kim, Sehyung Kim, and Hyunwoo J Kim. Groupwise query specialization and quality-aware multi-assignment for transformer-based visual relationship detection. In CVPR, 2024. +[27] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 123:32-73, 2017. +[28] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83-97, 1955. +[29] Sanjoy Kundu and Sathyanarayanan N Aakur. Is-ggt: Iterative scene graph generation with generative transformers. In CVPR, pp. 6292-6301, 2023. +[30] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Alexander Kolesnikov, et al. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. IJCV, 128(7):1956-1981, 2020. +[31] Feng Li, Hao Zhang, Shilong Liu, Jian Guo, Lionel M Ni, and Lei Zhang. Dn-detr: Accelerate detr training by introducing query denoising. In CVPR, pp. 13619-13627, 2022. +[32] Jiankai Li, Yunhong Wang, Xiefan Guo, Ruijie Yang, and Weixin Li. Leveraging predicate and triplet learning for scene graph generation. In CVPR, 2024. +[33] Lin Li, Long Chen, Yifeng Huang, Zhimeng Zhang, Songyang Zhang, and Jun Xiao. The devil is in the labels: Noisy label correction for robust scene graph generation. In CVPR, pp. 18869-18878, 2022. +[34] Lin Li, Guikun Chen, Jun Xiao, Yi Yang, Chunping Wang, and Long Chen. Compositional feature augmentation for unbiased scene graph generation. In ICCV, pp. 21685-21695, 2023. +[35] Lin Li, Jun Xiao, Guikun Chen, Jian Shao, Yueting Zhuang, and Long Chen. Zero-shot visual relation detection via composite visual cues from large language models. In NeurIPS, 2023. +[36] Lin Li, Jun Xiao, Hanrong Shi, Hanwang Zhang, Yi Yang, Wei Liu, and Long Chen. Nicest: Noisy label correction and training for robust scene graph generation. TPAMI, 2024. +[37] Lulei Li, Wenguan Wang, and Yi Yang. Human-object interaction detection collaboration with large relation-driven diffusion models. In NeurIPS, 2024. +[38] Lulei Li, Jianan Wei, Wenguan Wang, and Yi Yang. Neural-logic human-object interaction detection. In NeurIPS, 2024. +[39] Rongjie Li, Songyang Zhang, Bo Wan, and Xuming He. Bipartite graph network with adaptive message passing for unbiased scene graph generation. In CVPR, pp. 11109-11119, 2021. + +[40] Rongjie Li, Songyang Zhang, and Xuming He. Sgtr: End-to-end scene graph generation with transformer. In CVPR, pp. 19486-19496, 2022. +[41] Yicong Li, Xiang Wang, Junbin Xiao, Wei Ji, and Tat-Seng Chua. Invariant grounding for video question answering. In CVPR, pp. 2928-2937, 2022. +[42] Yikang Li, Wanli Ouyang, Xiaogang Wang, and Xiao'ou Tang. Vip-cnn: Visual phrase guided convolutional neural network. In CVPR, pp. 1347-1356, 2017. +[43] Yuanzhi Liang, Yalong Bai, Wei Zhang, Xueming Qian, Li Zhu, and Tao Mei. Vrr-vg: Refocusing visually-relevant relationships. In ICCV, pp. 10403-10412, 2019. +[44] Yue Liao, Aixi Zhang, Miao Lu, Yongliang Wang, Xiaobo Li, and Si Liu. Gen-vlkt: Simplify association and enhance interaction understanding for hoi detection. In CVPR, pp. 20123-20132, 2022. +[45] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dólar. Focal loss for dense object detection. In ICCV, pp. 2980-2988, 2017. +[46] Hengyue Liu, Ning Yan, Masood Mortazavi, and Bir Bhanu. Fully convolutional scene graph generation. In CVPR, pp. 11546-11556, 2021. +[47] Rui Liu, Xiaohan Wang, Wenguan Wang, and Yi Yang. Bird's-eye-view scene graph for vision-language navigation. In ICCV, pp. 10968-10980, 2023. +[48] Rui Liu, Wenguan Wang, and Yi Yang. Vision-language navigation with energy-based policy. In NeurIPS, 2024. +[49] Shilong Liu, Feng Li, Hao Zhang, Xiao Yang, Xianbiao Qi, Hang Su, Jun Zhu, and Lei Zhang. DAB-DETR: Dynamic anchor boxes are better queries for DETR. In ICLR, 2022. +[50] Cewu Lu, Ranjay Krishna, Michael Bernstein, and Li Fei-Fei. Visual relationship detection with language priors. In ECCV, pp. 852–869, 2016. +[51] Yichao Lu, Himanshu Rai, Jason Chang, Boris Knyazev, Guangwei Yu, Shashank Shekhar, Graham W Taylor, and Maksims Volkovs. Context-aware scene graph generation with seq2seq transformers. In ICCV, pp. 15931-15941, 2021. +[52] Depu Meng, Xiaokang Chen, Zejia Fan, Gang Zeng, Houqiang Li, Yuhui Yuan, Lei Sun, and Jingdong Wang. Conditional detr for fast training convergence. In ICCV, pp. 3651-3660, 2021. +[53] Mengshi Qi, Weijian Li, Zhengyuan Yang, Yunhong Wang, and Jiebo Luo. Attentive relational networks for mapping images to scene graphs. In CVPR, pp. 3957-3966, 2019. +[54] Siyuan Qi, Wenguan Wang, Baoxiong Jia, Jianbing Shen, and Song-Chun Zhu. Learning human-object interactions by graph parsing neural networks. In ECCV, pp. 401-417, 2018. +[55] Joseph Redmon and Ali Farhadi. Yolo9000: better, faster, stronger. In CVPR, pp. 7263-7271, 2017. +[56] Joseph Redmon and Ali Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018. +[57] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. +[58] Hanrong Shi, Lin Li, Jun Xiao, Yueting Zhuang, and Long Chen. From easy to hard: Learning curricular shape-aware features for robust panoptic scene graph generation. IJCV, pp. 1-20, 2024. +[59] Suprosanna Shit, Rajat Koner, Bastian Wittmann, Johannes Paetzold, Ivan Ezhov, Hongwei Li, Jiazhen Pan, Sahand Sharifzadeh, Georgios Kaissis, Volker Tresp, et al. Relationformer: A unified framework for image-to-graph generation. In ECCV, pp. 422-439, 2022. + +[60] Kunal Pratap Singh, Jordi Salvador, Luca Weihs, and Aniruddha Kembhavi. Scene graph contrastive learning for embodied navigation. In ICCV, pp. 10884-10894, 2023. +[61] Gopika Sudhakaran, Devendra Singh Dhami, Kristian Kersting, and Stefan Roth. Vision relation transformer for unbiased scene graph generation. In ICCV, pp. 21882-21893, 2023. +[62] Mohammed Suhail, Abhay Mittal, Behjat Siddique, Chris Broaddus, Jayan Eledath, Gerard Medioni, and Leonid Sigal. Energy-based learning for scene graph generation. In CVPR, pp. 13936-13945, 2021. +[63] Masato Tamura, Hiroki Ohashi, and Tomoaki Yoshinaga. Qpic: Query-based pairwise human-object interaction detection with image-wide contextual information. In CVPR, pp. 10410-10419, 2021. +[64] Kaihua Tang, Hanwang Zhang, Baoyuan Wu, Wenhan Luo, and Wei Liu. Learning to compose dynamic tree structures for visual contexts. In CVPR, pp. 6619-6628, 2019. +[65] Kaihua Tang, Yulei Niu, Jianqiang Huang, Jiaxin Shi, and Hanwang Zhang. Unbiased scene graph generation from biased training. In CVPR, pp. 3716-3725, 2020. +[66] Damien Teney, Lingqiao Liu, and Anton van Den Hengel. Graph-structured representations for visual question answering. In CVPR, pp. 1–9, 2017. +[67] Yao Teng and Limin Wang. Structured sparse r-cnn for direct scene graph generation. In CVPR, pp. 19437-19446, 2022. +[68] Yao Teng, Limin Wang, Zhifeng Li, and Gangshan Wu. Target adaptive context aggregation for video scene graph generation. In ICCV, pp. 13688-13697, 2021. +[69] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. +[70] Wenbin Wang, Ruiping Wang, Shiguang Shan, and Xilin Chen. Exploring context and visual pattern of relationship for scene graph generation. In CVPR, pp. 8188-8197, 2019. +[71] Wenguan Wang, Yi Yang, and Yunhe Pan. Visual knowledge in the big model era: Retrospect and prospect. FITEE, 2024. +[72] Wenguan Wang, Yi Yang, and Fei Wu. Towards data-and knowledge-driven ai: A survey on neuro-symbolic computing. TPAMI, 47(2):878-899, 2025. +[73] Jianan Wei, Tianfei Zhou, Yi Yang, and Wenguan Wang. Nonverbal interaction detection. In ECCV, pp. 277-295, 2024. +[74] Sanghyun Woo, Dahun Kim, Donghyeon Cho, and In So Kweon. Linknet: Relational embedding for scene graph. In NeurIPS, 2018. +[75] Danfei Xu, Yuke Zhu, Christopher B Choy, and Li Fei-Fei. Scene graph generation by iterative message passing. In CVPR, pp. 5410–5419, 2017. +[76] Li Xu, Haoxuan Qu, Jason Kuen, Jiumiang Gu, and Jun Liu. Meta spatio-temporal debiasing for video scene graph generation. In ECCV, pp. 374-390, 2022. +[77] Jianwei Yang, Jiasen Lu, Stefan Lee, Dhruv Batra, and Devi Parikh. Graph r-cnn for scene graph generation. In ECCV, pp. 670-685, 2018. +[78] Jingkang Yang, Wenxuan Peng, Xiangtai Li, Zujin Guo, Liangyu Chen, Bo Li, Zheng Ma, Kaiyang Zhou, Wayne Zhang, Chen Change Loy, et al. Panoptic video scene graph generation. In CVPR, pp. 18675-18685, 2023. +[79] Ling Yang, Zhilin Huang, Yang Song, Shenda Hong, Guohao Li, Wentao Zhang, Bin Cui, Bernard Ghanem, and Ming-Hsuan Yang. Diffusion-based scene graph to image generation with masked contrastive pre-training. arXiv preprint arXiv:2211.11138, 2022. + +[80] Wei Yang, Xiaolong Wang, Ali Farhadi, Abhinav Gupta, and Roozbeh Mottaghi. Visual semantic navigation using scene priors. arXiv preprint arXiv:1810.06543, 2018. +[81] Zongxin Yang, Guikun Chen, Xiaodi Li, Wenguan Wang, and Yi Yang. Doraemongpt: Toward understanding dynamic scenes with large language models (exemplified as a video agent). In ICML, 2024. +[82] Yuan Yao, Ao Zhang, Xu Han, Mengdi Li, Cornelius Weber, Zhiyuan Liu, Stefan Wermter, and Maosong Sun. Visual distant supervision for scene graph generation. In ICCV, pp. 15816-15826, 2021. +[83] Guojun Yin, Lu Sheng, Bin Liu, Nenghai Yu, Xiaogang Wang, Jing Shao, and Chen Change Loy. Zoom-net: Mining deep feature interactions for visual relationship recognition. In ECCV, pp. 322-338, 2018. +[84] Ruichi Yu, Ang Li, Vlad I Morariu, and Larry S Davis. Visual relationship detection with internal and external linguistic knowledge distillation. In ICCV, pp. 1974-1982, 2017. +[85] Rowan Zellers, Mark Yatskar, Sam Thomson, and Yejin Choi. Neural motifs: Scene graph parsing with global context. In CVPR, pp. 5831-5840, 2018. +[86] Aixi Zhang, Yue Liao, Si Liu, Miao Lu, Yongliang Wang, Chen Gao, and Xiaobo Li. Mining the benefits of two-stage and one-stage hoi detection. In NeurIPS, 2021. +[87] Ao Zhang, Yuan Yao, Qianyu Chen, Wei Ji, Zhiyuan Liu, Maosong Sun, and Tat-Seng Chua. Fine-grained scene graph generation with data transfer. In ECCV, pp. 409-424, 2022. +[88] Hanwang Zhang, Zawlin Kyaw, Shih-Fu Chang, and Tat-Seng Chua. Visual translation embedding network for visual relation detection. In CVPR, pp. 5532-5540, 2017. +[89] Hao Zhang, Feng Li, Shilong Liu, Lei Zhang, Hang Su, Jun Zhu, Lionel Ni, and Heung-Yeung Shum. DINO: DETR with improved denoising anchor boxes for end-to-end object detection. In ICLR, 2023. +[90] Long Zhao, Liangzhe Yuan, Boqing Gong, Yin Cui, Florian Schroff, Ming-Hsuan Yang, Hartwig Adam, and Ting Liu. Unified visual relationship detection with vision and language models. In ICCV, pp. 6962-6973, 2023. +[91] Chaofan Zheng, Xinyu Lyu, Lianli Gao, Bo Dai, and Jingkuan Song. Prototype-based embedding network for scene graph generation. In CVPR, pp. 22783-22792, 2023. +[92] Tianfei Zhou, Wenguan Wang, Siyuan Qi, Haibin Ling, and Jianbing Shen. Cascaded human-object interaction recognition. In CVPR, pp. 4263-4272, 2020. +[93] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In ICLR, 2021. +[94] Zhuofan Zong, Guanglu Song, and Yu Liu. Detrs with collaborative hybrid assignments training. In ICCV, pp. 6748-6758, 2023. +[95] Cheng Zou, Bohan Wang, Yue Hu, Junqi Liu, Qian Wu, Yu Zhao, Boxun Li, Chenguang Zhang, Chi Zhang, Yichen Wei, et al. End-to-end human object interaction detection with hoi transformer. In CVPR, pp. 11825-11834, 2021. + +# APPENDIX + +For a better understanding of the main paper, we provide additional details in this supplementary material, which is organized as follows: + +- $\S A$ details the implementation details. +- $\S B$ provides the pseudo code of Hydra-SGG. +- $\S C$ shows failure cases of Hydra-SGG in VG150 [75]. +- §D discusses our limitations, societal impact, and directions of future work. + +# A IMPLEMENTATION + +Inspired by RelTR [7], we also set relation queries to be composed of subject and object queries. We adopt the same training techniques and attention mechanisms as previous works [31, 89, 7] in Hydra-SGG. In particular, we use anchor boxes as embeddings to accelerate training and employ deformable attention [93] respectively. We input noised box-label pairs to generate both entity and relation denoising queries. To prevent information leakage, we employ attention masks. Given the absence of an attention map in the deformable decoder, we simplify the model by omitting the convolutional mask head in RelTR [7]. In particular, we concatenate the output subject and object queries and input them into an MLP. This simplification not only reduces computational complexity but also maintains performance. + +Both One-to-One and One-to-Many losses are composed of box regression loss, entity classification loss, and relation classification loss as previous works [2, 40, 7, 18, 63]. Specifically, we use Focal loss [45] for both relation and detection, as in previous works [49, 31, 89]. In the post-processing stage, the predictions are first ranked by the relation probability. Then we use the relation index to find corresponding subject and object predictions to compose the prediction triplets. Finally, we follow the same process as RelTR [7] that removes predictions where the subject and object are the same, as such data does not exist in VG150 [75], but we do not use this process in Open Images V6 [30]. + +For training, we adopt the same data augmentation techniques as RelTR [7] but discard random cropping since some triplets could be incomplete. The default training epochs are 12 for VG150 [75] and 7 for Open Images V6 [30]. For VG150, the learning rate is scaled by 0.1 at epoch 11, while for Open Images V6, it is scaled at epoch 6. Open Images V6 [30] contains more than 120,000 training images, but most scenes in the dataset are simpler than those in VG150 [75], therefore training for 7 epochs is enough to achieve state-of-the-art performance. Extended training on Open Images V6 may improve the performance, but considering the dataset size, the marginal benefits are limited. + +Due to the inherent bias in SGG datasets, numerous unbiased algorithms have been developed [65, 34, 33, 61, 91]. While adopting these unbiased techniques typically leads to significant performance improvements, we opt for a fair comparison by evaluating Hydra-SGG against methods that do not employ such techniques. + +# B PSEUDO CODE + +The pseudo-code of Hydra-SGG is given in Algorithm S1. Our code and pre-trained models will be made publicly available. + +# C FAILURE CASES + +In this section, we present failure cases of scene graphs generated by Hydra-SGG on VG150 [75] val. In the first row (Fig. S1a-c), Hydra-SGG successfully recognizes the airplane in the image, but the predicted label is 'plane'. Although 'plane' is a plausible label, the ground truth label is 'airplane', which leads to all predicted relationships being incorrect since they don't match the ground truth. However, from a semantic perspective, the model correctly identifies these relationships and even recognizes more fine-grained relationships that are not annotated in the ground truth. For instance, the ground truth only marks the right engine of the airplane, but the model correctly identifies + +Algorithm 1 Hydra-SGG: PyTorch-like Pseudo-code +Algorithm S1: Hydra-SGG core implementation. +```python +RelDecoder shares parameters with Hydra Branch +# memory: image tokens (L x D) +# Query.rel: relation queries of RelDecoder (N x D) +# Query rel_o2m: relation queries of HydraBranch (N x D) +# Loss_o2o: apply box regression, entity, and relation classification losses between matched queries and GTs by Hungarian matching. +# Loss_o2m: apply box regression, entity, and relation classification losses between matched queries and GTs by One-to-Many Relation Assignment. +Hydra SGG forward +def forward(sample, target): # extract and enhance features from the input memory $=$ Encoder(Backbone(sample)) $\#$ (L x D) # init relation queries for RelDecoder and Hydra Branch Query rel $=$ Query rel_o2m $=$ self.initQueries() Query rel_bar $=$ RelDecoder(Query_rel, memory) # (N x D) Query rel_o2m_bar $=$ HydraBranch(Query rel_o2m, memory) # (N x D) loss_1 $=$ Loss_o2o(Query_rel_bar, targets) loss_2 $=$ Loss_o2m(Query rel_o2m_bar, targets) loss_hydra $=$ loss_1 + loss_2 loss_hydra.backup() +# RelDecoder +def RelDecoder(Query_rel, memory): Query rel $=$ Self_attn(Query_rel) # (N x D) Query rel $=$ Cross_attn(Query_rel, memory) # (N x D) Query rel $=$ FFN(Query_rel) return Query rel +# Hydra Branch +def HydraBranch(Query rel_o2m, memory): Query rel_o2m $=$ Cross_attn(Query rel_o2m, memory) # (N x D) Query rel_o2m $=$ FFN(Query rel_o2m) return Query rel_o2m +``` + +![](images/2553a967e1436ac4f4d49517b95bca7b5ddd95a64979993677b5cc0f4f4793f3.jpg) +(a) Image 1 + +![](images/fd7ee97bfaffa4f4fe2100aff21af74e57b74dc3792b4a1758e84e378d53e163.jpg) +(b) Ground truth 1 + +![](images/02d9e4e1355cd86a3bea3e97c3749d682afe2654d828a6987fdf99adab836e55.jpg) +(c) Hydra-SGG 1 + +![](images/d6f11387af1289c00a6069a8e6e47bc94b5fbffd53b3264d9d2188f491e6d0b0.jpg) +(d) Image 2 + +![](images/8d882e726bce174ea3fe8e34ad3635c854da187f16ed807d080b940ca02351d8.jpg) +(e) Ground truth 2 + +![](images/f998f7b840967d919897b1ad89e3627393d2c2cfe2a8e86e0d407354252cbede.jpg) +(f) Hydra-SGG 2 +Figure S1: Failure cases of Hydra-SGG on VG150 [75] val. + +both engines. In addition, the model correctly identifies the logo and windows on the airplane, which are reasonable and correct predictions but are considered incorrect because they are not annotated in the ground truth. In the second row (Fig. S1d-f), the ground truth annotation uses a single box to label two women, which is an unreasonable annotation. The model correctly predicts two women + +and identifies that both women are wearing shirts and shorts, which are annotations absent in the ground truth but are semantically accurate. + +# D DISCUSSION + +Limitation Analysis. A significant limitation of the current Hydra-SGG is its inability to predict object and relation categories beyond a predefined closed set. The algorithm can only make predictions for object and relation classes that have been explicitly defined and included in the training dataset. This constraint means that the model lacks the capability to recognize or infer novel object types or relationship categories that were not present during the training phase. Such a limitation restricts the model's applicability in real-world scenarios, where encountering previously unseen objects or relations is common. In addition, since the current One-to-Many Relation Assignment rules are manually designed, they may lack flexibility and potentially introduce some noise to the training process. + +Societal Impact. Hydra-SGG has the potential to significantly enhance autonomous driving systems, thereby improving road safety and efficiency. For instance, when integrated into self-driving vehicles, Hydra-SGG can provide a deeper understanding of complex traffic scenarios. Beyond merely identifying vehicles, pedestrians, and road signs, it can comprehend the spatial relationships and potential interactions between these elements. This advanced scene understanding could enable autonomous vehicles to more accurately predict the behavior of other road users, leading to safer and more efficient navigation in diverse traffic conditions. + +Future Work. A promising direction for future research is to extend the current model towards open vocabulary SGG. This advancement would allow Hydra-SGG to recognize and predict objects and relationships beyond the predefined closed set of categories used in training. + +As mentioned in the limitations, since the current One-to-Many Relation Assignment rules are manually designed, they may introduce noise during training that affects learning. Therefore, another direction for future work could focus on designing better one-to-many strategies to further improve performance. For instance, we could develop a feature composition module to generate new relation triplets, or we can incorporate a relationship refine module to transfer coarse-grained relations into fine-grained relations. \ No newline at end of file diff --git a/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/images.zip b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ad73a9fad686c769e2fa303c6a6f7e6653ffc7cd --- /dev/null +++ b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4504a0c8161a44ac5118d0c028b0ac7423dc0b862a2cada9de20bb6b5e32801b +size 658435 diff --git a/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/layout.json b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..59605281fc103a522cad13e687a0f5a5bc412bcd --- /dev/null +++ b/ICLR/2025/Hydra-SGG_ Hybrid Relation Assignment for One-stage Scene Graph Generation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3625c15ea9fdacab041397eb434ff2e0ddb4108f9f333d7a0755710a3085a940 +size 618555 diff --git a/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_content_list.json b/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a763e88e7d3e249c102a81dbf103b68dc7ab18b4 --- /dev/null +++ b/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0afb09a793b1e807592bfcca88a034521ba5d0f38aa2b3dafde42058e67af82c +size 208793 diff --git a/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_model.json b/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..96538a42823eca8eb725941e8da66884f8195597 --- /dev/null +++ b/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:723a9731ba5e1bd4727b0792dfc4df77ccb9758eb718648ce1d4e39008da6f89 +size 231445 diff --git a/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_origin.pdf b/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..76706a711d8062c5e40504c6574b9eb11d78c037 --- /dev/null +++ b/ICLR/2025/Hyper-Connections/d1a33097-bb20-422b-ab7f-fd6996d549a5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34af62734a2bafa80692a879c7309b45daf98ce4fa764b11161c030a15fb3319 +size 7263596 diff --git a/ICLR/2025/Hyper-Connections/full.md b/ICLR/2025/Hyper-Connections/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7bffc557c11d2cdb37524e49618689980f3238c0 --- /dev/null +++ b/ICLR/2025/Hyper-Connections/full.md @@ -0,0 +1,945 @@ +# HYPER-CONNECTIONS + +Defa Zhu, Hongzhi Huang, Zihao Huang, Yutao Zeng, Yunyao Mao, Banggu Wu, Qiyang Min, Xun Zhou + +Seed-Foundation-Model Team, ByteDance + +{zhudefa,huanghongzhi.51,huangzihao.notabot,yutao.zeng, maoyunyao.myy,wubanggu,minqiyang,zhouxun}@bytedance.com + +# ABSTRACT + +We present hyper-connections, a simple yet effective method that can serve as an alternative to residual connections. This approach specifically addresses common drawbacks observed in residual connection variants, such as the seesaw effect between gradient vanishing and representation collapse. Theoretically, hyperconnections allow the network to adjust the strength of connections between features at different depths and dynamically rearrange layers. We conduct experiments focusing on the pre-training of large language models, including dense and sparse models, where hyper-connections show significant performance improvements over residual connections. Additional experiments conducted on vision tasks also demonstrate similar improvements. We anticipate that this method will be broadly applicable and beneficial across a wide range of AI problems. + +# 1 INTRODUCTION + +![](images/34ad00d5a1fb1c670fd2e5386c62b55cd69d037bd2406e87b4b70967d92d8430.jpg) +Figure 1: The performance of the baseline model OLMoE-1B-7B and the model with hyperconnections, OLMoE-1B-7B-DHC×4. (1) and (2) show the training loss (0.99 EMA smoothed) and the C4-en validation loss, respectively. Our method converges 1.8 times faster compared to the baseline and maintains a significant advantage at the 500B tokens. (3) and (4) show the accuracy curves on HellaSwag and ARC-Challenge, demonstrating the superior performance of the OLMoE-1B-7B-DHC×4 model. + +![](images/fe0669f686f55fd4616846cba0e17187831ed8c13e671295f0afffbf29b6a5e0.jpg) + +![](images/fa52d4c716318a70ef57f09f144110cb8aa6f9d2339b4e94ab1d370983be1e6f.jpg) + +![](images/53ccb0997ec6a3e44a880560435d7b58796b89108e493d18f362a0d875c998f1.jpg) + +Deep learning has achieved tremendous success across various domains, where residual connections (He et al., 2016) have been instrumental in contemporary neural network architectures, including transformers and CNNs. Residual connections help mitigate the problem of gradient vanishing, enabling the effective training of very deep networks. However, it is important to acknowledge that residual connections are not infallible solutions and still present limitations that remain unresolved. + +The two main variants of residual connections, Pre-Norm and Post-Norm, each make distinct trade-offs between gradient vanishing and representation collapse. Pre-Norm applies normalization operations to the input before each residual block, effectively addressing the problem of gradient vanishing (Bengio et al., 1994; Glorot & Bengio, 2010). However, it can also lead to the issue of collapse in deep representations (Liu et al., 2020), where hidden features in deeper layers become highly similar, diminishing the contribution of additional layers as their number increases. In contrast, Post-Norm applies normalization after the output of each residual block, reducing the influence of a hidden state on subsequent layers. This approach can alleviate the issue of representation collapse but + +![](images/946267e8ec73cd3edd02f054903dccbf881fedd18016418fb097f8346fa9dfb9.jpg) +Figure 2: Hyper-connections (HC) with an expansion rate of $n = 2$ . (a) Residual connections. (b) Hyper-connections: $\beta_{1}, \beta_{2}, \alpha_{0,0}, \alpha_{0,1}, \alpha_{1,0}, \alpha_{1,1}, \alpha_{2,1}$ , and $\alpha_{2,2}$ are learnable scalars or scalars predicted by the network, depending on the specific HC version. These connections enable lateral information exchange and vertical integration of features across depths. The Transformer with HC is shown in Fig. 17. They can be decoupled into depth-connections and width-connections. (c) Depth-connections perform a weighted sum between the layer output and the hidden vector $h_{1}$ . (d) Width-connections allow information exchange between the hidden vectors $h_{1}$ and $h_{2}$ . + +also reintroduces the problem of vanishing gradients. The vanishing gradient and the representation collapse are like two ends of a seesaw, with these two variants making respective trade-offs between these issues. The key issue is that residual connections, including both Pre-Norm and Post-Norm variants, predefine the strength of connections between the output and input within a layer. + +Driven by the limitations of residual connections, an important question arises: Can neural networks autonomously learn the optimal strength of connections to improve performance? To address this, we propose hyper-connections (HC), which lead to significantly improved performance with a negligible increase in computation and parameters. We will show that both Post-Norm and Pre-Norm variants can be expressed as specific nontrainable forms of hyper-connections, as discussed in § 3.1. + +The core idea of hyper-connections (HC) is to propose learnable depth-connections and width-connections, as depicted in Fig.2 (b). These connections flexibly integrate features vertically across depths, compared to the residual connections shown in Fig.2 (a). Depth-connections can be considered as a generalized residual connections, assigning weights to the connections between the inputs and outputs of each layer. To enable the network to model different depth-connections simultaneously, we expand the network's input into $n$ copies, each having its own depth connection, as shown in Fig. 2 (b). This design allows multiple hidden vectors to reserve multiple patterns connecting preceding layers, as shown in § 4.5. Moreover, we establish width connections between the $n$ hidden vectors, allowing information exchange between hidden vectors within the same layer, as shown in Fig. 2 (b). We argue that $n (>1)$ hidden states are necessary. As analyzed in Appendix F, the seesaw effect persists when $n = 1$ , and experiments show that it does not improve performance, as shown in Fig. 5. In contrast, when $n > 1$ , hyper-connections can not only learn to adjust the + +![](images/43ec523c5e3d55318901e3f22490f899f3c553e86b408922765aac90d63129a9.jpg) +Figure 3: Cosine similarity between the input of the current and the previous layers for the OLMo-1B models (Groeneveld et al., 2024). The curve represents the median of similarity, while the shaded area indicates the range between the 5th and 95th percentiles. The red curve shows the model with Pre-Norm, and the blue curve shows that with hyper-connections. + +strength of residuals but also rearrange layers, either sequentially or in parallel, as discussed in § 3.2. To further enhance flexibility, we introduce dynamic hyper-connections (DHC), enabling the network to adjust connection weights according to the input. Notably, although HC seem to increase the network's width by $n$ times, the additional parameters and computational cost are almost negligible, as analyzed in Appendix B. The Transformer with HC is shown in Fig. 17. + +Our research, primarily centered on large language models (LLMs) pre-training, also extends to visual generation and classification tasks. Using Pre-Norm as a baseline, we demonstrate the significant benefits of hyper-connections, including 1B and 7B dense models as well as 7B MoE models, as + +detailed in § 4. The benefits are particularly prominent for OLMoE (Muennighoff et al., 2024) as presented in Fig.1. The model utilizing DHC converges 1.8 times faster and shows an improvement of 6 points on ARC-Challenge compared to the baseline trained with 500 B tokens. According to our visualization analysis, as shown in Fig.3, the baseline model tends toward representation collapse, characterized by high similarity between features of adjacent layers. In contrast, models with HC exhibit significantly lower similarity between features across adjacent layers and a wider range of similarities. This suggests that HC enhance the impact of each layer. Further discussion is provided in §4.5 and in Appendix F. These compelling pieces of evidence demonstrate the generality of the hyper-connections principle, and we anticipate their applicability in numerous other AI challenges. + +# 2 METHOD + +# 2.1 STATIC HYPER-CONNECTIONS + +Consider the hidden vector $\mathbf{h}^{k - 1}\in \mathbb{R}^d$ (or $\mathbf{h}^{k - 1}\in \mathbb{R}^{d\times 1}$ ) as the input to the $k$ -th layer, with the initial input $\mathbf{h}^0$ to the network. Initially, $\mathbf{h}^0\in \mathbb{R}^d$ is replicated $n$ times to form the initial hyper hidden matrix $\mathbf{H}^0 = \left(\mathbf{h}^0\quad \mathbf{h}^0\quad \ldots \quad \mathbf{h}^0\right)^\top \in \mathbb{R}^{n\times d}$ . Here, $n$ is the expansion rate. For the $k$ -th layer, the input consists of the hyper hidden matrix from the previous layer $\mathbf{H}^{k - 1} = \left(\mathbf{h}_1^{k - 1}\quad \mathbf{h}_2^{k - 1}\quad \ldots \quad \mathbf{h}_n^{k - 1}\right)^\top \in \mathbb{R}^{n\times d}$ . Finally, we sum the last hyper hidden matrix row-wise to obtain the required hidden vector, which is then passed through a final projector to produce the final output of the network (i.e., a normalization layer and an unembedding layer in transformers). To simplify the notation in subsequent analysis, we omit the layer index and simply denote the hyper-hidden matrix as $\mathbf{H} = (\mathbf{h}_1\quad \mathbf{h}_2\quad \ldots \quad \mathbf{h}_n)^\top$ . + +The hyper-connections (HC) can be represented by a matrix $\mathcal{H}\mathcal{C}$ , where each element defines the connection weight. The matrix is structured as follows: + +$$ +\mathcal {H C} = \left( \begin{array}{c c} \mathbf {0} _ {1 \times 1} & \mathbf {B} \\ \mathbf {A} _ {\mathbf {m}} & \mathbf {A} _ {\mathbf {r}} \end{array} \right) = \left( \begin{array}{c c c c c} 0 & \beta_ {1} & \beta_ {2} & \dots & \beta_ {n} \\ \alpha_ {1, 0} & \alpha_ {1, 1} & \alpha_ {1, 2} & \dots & \alpha_ {1, n} \\ \alpha_ {2, 0} & \alpha_ {2, 1} & \alpha_ {2, 2} & \dots & \alpha_ {2, n} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ \alpha_ {n, 0} & \alpha_ {n, 1} & \alpha_ {n, 2} & \dots & \alpha_ {n, n} \end{array} \right) \in \mathbb {R} ^ {(n + 1) \times (n + 1)}. \tag {1} +$$ + +Consider a network layer $\mathcal{T}$ , it integrates self-attention layers and feed-forward networks within transformers. The output of the HC, denoted by $\hat{\mathbf{H}}$ , can be simply formulated as follows: + +$$ +\hat {\mathbf {H}} = \mathcal {H C} (\mathcal {T}, \mathbf {H}) = \mathbf {B} ^ {\intercal} \mathcal {T} \left(\mathbf {H} ^ {\intercal} \mathbf {A} _ {\mathbf {m}}\right) ^ {\intercal} + \mathbf {A} _ {\mathbf {r}} ^ {\intercal} \mathbf {H}. \tag {2} +$$ + +We use $\mathbf{A}_{\mathbf{m}}$ as weights to perform a weighted sum on the input $\mathbf{H} = (\mathbf{h}_1 \quad \mathbf{h}_2 \quad \ldots \quad \mathbf{h}_n)^\top$ to obtain the input $\mathbf{h}_0$ of the current layer $\mathcal{T}$ , which is given by: + +$$ +\mathbf {h} _ {0} ^ {\intercal} = \mathbf {A} _ {\mathbf {m}} ^ {\intercal} \mathbf {H}, \tag {3} +$$ + +While $\mathbf{A_r}$ is used to connect $\mathbf{H}$ and map it to a hyper hidden matrix $\mathbf{H}'$ , as shown below: + +$$ +\mathbf {H} ^ {\prime} = \mathbf {A} _ {\mathbf {r}} ^ {\top} \mathbf {H}. \tag {4} +$$ + +Subsequently, the output is given by: + +$$ +\hat {\mathbf {H}} = \mathbf {B} ^ {\mathsf {T}} \left(\mathcal {T} \mathbf {h} _ {0}\right) ^ {\mathsf {T}} + \mathbf {H} ^ {\prime}. \tag {5} +$$ + +The depth-connections can be decoupled as the following matrix, which is shown at Fig 2 (a): + +$$ +\mathcal {D C} = \binom {\mathbf {B}} {\operatorname {d i a g} \left(\mathbf {A} _ {\mathbf {r}}\right)} = \left( \begin{array}{c c c c} \beta_ {1} & \beta_ {2} & \dots & \beta_ {n} \\ \alpha_ {1, 1} & \alpha_ {2, 2} & \dots & \alpha_ {n, n} \end{array} \right) \in \mathbb {R} ^ {2 \times n}, \tag {6} +$$ + +where the first row $\mathbf{B}$ represents the weights of the output of the current layer $\mathcal{T}$ , and the last row $\mathrm{diag}(\mathbf{A_r})$ represents the weights of the input. We use $\mathrm{diag}(\mathbf{A_r})$ to represent the flatten vector of the diagonal entries of $\mathbf{A_r}$ . + +The width-connections matrix can be defined as follows, which is shown at Fig 2 (b): + +$$ +\mathcal {W C} = \left( \begin{array}{c c} \mathbf {A _ {m}} & \mathbf {A _ {r}} \end{array} \right) \in \mathbb {R} ^ {n \times (n + 1)}. \tag {7} +$$ + +The algorithm that employs hyper-connections is presented in Algorithm 1. + +# 2.2 DYNAMIC HYPER-CONNECTIONS + +The entries of $\mathcal{HC}$ can dynamically depend on the input $\mathbf{H}$ , which the matrix representation of dynamic hyper-connections (DHC) is defined as follows: + +$$ +\mathcal {H C} (\mathbf {H}) = \left( \begin{array}{c c} \mathbf {0} _ {1 \times 1} & \mathcal {B} (\mathbf {H}) \\ \mathcal {A} _ {m} (\mathbf {H}) & \mathcal {A} _ {r} (\mathbf {H}) \end{array} \right) \tag {8} +$$ + +Similarly, given a layer $\mathcal{T}$ and input $\mathbf{H}$ , we obtain the output of the DHC as follows: + +$$ +\hat {\mathbf {H}} = \mathcal {H C} (\mathbf {H}) (\mathcal {T}, \mathbf {H}). \tag {9} +$$ + +In practice, we combine the dynamic and static matrices to achieve DHC. The dynamic parameters are obtained through a linear transformation. To stabilize the training process, we introduce normalization before the linear transformation and apply the tanh activation function after it, scaling it by a small initial learnable factor. The following equations detail how these dynamic parameters are computed: + +$$ +\overline {{\mathbf {H}}} = \operatorname {n o r m} (\mathbf {H}) \tag {10} +$$ + +$$ +\mathcal {B} (\mathbf {H}) = s _ {\beta} \circ \tanh \left(\overline {{\mathbf {H}}} \mathbf {W} _ {\beta}\right) ^ {\intercal} + \mathbf {B} \in \mathbb {R} ^ {1 \times n} \tag {11} +$$ + +$$ +\mathcal {A} _ {m} (\mathbf {H}) = s _ {\alpha} \circ \tanh \left(\overline {{\mathbf {H}}} \mathbf {W} _ {m}\right) + \mathbf {A} _ {m} \in \mathbb {R} ^ {n \times 1} \tag {12} +$$ + +$$ +\mathcal {A} _ {r} (\mathbf {H}) = s _ {\alpha} \circ \tanh \left(\overline {{\mathbf {H}}} \mathbf {W} _ {r}\right) + \mathbf {A} _ {r} \in \mathbb {R} ^ {n \times n} \tag {13} +$$ + +Our experiments in § 4 demonstrate that dynamic hyper-connections outperform static hyperconnections in language modeling tasks. The PyTorch implementations for both the static and dynamic variants of hyper-connections are detailed in Algorithm 2 and 3. + +# 2.3 INITIALIZATION + +In order to make the initialization of the hyper-connections equivalent to the Pre-Norm residual connections, we adopt the following initialization strategy. The dynamic parameters $\mathbf{W}_{\beta}, \mathbf{W}_m$ , and $\mathbf{W}_r$ in Eqs. 11, 12, and 13 are initialized to 0, while the static matrices are initialized as follows: + +$$ +\left( \begin{array}{l l} \mathbf {0} _ {1 \times 1} & \mathbf {B} ^ {k} \\ \mathbf {A} _ {\mathbf {m}} ^ {k} & \mathbf {A} _ {\mathbf {r}} ^ {k} \end{array} \right) = \left( \begin{array}{l l} \mathbf {0} _ {1 \times 1} & \mathbf {1} _ {1 \times n} \\ \mathbf {e} _ {k \bmod n} & \mathbf {e} _ {n \times n} \end{array} \right), \tag {14} +$$ + +where $k$ is the index of the layer. mod denotes the modulo operation. + +# 3 WHY HYPER-CONNECTIONS + +In this section, we elucidate the rationale behind hyper-connections. We explore how variants of residual connections, namely Pre-Norm and Post-Norm, can be viewed as non-trainable hyperconnections, and introduce the concept of sequential-parallel duality, demonstrating how hyperconnections can dynamically optimize layer arrangements to enhance network performance. A visulize analysis of hyper-connections through an unfolded view is discussed in $\S 4.5$ . + +# 3.1 RESIDUAL CONNECTIONS AS NON-TRAINABLE HYPER-CONNECTIONS + +The Pre-Norm and Post-Norm residual connections can be represented as the following hyperconnections matrices with an expansion rate $n = 1$ : + +$$ +\mathcal {H C} _ {\text {P r e N o r m}} = \left( \begin{array}{l l} 0 & 1 \\ 1 & 1 \end{array} \right), \quad \tag {15} \qquad \mathcal {H C} _ {\text {P o s t N o r m}} = \left( \begin{array}{c c} 0 & \frac {1}{\sqrt {\sigma_ {i} ^ {2} + \sigma_ {o} ^ {2} + 2 \sigma_ {i o}}} \\ 1 & \frac {1}{\sqrt {\sigma_ {i} ^ {2} + \sigma_ {o} ^ {2} + 2 \sigma_ {i o}}} \end{array} \right), \tag{16} +$$ + +where $\sigma_{i}$ and $\sigma_{o}$ denote the standard deviations of the input and output of the neural network layer, respectively, and $\sigma_{io}$ is the covariance between them. + +For Pre-Norm, its hyper-connection matrix is a $2 \times 2$ matrix where the bottom right triangular part is filled with 1 and the rest is a placeholder 0. For Post-Norm, the weights depend on the variances and covariance of the input and output, forming a $2 \times 2$ matrix. Therefore, their hyper-connection matrices are non-trainable. In this work, we propose hyper-connections that can be $(n + 1) \times (n + 1)$ matrices, with weights that are trainable or even predicted based on the input. The complete derivation is provided in Appendix G. + +# 3.2 SEQUENTIAL-PARALLEL DUALITY + +Given a series of neural network modules, we have the option to arrange them either sequentially or in parallel. However, hyper-connections offer an approach that learns to rearrange these layers in a configuration blending both sequential and parallel arrangements. + +![](images/978751ac2edd3876a6b42d167acff9d74a3dddbebd7fad09073c940b5567f964.jpg) +(a) Sequential Arrangement + +![](images/0236abc1577756b13a922bfdf28f2c2ea76311024fc766e8776204217cdbd683.jpg) +(b) Parallel Arrangement +Figure 4: Sequential and parallel arrangements of hyper-connections with $n = 2$ . + +Without loss of generality, we set the expansion rate to $n = 2$ . If the hyper-connections are learned as the following matrix, the neural network will be arranged sequentially: + +$$ +\mathcal {H C} = \left( \begin{array}{l l l} 0 & 1 & 1 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right). \tag {17} +$$ + +In this case, the depth connection degenerates into a residual connection, as shown in Fig. 4 (a). + +When the hyper-connections for odd and even layers (with layer numbering starting from 1) are defined by the following matrices, the neural network will be arranged in parallel every two consecutive layers, similar to the arrangement of parallel transformer blocks in transformers (Wang, 2021), as shown in Fig. 4 (b). The general and complete derivation is provided in Appendix H. + +$$ +\mathcal {H C} _ {o d d} = \left( \begin{array}{l l l} 0 & 1 & 0 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{array} \right), \tag {18} +$$ + +Thus, learning the hyper-connection matrix in various forms can create layer arrangements that surpass traditional sequential and parallel configurations, resulting in a soft-mixture or even dynamic + +arrangement. For static hyper-connections, the layer arrangement within the network remains fixed after training. In contrast, dynamic hyper-connections allow the arrangement to adapt dynamically for each token. + +# 4 RESULTS + +![](images/17ce979feb0264c466d3dacc6e9b519c9b0293e61423674fb4d2147eb63bd432.jpg) +Figure 5: Comparison of training loss curves for different expansion rate. The left subfigure includes models with dynamic hyper-connections (DHC) at various expansion rates, while the right subfigure shows the effect of omitting the tanh function. Both subfigures illustrate how increasing the expansion rate leads to improved training loss performance over 500B tokens. Results are smoothed using an exponential moving average with a coefficient of 0.99. + +![](images/658be4331c79e2713e5d6305e6ee98565b7e653de3fb3f2170e46863ef9f1748.jpg) + +Table 1: Ablation study on expansion rates $n$ with training on ${500}\mathrm{\;B}$ tokens. + +
MethodsV2 Eval Loss ↓V2 Eval PPL ↓V3 Eval Loss ↓V3 Eval PPL ↓Down Stream Avg, Acc. ↑
OLMo-1B2.81118.0232.54414.22962.5
OLMo-1B-DHC×1 W/O tanh2.82218.2702.55614.42862.3
OLMo-1B-DHC×2 W/O tanh2.79217.6632.53714.03363.8
OLMo-1B-DHC×4 W/O tanh2.77917.4512.51613.84464.4
OLMo-1B-DHC×8 W/O tanh2.77717.4252.51413.81963.8
OLMo-1B-DHC×12.81918.1252.55614.41862.3
OLMo-1B-DHC×22.80217.9502.53414.11463.0
OLMo-1B-DHC×42.78117.5092.51413.82663.8
OLMo-1B-DHC×82.77817.4452.51613.84362.8
+ +We primarily conduct experiments on pre-training of large language model, including dense and Mixture-of-Experts (MoE) (Shazeer et al., 2017) models, and extend to visual generation and classification tasks. Due to space constraints, we include the vision experiments in the Appendix E. + +Experiment Settings. We employ the experimental setup outlined by OLMo (Groeneveld et al., 2024) for dense models and by OLMoE (Muennighoff et al., 2024) for MoE models. For dense models, we use dolmap-v1.5-sample (Soldaini et al., 2024) as our training dataset. We conduct ablation studies on 1B models and assess the effectiveness of our method at the 7B model scale. For MoE models, we train the OLMoE-1B-7B model, both with and without hyper-connections, on the OLMOE-MIX dataset. These models activate 1.3B out of a total of 7B parameters. All experiments are trained on 500B tokens. + +Implementation. We maintain the training configuration of the baseline model, replacing the residual connections with hyper-connections. The static component in Eqs. 1, 11, 12, 13 does not utilize weight decay, whereas the dynamic component does. Since the hyper hidden vectors of the final transformer block are ultimately summed, we ensure that the standard deviation (std) of the output (before the final layernorm and unembedding layers) remains consistent with the original. At initialization, we scale the std of the weights of the output module at all layers, including those of the second linear layer of the feedforward network and the output projector of the attention module, by a factor of $\sqrt{n}$ , + +where $n$ represents the expansion rate. The parameters and computational overhead introduced by hyper-connections is negligible, see Table. 7 and 8. + +Metrics. In accordance with the methodology of OLMo (Groeneveld et al., 2024), we report the average perplexities (PPL) and losses on both the V2 and V3 validation sets, along with the average metrics for zero-shot evaluation on downstream benchmarks (refer to Table 13). We observe significant volatility in the zero-shot performance indicators for the datasets (highlighted in grey in Table 13), with fluctuations exceeding $20\%$ across neighboring checkpoints. For more reliable and consistent results, we excludes these volatile datasets from our analysis. For the MoE models, in line with OLMoE, we also present losses on V3 validation sets, and accuracies on downstream benchmarks (refer to Table 14). + +# 4.1 ABLATION STUDY + +We use the dynamic hyperconnections with an expansion rate of $n = 4$ and include the tanh function as the default method, marked with the suffix -DHC, while -SHC denotes static hyper-connections. + +The evaluation results are presented in Table 1, and the training loss curves are depicted in Fig. 5. We observe that with an expansion rate of $n = 1$ , the performance of DHC is inferior to the baseline. However, for $n > 1$ , DHC significantly outperforms the baseline, achieving superior results at $n = 4$ with the increase to $n = 8$ providing minimal additional benefits. Notably, OLMo-1B-DHC×8 W/O tanh excels on both V2 and V3 validation sets, with a reduction in V2 Eval Loss by 0.034 and V3 Eval Loss by 0.029 compared to the baseline. Furthermore, the decline rate of training losses for DHC ( $n \geq 2$ ) is steeper than that of the baseline, and DHC demonstrates greater stability, with no spikes observed in any DHC experiments. + +Static and dynamic hyper-connections. Table 2 presents an ablation study comparing SHC and DHC. All hyper-connection (HC) variants significantly outperform the baseline. At an expansion rate of 2, the improvements of DHC and SHC are similar. However, at an expansion rate of 4, DHC performs notably better than SHC. + +Table 2: Ablation study on static and dynamic hyper-connections with training on ${500}\mathrm{\;B}$ tokens. + +
MethodsV2 Eval Loss ↓V2 Eval PPL ↓V3 Eval Loss ↓V3 Eval PPL ↓Down Stream Avg, Acc. ↑
OLMo-1B2.81118.0232.54414.22962.5
OLMo-1B-SHC×22.79917.7782.53814.15263.4
OLMo-1B-DHC×22.80217.9502.53414.11463.0
OLMo-1B-DHC×2 W/O tanh2.79217.6632.52914.03363.8
OLMo-1B-SHC×42.79117.6712.52814.02563.6
OLMo-1B-DHC×42.78117.5092.51513.82663.8
OLMo-1B-DHC×4 W/O tanh2.77917.4512.51613.84464.4
+ +The importance of B and $\mathcal{WC}$ . As shown in Table 3, not training $\mathcal{WC}$ leads to significant performance declines, with the V2 loss increasing by 0.021 and the V3 loss by 0.017, as seen when comparing the 4th and 6th lines of Table 3. In contrast, the impact is less pronounced when B is not trained. Therefore, ensuring the trainability of both $\mathcal{WC}$ and B is crucial. + +# 4.2 COMPARISON WITH RELATED WORKS + +We implemented the Altup (Baykal et al., 2024) and ResiDual (Xie et al., 2023) methods in OLMo. Altup is motivated to widen the hidden dimension while maintaining low computation cost by passing only a part of hidden state to transformer blocks. By contrast, ResiDual is proposed to combine both Pre- and Post-Norm in a two-stream style. Both methods expand the hidden size by $n$ times with negligible computational overhead, with ResiDual expanding it exactly 2 times. For a fair comparison, we set $n = 2$ in our experiments. Unfortunately, although these methods show gains in the early stages of training, they are gradually surpassed by the baseline, as demonstrated by the results in Table 4 and the training loss curves in Fig. 15. + +Table 3: Ablation study on OLMo-1B-DHC×4. In the B or Wc column, the symbol "x" denotes parameters that are not trainable from initialization. + +
WCBTanhV2 Eval Loss ↓V2 Eval PPL ↓V3 Eval Loss ↓V3 Eval PPL ↓Down Stream Avg, Acc. ↑
X✓X2.80417.9122.53714.14562.5
✓XX2.78117.4932.51813.87463.6
✓✓X2.77917.7732.51613.82364.4
X✓✓2.80217.9142.53214.07263.4
✓X✓2.78317.5042.52013.90663.4
✓✓✓2.78117.8352.51513.80763.8
+ +Table 4: Performance of related methods on OLMo-1B models. + +
MethodsV2 Eval Loss ↓V2 Eval PPL ↓V3 Eval Loss ↓V3 Eval PPL ↓Down Stream Avg, Acc. ↑
OLMo-1B2.81118.0232.54414.22962.5
OLMo-1B-ResiDual2.82518.3752.55114.34662.0
OLMo-1B-Altup×22.82718.2682.55814.45462.4
OLMo-1B-DHC×22.80217.9502.53414.11463.0
OLMo-1B-DHC×2 W/O tanh2.79217.6632.52914.03363.8
+ +# 4.3 7B MODELS + +![](images/164158a0465ea86f3fec42bc3cc47e0966976700d39e6f837d5384cfcf9e82f8.jpg) +Figure 6: (1) and (2) Training loss (0.99 EMA smoothed) and C4-en validation loss for OLMo-7B and OLMo-7B-DHC×4 models. (3) and (4) Accuracy curves on hellaswag and sciq, demonstrating the superior performance of the OLMo-7B-DHC×4 model. + +![](images/80ab9ed9963d3e8209a663c5444e74158497a17032550df70c55efd49de16c4d.jpg) + +![](images/0b4c61efe148f2fef135a0b42c45b0bcca62c2cb859a2cdd07ac10a17465936b.jpg) + +![](images/17d6f6e78ce805b969770574978262b29951fd66cc4393ce10c68c3ef8dcedc1.jpg) + +We evaluate the effectiveness of hyper-connections on the 7B model, training a model with DHCs with an expansion rate of 4, denoted as OLMo-7B-DHC $\times 4$ . According to Table 5, OLMo-7B-DHC $\times 4$ significantly outperforms the baseline OLMo-7B model in all average metrics. In the V2 evaluation, OLMo-7B-DHC $\times 4$ shows improvements of 0.022 for loss and 0.293 for PPL. Furthermore, the average score of downstream benchmarks 0.710 surpasses the baseline 0.701, with the results of specific tasks shown in Fig. 10. + +Based on Fig 6, the OLMo-7B-DHC $\times 4$ model consistently shows better metrics compared to baseline, including training and validation loss and accuracy in downstream benchmarks. Notably, after $400\mathrm{~B}$ tokens, the model maintains its improvement without the gains diminishing. This indicates that the OLMo-7B-DHC $\times 4$ model continues to provide consistent benefits in reducing loss, even at higher token counts. Furthermore, according to Fig. 6, the baseline model exhibits frequent spikes, while our model with DHCs shows no spikes throughout the training. This shows that our approach not only achieves better loss but also ensures more stable training. + +# 4.4 MOE MODELS + +We evaluate the effectiveness of hyper-connections on the Mixture-of-Experts (MoE) model. We retrain the original OLMoE-1B-7B model as the baseline and train a model that applies Dynamic + +Table 5: Performance of 7B models. FLOPs refers to the computation per token in the forward pass. + +
MethodsParams (B)FLOPs (G)V2 Loss ↓V2 PPL ↓V3 Loss ↓V3 PPL ↓Tasks Avg. Acc. ↑
OLMo-7B6.913.362.58114.3162.32211.32470.1
OLMo-7B-DHC×46.913.382.55914.0232.30411.12071.0
+ +Hyper-Connections (DHC) with $n = 4$ , replacing the residual connections. The full results are shown in Fig. 9, which illustrates that hyper-connections outperform residual connections in almost all metrics. In many metrics, our method requires only half of the training tokens to achieve the same performance as the baseline. Fig. 1 and Table 6 highlight some of the results, such as a reduction in training loss of approximately 0.027, a reduction in loss on the C4-en validation set of 0.028, an improvement of 6 points on the ARC-Challenge and an improvement of 1.2 points on MMLU Var. + +Table 6: Downstream evaluations for MoE models training with 500B tokens under the OLMoE evaluation setting. ARC-C stands for ARC-Challenge, and ARC-E for ARC-Easy. MMLU Var is a modified version of MMLU that includes varying few-shot examples, providing stable feedback during early training, as outlined in the OLMoE setting (Muennighoff et al., 2024). + +
MethodsMMLU VarHella-SwagARC-CARC-EPIQAWino-GrandeBoolQ
OLMoE-1B-7B38.569.541.872.877.664.465.4
OLMoE-1B-7B-DHC×439.770.247.876.778.264.668.5
+ +# 4.5 VISUALIZATION ANALYSIS + +![](images/419112dd6d26c9ffecbc9c03c443a81510e9f57095443753eee570e055ebfd1d.jpg) +Figure 7: Visualization of connection matrices for hyper-connections and various related baseline methods. The attention layers, which have odd ids, are marked with green tick marks. + +In this section, we investigate the learned hyper-connection weights and show how the output of the former layer contributes to the latter ones. To this end, we convert hyper-connections to dense connections cross layers. Consider the input hidden vectors $\mathbf{h}_0^k$ in $k$ -th layer, it can be unfolded as a weighted summation over previous layer outputs: + +$$ +\mathbf {h} _ {0} ^ {k} = \sum_ {j = 0} ^ {k - 1} c _ {k j} ^ {(0)} \mathcal {T} ^ {j} \left(\mathbf {h} _ {0} ^ {j}\right), \tag {20} +$$ + +where $c_{kj}^{(0)}$ describes how much layer- $j$ ( $\mathcal{T}^j$ ) contributes to layer- $k$ 's input $\mathbf{h}_0^k$ . Then, $\mathbf{C}^{(0)}$ denotes a dense connection weight matrix. In particular, let layer-0 be the word embedding and $\mathcal{T}^0$ be an identity mapping, layer- $L + 1$ be the hidden state before the unembedding layer, which is a summation over the last hidden vectors, i.e., $\mathbf{h}_0^{L + 1} = \sum_j\mathbf{h}_j^L$ . + +OLMo-1B-DHC $\times 4$ model is adopted for visualization. We take the checkpoint at 500B tokens and forward random validation text to obtain dynamic hyper-connection weights. In addition, we show connection patterns for some related baseline methods. Finally, the visualization is illustrated in Fig. 13. We present the following findings, with more detailed discussions provided in Appendix F. + +Connection patterns for baseline methods. For Pre-Norm baseline, the connection matrix is simply a lower triangular matrix with diagonal elements erased, because each transformer layer joins the residual equally. In the Pre-Norm parallel transformer block (PTB) baseline, the connection matrix appears jagged because the input to the FFN layer does not depend on the output of the previous attention layer. For Post-Norm baseline, the connection only holds for adjacent layers, as the weight for bottom layers decays every time the residual passes a post-norm layer. For the two-hop residual baseline (Ma et al., 2024), the outputs of attention layers are not added to residual and only contributes to the next one FFN layer, resulting in a vertical strip pattern in the connection matrix. + +$\Lambda$ -shaped connection pattern. In the connection matrix for hyper-connections, a long-term decay pattern can be observed, where layers are generally preferred to rely on a few adjacent layer outputs. Moreover, the bottom layers (e.g. layer 0,2) are observed frequently used in most of subsequent layers. Therefore, the two patterns together form a $\Lambda$ -shaped connection pattern. Note that the long-term decay pattern is a Post-Norm style pattern, while the frequently accessed pattern is Pre-Norm style, indicating that the hyper-connection introduces a free mixture of Pre- and Post-Norm architecture. + +Input word embedding is eliminated from model output. As per the first column in the connection matrix for layer inputs, the input word embedding contributes to most of the layers except for the final one. This last layer, which products the model's output, is used for next token prediction. In most cases, keeping a component of input embedding in model output is harmful to next token prediction, especially when using a tied word embedding such as that employed by OLMo-1B. Similar results are found in previous works (Ma et al., 2023). + +Parallel transformer blocks are observed. As discussed in § 3.2, parallel transformer block, which performs attention and FFN in parallel, is a special case for hyper-connection. In practice, PTB-like patterns, which can be identified by the local jagged pattern, are surprisingly observed to be learned by hyper-connections. For instance, layer 11 has a minimal contribution to the input of layer 12 (refer to row 12 in the hyper-connection connection matrix). This suggests that layers 11 and 12 can operate in parallel, thereby forming a PTB module. + +Attention layers tend to have fewer long-term connections. It is observed that attention layers at the bottom barely have long-term contribution, a trend that persists until layer 17. Upon examining the connection matrix for hyper hiddens (refer to Fig. 13 in the appendix), it's evident that the outputs of the FFN layers have significantly greater magnitudes than those of the attention layers. This pattern resembles a two-hop residual connection design, wherein the attention output contributes to the input of the following FFN layer, but doesn't join the main residual path. + +# 5 RELATED WORK + +Transformers (Vaswani et al., 2017) have revolutionized various fields, particularly natural language processing and computer vision. They rely heavily on residual connections to facilitate the training of deep models. Our hyper-connections approach can replace residual connections, providing stable training and consistent improvements in both natural language processing and computer vision. + +The issues of gradient vanishing and representation collapse (Bengio et al., 1994; Glorot & Bengio, 2010; Liu et al., 2020) have been extensively studied. The combinations of normalization techniques (Ioffe & Szegedy, 2015; Ba et al., 2016) and residual connections (He et al., 2016), like Pre-Norm and Post-Norm, actually reflects different emphases in solving these two issues. However, despite these advancements, the fundamental trade-off between gradient vanishing and representation collapse in deep networks remains a critical challenge. Building on these findings, our work introduces a novel approach that enables neural networks to autonomously learn the optimal strength of connections, potentially improving both gradient stability and representation quality. + +# 6 CONCLUSION + +In conclusion, we have introduced hyper-connections as an effective alternative to residual connections in transformers. Our analysis reveals that hyper-connections not only overcome the limitations of residuals but also enable dynamic adjustments in network architecture. Experimental results confirm their promising benefits across various tasks, including pre-training of large language model, image generation, and image classification. + +# ACKNOWLEDGEMENTS + +This research was conducted at ByteDance Inc. We are grateful for the suggestions and assistance provided by Yaowei Zheng, Yuyu Zhang, Yunshui Li, Xiang Li, Bairen Yi, Zhenyi Lu and Xintian Han. + +# REFERENCES + +Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. In arXiv preprint arXiv:1607.06450, 2016. +Cenk Baykal, Dylan Cutler, Nishanth Dikkala, Nikhil Ghosh, Rina Panigrahy, and Xin Wang. Alternating updates for efficient transformers. Advances in Neural Information Processing Systems, 36, 2024. +Yoshua Bengio, Patrice Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE transactions on neural networks, 5(2), 1994. +Yonatan Bisk, Rowan Zellers, Jianfeng Gao, Yejin Choi, et al. Piqa: Reasoning about physical commonsense in natural language. In Proceedings of the AAAI conference on artificial intelligence, volume 34, 2020. +Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. Boolq: Exploring the surprising difficulty of natural yes/no questions. arXiv preprint arXiv:1905.10044, 2019. +Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv:1803.05457v1, 2018. +Ido Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual entailment challenge. In Machine learning challenges workshop. Springer, 2005. +Marie-Catherine De Marneffe, Mandy Simons, and Judith Tonhauser. The commitmentbank: Investigating projection in naturally occurring discourse. In proceedings of Sinn und Bedeutung, volume 23, 2019. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition. IEEE, 2009. +Bill Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Third international workshop on paraphrasing (IWP2005), 2005. +Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. +Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics. JMLR Workshop and Conference Proceedings, 2010. +Dirk Groeneveld, Iz Beltagy, Pete Walsh, Akshita Bhagia, Rodney Kinney, Oyvind Tafjord, Ananya Harsh Jha, Hamish Ivison, Ian Magnusson, Yizhong Wang, et al. Olmo: Accelerating the science of language models. arXiv preprint arXiv:2402.00838, 2024. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2016. + +Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. Proceedings of the International Conference on Learning Representations (ICLR), 2021. +Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning. PMLR, 2015. +Matt Gardner Johannes Welbl, Nelson F. Liu. Crowdsourcing multiple choice science questions. 2017. +Vijay Korthikanti, Jared Casper, Sangkug Lym, Lawrence McAfee, Michael Andersch, Mohammad Shoeybi, and Bryan Catanzaro. Reducing activation recomputation in large transformer models. arXiv preprint arXiv:2205.05198, 2022. +Liyuan Liu, Xiaodong Liu, Jianfeng Gao, Weizhu Chen, and Jiawei Han. Understanding the difficulty of training transformers. arXiv preprint arXiv:2004.08249, 2020. +Haoyan Ma, Xiang Li, Xia Yuan, and Chunxia Zhao. Denseformer: A dense transformer framework for person re-identification. IET Computer Vision, 17(5), 2023. +Xuezhe Ma, Xiaomeng Yang, Wenhan Xiong, Beidi Chen, Lili Yu, Hao Zhang, Jonathan May, Luke Zettlemoyer, Omer Levy, and Chunting Zhou. Megalodon: Efficient llm pretraining and inference with unlimited context length. arXiv preprint arXiv:2404.08801, 2024. +Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. In EMNLP, 2018. +Niklas Muennighoff, Luca Soldaini, Dirk Groeneveld, Kyle Lo, Jacob Morrison, Sewon Min, Weijia Shi, Pete Walsh, Oyvind Tafjord, Nathan Lambert, Yuling Gu, Shane Arora, Akshita Bhagia, Dustin Schwenk, David Wadden, Alexander Wettig, Binyuan Hui, Tim Dettmers, Douwe Kiela, Ali Farhadi, Noah A. Smith, Pang Wei Koh, Amanpreet Singh, and Hannaneh Hajishirzi. Olmoe: Open mixture-of-experts language models, 2024. URL https://arxiv.org/abs/2409.02060. +William Peebles and Saining Xie. Scalable diffusion models with transformers. arXiv preprint arXiv:2212.09748, 2022. +Melissa Roemmele, Cosmin Adrian Bejan, and Andrew S Gordon. Choice of plausible alternatives: An evaluation of commonsense causal reasoning. In 2011 AAAI spring symposium series, 2011. +Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adversarial winograd schema challenge at scale. Communications of the ACM, 64(9), 2021. +Maarten Sap, Hannah Rashkin, Derek Chen, Ronan LeBras, and Yejin Choi. Socialiaq: Commonsense reasoning about social interactions. arXiv preprint arXiv:1904.09728, 2019. +N Shazeer, A Mirhoseini, K Maziarz, A Davis, Q Le, G Hinton, and J Dean. The sparsely-gated mixture-of-experts layer. Outrageously large neural networks, 2017. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, 2013. +Luca Soldaini, Rodney Kinney, Akshita Bhagia, Dustin Schwenk, David Atkinson, Russell Authur, Ben Bogin, Khyathi Chandu, Jennifer Dumas, Yanai Elazar, et al. Dolma: An open corpus of three trillion tokens for language model pretraining research. arXiv preprint arXiv:2402.00159, 2024. +Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. Commonsenseqa: A question answering challenge targeting commonsense knowledge. arXiv preprint arXiv:1811.00937, 2018. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, 2017. + +Ben Wang. Mesh-Transformer-JAX: Model-Parallel Implementation of Transformer Language Model with JAX. https://github.com/kingofflolz/mesh-transformer-jax, May 2021. +Mitchell Wortsman, Peter J Liu, Lechao Xiao, Katie Everett, Alex Alemi, Ben Adlam, John D Co-Reyes, Izzeddin Gur, Abhishek Kumar, Roman Novak, et al. Small-scale proxies for large-scale transformer training instabilities. arXiv preprint arXiv:2309.14322, 2023. +Shufang Xie, Huishuai Zhang, Junliang Guo, Xu Tan, Jiang Bian, Hany Hassan Awadalla, Arul Menezes, Tao Qin, and Rui Yan. Residual: Transformer with dual residual connections. arXiv preprint arXiv:2304.14802, 2023. +Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? arXiv preprint arXiv:1905.07830, 2019. +Biao Zhang and Rico Sennrich. Root mean square layer normalization. Advances in Neural Information Processing Systems, 32, 2019. + +# A TRANSFORMER WITH HYPER-CONNECTIONS + +![](images/8bcfb1ad9b78647fc03844b67509f2c4263565b5663dfa96dc88c5da80d9b0f7.jpg) +Figure 8: Comparison between transformers with hyper-connections and that with residual connections. + +# B PARAMETERS,COMPUTATION AND MEMORY FOOTPRINT ANALYSIS + +Static Hyper-Connections. All learnable parameters are included in the hyper-connection matrix $\mathcal{H}\mathcal{C}$ in Eq. 1. The number of parameters in one $\mathcal{H}\mathcal{C}$ is given by: + +$$ +\left| \theta_ {\mathrm {S H C}} \right| = \left| \theta_ {\mathbf {B}} \right| + \left| \theta_ {\mathbf {A}} \right| = n + n \cdot (n + 1) = n \cdot (n + 2), \tag {21} +$$ + +where $n$ is the expansion rate, $|\theta_{\mathbf{B}}|$ is the number of parameters in $\mathbf{B}$ in SHC, and $|\theta_{\mathbf{A}}|$ is the number of parameters in $\mathbf{A}$ . Each layer contains two hyper-connection modules (one for the self attention and one for the feedforward network). Thus, the number of extra parameters is: + +$$ +P _ {\text {e x t r a}} = \left| \theta_ {\mathrm {S H C}} \right| \times 2 \times L, \tag {22} +$$ + +where $L$ is the number of layers. For example, in OLMo-1B-SHC×4, $P_{\text{extra}} = 4 \times (4 + 2) \times 2 \times 16 = 768$ . + +Dynamic Hyper-Connections. The parameters of DHC are defined in Eqs. 10, 11, 12, and 13, and the number of parameters is given by: + +$$ +\begin{array}{l} \left| \theta_ {\mathrm {D H C}} \right| = \left| \theta_ {\text {n o r m}} \right| + \left| s _ {\beta} \right| + \left| \theta_ {\mathbf {W} _ {\beta}} \right| + \left| \theta_ {\mathbf {B}} \right| + \left| s _ {\alpha} \right| + \left| \theta_ {\mathbf {W} _ {m}} \right| + \left| \theta_ {\mathbf {A} _ {m}} \right| + \left| \theta_ {\mathbf {W} _ {r}} \right| + \left| \theta_ {\mathbf {A} _ {r}} \right| (23) \\ = \left| \theta_ {\text {n o r m}} \right| + 1 + d _ {\text {m o d e l}} + n + 1 + d _ {\text {m o d e l}} + n + d _ {\text {m o d e l}} \times n + n \times n (24) \\ = \left| \theta_ {\text {n o r m}} \right| + d _ {\text {m o d e l}} \times (n + 2) + n \times (n + 2) + 2, (25) \\ \end{array} +$$ + +where $d_{\mathrm{model}}$ is the dimension of the hidden states in the transformer, and $|\theta_{\mathrm{norm}}|$ depends on the type of normalization module. In OLMo models, there are no parameters for normalization, so $|\theta_{\mathrm{norm}}| = 0$ . In OLMoE, $|\theta_{\mathrm{norm}}| = d_{\mathrm{model}}$ . Similar to the static hyper-connections, the number of extra parameters is: + +$$ +P _ {\text {e x t r a}} = \left| \theta_ {\mathrm {D H C}} \right| \times 2 \times L, \tag {26} +$$ + +For example, for OLMo-1B-DHC $\times 4$ , $P_{\mathrm{extra}} = (0 + 2048 \times (4 + 2) + 4 \times (4 + 2) + 2) \times 2 \times 16 = 394.048$ . + +The number of parameters for DHC and SHC used in the experiments is detailed in Table 7, while their corresponding FLOPs comparisons are provided in Table 8. Regardless of whether SHC or DHC is used, the additional parameters and computational overhead introduced are minimal and can be considered negligible. + +Table 7: Comparison of number of parameters. + +
MethodHC Params(B)Total Params(B)Total Params Δ rate (%)
OLMo-1B-1.17676442-
OLMo-1B-SHC×20.00000261.17676467+0.00002%
OLMo-1B-SHC×40.00000771.17676518+0.00007%
OLMo-1B-DHC×20.00026251.17702688+0.02230%
OLMo-1B-DHC×40.00039401.17715846+0.03349%
OLMo-7B-6.88809574-
OLMo-7B-DHC×40.00131246.88967027+0.02286%
OLMoE-1B-7B-6.91909427-
OLMoE-1B-7B-DHC×40.00039406.91948832+0.00570%
+ +**Computation Analysis.** The main computational cost of SHC and DHC lies in line 5 of Algorithm 1, where the complexity is $\mathcal{O}(d_{\mathrm{model}} \times n \times (n + 1))$ . The computational cost of the FFN is $\mathcal{O}(2 \times d_{\mathrm{model}} \times d_{\mathrm{ffn}})$ , and that of the projection part of attention is $\mathcal{O}(4 \times d_{\mathrm{model}} \times d_{\mathrm{model}})$ . Since $\mathcal{O}(d_{\mathrm{model}} \times n \times (n + 1)) \ll \mathcal{O}(4 \times d_{\mathrm{model}} \times d_{\mathrm{model}}) < \mathcal{O}(2 \times d_{\mathrm{model}} \times d_{\mathrm{ffn}})$ , the computational cost of HC is negligible compared to the cost of both FFN and the attention projection part. Here, $d_{\mathrm{ffn}}$ is the inner dimension of the FFN. The detailed computation cost statistics are presented in Table 8. + +Table 8: FLOPs per token in forward pass. + +
MethodHC FLOPs (G)Total FLOPs (G)Total FLOPs Δ rate (%)
OLMo-1B-2.3536-
OLMo-1B-SHC×20.00102.3545+0.038%
OLMo-1B-SHC×40.00312.3566+0.127%
OLMo-1B-DHC×20.00202.3554+0.076%
OLMo-1B-DHC×40.00492.3583+0.200%
OLMo-7B-13.3647-
OLMo-7B-DHC×40.019713.3844+0.147%
OLMoE-1B-7B-2.3580-
OLMoE-1B-7B-DHC×40.00492.3629+0.208%
+ +Memory Footprint. The introduction of HC results in a minor increase in activation memory usage during training. For a transformer model with $L$ layers, a model dimension of $d_{\mathrm{model}}$ , batch size $b$ , sequence length $s$ , and number of attention heads $a$ , the activation memory is calculated as $sbd_{\mathrm{model}}L(34 + 5as / d_{\mathrm{model}})$ , as outlined in Korthikanti et al. (2022). Incorporating HC with an expansion rate of $n$ adds an extra memory overhead of $2nsbd_{\mathrm{model}}L$ . For $n = 2$ , this contributes less than $15\%$ to the total memory usage of a standard transformer. Notably, the memory consumption is mostly driven by the weight parameters, which experience only a slight increase with HC. Additionally, given HC's low computational cost, the hidden states generated by HC can be discarded post forward pass and recomputed during backpropagation to further optimize memory usage. With this approach, the additional memory requirement is reduced to $nsbd_{\mathrm{model}}$ . During inference, the memory usage for activations is largely determined by the Key-Value cache, which is not impacted by the extra activations brought by HC. Moreover, the hidden states from earlier layers can be released as soon as the next layer's computations start, significantly lowering memory requirements. The actual memory footprint is empirically measured on 8 GPUs, as shown in Table 9. + +Table 9: Measured Memory Footprint on 8 GPUs. + +
MethodMemory (GB)Memory Δ Rate (%)Micro Batch Size (tokens per GPU)
OLMo-1B41.11-16,384
OLMo-1B-SHC×247.55+15.7%16,384
OLMo-1B-SHC×451.85+26.0%16,384
OLMo-1B-DHC×247.56+15.7%16,384
OLMo-1B-DHC×451.86+26.1%16,384
OLMo-7B26.27-2,048
OLMo-7B-DHC×433.70+28.28%2,048
OLMoE-1B-7B31.59-4,096
OLMoE-1B-7B-DHC×434.65+9.7%4,096
+ +# C MOE 1B/7B MODEL EXPERIMENTS + +![](images/b23ae9b25ca8e1994d0cac6695f2271312a7b9343617cc8a076d1be679028830.jpg) + +![](images/3c8bd4784a1fa271eaba82071ddc1b029c2eb99b8beab7338b647cfe632ce767.jpg) + +![](images/a6be7474cafddfc80fd20a8e4cbf1f51f8f53322f6baee7fe23ce72e4e726641.jpg) + +![](images/3eadee715f336c0eaa4b6394774ad990c6b674419d2dc2af3c5fb4e52d0c9f79.jpg) + +![](images/34f76ebbe3d39ac1377ed9903066d6cd7bf33de310862f7a3082d9aa0d7ddd51.jpg) + +![](images/0d289f470e22e53b1b296e418a3100855d7312c7fa9d032f82ce18a60e159cb7.jpg) + +![](images/1fcb639c45e37fd4ae8a38aebb950235f4bec4cf2d8c0325b2b83eafa2260028.jpg) + +![](images/aa7913789ce8d02a645214131c40703bd68df5200cc139c32a9fd854439fd533.jpg) + +![](images/bf42197a54325ad289232b04b04f2ca69b559e4763f1ee03a412bfd5a5d62b6e.jpg) + +![](images/5ca98ccf149274823a948ffdfa2402110c7c5d3f3434d3367b71ac27723d52a0.jpg) + +![](images/bbb8c4921e6cb48e036c058bd32178e372832269b9e6a2680186a5a3f3471787.jpg) + +![](images/ba0439dd9aeb0d57eccc0403659a2c148e60a09ed3ca188259b14064a2dc77a7.jpg) + +![](images/47a0fa3861adaf47bc52b0807c0e1eea8be19e1c5436af0eff00020d5f64f937.jpg) + +![](images/4e29545e92ab63cc0b016612d96ef1b85634df798335c819c213dce4515159c4.jpg) + +![](images/bdfaecbcfdd67ff8ec7117996c04b21354d059f0c987fa7040d866dc0179f0a7.jpg) + +![](images/e93970051f17706dee0a0a59de4e1fe6a05705e9b5a25530e8a43c853a1e7ffb.jpg) + +![](images/2628089528631af32975713ba6c89b7d568901cb92a0a955f0cbe054d04d3462.jpg) +Figure 9: Loss curves in V3 validation sets and accuracy curves on downstream tasks for OLMoE-1B7B and OLMoE-1B7B-DHC×4 models. + +![](images/ce13bf5865ece9986fd076885a4765569d53f8576c0233d259265a27c3931ee6.jpg) + +![](images/589dfd744a7570706aeed8cdd027865ae44c5fc28be7ace684777cbd100b2daa.jpg) + +![](images/183933d25e97cc537d7e430f171b528d1fab20bc30ffe315a0142179ce2bfd31.jpg) + +![](images/70b3a168794ad1967efc7500f9529c00f2a48c85eec73b4b83382aedd644273c.jpg) + +![](images/a0c542aceef95fb90cdc30c9a58789eb0a25a59c9d70e3f255169afea36631b1.jpg) + +![](images/e12c4c6bd0ce7c4b76eb58811ff8633680039117d4af016c8dd0ec638a9a1ea7.jpg) + +![](images/85c8d92bae62fa95385724ac884ccc211902e230a3d19ba1ccfce2c00b4b24ae.jpg) + +![](images/b3e4d396f4978fef1484624c3a185b6f8780913dfc534a236633428f097c8f18.jpg) + +![](images/4ef948fe27963aec04d106c8ffc0e88e0193149ae3d76fb152347ef0989018fc.jpg) + +![](images/4ba4eb385082be15078924d4c2dd5dda0432327a220beef7adb8c3315e107e81.jpg) + +![](images/7223d6329f22340477a8058b36cbc827f00844acc97651a695ee9523330f4389.jpg) + +# D 7B MODEL EXPERIMENTS + +![](images/fa17b9a77870bcb430446270b5fd478704d72a0f241c1b2a8e195b34b8a5d4d5.jpg) +c4 en val. loss + +![](images/e37dbcb999f4fe758c7b97a23da7a5ff7113c5da113e0c846b91f523ca2d5578.jpg) +dolma books val, loss + +![](images/39f00e3d913425cc1ef9b8ddc26e6e4f0df65d1a587f03ed3a574b80ea355ad6.jpg) +dolma cc val, loss + +![](images/41c858afabcf2b3fd59a3b7d3a6e7ea4e4e13891f306c112d4274ed7cbe9fbc7.jpg) +dolma_pes2o val. loss + +![](images/bac724bdb612181cb534751345e04c37ee7ca406fa90fa804d7753e75cf5e3ab.jpg) +dolma reddit val. loss + +![](images/a7a1fa966f0ac254af19125852a707a0ce0534b98184154a1644855ea2748451.jpg) +dolma stack val. loss + +![](images/6bd5c82d1b7514a62e7607a181f5b9740b4a1618b95816179b31e4f37970e813.jpg) +dolma wiki val. loss + +![](images/b4d56ce6b1f94fad9c8120b0d9e8202fd0dd938a2e094fc544c4c5c642fe0dfe.jpg) +ice val. loss + +![](images/4df2a2c4e9b024f272613224b30f243eac9b8a4156c448d2b93e11b37a8ec3ec.jpg) +m2d2-s2orc val. loss + +![](images/53c581e0502510eb8a8c5a3b38c78c95457a633aa8944c81def8856355ef3251.jpg) +pile val. loss + +![](images/a0ca741d0cc7a6145e9a865be4327797caef647abee5be6829d0567583fbd076.jpg) +wiktext 103 val. loss + +![](images/891cc3823d47d1034b348dd6dcd9757cc831276b78ddf0496ae30be5b8406b42.jpg) +HellaSwag Acc. $(\%)$ +Openbook QA Acc. $(\%)$ + +![](images/6ce817ccc7ffd27a461753def85b4db222340d941cb2b0468c4ebf6b2ee76e5e.jpg) +SciQ Acc. (%) + +![](images/9eae81ad0dd50a8944b40a5eebf29f02eb3434d52acb649015a52aaa87f6cb75.jpg) +COPA Acc. (%) + +![](images/a4d92e8694b2e7492d85b2d99e425e9de68e0d9cbd39f0245f409a7eb0b1a26d.jpg) + +![](images/bda582effd3072d2b53160732288242131606535b5bbf54ba7ad16d9621dd409.jpg) +PIQA Acc. $(\%)$ +Figure 10: Loss curves in V3 validation set and accuracy curves on downstream tasks for OLMo-7B and OLMo-7B-DHC $\times 4$ models. + +![](images/e6d5035c6b04519d52a82acf23e1e2c0a6a5b26b4cbcceab9f612a0157c47766.jpg) +WinoGrande Acc. $(\%)$ + +![](images/f46e5ebb0559ae806f0b1667f3850b20b0d8b8d8a75cac1e4de57b00a53fa80c.jpg) +ARC-Easy Acc. $(\%)$ + +# E VISION EXPERIMENTS + +Datasets. We use the ILSVRC-2012 ImageNet dataset (Deng et al., 2009) with 1k classes and 1.3M images (see ImageNet in the following) for image generation and classification. + +# E.1 IMAGE GENERATION + +To investigate the generalizability of hyper-connections in image generation, our experiments are conducted using the DiT framework (Peebles & Xie, 2022) training the models for 1400 epochs. In order to save experimental costs, we use FP16 precision, introduce flash-attention to speed up training, and introduce QK-Norm (Wortsman et al., 2023) to stabilize training. + +Table 10: Benchmarking class-conditional image generation on ImageNet $256 \times 256$ , with $\mathrm{cfg} = 1.50$ . NP, P, and R are short for Numerical Precision, Precision, and Recall, respectively. + +
MethodNPQK-NormSize (M)FID↓sFID↓IS↑P↑R↑
DiT-XL/2FP32×6752.274.60278.240.830.57
DiT-XL/2FP16✓6752.364.54269.460.830.58
DiT-1B/2FP16✓9832.134.50288.690.820.59
DiT-XL/2-SHC×2FP16✓6752.184.52287.240.820.60
+ +Our experimental results demonstrate that DiT models incorporating hyper-connections exhibit comparable performance metrics to DiT models with $50\%$ more parameters. This finding underscores the efficiency and efficacy of hyper-connections in enhancing model performance without increasing model size. + +# E.2 IMAGE CLASSIFICATION + +For the image classification experiments, we train ViT/16-Base and ViT/16-Large models with images at a resolution of $224 \times 224$ for 300 epochs, following the experimental setup used by (Dosovitskiy et al., 2020). To speed up the training process, we use bfloat16 numerical precision. The training configuration is detailed in Table 12. Within this configuration, we replace the residual connections with static and dynamic hyper-connections, referred to as SHC and DHC, respectively, using an expansion rate of $n = 2$ . The top-1 accuracy results are presented in Table 11, and the training loss curves for ViT/16-Large and ViT/16-Large with $\mathrm{DHC} \times 2$ are shown in Fig. 11. + +For the Base model (85M), our re-implemented ViT/16 achieves $76.38\%$ accuracy on $224 \times 224$ images. The SHC and DHC enhance performance to $77.60\%$ and $77.26\%$ , respectively. representing relative increases of $1.22\%$ and $0.88\%$ . For the Large model (307M parameters), ViT/16 achieves $77.25\%$ accuracy. The SHC and DHC configurations further enhance accuracy to $78.38\%$ and $79.94\%$ , respectively. This corresponds to relative improvements of $1.13\%$ and $2.69\%$ , with DHC showing the highest performance. These results demonstrate that hyper-connections (SHC and DHC) significantly improve accuracy, especially in the Large model scale. + +Table 11: Accuracy on ImageNet. ViT*/16 refers to the results reported by (Dosovitskiy et al., 2020), whereas ViT/16 denotes our re-implemented baseline. SHC and DHC indicate that residual connections are replaced with static and dynamic hyper-connections, respectively. + +
Model ScalesParams (M)ViT*/16ViT/16ViT/16-SHC×2ViT/16-DHC×2
384 × 384224 × 224
Base8577.9176.3877.6077.26
Large30776.5377.2578.3879.94
+ +![](images/2561e01fc30477e60c4c0a8e8d5b685c0fec88e10b2d73aa378bab46269b421c.jpg) +Figure 11: Training loss curves of ViT/16-Large and ViT/16-Large-DHC×2, smoothed using an Exponential Moving Average (EMA) with a decay rate of 0.999. The gain from Hyper-Connections decreases as training progresses, likely due to pass over the same dataset across many epochs, resulting in diminishing returns from the additional capacity provided by Hyper-Connections. + +# E.3 VISULATION OF DHC + +We randomly select three categories from the ImageNet dataset and sample the corresponding examples from the validation set. These samples are fed into the ViT-Base/16-DHC×2 model to compute the dynamic connection weights of the DHC in the final layer. As shown in Fig. 12, we visualize the distribution of these weights. We observe that the intra-class distribution of beta is highly concentrated, indicating that samples within the same category tend to have similar beta values. In contrast, the distribution of alpha is less concentrated, but the differences between the distributions of different categories are more pronounced, as exemplified by $\alpha_{2,0}$ . + +Table 12: Training hyperparameters for ViT. + +
HyperparameterValue
Learning Rate (lr)0.003
Batch Size4096
SchedulerCosine Annealing with Linear Warmup (10k steps)
Data AugmentationMixup (α = 0.2)
Epochs300
OptimizerAdamW (β1 = 0.9, β2 = 0.999, ε = 1e-8)
Gradient Clipping1.0
Weight Decay0.3
Dropout0.1
Precisionbf16
+ +![](images/7dea035897ec3c65a717f2bb58437a157e0eb30758568ea634c67c2a3c8f7374.jpg) + +![](images/ec48e13e699d7e7ae70580e02c7be63b6094d021b4cca3f60ed022e6f9dbe3c3.jpg) + +![](images/0a18b91a1fd829839f80546e08b726103788dbc3a78f7b7bfe1bde4e82416556.jpg) + +![](images/cc5846c840845d09ee521b5410d9f9ebe55f7c27de6afa1ff590545da1e6074d.jpg) + +![](images/838d11d276e99e2499665a3ef2a8191a83f59a79658f3b23060f108f4378b724.jpg) + +![](images/df6053e2554968e0d7cf9dd9b3b9d1bc28a833873aec3ba06f4cdd5a9935a1af.jpg) + +![](images/0ad839f0de98d253c75676f19ff0b731573c57a2f5fe5b2a9d221cc6eb3daaed.jpg) + +![](images/06d6da9a5169d711238f8002e8356fd53784ac9bb6d5afe1a760da212ea4f978.jpg) + +![](images/9ed8cecb9ee7f917942a3034020be579ff6eb0b3755b0c80100a92c96499c562.jpg) + +![](images/ee0b4ccc4cdbcd443ff997950ca61e56fd6f4c8a7aadd3fa5f10bd5527542806.jpg) + +![](images/3f9821fff896e24f8e7f00688df3007b22ecaa17a9038097905ce63629d0c5b1.jpg) + +![](images/7146aae4ec2b583dfe83830ef22d56309af7fa046d7ea0a1cccd8256da2384e4.jpg) + +![](images/13d52b48a70c40843652363b4198ce4f67067fa357fe63917fae97dc7bc636b7.jpg) + +![](images/5757570ae05d70f47f2b3e14d774a2a42292c6362610bbd713f6bf144bae085c.jpg) + +![](images/444cf03dec12389dbba03fa569e8d5a78a10ee84fbbab3fba1f1c5077c301701.jpg) + +![](images/68da942bb6b5aed2f2e1a55540c085abf9e7468c4a12476003b6d6068a55c19c.jpg) + +![](images/8f1ad3aaba25ac83e30b7f0da04cd0284b69edea687f552de09ed42d57225a2f.jpg) + +![](images/2dfc93d1d56912e610bb02164b890c651b7e1d791afdaba5ee1c091f1c9978da.jpg) + +![](images/960225c0cf19ec6556f80905c83127e63fc5b69c5b540fe54513c254923f19d8.jpg) +Figure 12: Distribution of weights of last DHC in ViT-Base/16-DHC $\times 2$ model. + +![](images/befab158009df3359c65a3d92fc84f893a628187c88a77626aa4b2c7dfb03535.jpg) + +![](images/ced955e1badf3705f5eb259040b9b09de9e8b1096b5c59b9b35c166b1bb920ce.jpg) + +# F MORE VISUALIZATION AND ANALYSIS + +Unfolding hyper-connections. We first introduce how to determine the connection matrix $\mathbf{C}^{(0)}$ for hyper-connections. To simplify writing, the layer output $\mathcal{T}^k (\mathbf{h}_0^k)$ is denoted by $\mathcal{T}^k$ for short. The + +![](images/a39785869ece17f357f7f0b34bfc1f5c031365ffb7e55fd7fb00224850881555.jpg) + +![](images/8eaa5eb234ba7b403bdde2491927a03c7290799c6ddcfae1b8a552d2ec6238a4.jpg) + +![](images/2f090facd0a13d1dfe720f171e0ab0cc4b04f2b9d7edb65ed368fd5c82fab3ae.jpg) + +![](images/0cfc4c1c3a1a43ea88037baf698e2d8716da25c9201de15217623b2e8d6b16d0.jpg) + +![](images/d06011ae8da51a004ca74f3bdfdaf40caf6040d145da7b9847a1177b75b1a718.jpg) + +![](images/1d180e0a6a6a6713282c3f72cbf4549f0af40060f8f6b540b01127c094d8e7c6.jpg) + +![](images/25369046c6cd555dd96baa1d255be0d5ed44c67c8adbe2b3f339f76f0bcfb468.jpg) +Figure 13: Visualization of unfolded connection matrix. Matrices from left to right are $\mathbf{C}^{(0)}(\mathrm{Connections~for~}\{\mathbf{h}_0^j\}_{j = 0}^{L + 1})$ , $\mathbf{C}^{(i)}$ (Connections for $\{\mathbf{h}'_i^j\}_{j = 0}^{L + 1}$ ) for $i\in \{1,2,3,4\}$ . The attention layers, which have odd ids, are marked with green tick marks. + +![](images/73252f4e20a93ed46407b7c0184ca5ad316c2fcdce187051e56ede2190e99b53.jpg) +(a) Connection matrix for DHC model. + +![](images/767b4768cac54ea05c07c6299a1f037eb6f0b792f45cab7a0355cbe54c8f575d.jpg) + +![](images/7f0803f1dfaca46c92ba2eb480ac05b425b404c6f56cbf0c60226c90b1156b43.jpg) +(b) Connection matrix for SHC model. + +![](images/196ff76842d65b4a0fc6575281faa40ce9e8a7de254120fda1fbd513ea9712b1.jpg) + +![](images/3151497ef4beaa1bb6e7044332e35dddf994b66ed160645d2d1beb42db5eba70.jpg) + +recurrent form of hyper connection in Eq. 2 is expanded as follows: + +$$ +\begin{array}{l} \mathbf {h} _ {\mathbf {0}} ^ {k} = \mathbf {H} ^ {k ^ {\intercal}} \mathbf {A} _ {\mathbf {m}} ^ {k} = \left(\mathcal {T} ^ {k - 1} \mathbf {B} ^ {k - 1} + \mathbf {H} ^ {k - 1 ^ {\intercal}} \mathbf {A} _ {\mathbf {r}} ^ {k - 1}\right) \mathbf {A} _ {\mathbf {m}} ^ {k} \\ = \sum_ {j = 0} ^ {k - 1} \mathcal {T} ^ {j} \mathbf {B} ^ {j} \left(\mathbf {A _ {r}} ^ {j + 1} \mathbf {A _ {r}} ^ {j + 2} \dots \mathbf {A _ {r}} ^ {k - 1}\right) \mathbf {A _ {m}} ^ {k} \\ = \sum_ {j = 0} ^ {k - 1} \mathcal {T} ^ {j} \mathbf {B} ^ {j} \left(\prod_ {t = j + 1} ^ {k - 1} \mathbf {A} _ {\mathbf {r}} ^ {t}\right) \mathbf {A} _ {\mathbf {m}} ^ {k}. \tag {27} \\ \end{array} +$$ + +Therefore, we obtain connection matrix $c_{kj}^{(0)} = \mathbf{B}^j (\prod_{t = j + 1}^{k - 1}\mathbf{A_r}^t)\mathbf{A_m}^k$ . Similarly, the connection matrix $\mathbf{C}^{(i)}$ for the $i$ -th hyper hidden from $k$ -th layer can be computed by substituting the last $\mathbf{A}_{\mathbf{m}}^{k}$ with $\mathbf{A}_{\mathbf{r}}^{k}$ in Eq. 27, i.e., + +$$ +\mathbf {H} ^ {\prime k} = \mathbf {A} _ {\mathbf {r}} ^ {k ^ {\intercal}} \mathbf {H} ^ {k} = \sum_ {j = 0} ^ {k - 1} \left(\prod_ {t = j + 1} ^ {k} \mathbf {A} _ {\mathbf {r}} ^ {t}\right) ^ {\intercal} \mathbf {B} ^ {j ^ {\intercal}} \mathcal {T} ^ {j ^ {\intercal}} \tag {28} +$$ + +$$ +c _ {k j} ^ {(i)} = \left(\left(\prod_ {t = j + 1} ^ {k} \mathbf {A} _ {\mathbf {r}} ^ {t}\right) ^ {\intercal} \mathbf {B} ^ {j \intercal}\right) _ {i}. \tag {29} +$$ + +Visualization for hyper hidden. We visualize connection matrices for hyper hiddens in Fig. 13 to reveal how hyper-connection maintains intermediate layer outputs. First of all, the four hyper hiddens are dissimilar and show completely different connection patterns. Then, we can see outputs from FFN layers are preserved long-termly in hyper hiddens, while attention layers are reserved less. It is also observed that the long-term connections are usually stored in pairs of hyper hiddens, where the connection is positive in one hyper hidden but negative in the other, for example, column 0 and 2 in $\mathbf{C}^{(1)},\mathbf{C}^{(3)}$ . With such strategy, these connections can be easily eliminated in the sum-pooling operation before the unembedding layer. + +SHC shares similar connection pattern with DHC. We show the connection matrices for OLMo-1B-SHC×4 model in Fig. 13b. Comparing to DHC, as shown in Fig. 13a, SHC shares exactly the same connection patterns. Moreover, we observe many more PTB-like blocks in SHC, e.g., layers from 13 to 18. Note that the connection relation for SHC is token independent, and such PTB-like blocks can be physically reorganized to be parallelly computed. + +![](images/d1ef5c9f3b3917f8cddbe2f4011f5f88cb1a35939b5747e8a6d930c74d0d4b2f.jpg) +(a) OLMo-1B-DHC×1 + +![](images/c50a5663d067bdfd6d2c216be2422cba63fa9cace04c70c353e42e12024978ec.jpg) +(b) OLMo-1B-DHC×2 +Figure 14: Comparison of unfolded connection matrices for OLMo-1B-DHC×1, OLMo-1B-DHC×2 and OLMo-1B-DHC×4 model. + +![](images/99c99b5fedc36fe0f08cc97f460c6c482a022f62590d5a11e4295e795d3cbd1f.jpg) +(c) OLMo-1B-DHC×4 + +How $\mathbf{HC} \times 1$ fails. The OLMo- $1\mathrm{B} \times 1$ model is observed to perform worse than baseline in our experiments. Its connection matrix is visualized in Fig. 14 to show how it fails. Above all, we observe that layer 17 is wasted, who has no connection to subsequent layers at all. Secondly, compared to $\mathrm{HC} \times 2$ and $\mathrm{HC} \times 4$ models, the $\Lambda$ shaped pattern does not appear. Note that $\mathrm{HC} \times 1$ does not support the pattern of $\Lambda$ in its mathematical formulation, where the connections to previous layers must be weakened or strengthened simultaneously. Thus, the lack of connection from the early layers to the final layers may suffer from gradient vanishing, like post-norm style transformers, which leads to performance degeneration. + +# G DERIVATION OF NON-TRAINABLE HYPER-CONNECTION MATRIX FOR RESIDUAL CONNECTIONS + +# G.1 PRE-NORM RESIDUAL CONNECTION + +In the Pre-Norm residual connection, the input to a layer is first normalized before being passed through the layer. The output of the layer is then added to the original input. This can be represented as: + +$$ +\hat {\mathbf {h}} = \mathcal {T} (\operatorname {N o r m} (\mathbf {h})) + \mathbf {h}. \tag {30} +$$ + +By incorporating the normalization operator into the layer, $\mathcal{T} \coloneqq \mathcal{T} \circ \mathrm{Norm}$ , we can express the entire process as: + +$$ +\hat {\mathbf {h}} = \mathcal {T} (\mathbf {h}) + \mathbf {h}. \tag {31} +$$ + +To express this using hyper-connections, the matrix for Pre-Norm can be structured as follows: + +$$ +\mathcal {H C} _ {\text {P r e N o r m}} = \left( \begin{array}{l l} 0 & 1 \\ 1 & 1 \end{array} \right) \tag {32} +$$ + +Given hyper hidden matrix $\mathbf{H} = \mathbf{h}^{\mathrm{T}}$ , we prove that the output of $\mathcal{HC}_{\mathrm{PreNorm}}\hat{\mathbf{H}} = \hat{\mathbf{h}}^{\mathrm{T}}$ . + +Proof. + +$$ +\begin{array}{l} \hat {\mathbf {H}} = \mathcal {H C} (\mathcal {T}, \mathbf {H}) \\ = \mathbf {B} ^ {\intercal} \mathcal {T} (\mathbf {H} ^ {\intercal} \mathbf {A} _ {\mathbf {m}}) ^ {\intercal} + \mathbf {A} _ {\mathbf {r}} ^ {\intercal} \mathbf {H} \\ = \mathcal {T} (\mathbf {h}) ^ {\intercal} + \mathbf {h} ^ {\intercal} \tag {33} \\ = \hat {\mathbf {h}} ^ {\intercal}. \\ \end{array} +$$ + +![](images/4fae505f2b5c5da4b568d28bf05994c491aabdef49442821cb37b2f4cdcd17cd.jpg) + +# G.2 POST-NORM RESIDUAL CONNECTION + +In the Post-Norm residual connection, the input to a layer is passed through the layer first, and then the output is normalized after being added to the original input. In matrix form, this can be represented as: + +$$ +\mathbf {h} ^ {\prime} = \mathcal {T} (\mathbf {h}) \tag {34} +$$ + +The summation of the input and the normalized output of the layer is: + +$$ +\hat {\mathbf {h}} = \operatorname {N o r m} \left(\mathbf {h} + \mathbf {h} ^ {\prime}\right) \tag {35} +$$ + +We consider Norm to be LayerNorm (Zhang & Sennrich, 2019). The analysis process for RMSNorm is almost identical. In fact, the affine transformation can be incorporated into the subsequent layer, while the mean subtraction operation can be integrated into the current layer. + +$$ +\mathcal {T} = \mathcal {C} \circ \mathcal {T} \circ \mathcal {A}, \tag {36} +$$ + +where $\mathcal{A}$ is the affine transformation, and $\mathcal{C}$ is the re-centering operator. Thus, the mean of the output of $\mathcal{T}$ is 0. + +To express this using hyper-connections with an expansion rate $n = 1$ , we need a hyper-connection matrix $\mathcal{HC}$ that encapsulates this operation: + +$$ +\mathcal {H C} _ {\text {P o s t N o r m}} = \left( \begin{array}{l l} 0 & \frac {1}{\sqrt {\sigma_ {\mathrm {h}} ^ {2} + \sigma_ {\mathrm {h} ^ {\prime}} ^ {2} + 2 \sigma_ {\mathrm {h h} ^ {\prime}}}} \\ 1 & \frac {1}{\sqrt {\sigma_ {\mathrm {h}} ^ {2} + \sigma_ {\mathrm {h} ^ {\prime}} ^ {2} + 2 \sigma_ {\mathrm {h h} ^ {\prime}}}} \end{array} \right) = \left( \begin{array}{l l} 0 & \mathbf {B} \\ \mathbf {A} _ {m} & \mathbf {A} _ {r} \end{array} \right). \tag {37} +$$ + +Similar to the previous proof, we prove that the output of $\mathcal{HC}_{\mathrm{PostNorm}}$ is equivalent to the transpose of the output of the Post-Norm residual connection: + +$$ +\hat {\mathbf {H}} = \hat {\mathbf {h}} ^ {\intercal}. \tag {38} +$$ + +Proof: Note that + +$$ +\sigma_ {\mathbf {h} + \mathbf {h} ^ {\prime}} = \sqrt {\sigma_ {\mathbf {h}} ^ {2} + \sigma_ {\mathbf {h} ^ {\prime}} ^ {2} + 2 \sigma_ {\mathbf {h h} ^ {\prime}}}. \tag {39} +$$ + +Given this fact, we can derive the Post-Norm: + +$$ +\begin{array}{l} \hat {\mathbf {h}} = \operatorname {N o r m} \left(\mathbf {h} ^ {\prime} + \mathbf {h}\right) \\ = \frac {\mathrm {h} ^ {\prime} + \mathrm {h} - \mu_ {\mathrm {h} ^ {\prime} + \mathrm {h}}}{\sigma_ {\mathrm {h} + \mathrm {h} ^ {\prime}}} \\ = \frac {1}{\sigma_ {\mathbf {h} ^ {\prime} + \mathbf {h}}} \left(\mathbf {h} ^ {\prime} + \mathbf {h}\right) \tag {40} \\ = \frac {1}{\sqrt {\sigma_ {\mathbf {h}} ^ {2} + \sigma_ {\mathbf {h} ^ {\prime}} ^ {2} + 2 \sigma_ {\mathbf {h h} ^ {\prime}}}} (\mathbf {h} ^ {\prime} + \mathbf {h}) \\ \end{array} +$$ + +For hyper-connections side, we have: + +$$ +\begin{array}{l} \hat {\mathbf {H}} = \mathbf {B} ^ {\intercal} \mathbf {h} ^ {\prime \intercal} + \mathbf {H} ^ {\prime} \\ = \mathbf {B} ^ {\mathrm {T}} \mathbf {h} ^ {\prime \mathrm {T}} + \mathbf {A} _ {r} \mathbf {H} \\ = \mathbf {B} ^ {\intercal} \mathbf {h} ^ {\prime \intercal} + \mathbf {A} _ {r} \mathbf {h} ^ {\intercal} \tag {41} \\ {= \frac {1}{\sqrt {\sigma_ {\mathbf {h}} ^ {2} + \sigma_ {\mathbf {h} ^ {\prime}} ^ {2} + 2 \sigma_ {\mathbf {h h} ^ {\prime}}}} \mathbf {h} ^ {\prime \intercal} + \frac {1}{\sqrt {\sigma_ {\mathbf {h}} ^ {2} + \sigma_ {\mathbf {h} ^ {\prime}} ^ {2} + 2 \sigma_ {\mathbf {h h} ^ {\prime}}}} \mathbf {h} ^ {\intercal}} = \hat {\mathbf {h}} ^ {\intercal}.} \\ \end{array} +$$ + +# H SEQUENTIAL-PARALLEL DUALITY + +# H.1 HYPER-CONNECTION MATRIX OF SEQUENTIAL ARRANGEMENT + +In this section, we demonstrate that the following hyper-connection matrix will produce $n$ identical networks arranged sequentially with residual connections between them: + +$$ +\mathcal {H C} = \left( \begin{array}{c c} \mathbf {0} _ {1 \times 1} & \mathbf {1} _ {1 \times n} \\ \mathbf {e} _ {1} & \mathbf {e} _ {n \times n} \end{array} \right), \tag {42} +$$ + +where $\mathbf{e}_{n\times n}$ denotes an $n\times n$ identity matrix, $\mathbf{e}_i\in \mathbb{R}^{n\times 1}$ represents the $i$ -th column of $\mathbf{e}_{n\times n}$ , and $\mathbf{1}_{1\times n}$ signifies a $1\times n$ matrix of ones. + +We will use mathematical induction to prove that $\mathbf{h}_i^k = \mathbf{h}_j^k$ and $\mathbf{h}_i^{k + 1} = \mathcal{T}^k (\mathbf{h}_i^k) + \mathbf{h}_i^k$ , $\forall i,j\in \{0,1,\ldots ,n\}$ , $\forall k\in \{0,1,\dots ,L\}$ , where $L$ is the number of layers. + +# Proof. BASE CASE + +For $k = 0$ , we have the initial condition $\mathbf{h}_i^0 = \mathbf{h}_j^0, \forall i,j \in \{0,1,\ldots,n\}$ , as we define $\mathbf{H}^0 = (\mathbf{h}^0, \mathbf{h}^0, \ldots, \mathbf{h}^0)^\top \in \mathbb{R}^{n\times d}$ . + +# INDUCTION HYPOTHESIS + +Assume that for some $k \in \{1, \dots, L - 1\}$ , we have $\mathbf{h}_i^k = \mathbf{h}_j^k$ and $\mathbf{h}_i^k = \mathcal{T}^k(\mathbf{h}_i^{k-1}) + \mathbf{h}_i^{k-1}$ , $\forall i, j \in \{0, 1, \dots, n\}$ . + +# INDUCTION STEP + +We have + +$$ +\begin{array}{l} \mathbf {H} ^ {k + 1} = \mathcal {H C} \left(\mathcal {T} ^ {k}, \mathbf {H} ^ {k}\right) (43) \\ = \mathbf {B} ^ {\intercal} \left(\mathbf {h} _ {0} ^ {\prime k}\right) ^ {\intercal} + \mathbf {H} ^ {\prime k} (44) \\ = \mathbf {B} ^ {\intercal} \mathbf {A} _ {\mathbf {m}} ^ {\intercal} \mathbf {H} ^ {k} + \mathbf {A} _ {\mathbf {r}} ^ {\intercal} \mathbf {H} ^ {k} (45) \\ = \mathbf {1} _ {n \times 1} \mathcal {T} ^ {k} \left(\mathbf {e} _ {1} ^ {\intercal} \mathbf {H} ^ {k}\right) + \mathbf {e} _ {n \times n} \mathbf {H} ^ {k} (46) \\ = \left(\mathcal {T} ^ {k} \left(\mathbf {h} _ {1} ^ {k}\right) \quad \mathcal {T} ^ {k} \left(\mathbf {h} _ {1} ^ {k}\right) \quad \dots \quad \mathcal {T} ^ {k} \left(\mathbf {h} _ {1} ^ {k}\right)\right) ^ {\intercal} + \left(\mathbf {h} _ {1} ^ {k} \quad \mathbf {h} _ {2} ^ {k} \quad \dots \quad \mathbf {h} _ {n} ^ {k}\right) ^ {\intercal} (47) \\ = \left(\mathcal {T} ^ {k} \left(\mathbf {h} _ {1} ^ {k}\right) + \mathbf {h} _ {1} ^ {k} \quad \mathcal {T} ^ {k} \left(\mathbf {h} _ {1} ^ {k}\right) + \mathbf {h} _ {2} ^ {k} \quad \dots \quad \mathcal {T} ^ {k} \left(\mathbf {h} _ {1} ^ {k}\right) + \mathbf {h} _ {n} ^ {k}\right) ^ {\intercal} (48) \\ = \left(\mathbf {h} _ {1} ^ {k + 1} \quad \mathbf {h} _ {2} ^ {k + 1} \quad \dots \quad \mathbf {h} _ {n} ^ {k + 1}\right) ^ {\intercal} (49) \\ \end{array} +$$ + +Since $\mathbf{h}_i^k = \mathbf{h}_j^k$ , $\forall i, j \in \{0, 1, \dots, n\}$ , it follows that $\mathcal{T}^k(\mathbf{h}_1^k) + \mathbf{h}_i^k = \mathcal{T}^k(\mathbf{h}_1^k) + \mathbf{h}_j^k$ . Thus, we have + +$$ +\mathbf {h} _ {i} ^ {k + 1} = \mathbf {h} _ {j} ^ {k + 1} \tag {50} +$$ + +Since $\mathbf{h}_i^k = \mathbf{h}_j^k$ , $\forall i, j \in \{0, 1, \dots, n\}$ , it follows that $\mathbf{h}_1^k = \mathbf{h}_i^k$ , $\forall i \in \{0, 1, \dots, n\}$ . Thus, we have + +$$ +\begin{array}{l} \mathbf {h} _ {i} ^ {k + 1} = \mathcal {T} ^ {k} \left(\mathbf {h} _ {1} ^ {k}\right) + \mathbf {h} _ {i} ^ {k} (51) \\ = \mathcal {T} ^ {k} \left(\mathbf {h} _ {i} ^ {k}\right) + \mathbf {h} _ {i} ^ {k} (52) \\ \end{array} +$$ + +![](images/149a4b549e05dda3cb5f5b3a692a31a8baf4cbf7af07e9132bbb1d40d5af55f0.jpg) + +# H.2 HYPER-CONNECTION MATRIX OF PARALLEL ARRANGEMENT + +In this section, we demonstrate that the following hyper-connection matrix will produce a network where every $n$ adjacent layers are arranged in parallel, with each layer incorporating residual connections. We define a parallel-arranged network such that $n$ adjacent layers form a group, with layers within a group being parallel and groups arranged sequentially. The output of $k$ -th group is given by: + +$$ +\mathbf {h} ^ {k + 1} = \sum_ {i = 1} ^ {n} \left(\mathcal {T} ^ {k \times n + i} \left(\mathbf {h} ^ {k}\right) + \mathbf {h} ^ {k}\right). \tag {53} +$$ + +It can be proved that this arrangement can be described by the following hyper-connection matrices. + +First, for $k$ where $k - 1 \equiv 0 \pmod{n}$ : + +$$ +\mathcal {H C} ^ {\{k \mid k - 1 \equiv 0 \pmod {n} \}} = \left( \begin{array}{c c} \mathbf {0} _ {1 \times 1} & \mathbf {e} _ {1} ^ {\intercal} \\ \mathbf {1} _ {n \times 1} & \mathbf {1} _ {n \times n}, \end{array} \right) \tag {54} +$$ + +where the $\mathcal{HC}$ matrix can be decomposed into two operations: 1) sum up all the outputs of the previous group and use it as the input of the current layer and as the residual of the subsequent layers; 2) sum up the output and input saving to the first hidden vector slot. + +Next, for $k$ where $k - 1 \equiv i \pmod{n}$ and $i \neq 0$ : + +$$ +\mathcal {H C} ^ {\{k \mid k - 1 \equiv i \pmod {n}, i \neq 0 \}} = \left( \begin{array}{c c} \mathbf {0} _ {1 \times 1} & \mathbf {e} _ {i} ^ {\intercal} \\ \mathbf {e} _ {i} & \mathbf {e} _ {n \times n}, \end{array} \right). \tag {55} +$$ + +where the $\mathcal{HC}$ matrix selects the $i$ -th hidden vector as the input of the current layer, and sums up the output and input, saving to the $i$ -th hidden vector slot. + +This means: + +$$ +\mathbf {h} ^ {k + 1} = \mathcal {H C} ^ {(k + 1) \times n} \left(\mathcal {T} ^ {(k + 1) \times n}, \right. \tag {56} +$$ + +$$ +\mathcal {H C} ^ {(k + 1) \times n - 1} \left(\mathcal {T} ^ {(k + 1) \times n - 1}, \right. \tag {57} +$$ + +$$ +\dots \tag {58} +$$ + +$$ +\mathcal {H C} ^ {k \times n + 1} \left(\mathcal {T} ^ {k \times n + 1}, \mathbf {h} ^ {k}\right)) \tag {59} +$$ + +This can also be proved by mathematical induction; however, the conclusion is quite obvious through drawing, and the proof process is very tedious. Therefore, we don't repeat the similar proof here. + +# I PSEUDOCODE OF HYPER-CONNECTIONS + +
Algorithm 1 Network with Hyper-Connections
Require: Initial hidden vector h0 ∈ Rd
Require: Expansion rate n
Ensure: Final output y
1: Initialize:
2: H0← (h0 h0 ... h0)T ∈ Rn×d
3: for k = 1 to L do▷ For each layer
4: H ← Hk-1
5: (h0 H') ← WcKTH▷ Width Connections
6: h0' ← Tk(h0)▷ Layer Computation
7: H ← BkTH0' + H'▷ Depth Connections
8: Hk ← H
9: end for
10: Final Output:
11: hL ← sum rows of HL
12: hL ← Normalization Layer(hL)
13: y ← Output Layer(hL)
14: return y
+ +# J PYTORCH IMPLEMENTATION OF HYPER-CONNECTIONS + +Algorithm 2 Pseudocode of hyper-connections in a PyTorch-like style. +```python +h: hyper hidden matrix (BxLxNxD) +class HyperConnection(nnModule): def __init__(self, dim, rate, layer_id, dynamic, device=None): super(HyperConnection, self).__init_( ) self RATE $=$ rate self(layer_id $\equiv$ layer_id self.dynamic $=$ dynamic self(static_beta $\equiv$ nn.Parameters(torch.ones((rate,) device=device)) init_alpha0 $\equiv$ torch.zeros((rate, 1), device $\equiv$ device) init_alpha0[layer_id % rate, 0] = 1. self/static_alpha $\equiv$ nn.Parameter(torch.cat([init_alpha0, torch.eye((rate), device= device)], dim=1)) if self.dynamic: self.dynamic_alpha_fn $\equiv$ nn.Parameter(torch.zeros((dim, rate+1), device $\equiv$ device)) self.dynamic_alpha_scale $\equiv$ nn.Parameter(torch.ones(1, device $\equiv$ device) $\star 0.01$ self.dynamic_beta_fn $\equiv$ nn.Parameter(torch.zeros((dim,) device $\equiv$ device)) self.dynamic_beta_scale $\equiv$ nn.Parameter(torch.ones(1, device $\equiv$ device) $\star 0.01$ self(layer_norm $=$ LayerNorm(dim) def width_connection(self, h): # get alpha and beta if self.dynamic: norm_h $=$ self(layer_norm(h) if self.dynamic: wc_weight $=$ norm_h @ self.dynamic_alpha_fn wc_weight $=$ F.tanh(wc_weight) dynamic_alpha $\equiv$ wc_weight $\star$ self.dynamic_alpha_scale alpha $=$ dynamic_alpha + self/static_alpha[None, None, ... ] else: alpha $=$ self/static_alpha[None, None, ... ] if self.dynamic: dc_weight $=$ norm_h @ self.dynamic_beta_fn dc_weight $=$ F.tanh(dc_weight) dynamic_beta $=$ dc_weight $\star$ self_dynamic_beta_scale beta $=$ dynamic_beta + self/static_beta[None, None, ... ] else: beta $=$ self/static_beta[None, None, ... ] # width connection mix_h $=$ alpha.transpose(-1, -2) @ h return mix_h, beta +def depth_connection(self, mix_h, h_o, beta): h $=$ torch.einsum("blh,bln->blnh", h_o, beta) + mix_h[., 1:, :] return h +``` + +Algorithm 3 Pseudocode of transformer with hyper-connections in a PyTorch-like style. +```python +h: hyper hidden matrix (BxLxNxD) +# attenuHyper_connection, ffn_hyper_connection: hyperconnection modules +# attenu_norm, ffn_norm: normalization modules +# Attention Block +mix_h, beta = attenu_hyper_connection.width_connection(h) +h = attenu_norm(mix_h[.,0,:]) +h = self_attention(h) +h = attenu_hyper_connection.depth_connection(mix_h, dropout(h), beta) +# FFN Block +mix_h, beta = ffn_hyper_connection.width_connection(h) +h = ffn_norm(mix_h[.,0,:]) +h = ffn(h) +h = ffn_hyper_connection.depth_connection(mix_h, dropout(h), beta) +``` + +# K VALIDATION SETS AND DOWNSTREAM TASKS + +Table 13: OLMo's default configuration was evaluated using multiple metrics. Perplexity (PPL) and loss were used for the V2 and V3 Validation Sets, while zero-shot testing was applied to the Downstream Benchmarks. However, the grey benchmarks were excluded from our analysis due to the instability of their performance indicators. + +V2 Validation Sets +V3 Validation Sets +```txt +v2-small-4chan-validation +v2-small-c4_100_domains-validation +v2-small-c4_en-validation +v2-small-gab-validation +v2-small-ice-validation +v2-small-m2d2_s2orc-validation +v2-small-m2d2_wiki-validation +v2-small-manosphere-validation +v2-small-mc4_en-validation +v2-small-pile-validation +v2-small-ptb-validation +v2-small-twitterAEE-validation +v2-small-wikitext_103-validation +``` + +Downstream Benchmarks +```txt +v3-small-c4_en-validation +v3-small-dolma_books-validation +v3-small-dolma_common-crawl-validation +v3-small-dolma_pes2o-validation +v3-small-dolma_redgit-validation +v3-small-dolma_stack-validation +v3-small-dolma_wiki-validation +v3-small-ice-validation +v3-small-m2d2_s2orc-validation +v3-small-pile-validation +v3-small-wikitext_103-validation +``` + +```txt +piqa (Bisk et al., 2020) +hellaswag (Zellers et al., 2019) +winogrande (Sakaguchi et al., 2021) +openbook_qa (Mihaylov et al., 2018) +sciq (Johannes Welbl, 2017) +arc_easy (Clark et al., 2018) +copa (Roemmele et al., 2011) +commitment_bank (De Marneffe et al., 2019) +mrpc (Dolan & Brockett, 2005) +rte (Dagan et al., 2005) +sst2 (Socher et al., 2013) +``` + +Table 14: Downstream Benchmarks for OLMoE. + +
Downstream Benchmarks for OLMoE
piqa (Bisk et al., 2020)
hellaswag (Zellers et al., 2019)
winogrande (Sakaguchi et al., 2021)
openbook_qa (Mihaylov et al., 2018)
sciq (Johannes Welbl, 2017)
arc_easy (Clark et al., 2018)
arc_challenage (Clark et al., 2018)
copa (Roemmele et al., 2011)
boolq (Clark et al., 2019)
commonsense_qa (Talmor et al., 2018)
social_iqa (Sap et al., 2019)
mmlu (Hendrycks et al., 2021)
+ +# L 1B MODEL EXPERIMENTS + +![](images/e166be435c5af2fb5a0e1d0fc0f3cc79007a9c5b9ebb9d85ea1330c594ef5a66.jpg) +Figure 15: Training loss curves of related works, smoothed using Exponential Moving Average (EMA) with a decay rate of 0.99. + +![](images/8a44002f53ee56f5ce7c12398b81786170e2c90c42b1e209868ebd1dc2b8a0a2.jpg) +Figure 16: Training loss curves of DHC with tanh over 500 billion tokens, smoothed using Exponential Moving Average (EMA) with a decay rate of 0.99. + +![](images/68cf7ad8b627eb8eaa95e9371e3d7084c5ff9e99d29f2d472750896aa9e50a94.jpg) +Figure 17: Training loss curves of DHC without tanh over 500 billion tokens, smoothed using Exponential Moving Average (EMA) with a decay rate of 0.99. + +![](images/29e21fc9b3c4de92ec4af288a2a5bab8a5d793d3c213564e0e74cd62c86fe1e9.jpg) +Figure 18: Training loss curves compared with parallel transformer blocks (PTB), smoothed using Exponential Moving Average (EMA) with a decay rate of 0.99. + +Table 15: Results on downstream benchmarks for 1B models. + +
Methodarc.easycopahellaswagopenbook_qapiqasciqwinograndeavg.
OLMo-1B56.876.056.133.874.485.155.662.5
Scaling n in DHC W/O tanh
OLMo-1B-DHCx1 W/O tanh56.875.055.333.472.985.457.162.3
OLMo-1B-DHCx2 W/O tanh63.074.057.134.673.586.058.263.8
OLMo-1B-DHCx4 W/O tanh61.280.057.533.675.585.856.964.4
OLMo-1B-DHCx8 W/O tanh61.175.057.635.473.885.258.563.8
Scaling n in DHC
OLMo-1B-DHCx159.774.055.533.673.585.454.562.3
OLMo-1B-DHCx259.773.056.734.074.785.257.963.0
OLMo-1B-DHCx459.879.058.132.474.386.157.163.8
OLMo-1B-DHCx856.875.058.034.473.884.257.362.8
Scaling n in SHC
OLMo-1B-SHCx259.177.056.635.474.285.356.463.4
OLMo-1B-SHCx459.377.056.734.074.386.657.163.6
Non-trainable WC
OLMo-1B-DHCx460.578.056.234.073.586.055.863.4
OLMo-1B-DHCx4 W/O tanh59.172.056.835.073.386.055.562.5
Non-trainable B
OLMo-1B-DHCx459.577.057.933.873.385.656.663.4
OLMo-1B-DHCx4 W/O tanh60.474.057.634.074.986.757.563.6
+ +
18L'Z909'Z8E9'ZL88'Z22'Z96'Z500'ZL95'Z990'Z689'ZL4'E'6E'L'Z265'Z562'Zquen O/A+HCH-BH-IR-WTO
E8L'Z22'ZL29'ZL16'Z12'ZL6'Z800'Z695'Z150'Zt89'Z84'E'74'L'Zt65'Z96'Zquen O/A+HCH-BH-IR-WTO
Non-Brane Bonding
t08'Zt+9'Z£99'ZS+6'Z0+7'Z015'ZS20'ZS85'Z001'Z01L'ZLSE'ZSSL'Z609'Z80'E'quen O/A+HCH-BH-IR-WTO
208'Z9E9'Z8L'9'Z6S6'Z8E'Z805'Zt20'Z£85'ZLL'0'Z00L'ZLSE'ZTSL'Z809'Z71'E'quen O/A+HCH-BH-IR-WTO
CWM Nonbonding
16L'ZL29'Z£99'Z668'Z22'Zt05'Z810'Z085'Z290'Z269'ZLSE'Z1SL'Z£09'Z00E'Zquen O/A+HCH-BH-IR-WTO
66L'Z£+9'Z£+9'Z£66'Z8E'Z115'Z£20'ZL85'Z990'Z09E'ZLSL'Z019'Z0L'E'20E'Zquen O/A+HCH-BH-IR-WTO
OHS un iu u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u uu u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuUUuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUuuUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUuuuuuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUC UUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUC/UUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUNUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCU.UUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUBUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCU UCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUUCUucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucunucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuuculucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuucuuc
+ +IaONnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnaeNnnae + +
t0S'LI99L'EL019'LE8L'8I02C'67I'2I85'2O150'EL0E'1'2149'I9E'8Z01S'5I98E'EL266'6quen O/At+XHCH-BI-WTO
86'LI8SS'EL900'8E8EE'LI8ZZ'69E'2I88'1O120'EL75'1'272'LI8Z'8Z5L'5'575'5'575'5'575'5'5t+XHCH-BI-WTO
Non-Relation
t+16'LI896'EL0LS'6E7L'6I8LL'69L'2I6LS'0Z74'CEI969'1Z8L'8Z999'SI99S'EL260'OIquen O/At+XHCH-BI-WTO
716'LI0L'0+I696'8E910'6I06E'601E'2I76S'0Z89'2Z981'2Z820'5I689'8Z17L'5I78S'EL75'0It+XHCH-BI-WTO
ON-Relation
1L'9'LI988'EL69S'8E6H'8I81E'67E'2I75'2Z761'EL77L'1Z99L'1I169'8Z89S'5I76S'EL76'6t+XHCH-BI-WTO
8L'LI090'I712'8E16L'8I7L'661E'2I79S'0Z762'EL167'1Z166'1I78L'8Z89S'5I109'EL94'0I76S'EL
CHS u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u uu u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuucuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuccuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuccuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuddu:
CHS u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u uu u u u uu u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u uu u u u u uu:
ST'LI0LS'EL8L'8E6L'8I961'6760'2I042'0Z820'EL861'1Z049'1Z165'8Z799'SI99S'EL94'0E726'68xHCH-BI-WTO
60'S'LI909'EL981'8E201'8I681'6080'2I981'0Z900'EL014'1Z899'1Z799'8Z089'5I788'5Z788'5Z788'5Z788'5Z
056'LI766'EL765'0Z799'6799'6762'2I795'2Z787'1Z642'1Z796'1Z796'1Z001'6Z895'5Z895'5Z895'5Z
SZ'8I855'LI795'8E92E'6I909'6788'2Z788'2Z786'1Z986'1Z792'6Z792'6Z180'9I018'9I018'9I018'9I
CHS U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U U UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUAUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCCUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU uu:
+ +sopwRnrsnsnnprrnA ZJ Jo sənXxDd: Ll 1qL + +
02S'2829'2+02'2£81'2089'279'2+20'1996'290'220L'2988'2189'2quen O/A+XCHH-BI-WTO
81'S'2219'2+02'2881'2+89'285'2+20'1196'290'2L69'2088'26L'2+XCHH-BI-WTO
non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non- Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-ND
non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-Non-ND
82S'2£89'2+12'2$61'2889'279'2820'1£L6'2£L'211L'2268'2689'2+XCHS-BI-WTO
82S'2099'212'2861'200L'26L'2£L'2086'2£L'281L'2L06'2869'2+XCHS-BI-WTO
CHS u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u uu u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuddu
91S'2+19'210'2LLI'2089'295'2220'1+96'2+08'210L'2088'2LLL'288'288'2
91S'2L19'200'29L'26L'255'2120'1296'210L'2L69'29L'25L'2+XCHD-BI-WTO
+19'S'2+19'281'220L'2669'284'2220'19L'2120'221L'2106'2+69'2+XCHD-BI-WTO
91S'2£89'2+19'2112'2£L'266'2+08'1166'29L'2£L'2L26'2+1L'2+XCHD-BI-WTO
CHD u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u u UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUAUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUGUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUucUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCAUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUUUUCUUuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu ku uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uu
+ +[OpoWg]I Jos OJnepaA EJ Jo sssot :8I [q] + +
906'EI6E8'EI090'6801'2885'17L'11S8L'2S0F'61ZE0'01t06'19Z6'LIE6S'1quen O/AHCH-BI-1WTO
t4L'8'EI1Z9'EI6S0'6E2C'2L'9'1LL'9'1L8'20ZE'618E0'010t8'10Z8'LItL'S'1HCH-BI-1WTO
non-hydrogenation
ZD'0+I1Z0'1E0Z'6E2Z'2L'08'1898'1908'2E19'61161'01S60'S1091'819SL'1quen O/AHCH-BI-1WTO
S1'1+ISE1'10ZZ'6ZS'2t'6'1Z06'1918'20S9'61S1'2010Z1'S1tZZ'81018'1HCH-BI-1WTO
non-hydrogenation
SZ'0+IZ16'EIS1'S6L'0+T2669'19t8'1196L'20SS'611Z1'016t0'S18Z0'81L1L'1HCH-SB-1WTO
ZS'1+IOS1'1t'12'68L'4'29L'8'1t'6'11L'08'2689'610E2'010S1'S1£6Z'81tS8'1HCH-SB-1WTO
CHS u n 133
E8'8'EIE89'EI0E0'6t'96'26LS'1E99'116LL'299E'61110'01688'1L08'LI9tS'1HCH-BI-1WTO
9Z8'EI689'EI8Z0'68t6'2ELS'1099'119LL'2E4t'61686'66Z8'1E4L'LIt1S'1HCH-BI-1WTO
t11'1E0'1L81'6685'20L8'1S16'11908'2Z19'61161'01190'S1061'81t6L'1HCH-BI-1WTO
81'1+IZ9'19E9'6018'2S22'S1tL'121sL'82606'61Zt'0109E'S1£9'81£60'S1HCH-BI-1WTO
CHD u n 133
618'EIt89'EI1Z0'68t6'2L85'10E9'116LL'290E'61000'01E18'16tL'LIt6F'1quen O/AHCH-BI-1WTO
E0'0+IL'6'EI9t1'68t5'26E8'10E8'11008'26L'619t'01S6'1966'LI11L'1quen O/AHCH-BI-1WTO
t8'8'EIt69'EI190'6906'2809'1Z99'11£8L'2E2E'618E0'01L8'8'1L18'LIE2E'1quen O/AHCH-BI-1WTO
8Z'1+I0t5'11S'6£10'S2161'S1L91'21t8'8'2606'61£L'019S'S1669'81t90'S1quen O/AHCH-BI-1WTO
non-hydrogenation
O/A CHD u n 133
6Z'2+ItE'E'161E'6E0S'2860'S19Z0'212E8'2989'61S0E'01912'S1682'81806'1BI-1WTO
8Ae£0'-1x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x'x"
+ +sopwI rssneppIeA eA Jo sənnxod:61 1qL \ No newline at end of file diff --git a/ICLR/2025/Hyper-Connections/images.zip b/ICLR/2025/Hyper-Connections/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e929e67e7fd0b8e83b230b455d5b8125af002d05 --- /dev/null +++ b/ICLR/2025/Hyper-Connections/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4546b725f3ac178defccbda12d545fffb3e9f4775bc585013de90769255a98ea +size 2862749 diff --git a/ICLR/2025/Hyper-Connections/layout.json b/ICLR/2025/Hyper-Connections/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a53bb2c050043727bd7e9da3717b8bb0f681b5e2 --- /dev/null +++ b/ICLR/2025/Hyper-Connections/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6dd4daf184b2f3b3abbaec14a3ee161746c304d48fa02982f1acc14fdaff59c +size 1046625 diff --git a/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_content_list.json b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a6e6aae9ca4f7d9c0d31d93b1cdc2ffdbdc7bb3c --- /dev/null +++ b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4823a8f13e14c4d10d1f1787b555428b6048c835788177470014fd4d14e9e4dc +size 100319 diff --git a/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_model.json b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8fc551587e1ce65cd9e73775be47d17632a385db --- /dev/null +++ b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbd80f64a14fb0364418bc10ddf97b68944b312522d5ee0241cc793576ed3a6e +size 116070 diff --git a/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_origin.pdf b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f0931ed91f0ad88bdce058731c22559f2654300b --- /dev/null +++ b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/aa7eeac4-75ae-4dd0-ab56-600d6bacfa3d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2eaf43aa09e7fda19e8cf94326bb1ac805c1aa118a4615c368cdfa99d02558db +size 1928979 diff --git a/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/full.md b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c600c5f42a8f8f691f64be77e62973dafd403a8a --- /dev/null +++ b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/full.md @@ -0,0 +1,404 @@ +# HYPERDAS: TOWARDS AUTOMATING MECHANISTIC INTERPRETABILITY WITH HYPERNETWORKS + +Jiuding Sun $^{\text{♥}}$ Jing Huang $^{\text{♣}}$ Sidharth Baskaran $^{\text{♣}}$ Karel D'Oosterlinck $^{\text{♣}}$ + +Christopher Potts Michael Sklar\* Atticus Geiger\* + +$^{\diamond}\mathrm{Pr}(\mathbf{Ai})^{2}\mathbf{R}$ Group Stanford University Confirm Labs Ghent University + +# ABSTRACT + +Mechanistic interpretability has made great strides in identifying neural network features (e.g., directions in hidden activation space) that mediate concepts (e.g., the birth year of a person) and enable predictable manipulation. Distributed alignment search (DAS) leverages supervision from counterfactual data to learn concept features within hidden states, but DAS assumes we can afford to conduct a brute force search over potential feature locations. To address this, we present HyperDAS, a transformer-based hypernetwork architecture that (1) automatically locates the token-positions of the residual stream that a concept is realized in and (2) constructs features of those residual stream vectors for the concept. In experiments with Llama3-8B, HyperDAS achieves state-of-the-art performance on the RAVEL benchmark for disentangling concepts in hidden states. In addition, we review the design decisions we made to mitigate the concern that HyperDAS (like all powerful interpretability methods) might inject new information into the target model rather than faithfully interpreting it. + +# 1 INTRODUCTION + +Mechanistic interpretability methods promise to demystify the internal workings of black-box language models (LMs), thereby helping us to more accurately control these models and predict how they will behave. Automating such efforts is critical for interpreting our largest and most performant models, and strides toward this goal have been made for circuit discovery (Conmy et al., 2023; Rajaram et al., 2024) and neuron/feature labeling (Bills et al., 2023; Huang et al., 2023; Schwettmann et al., 2023; Shaham et al., 2024). In the present paper, we complement these efforts by taking the first steps toward automating interpretability for identifying features of hidden representations (e.g., directions in activation space) that mediate concepts (Mueller et al., 2024; Geiger et al., 2024a). + +Interventions on model-internal states are the building blocks of mechanistic interpretability (Saphra & Wiegreffe, 2024). To establish that features of a hidden representation are mediators of a concept, a large number of interchange intervention (Vig et al., 2020; Geiger et al., 2020) experiments are performed on the LM. Interchange interventions change features to values they would take on if a counterfactual input were processed. For example, if the concept is $C =$ the birth year of a person, we can fix the features $F$ of an LM processing the input Albert Einstein was born in to the value they take for Marie Curie was a chemist. If the output changes from 1879 to 1934, we have a piece of evidence that $F$ mediates $C$ . The field has developed a variety of methods for learning such interventions, but all of them require a brute-force search through potential hidden representations. + +To address this significant bottlebeck, we propose HyperDAS, a method to automate this search process via a hypernetwork. In the HyperDAS architecture, a transformer-based hypernetwork localizes a concept within the residual stream of a fixed layer in a target LM by: + +1. Encoding a language description (e.g., the birth year of a person) of a concept using a transformer that can attend to the target LM processing a base prompt (e.g., Albert Einstein was born in) and a counterfactual prompt (e.g., Marie Curie was a chemist). + +![](images/92d7956ca05fdd4a3ce902e93c7bc915a0e349227d81ecfdaa07686327651ea7.jpg) +Figure 1: The HyperDAS framework, used here to find the features that mediate the concept of "country". (1) Concept Encoding A natural language description that specifies which concept to localize, "The country of a city", is encoded by a transformer hypernetwork with two additional cross-attention blocks attending to the hidden states of the target LM prompted with the base text "Vienna is in" and the counterfactual text "I love Paris". (2) Selecting Token-Positions With the encoding from step 1 as a query, HyperDAS uses selects the tokens "nna" and "Paris" as the location of the concept "country" for the base and counterfactual, respectively. (3) Identifying a Subspace With the representation from step 1 as the encoding, HyperDAS constructs a matrix whose orthogonal columns are the features for "country". (4) Interchange Intervention With the token-positions from step 2 and subspace from step 3, HyperDAS performs a intervention by patching the subspace of the hidden vector for the token "nna" to the value it takes on in the hidden vector for the token "Paris", leading the model to predict "France" from the base prompt "Vienna is in". + +![](images/e913e8b3d7c8f945eb567b034a45051bf36ea424f171d7e80a8708a3816b82b0.jpg) + +2. Pairing tokens in the base and counterfactual prompts (e.g., align "Cur" with "Ein") with an attention mechanism using the encoding from (1) as a query and token-pairs as keys/values. +3. Selecting features of the residual stream via a fixed orthogonal matrix that undergoes a Householder transformation (Householder, 1958) using the encoding from (1). +4. Patching the selected residual stream features of aligned tokens from the base prompt to the values they take on in the residual stream of aligned tokens from the counterfactual prompt. + +We benchmark HyperDAS on the RAVEL interpretability benchmark (Huang et al., 2024), in which concepts related to a type of entity are disentangled. For example, we might seek to separate features for the birth year and field of study of a Nobel laureate. HyperDAS achieves state-of-the-art performance on RAVEL with a single model. Greater gains are achieved when a separate HyperDAS is trained for each entity type (e.g., Nobel laureates). + +Finally, we address the issue of whether HyperDAS is faithful to the target model. As we use more complex machine learning tools for interpretability, there is an increasing concern that we are not uncovering latent causal structure, but instead injecting new information to steer or edit a model (Meng et al., 2022; Ghandeharioun et al., 2024). If we allow our supervised interpretability models too much power, we run the risk of false-positive signals. Thus, we conclude with a discussion of how our decisions about architecture, training, and evaluation were made to mitigate these concerns. + +# 2 BACKGROUND + +Automating Interpretability Workflows The growing size and complexity of language models demands scalable techniques for interpretability. Major directions include circuit analysis (Conmy + +et al., 2023; Marks et al., 2024; Rajaram et al., 2024; Ferrando & Voita, 2024), unsupervised feature learning (Huben et al., 2024; Braun et al., 2024), and feature labeling with natural language descriptions (Mu & Andreas, 2021; Hernandez et al., 2022; Bills et al., 2023; Huang et al., 2023; Shaham et al., 2024). In this work, we take steps towards automating the process of identifying features that are causal mediators of concepts using supervision from counterfactual data. + +Identifying Features that Mediate Concepts Interchange interventions identify neural representations that are causal mediators of high-level concepts (Vig et al., 2020; Geiger et al., 2020; Finlayson et al., 2021; Stolfo et al., 2023). Geiger et al. (2024b) and Wu et al. (2024) further extend interchange interventions to localizing concepts in hidden vector subspaces. However, these methods require an exhaustive search over all layers and tokens to measure causal effects at each position. In practice, the lack of an effective search method leads to heuristics in token selection. For example, in knowledge editing and model inspection, a widely held assumption is that the entity information is localized to the last entity token (Meng et al., 2022; 2023; Hernandez et al., 2024; Geva et al., 2023; Ghandeharioun et al., 2024), but this does not hold for all entities (Meng et al., 2022). Our proposed method directly addresses this problem by using an end-to-end optimization to automatically select the intervention site across all tokens, conditioned on the concept to localize. + +The RAVEL Benchmark The RAVEL benchmark evaluates how well an interpretability method can localize and disentangle entity attributes through causal interventions. An example consists of a base prompt that queries a specific attribute of an entity (e.g., Albert Einstein studied the field), a counterfactual prompt containing a different entity of the same type (e.g., Poland declared 2011 the Year of Marie Curie), an attribute targeted for intervention (e.g., field of study or birth year), and a counterfactual label for the base prompt. The label would be physics if the targeted attribute is birth year (the intervention should not affect the field of study attribute), and it would be chemistry if the targeted attribute is field of study. + +Distributed Interchange Interventions RAVEL supports evaluations with distributed interchange interventions on features of a hidden representation $\mathbf{H}$ that encode an attribute in the original model $\mathcal{M}$ . In our experiments, features are orthogonal directions that form the columns of a low-rank matrix $\mathbf{R}$ . Given a base prompt $\bar{\mathbf{x}}$ and a counterfactual prompt $\hat{\mathbf{x}}$ , we perform an intervention that fixes the linear subspace spanned by $\mathbf{R}$ : + +$$ +\mathbf {H} \leftarrow \bar {\mathbf {h}} + \mathbf {R} ^ {\top} \left(\mathbf {R} (\hat {\mathbf {h}}) - \mathbf {R} (\bar {\mathbf {h}})\right) \tag {1} +$$ + +where $\bar{\mathbf{h}}$ and $\hat{\mathbf{h}}$ are the values that variable $\mathbf{H}$ has when the model $\mathcal{M}$ is run on $\bar{\mathbf{x}}$ and $\hat{\mathbf{x}}$ , respectively. + +RAVEL Metrics The metric from the RAVEL dataset has two components. The Cause score is the proportion of interchange interventions that successfully change the attribute that was targeted, and the Iso score is the proportion of interchange interventions that successfully do not change an attribute that was not targeted. The Disentangle score is the average of these two. + +Distributed Alignment Search The RAVEL evaluations use distributed alignment search (DAS; Geiger et al. 2024b) as a baseline for learning a feature of a hidden representation that mediate an attribute. A rotation matrix is optimized on a RAVEL example with base input $\bar{\mathbf{x}}$ , counterfactual input $\hat{\mathbf{x}}$ , and counterfactual label $y$ using the following loss: + +$$ +\mathcal {L} _ {\mathrm {D A S}} = \operatorname {C E} \left(\mathcal {M} _ {\mathbf {H} \leftarrow \bar {\mathbf {h}} + \mathbf {R} ^ {\top} \left(\mathbf {R} (\hat {\mathbf {h}}) - \mathbf {R} (\bar {\mathbf {h}})\right)} (\bar {\mathbf {x}}), y\right) \tag {2} +$$ + +where $\mathcal{M}_{\gamma}(\bar{\mathbf{x}})$ is the output of the model $\mathcal{M}$ run on input $\bar{\mathbf{x}}$ with an intervention $\gamma$ . Only the parameters $\mathbf{R}$ are updated while the parameters of the target model $\mathcal{M}$ are frozen. + +# 3 HYPERDAS + +To localize a concept in the layer $l$ of a target model $\mathcal{M}$ , a HyperDAS architecture consists of a hypernetwork $\mathcal{H}$ that takes in a text specification $\mathbf{x}$ of the target concept and dynamically selects token positions in the base text $\bar{\mathbf{x}}$ and counterfactual text $\hat{\mathbf{x}}$ and identifies a linear subspace $\mathbf{R}$ that mediates the target concept. Selecting tokens is a discrete operation, so we "soften" the selection during training and force discrete decisions during evaluation. Our specific model is as follows. + +# 3.1 REPRESENTING THE TARGET CONCEPT AS A VECTOR + +Token Embedding A token sequence $\mathbf{x}$ of length $E$ that specifies the concept to localize, e.g., the country a city is in, is encoded with the embeddings of the target model $\mathcal{M}$ to form $\mathbf{e}_0 = \mathrm{Emb}(\mathbf{x})\in$ $\mathbb{R}^{E\times d}$ , the zeroth layer of the residual stream for the hypernetwork $\mathcal{H}$ . + +Cross-attention Decoder Layers After embedding the target concept, we run a transformer with $N$ decoder layers. Besides the standard multi-headed self-attention (MHA) and feed-forward layers (MLP), each decoder block has two additional cross-attention modules to incorporate information from the target model $\mathcal{M}$ processing the base and counterfactual prompts $\bar{\mathbf{x}}$ and $\hat{\mathbf{x}}$ . + +Let $\bar{\mathbf{h}}\in \mathbb{R}^{B\times L\times d}$ and $\hat{\mathbf{h}}\in \mathbb{R}^{C\times L\times d}$ be the stacks of base and counterfactual hidden states from the base and the counterfactual input, where $L$ is the number of layers in $\mathcal{M}$ , $d$ is the hidden dimension, and $B$ and $C$ are the sequence length of the base and counterfactual examples, respectively. Two multi-headed cross-attention modules MHA and MHA allow $\mathcal{H}$ to attend to $\bar{\mathbf{h}}$ and $\hat{\mathbf{h}}$ . Each layer of the hypernetwork $\mathcal{H}$ can attend to every layer of the target model. + +For the $p$ -th decoder layer of the hypernetwork $\mathcal{H}$ , the three attention mechanisms are as follows: + +$$ +\mathbf {e} _ {p} ^ {\prime} = \operatorname {M H A} \left(\mathbf {Q} \left(\mathbf {e} _ {p}\right), \mathbf {K} \left(\mathbf {e} _ {p}\right), \mathbf {V} \left(\mathbf {e} _ {p}\right)\right) \tag {3} +$$ + +$$ +\mathbf {e} _ {p} ^ {\prime \prime} = \mathrm {M H A} \left(\bar {\mathbf {Q}} \left(\mathbf {e} _ {p} ^ {\prime}\right), \bar {\mathbf {K}} (\bar {\mathbf {h}}), \bar {\mathbf {V}} (\bar {\mathbf {h}})\right) \tag {4} +$$ + +$$ +\mathbf {e} _ {p + 1} = \mathsf {M} \hat {\mathsf {H}} \mathsf {A} \left(\hat {\mathbf {Q}} \left(\mathbf {e} _ {p} ^ {\prime \prime}\right), \hat {\mathbf {K}} (\hat {\mathbf {h}}), \hat {\mathbf {V}} (\hat {\mathbf {h}})\right) \tag {5} +$$ + +After the final transformer block is applied, the residual stream vector at the last token position $\mathbf{e}_E^{(N)}\in \mathbb{R}^d$ encodes information about the concept targeted for intervention and the target model's base and counterfactual runs. This representation is used to select token-positions in the base and source texts and identify a linear subspace for intervention. + +# 3.2 DYNAMICALLY SELECTINGTOKEN-POSITIONS THAT CONTAIN THE TARGET CONCEPT + +The next step is selecting the tokens in the base and counterfactual prompts that contain the concept encoded as $\mathbf{e}_E^{(N)}$ . We construct an "intervention score" matrix $G \in \mathbb{R}^{B \times (C + 1)}$ with elements ranging from 0 to 1, where $B$ and $C$ are the number of tokens in the base and counterfactual prompts, respectively. Each element $G_{(b,c)}$ denotes the degree to which the $b$ -th base token is aligned with $c$ -th counterfactual token for intervention. The additional column $G_{(b,c)}$ corresponds to the score for retaining the $b$ -th base token without any intervention. + +In Figure 1, only the base-token "nna" (the last token of the entity "Vienna") receives an intervention score of 1 when paired with the counterfactual=token "Paris". All other base tokens are not selected for intervention. The concept of "country" is localized to the last token of the city entities. + +To compute the element $G_{(b,c)}$ , we use $\bar{\mathbf{h}}_b^{(l)}$ and $\hat{\mathbf{h}}_c^{(l)}$ , the $l$ -th layer residual stream representation of the target model at $b$ -th base-token and $c$ -th counterfactual-token. We first linearly combine the two: + +$$ +\mathbf {g} _ {(b, c)} = F \left(\left[ \bar {\mathbf {h}} _ {b} ^ {(l)}; \hat {\mathbf {h}} _ {c} ^ {(l)} \right]\right) \tag {6} +$$ + +where $F(.): \mathbb{R}^{2d} \to \mathbb{R}^d$ is a linear projection that condenses the concatenated representation into the original dimension $d$ . For the extra column that indicates no intervention, the representation is simply the original base token representation: + +$$ +\mathbf {g} _ {(b, C + 1)} = \bar {\mathbf {h}} _ {b} ^ {(l)} \tag {7} +$$ + +Then, we weight each merged representation $\tilde{\mathbf{h}}$ using the concept encoding $\mathbf{e}_E^{(N)}\in \mathbb{R}^d$ and $M$ "query" and "key" matrices $Q^{(i)}\in \mathbb{R}^{d\times M\times \frac{d}{M}}$ and $K^{(i)}\in \mathbb{R}^{d\times M\times \frac{d}{M}}$ .. + +$$ +G _ {(b, c)} ^ {\prime} = \frac {\sum_ {i = 1} ^ {M} \left(\mathbf {e} _ {E} ^ {(N)}\right) Q ^ {(i)} \cdot (\tilde {\mathbf {h}}) K ^ {(i)}}{M \sqrt {d}} \tag {8} +$$ + +Finally, we apply a column-wise softmax $G = \text{ColumnSoftmax}(G')$ . + +Using the matrix $G$ , we can construct the representation that we will use to intervene on each token in the base prompt. For the $b$ -th base-token hidden states $\bar{\mathbf{h}}_b^l$ , the intervention representation is: + +$$ +\tilde {\mathbf {h}} _ {b} ^ {(l)} = G _ {(b, C + 1)} \bar {\mathbf {h}} _ {b} ^ {(l)} + \sum_ {c = 1} ^ {C} G _ {(b, c)} \hat {\mathbf {h}} _ {c} ^ {(l)} \tag {9} +$$ + +This is how the counterfactual representation is constructed for a weighted interchange intervention (Wu et al., 2024). The counterfactual hidden states remain identical to the base hidden states (i.e., no intervention on token $b$ ) when $G_{(b,C + 1)} = 1$ . Conversely, if $G_{(b,c)} = 1$ for a specific position $c$ , the $b$ -th base token is entirely replaced by the hidden vector for the $c$ -th counterfactual token. + +# 3.3 DYNAMICALLY IDENTIFYING A LINEAR SUBSPACE THAT CONTAINS THE CONCEPT + +In addition to selecting token-positions, HyperDAS also dynamically identifies a linear subspace that contains the target concept, encoded as a low-rank matrix with orthogonal columns. First, we apply a multi-layer perceptron to $\mathbf{e}_E^{(N)} \in \mathbb{R}^d$ in order to produce a new vector + +$$ +\mathbf {v} = \operatorname {M L P} \left(\mathbf {e} _ {E} ^ {(N)}\right) \in \mathbb {R} ^ {d}. +$$ + +In DAS, there is a fixed low-rank matrix with orthogonal columns $\mathbf{R}^{\prime}$ representing a fixed subspace targeted for intervention. We use a linear algebra operation known as the Householder transformation to change $\mathbf{R}^{\prime}$ conditional on $\mathbf{v}$ into a new matrix $\mathbf{R}$ that still has orthogonal columns. Given a non-zero vector $\mathbf{v} \in \mathbb{R}^{d}$ , the Householder transformation $\mathbf{H}$ is defined as: + +$$ +\mathbf {H} = \mathbf {I} - 2 \frac {\mathbf {v v} ^ {\top}}{\mathbf {v} ^ {\top} \mathbf {v}}, \tag {10} +$$ + +where $\mathbf{I}$ is the identity matrix. The matrix $\mathbf{H}$ is orthogonal and $\mathbf{R}^{\prime}$ has orthogonal columns, which means $\mathbf{R}^{\prime}\mathbf{H}$ has orthogonal columns. Utilizing this property, we can dynamically select the subspace based on the intervention representation $\mathbf{e}_E^{(N)}$ by computing $\mathbf{R} = \mathbf{R}^{\prime}\mathbf{H}$ . + +# 3.4 INTERVENING ON THE SUBSPACE AT THE SELECTEDTOKEN-POSITIONS + +After selecting token-positions and identifying a subspace, we finally intervene. For each base-token $b$ in the $l$ -th layer of the target model $\mathcal{M}$ , we perform a weighted interchange intervention with the counterfactual hidden states $\tilde{\mathbf{h}}^{(l)}$ and low-rank orthogonal matrix $\mathbf{R}$ : + +$$ +\mathbf {H} _ {b} ^ {(l)} \leftarrow \bar {\mathbf {h}} _ {b} ^ {(l)} + \mathbf {R} ^ {\top} \left(\mathbf {R} \left(\tilde {\mathbf {h}} _ {b} ^ {(l)}\right) - \mathbf {R} \left(\bar {\mathbf {h}} _ {b} ^ {(l)}\right)\right). \tag {11} +$$ + +# 3.5 TRAINING + +We train HyperDAS on the RAVEL with two losses. The first simply measures success on RAVEL. The second incentivizes the model to select unique token-pairings so that performance is maintained when the token alignment matrix $G$ is snapped to binary values during test-time evaluation. + +RAVEL Loss A RAVEL example consists of a base input $\bar{\mathbf{x}}$ , counterfactual input $\hat{\mathbf{x}}$ , target concept input $\mathbf{x}$ , and a counterfactual label $\mathbf{y}$ . When the target concept matches the attribute queried in the base input, the label $\mathbf{y}$ is the attribute of $\hat{\mathbf{x}}$ . Otherwise, $\mathbf{y}$ is the attribute of $\bar{\mathbf{x}}$ . The loss is: + +$$ +\mathcal {L} _ {\mathrm {R A V E L}} = \operatorname {C E} \left(\mathcal {M} _ {\mathbf {H} _ {b} ^ {(l)} \leftarrow \bar {\mathbf {h}} _ {b} ^ {(l)} + \mathbf {R} ^ {T} \left(\mathbf {R} \left(\tilde {\mathbf {h}} _ {b} ^ {(l)}\right) - \mathbf {R} \left(\bar {\mathbf {h}} _ {b} ^ {(l)}\right)\right) (\bar {\mathbf {x}}), \mathbf {y}\right) \tag {12} +$$ + +Sparse Attention Loss The construction of $G$ allows for a single counterfactual token to be paired with a weighted combination of multiple base tokens, however during test-time evaluations we will enforce a 1-1 correspondence. Thus, we include a sparse attention loss that penalizes cases where one counterfactual token attends strongly to multiple base tokens in each row of matrix $G$ : + +$$ +\mathcal {L} _ {\text {s p a r s e}} = \frac {1}{C} \sum_ {c = 1} ^ {C} \left\{ \begin{array}{l l} \operatorname {S u m} \left(G _ {(*, c)}\right) & \text {i f} \operatorname {S u m} \left(G _ {(*, c)}\right) > 1 \\ 0 & \text {i f} \operatorname {S u m} \left(G _ {(*, c)}\right) \leq 1 \end{array} \right. \tag {13} +$$ + +The final loss is $\mathcal{L} = \mathcal{L}_{\mathrm{RAVEL}} + \lambda \mathcal{L}_{\mathrm{sparse}}$ , where $\lambda$ is a real-valued weight scheduled during training. + +![](images/611dfca14bfb996b883921b02bcd633dc4335b7352409f77e8e7da651c73fbf6.jpg) +Figure 2: The "intervention score" matrix $G$ for the counterfactual prompt "The city of Macheng's official language is" and base prompt "Springfield is a city in the country of", for which the target model will output "China". The attribute targeted for intervention is country, so the output should be "The United States". The raw intervention (left) is produced by the token-position selection discussed in Sec 3.2, and a column-wise and row-wise argmax is applied at inference time to enforce an 1-1 correspondence between the base and counterfactual tokens, detailed in Sec. 3.6. + +![](images/08c1880ec9030b0bb1ca29e5833b5032bac194ec6586bb500f9d918cb9918073.jpg) + +# 3.6 EVALUATION + +HyperDAS is end-to-end differentiable because discrete operations like aligning base and counterfactual tokens are "softened" using softmax operators. During the evaluation, we force these discrete decisions. In many cases, the matrix $G$ contains non-zero weight for multiple base-counterfactual sentence token pairs (left panel in Figure 2). At inference time, we perform a double argmax operation on the intervention score to select the most important location for the intervention. For each base-counterfactual token pair, it is set to 1 if and only if this position gets the highest intervention score across its row and column. + +$$ +G _ {(b, c)} = \left\{ \begin{array}{l l} 1 & \text {i f} G _ {(b, c)} = \max \left(G _ {(b, *)}, G _ {(*, c)}\right) \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {14} +$$ + +The [SELF] row, representing no intervention on a base-token, is readjusted according to the discrete intervention weight (right panel in Figure 2). + +$$ +G _ {(b, C + 1)} = 1 \text {i f} \max \left(G _ {(b, *)}\right) = 0 \tag {15} +$$ + +# 4 EXPERIMENTS + +We benchmark HyperDAS on RAVEL with Llama3-8B (Meta, 2024) as the target model. We both train a HyperDAS model on all of RAVEL at once and also train a separate HyperDAS model for each of the five entity domains in the RAVEL benchmark, i.e., cities, Nobel laureates, occupations, physical objects, and verbs. We experimented with initializing the transformer hypernetwork from pre-trained parameters, but found no advantage for this task. + +**Crucial Hyperparameters** We use 8 decoder blocks for the hypernetwork and 32 attention heads for computing the pairwise token position attention. The sparsity loss weight is scheduled to linearly increase from 0 to 1.5, starting at $50\%$ of the total steps. A learning rate between $2 \times 10^{4}$ to $2 \times 10^{5}$ is chosen depending on the dataset. Discussion of these choices concerning the sparsity loss is in Section 4.2. For the feature subspace, we experiment with dimensions from 32 up to 2048 (out of 4096 dimensions) and use a subspace of dimension 128. + +Masking of the Base Prompt As the hypernetwork has access to the target attribute information from the instruction and the base attribute information from the base model states, a trivial solution + +
MethodsCityNobel LaureateOccupationPhysical ObjectVerbAverage Disentangle
CausalIsoCausalIsoCausalIsoCausalIsoCausalIso
MDAS55.877.956.093.550.788.185.097.974.379.676.0
HyperDAS
- Asymmetric70.893.955.495.150.499.192.797.293.098.984.7
- Asymmetric All Domains58.890.547.692.075.782.192.994.586.995.880.7
- Symmetric76.990.959.288.447.189.194.897.542.382.976.9
- Symmetric All Domains16.894.72.098.86.197.321.699.313.697.854.8
+ +(a) Main results of HyperDAS on five domains of RAVEL with Llama3-8B. For each method, we report the results from the best layer between 10 and 15. HyperDAS achieves state-of-the-art attribute disentangling performance across the board. The MDAS baseline intervenes on fixed tokens. + +![](images/593bb09e3bef0e75598356be9e9541c0aca50f24559183349bf96afc81ecfca8.jpg) +Figure 3: RAVEL benchmark results. HyperDAS establishes a new state-of-the-art. + +![](images/8b7da7237edfd5e84431a52ff9adfea0d40403f3cc72d33cd551ccb96ab09ca8.jpg) + +![](images/6ab7c282ceaeefc5c09f87ab708cb8f79b7aee22708a2dd427b25df19eed199c.jpg) + +(b) The cause/iso/disentangle score of the baseline method and HyperDAS (Both symmetric and asymmetric implementation) for the entity type of "city" across the layers of Llama3-8B. For both HyperDAS and MDAS, the peak Disentangle Score happens around L15. + +the hypernetwork can learn is to condition the intervention location on whether the target attribute matches the base attribute. In other words, if the two attributes match, attend to a location that has causal effect on the output, otherwise attend to the extra [self] row (see Appendix A.3 for an example). This solution, however, does not find the actual concept subspace. To prevent the hypernetwork from learning this trivial solution, we apply an attention mask to the base prompt to mask out the attribute information. With the masking, the hypernetwork no longer has access to the base attribute information, and hence the localization prediction is only conditioned on the target attribute in the natural language instruction. + +Symmetry Intuitively, if we have localized a concept, then "get" operations that retrieve the concept and "set" operations that fix the concept should both target the same features and hidden representations. For this reason, we consider a variant of HyperDAS that enforces symmetry in the localization of base and counterfactual prompts. We can enforce symmetry between base and counterfactual inputs during token selection by randomly flipping the order of the concatenation between base and counterfactual hidden representations in Equation 6. We report full results for symmetric and asymmetric models. + +Multi-task DAS (MDAS) Baseline The current state-of-the-art method on RAVEL is MDAS, which uses a multi-task learning objective to satisfy multiple high-level causal criteria. MDAS requires supervised training data like HyperDAS, however, MDAS relies on manually selected token position for intervention, which in our case is the final token of the entity, e.g., "nna" in Figure 1. + +Results In Table 3a, we show results on RAVEL for layer 15 of Llama3-8B. In Figure 3b, we also run HyperDAS targeting every 2 layers in Llama3-8B starting from the embedding layer. The peak performance of attribute disentanglement for both MDAS and HyperDAS is around layer 15. + +# 4.1 LAYER-SPECIFIC INTERVENTION BEHAVIORS OF HYPERDAS + +HyperDAS searches for an optimal location to intervene within the target hidden state in a chosen layer. We evaluate MDAS and HyperDAS on 16 layers across the model (Figure 3b) and chose an early layer, middle layer, and deep layer for detailed study: Layer 7, Layer 15, and Layer 29. + +![](images/c2b9f74e7b0d9ce9bf8216970e9983714945ceef07179ba3018b3fc5420a1827.jpg) +Figure 4: The intervention location, in counterfactual and base sentence, picked by HyperDAS when targeting shallow (7), middle (15) and deep (29) decoder layers. + +Analysis presented in Figure 4 reveals that HyperDAS consistently targets entity tokens in the counterfactual input across all layers, suggesting robust detection of attribute information in the entity token's residual stream from an early stage. However, the choice of intervention location within the base input shows significant variation. For each example in the "city" entity split, we categorize the base and counterfactual token pair that gets the largest intervention weight, and classify them into the following categories: (1) BOS Token represents the beginning-of-sentence token. (2) Entity Token refers to tokens representing entities. (3) JSON Syntax includes special characters and syntactic tokens typical of JSON formatted text (e.g., opening curly brace "\{"). (4) Others comprises all tokens irrelevant to the current analysis, with "is" following the entity token being a common example in both shallow $(36\%)$ and deep $(29\%)$ layer bases. + +At very early layers, HyperDAS displays turbulent behavior, targeting random or even beginning-of-sentence tokens in the base sentence. By the middle layers, the model consistently favors the entity token for intervention, aligning with findings from Huang et al. (2024) and Geva et al. (2023). In contrast, at deeper layers, the hypernetwork learns to intervene on unintuitive positions such as syntax tokens within a JSON-formatted prompt, which were previously unknown to store attributes. + +# 4.2 DISCUSSION + +HyperDAS establishes a new state-of-the-art performance on RAVEL Our results show that HyperDAS outperforms MDAS, the previous state-of-the-art, across all entity splits at layer 15 in Llama3-8B and across all layers of Llama3-8B for the "cities" entity split. + +HyperDAS requires more compute than MDAS. HyperDAS is more powerful than MDAS, but also more computationally expensive. Training our HyperDAS model for one epoch on disentangling the country attribute in the city domain takes 468,923 TeraFLOPs, while training an MDAS model for one epoch on the same task takes 193,833. Thus, HyperDAS requires $\approx 2.4\mathrm{x}$ compute. + +On the other hand, HyperDAS is more memory efficient for tasks like RAVEL. Our target Llama model requires 16GB of RAM. The HyperDAS model requires 52GB more in total for RAVEL, whereas MDAS requires only 4.1GB more per attribute. The memory usage of HyperDAS does not go up with additional attributes, so when trained on all of RAVEL together (23 attributes), MDAS $(23 * 4.1 + 16 = 110.3\mathrm{GB})$ exceeds the memory usage of HyperDAS $(52 + 16 = 68\mathrm{GB})$ . + +Householder vectors analysis provides a window into attribute features. To analyze the Householder vectors generated by the model, we collected vectors from each test example and categorized them according to their respective attributes. For each attribute category, a subset of 1,000 samples was randomly selected. We then computed the similarity scores between pairs of attributes by calculating the average cosine similarity across these 1,000 pairs of selected Householder vectors. + +![](images/5af20fc6da7dd9b2d5107551253bf675942fd6845e260dee52bdfc6b0b07b86d.jpg) +Figure 5: The relative position between the Householder vector (after PCA) of attributes for all the correct predictions in city domain. The clustering indicates that HyperDAS learns different subspace for each attribute. + +![](images/79755c3501f55007ad2d19904f7cda805717a087e8ea525a0461611044a3139b.jpg) +Figure 6: The cosine similarity between the Householder vectors of different attributes in the city domain, computed using 100,000 samples from each attribute. Notably, HyperDAS effectively learns a highly similar subspace for the attributes 'Longitude' and 'Latitude'. + +![](images/957b6bef9a2e799b16b6760ebb74084fe1d174557a347ec9fa5d0275b34ea0c9.jpg) +Figure 7: Intervention locations for a base/counterfactual sentences pair with Occupation entity-type selected by HyperDAS trained with different amounts of sparsity loss. This comparison illustrates the intervention locations generated by HyperDAS when trained under three different sparsity loss conditions. All three models achieved a Disentangle Score $\approx 94.0\%$ using weighted interventions. With no sparsity loss (middle), HyperDAS tends to intervene from the last subject token in the counterfactual sentence to most tokens in the base sentence, which yields adequate performance under many-to-one constraints but not under strict one-to-one constraints. With too much sparsity loss (right), the pairwise token selection attention within HyperDAS fails, resulting in interventions that blend all hidden states. Although this approach achieves a near-perfect disentangle score with weighted intervention, the model's does not have interpretable intervention patterns and fails entirely during test time when masks are snapped to align base and source tokens one-to-one. + +![](images/0e4ca62e426a86125f662a38ee3dfb507d078f6f17f8f9bde234e149a00d2c21.jpg) + +![](images/1ba135fa41d00d5725ec428fd7b0c1bc3d014a873425caab368d1fd21b48f8f2.jpg) + +We analyze the geometry of the learned householder vectors, with the PCA projection shown in Figure 5. We also compute the average pairwise cosine similarity of Householder vectors sampled from within the same attribute or cross two different attributes, as shown in Figure 6. Despite an overall high cosine similarity among all Householder vectors associated with the same entity type, the Householder vectors associated with the same attribute form a tighter cluster, with a higher cosine similarity score than pairs of vectors associated with two different attributes. These per-attribute clusters might explain why the learned subspace can disentangle different attributes of the same entity, as different attributes are localized into different subspaces of the entity representation. + +How do we know HyperDAS uncovers actual causal structures faithful to the target model? On one hand, we should leverage the power of supervised machine learning to develop increasingly sophisticated interpretability methods. On the other hand, such methods are incentivized to "hack" evaluations without uncovering actual causal structure in the target model. We have taken several steps to maintain fidelity to the underlying model structures when training and evaluating HyperDAS, by constraining optimization flexibility to prevent inadvertently steering or editing the model with out-of-distribution interventions. + +![](images/284e6862065a31e9d8b5a7a4f4a93077b186e18c031180e9c43b80c835e3fd00.jpg) +Figure 8: The count of intervention location picked by HyperDAS at the counterfactual prompt (upper) v.s. at the base prompt (bottom) across all the attributes in the city domain on entities with three tokens. The asymmetric variant (right) of HyperDAS favors getting the attribute information from the last entity token for the majority of the counterfactual prompts ( $\geq 95\%$ ), and intervene on the second last entity token. The symmetric variant (left) favors last entity token consistently for both base and counterfactual prompt. + +The weighted interchange interventions used in training hacks the objective without soft constraints via loss terms. The loss term $\mathcal{L}_{\mathrm{sparse}}$ is crucial for ensuring that HyperDAS learns a one-to-one alignment between base tokens and counterfactual tokens (Figure 2). When no sparsity loss is applied, the model aligns the final entity token (e.g., "nna" from Figure 1) to many tokens in the base sentence. These solutions fail during evaluations where token alignments are snapped to be one-to-one. Conversely, with excessive sparsity loss, the model constructs a counterfactual hidden representation that is a linear combination of many hidden states, resulting in a high flexibility optimization scheme that is closer to model steering or editing. This also fails during one-to-one evaluations. See Figure 7 for an example of these pathological settings. + +Often only one token is aligned between base and counterfactual inputs. The MDAS baseline performs well on the RAVEL benchmark by one token in the base and one token in the source. However, our new state-of-the-art HyperDAS model will select multiple tokens $53\%$ of the time. + +Asymmetric HyperDAS targets different tokens for base and counterfactual examples. Figure 8 shows the tokens selected by the symmetric and asymmetric variants of HyperDAS. When allowed asymmetric parametrization, networks break symmetry in positional assignments; for a single input prompt, HyperDAS will select different tokens depending on whether that input is the base or counterfactual. + +# 5 CONCLUSION + +In this work, we introduced HyperDAS, a novel hypernetwork-based approach for automating causal interpretability work. HyperDAS achieves state-of-the-art performance on the RAVEL benchmark, demonstrating its effectiveness in localizing and disentangling entity attributes through causal interventions. Our method's ability to dynamically select hidden representations and learn linear features that mediate target concepts represents a significant advancement in interpretability techniques for language models. We are optimistic that HyperDAS will open new avenues for understanding and interpreting the internal workings of complex language models. + +Limitations HyperDAS will only be successful if the target concept is mediated by linear features. However, there is emerging evidence that non-linear mediators are a possibility (Csordás et al., 2024; Engels et al., 2024). As discussed extensively in the main text, applying supervised machine learning to interpretability has the potential to lead to false positive results. While we have taken steps to maintain fidelity to underlying model structures, future work should continue to explore the delicate balance between uncovering latent causal relationships and the risk of model steering. + +# ACKNOWLEDGEMENTS + +This research was in part supported by a grant from Open Philanthropy. + +# REFERENCES + +Steven Bills, Nick Cammarata, Dan Mossing, Henk Tillman, Leo Gao, Gabriel Goh, Ilya Sutskever, Jan Leike, Jeff Wu, and William Saunders. Language models can explain neurons in language models. URL https://openaipublic.blob.core.windows.net/neuron-explainer/paper/index.html.(Date accessed: 14.05.2023), 2, 2023. +Dan Braun, Jordan Taylor, Nicholas Goldowsky-Dill, and Lee Sharkey. Identifying functionally important features with end-to-end sparse dictionary learning, 2024. URL https://arxiv.org/abs/2405.12241. +Arthur Conmy, Augustine N. Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and Adrià Garriga-Alonso. Towards automated circuit discovery for mechanistic interpretability. In Alice Oh, Tristan Naumann, Amir Globerson, Kate Saenko, Moritz Hardt, and Sergey Levine (eds.), Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023, 2023. URL http://papers.nips.cc/paper_files/paper/2023/bit/34e1dbe95d34d7ebaf99b9bcaeb5b2be-Abstract-Conference.html. +Róbert Csordás, Christopher Potts, Christopher D. Manning, and Atticus Geiger. Recurrent neural networks learn to store and generate sequences using non-linear representations, 2024. URL https://arxiv.org/abs/2408.10920. +Joshua Engels, Isaac Liao, Eric J. Michaud, Wes Gurnee, and Max Tegmark. Not all language model features are linear, 2024. URL https://arxiv.org/abs/2405.14860. +Javier Ferrando and Elena Voita. Information flow routes: Automatically interpreting language models at scale, 2024. URL https://arxiv.org/abs/2403.00824. +Matthew Finlayson, Aaron Mueller, Sebastian Gehrmann, Stuart Shieber, Tal Linzen, and Yonatan Belinkov. Causal analysis of syntactic agreement mechanisms in neural language models. In Chengqing Zong, Fei Xia, Wenjie Li, and Roberto Navigli (eds.), Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1828-1843, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.144. URL https://aclanthology.org/2021.acl-long.144. +Atticus Geiger, Kyle Richardson, and Christopher Potts. Neural natural language inference models partially embed theories of lexical entailment and negation. In Afra Alishahi, Yonatan Belinkov, Grzegorz Chrupa, Dieuwke Hupkes, Yuval Pinter, and Hassan Sajjad (eds.), Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pp. 163-173, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.blackboxnlp-1.16. URL https://aclanthology.org/2020.blackboxnlp-1.16. +Atticus Geiger, Duligur Ibeling, Amir Zur, Maheep Chaudhary, Sonakshi Chauhan, Jing Huang, Aryaman Arora, Zhengxuan Wu, Noah Goodman, Christopher Potts, and Thomas Icard. Causal abstraction: A theoretical foundation for mechanistic interpretability, 2024a. URL https:// arxiv.org/abs/2301.04709. +Atticus Geiger, Zhengxuan Wu, Christopher Potts, Thomas Icard, and Noah Goodman. Finding alignments between interpretable causal variables and distributed neural representations. In Causal Learning and Reasoning, pp. 160-187. PMLR, 2024b. +Mor Geva, Jasmijn Bastings, Katja Filippova, and Amir Globerson. Dissecting recall of factual associations in auto-regressive language models. In Houda Bouamor, Juan Pino, and Kalika Bali (eds.), Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 12216-12235, Singapore, December 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.emnlp-main.751. URL https://aclanthology.org/2023.emnlp-main.751. + +Asma Ghandeharioun, Avi Caciularu, Adam Pearce, Lucas Dixon, and Mor Geva. Patchscapes: A unifying framework for inspecting hidden representations of language models. In *Forty-first International Conference on Machine Learning*, ICML 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=5uwBzcn885. +Evan Hernandez, Sarah Schwettmann, David Bau, Teona Bagashvili, Antonio Torralba, and Jacob Andreas. Natural language descriptions of deep visual features. In International Conference on Learning Representations, 2022. URL https://arxiv.org/abs/2201.11114. +Evan Hernandez, Belinda Z. Li, and Jacob Andreas. Inspecting and editing knowledge representations in language models. In First Conference on Language Modeling, 2024. URL https://openreview.net/forum?id=ADtL6fgNRv. +Alston S Householder. Unitary triangularization of a nonsymmetric matrix. Journal of the ACM (JACM), 5(4):339-342, 1958. +Jing Huang, Atticus Geiger, Karel D'Oosterlinck, Zhengxuan Wu, and Christopher Potts. Rigorously assessing natural language explanations of neurons. In Yonatan Belinkov, Sophie Hao, Jaap Jumelet, Najoung Kim, Arya McCarthy, and Hosein Mohebbi (eds.), Proceedings of the 6th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP, BlackboxNLP@EMNLP 2023, Singapore, December 7, 2023, pp. 317-331. Association for Computational Linguistics, 2023. doi: 10.18653/V1/2023.BLACKBOXNLP-1.24. URL https://doi.org/10.18653/v1/2023.blackboxnlp-1.24. +Jing Huang, Zhengxuan Wu, Christopher Potts, Mor Geva, and Atticus Geiger. RAVEL: Evaluating interpretability methods on disentangling language model representations. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 8669–8687, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.acl-long.470. URL https://aclanthology.org/2024.acl-long.470. +Robert Huben, Hoagy Cunningham, Logan Riggs Smith, Aidan Ewart, and Lee Sharkey. Sparse autoencoders find highly interpretable features in language models. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=F76bwRSLeK. +Samuel Marks, Can Rager, Eric J. Michaud, Yonatan Belinkov, David Bau, and Aaron Mueller. Sparse feature circuits: Discovering and editing interpretable causal graphs in language models. Computing Research Repository, arXiv:2403.19647, 2024. URL https://arxiv.org/abs/2403.19647. +Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associations in GPT. In Sanmi Koyejo, S. Mohamed, A. Agarwal, Danielle Belgrave, K. Cho, and A. Oh (eds.), Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022, 2022. URL http://papers.nips.cc/paper_files/paper/2022/ hash/6f1d43d5a82a37e89b0665b33bf3a182-Abstract-Conference.html. +Kevin Meng, Arnab Sen Sharma, Alex J Andonian, Yonatan Belinkov, and David Bau. Mass-editing memory in a transformer. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=MkbcAHIygyS. +AI Meta. Introducing meta llama 3: The most capable openly available llm to date. Meta AI, 2024. +Jesse Mu and Jacob Andreas. Compositional explanations of neurons, 2021. URL https://arxiv.org/abs/2006.14032. +Aaron Mueller, Jannik Brinkmann, Millicent Li, Samuel Marks, Koyena Pal, Nikhil Prakash, Can Rager, Aruna Sankaranarayanan, Arnab Sen Sharma, Jiuding Sun, Eric Todd, David Bau, and Yonatan Belinkov. The quest for the right mediator: A history, survey, and theoretical grounding of causal interpretability, 2024. URL https://arxiv.org/abs/2408.01416. + +Achyuta Rajaram, Neil Chowdhury, Antonio Torralba, Jacob Andreas, and Sarah Schwettmann. Automatic discovery of visual circuits. CoRR, abs/2404.14349, 2024. doi: 10.48550/ARXIV.2404.14349. URL https://doi.org/10.48550/arXiv.2404.14349. +Naomi Saphra and Sarah Wiegreff. Mechanistic?, 2024. URL https://arxiv.org/abs/2410.09087. +Sarah Schwettmann, Tamar Rott Shaham, Joanna Materzynska, Neil Chowdhury, Shuang Li, Jacob Andreas, David Bau, and Antonio Torralba. FIND: A function description benchmark for evaluating interpretability methods. In Alice Oh, Tristan Naumann, Amir Globerson, Kate Saenko, Moritz Hardt, and Sergey Levine (eds.), Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023, 2023. URL http://papers.nips.cc/paper_files/paper/2023/bitstream/ef0164c1112f56246224af540857348f-Abstract-Datasets_and_Benchmarks.html. +Tamar Rott Shaham, Sarah Schwettmann, Franklin Wang, Achyuta Rajaram, Evan Hernandez, Jacob Andreas, and Antonio Torralba. A multimodal automated interpretability agent. In *Forty-first International Conference on Machine Learning*, ICML 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=mDw42ZanmE. +Alessandro Stolfo, Yonatan Belinkov, and Mrinmaya Sachan. A mechanistic interpretation of arithmetic reasoning in language models using causal mediation analysis. In Houda Bouamor, Juan Pino, and Kalika Bali (eds.), Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, EMNLP 2023, Singapore, December 6-10, 2023, pp. 7035-7052. Association for Computational Linguistics, 2023. doi: 10.18653/V1/2023.EMNLP-MAIN.435. URL https://doi.org/10.18653/v1/2023.emnlp-main.435. +Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Yaron Singer, and Stuart Shieber. Investigating gender bias in language models using causal mediation analysis. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 12388-12401. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper_files/paper/2020/file/92650b2e92217715fe312e6fa7b90d82-Paper.pdf. +Zhengxuan Wu, Atticus Geiger, Thomas Icard, Christopher Potts, and Noah Goodman. Interpretability at scale: Identifying causal mechanisms in alpaca. Advances in Neural Information Processing Systems, 36, 2024. + +# A APPENDIX + +# A.1 HYPERDAS OVER ALL DOMAINS + +Our results at Table 3a show that we can train HyperDAS to achieve state of the art performance on the RAVEL benchmark by training a separate model for each entity type split, which is the set up used to train the previous state of the art MDAS. To test the scalability and generalizability of HyperDAS, we train a single model across all the entity type splits and evaluate its performance. + +Experiment Set-up We aggregate the training split of the dataset from all 5 domains and train HyperDAS for 5 epochs. We adjust the learning rate from $2 \times 10^{-5}$ to $5 \times 10^{-4}$ and schedule the sparsity weight $\lambda$ ranging from 0.75 to 1.5 starting after $50\%$ of the total steps. This set-up allows the model to first find a stable solution across all domains with soft intervention before forcing it to converge to a single token selection. + +Result We report the performance of HyperDAS trained over all entity type split in Table 3a. The model performs better than MDAS but slightly worse than HyperDAS trained on individual entity type split by $4.0\%$ . Specifically, HyperDAS-All-Domain performs worse over city and noble laureate split, better over occupation split, and on-par over physical object and verb split. + +# A.2 DATASET SPECIFICATION + +
Domain/Attribute# of Cause Example# of IsolateExample# of Entity
City34899/701649500/99303552/3374
Country7925/15448250/16553528/2411
Language6207/12528250/16553471/2221
Continent8254/16588250/16553543/2567
Timezone5371/11448250/16553414/1900
Latitude3813/7438250/16553107/1519
Longitude3329/6758250/16552989/1357
Nobel Laureate39771/675444628/7600928/928
Country of Birth7218/13568908/1520928/909
Award Year11037/19048930/1520928/926
Gender854/968930/1520592/149
Field9518/15588930/1520928/922
Birth Year11144/18408930/1520928/927
Occupation54444/158229052/864799/785
Work Location24216/7249684/288799/708
Duty12090/3719684/288785/522
Industry18138/4879684/288799/600
Physical Object49114/465935285/3636563/563
Color14707/15188825/909563/563
Category13540/12738820/909563/562
Texture14666/12658821/909563/561
Size6201/6038819/909563/528
Verb70003/380614396/782986/984
Past Tense34043/18487188/391986/975
Singular35960/19587208/391986/978
+ +Table 1: The details of the dataset used for the experiment, in the format of train/test splits. For every model in each setting. Methods are trained on the full dataset of that setting with 5 epochs. The prompts used by the train/test splits are completely disjoint. + +# A.3 DATASET PREPROCESSING + +HyperDAS uses an attention mechanism to gather information from the hidden states of the target model $\mathcal{M}$ when running the base and counterfactual sentences. This makes HyperDAS overtly powerful in some situations. Consider the following input: + +$$ +\left\{ \begin{array}{l l} \text {B a s e} & \bar {\mathbf {x}} = \text {V i e n n a , k n o w n f o r i t s I m p e r i a l p a l a c e s , i s a c i t y i n t h e c o u n t r y o f} \\ \text {C o u n t e r f a c t u a l} & \hat {\mathbf {x}} = \text {I l o v e P a r i s} \\ \text {I n s t r u c t i o n} & \mathbf {x} = \text {L o c a l i z e t h e l a t i d u t e o f t h e c i t y} \end{array} \right. \tag {16} +$$ + +If the model works as intended, it will intervene on the 'Latitude' subspace, which will leave the 'Country' features intact and therefore the target model will predict Austria. + +However, since the model can access the hidden states $\mathcal{M}(\bar{\mathbf{x}})$ , it knows that the queried attribute in the sentence is 'Country', which is different than the targeted attribute 'Latitude'. Through training, HyperDAS learns a shortcut to a trivial solution—performing no intervention when the target attribute is different from the one mentioned in the sentence. With this shortcut, the Isolate objective no longer works and the HyperDAS fails to learn disentangled feature subspaces for different attributes. + +Figure 9 shows how the HyperDAS may learn a trivial solution to the RAVEL benchmark if the relevant information (base prompt attribute) can be accessed by the model. + +![](images/2b2ffb270e57e564018922dffea01bd6d3581328544f3c14aab51ba20f18f696.jpg) +Figure 9: The trivial solution learnt by the HyperDAS on isolate examples when no mask is applied on the attribute token in the prompt. HyperDAS learns to not intervene if it sees the base prompt attribute to be different than the attribute in the instruction. + +Therefore, for each pair of prompts $\bar{\mathbf{x}},\hat{\mathbf{x}}$ at training, we apply an intervention mask to all the tokens starting from the attribute mention. The hidden states from token with intervention mask is not visible to HyperDAS and therefore cannot be selected for intervention. The example becomes: + +$$ +\left\{ \begin{array}{l l} \text {B a s e} & \bar {\mathbf {x}} = \text {V i e n n a , k n o w n f o r i t s I m p e r i a l p a l a c e s , i s a c i t y i n t h e c o u n t r y o f} \\ \text {C o u n t e r f a c t u a l} & \hat {\mathbf {x}} = \text {I l o v e P a r i s} \\ \text {I n s t r u c t i o n} & \mathbf {x} = \text {L o c a l i z e t h e l a t i d u t e o f t h e c i t y} \end{array} \right. \tag {17} +$$ + +where the hidden states of the red text is masked from the HyperDAS. + +# A.4 LOADING HYPERDAS WITH PRE-TRAINED PARAMETERS + +We have also explored initializing the HyperDAS from a pretrained LM instead of initializing it from scratch. With Llama3-8b (Meta, 2024) as the target LM, we initialize the modules of HyperDAS, besides the multi-head cross-attention heads and pairwise token position scores attention heads, as the copy of the parameters from the target model. We then evaluate the performance of this variation of the model on the city dataset of RAVEL (Huang et al., 2024). + +![](images/cd07800e79de948b7451a5c8ebe9f2656b5c3b12218f6acc38fd459bd005ef14.jpg) +Figure 10: The loss curve of HyperDAS initialized from scratch or from pretrained LM while training on the city dataset of RAVEL. + +In Figure 10, we observe that there is no significant difference between the model initialized from scratch and the model initialized from Llama3-8b parameters. However, it remains unknown how would this difference change as the training of HyperDAS scales. + +# A.5 SPARSE AUTOENCODERS + +We experiment with different feature subspace dimension, as shown in Figure 11. We add an trained sparse autoencoder as another baseline. Following the exact same setting in (Huang et al., 2024), we train sparse autoencoder that projects the target hidden states into a higher-dimensional sparse feature space and then reconstruct the original hidden states. + +# A.6 ABLATION RESULTS + +See ablations in Table 12. + +# A.7 INTERVENTION PATTERNS + +Here we include a few demonstrations of the intervention pattern that HyperDAS generates on RAVEL, as shown in Figure 13. + +![](images/0e03f8ddd52b777f6b84305e5795c75cd9a31d367a8495010000f828e27108d4.jpg) +Figure 11: Cause (x-axis) and Iso (y-axis) scores trade-off for HyperDAS, MDAS, and SAE when using different feature size shown as the ratio $\%$ . GOAL (1, 1) indicates the score with which the method is able to disentangle the feature subspace perfectly. +Figure 12: Ablation results for HyperDAS. No DAS has no rotation matrix and intervenes on entire hidden representations. No Hypernetwork replaces concept encoding via transformer with a vector lookup. No Cross Attention removes attention head submodules connecting the hypernetwork and target model. + +
AblationCausalIsoDisentangle
HyperDAS70.893.982.4
-No Cross Attention68.283.976.1
-No DAS0.897.449.1
-No Hypernetwork15.146.931.0
+ +![](images/30f44220c9340bcf9151294e7770645e34ef825855622ab42dcf2433cd3929a4.jpg) + +![](images/58314309f87243bfb4d2cfe100145cc0de3a28946af4c5cb6b1530cdb8089f06.jpg) +(a) + +![](images/07ea85d1af475b413e58bf0c85abfaa485400847a091eba4bd539bb7926ce802.jpg) + +![](images/3bb717536c648945674ebe69680320d48cb6ad6e0ad8de67ca29a2848ba471c7.jpg) + +![](images/a1ca76d568e60762573c8b3f134dd4d2fb6ada95e52cee45b9a52d2f49ed4550.jpg) +(b) + +![](images/7d851e51c087477af09971eecdc77a6f7dbcc5b4cd8090c04cb7ebc513ce3bf2.jpg) + +![](images/9662c4fbba7311f4908ad61a577f59c3cd946a6b6fcbc26e1652f3d4e5ebef43.jpg) + +![](images/77829c5c5247aa3537b9df58979c90b32dc33bfc6f4d95de6248b4aa2ccc0bd5.jpg) +(c) + +![](images/56612d1b6c08c96f16f52b0cc01b0512e9bb431a97ca130837412f78e1852df1.jpg) + +![](images/bdbff3ac8a19deadaf97d599bd4eb30845f617317a665d539d072bf449a3cd7d.jpg) +Figure 13: Four types of intervention patterns. + +![](images/f9c5f1ccb8f504305a7685c1c1148cc330e77bfa1eca0faf13c8c59297cb86b0.jpg) +(d) + +![](images/60fb266c05e17ad690cf88976f18f07b102c2eb97bde7ac776fc0701902869ad.jpg) \ No newline at end of file diff --git a/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/images.zip b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0b9c446da62be5ecb66ac278ebf1f286a4419711 --- /dev/null +++ b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17d19ff39c458a6aecf9b196617ae573b65ac223a0158bf51311967c6e24f744 +size 909403 diff --git a/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/layout.json b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e276f323aa05fff5d5ef8f0293fec10f3871fd63 --- /dev/null +++ b/ICLR/2025/HyperDAS_ Towards Automating Mechanistic Interpretability with Hypernetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2721bbc377037decfef431838515beff4bc93ee79d6135bb1be1343bfad8574 +size 506007 diff --git a/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_content_list.json b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..67ca2d48930d91dfb2c801f9ee00a3be8928d3cb --- /dev/null +++ b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfdf900dcbfff5464b92a6143b4f5b04ac5fe8e979c2c7bd7736ee2a806d4eeb +size 111973 diff --git a/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_model.json b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fd176679ff255ad4b2243464e3b5860e0864f9fa --- /dev/null +++ b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5addc5bae7b277355427d5f2ca407497e343c55e794995b1ed2fb760a8d842f +size 134806 diff --git a/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_origin.pdf b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b66dc73ba80c956f774f4437ff93d5bb1be3deb7 --- /dev/null +++ b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/f5964a21-b0cc-4623-965a-ba4ff9d909c2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bc8a87ed0e5b8e80a2b51eaf8eb3c58576e27f857412ab9af31e04410b1edc0 +size 13366040 diff --git a/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/full.md b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fa770a4e7a167969351d38947fcb3d222e73983d --- /dev/null +++ b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/full.md @@ -0,0 +1,424 @@ +# HYPERFACE: GENERATING SYNTHETIC FACE RECOGNITION DATASETS BY EXPLORING FACE EMBEDDING HYPERSPHHERE + +Hatef Otroshi Shahreza1,2 and Sébastien Marcel1,3 + +1Idiap Research Institute, Martigny, Switzerland +$^{2}$ École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland +3Université de Lausanne (UNIL), Lausanne, Switzerland + +{hatef.otroshi,sebastien.marcel}@idiap.ch + +# ABSTRACT + +Face recognition datasets are often collected by crawling Internet and without individuals' consents, raising ethical and privacy concerns. Generating synthetic datasets for training face recognition models has emerged as a promising alternative. However, the generation of synthetic datasets remains challenging as it entails adequate inter-class and intra-class variations. While advances in generative models have made it easier to increase intra-class variations in face datasets (such as pose, illumination, etc.), generating sufficient inter-class variation is still a difficult task. In this paper, we formulate the dataset generation as a packing problem on the embedding space (represented on a hypersphere) of a face recognition model and propose a new synthetic dataset generation approach, called HyperFace. We formalize our packing problem as an optimization problem and solve it with a gradient descent-based approach. Then, we use a conditional face generator model to synthesize face images from the optimized embeddings. We use our generated datasets to train face recognition models and evaluate the trained models on several benchmarking real datasets. Our experimental results show that models trained with HyperFace achieve state-of-the-art performance in training face recognition using synthetic datasets. Project page: https://www.idiap.ch/paper/hyperface + +# 1 INTRODUCTION + +Recent advances in the development of face recognition models are mainly driven by the deep neural networks (He et al., 2016), the angular loss functions (Deng et al., 2019; Kim et al., 2022), and the availability of large-scale training datasets (Guo et al., 2016; Cao et al., 2018; Zhu et al., 2021). The large-scale training face recognition datasets are collected by crawling the Internet and without the individual's consent, raising privacy concerns. This has created important ethical and legal challenges regarding the collecting, distribution, and use of such large-scale datasets (Nat, 2022). Considering such concerns, some popular face recognition datasets, such as MS-Celeb (Guo et al., 2016) and VGGFace2 (Cao et al., 2018), have been retracted. + +With the development of generative models, generating synthetic datasets has become a promising solution to address privacy concerns in large-scale datasets (Melzi et al., 2024; Shahreza et al., 2024). In spite of several face generator models in the literature (Deng et al., 2020; Karras et al., 2019; 2020; Rombach et al., 2022; Chan et al., 2022), generating a synthetic face recognition model that can replace real face recognition datasets and be used to train a new face recognition model from scratch is a challenging task. In particular, the generated synthetic face recognition datasets require adequate inter-class and intra-class variations. While conditioning the generator models on different attributes can help increasing intra-class variations, increasing inter-class variations remains a difficult task. + +In this paper, we focus on the generation of synthetic face recognition datasets and formulate the dataset generation process as a packing problem on the embedding space (represented on the surface + +![](images/4bb61d6112b08029e927b5de5ec16e028ef013c7f4e3af2e8b7ca088c106091f.jpg) +Figure 1: Sample face images from the HyperFace dataset + +of a hypersphere) of a pretrained face recognition model. We investigate different packing strategies and show that with a simple optimization, we can find a set of reference embeddings for synthetic subjects that has a high inter-class variation. We also propose a regularization term in our optimization to keep the optimized embedding on the manifold of face embeddings. After finding optimized embeddings, we use a face generative model that can generate face images from embeddings on the hypersphere, and generate synthetic face recognition datasets. We use our generated synthetic face recognition datasets, called HyperFace, to train face recognition models. We evaluate the recognition performance of models trained using synthetic datasets, and show that our optimization and packing approach can lead to new synthetic datasets that can be used to train face recognition models. We also compare trained models with our generated dataset to models trained with previous synthetic datasets, where our generated datasets achieve competitive performance with state-of-the-art synthetic datasets in the literature. Figure 1 illustrates sample face images from our synthetic dataset. + +The remainder of this paper is organized as follows. In Section 2, we present our problem formulation and describe our proposed method to generate synthetic face datasets. In Section 3, we provide our experimental results and evaluate our synthetic datasets. In Section 4, we review related work in the literature. Finally, we conclude the paper in Section 5. + +# 2 PROBLEM FORMULATION AND PROPOSED METHOD + +# 2.1 PROBLEM FORMULATION + +Identity Hypersphere: Let us assume that we have a pretrained face recognition model $F: \mathcal{I} \to \mathcal{X}$ , which can extract identity features (a.k.a. embedding) $\pmb{x} \in \mathcal{X} \subset \mathbb{R}^{n\mathcal{X}}$ from each face image $\pmb{I} \in \mathcal{I}$ . Without loss of generality, we can assume that the extracted identity features cover a unit hypersphere1, i.e., $||\pmb{x}||_2 = 1$ , $\forall \pmb{x} \in \mathcal{X}$ . + +Representing Synthetic Dataset on the Identity Hypersphere: We can represent a synthetic face recognition dataset $\mathcal{D}$ on this hypersphere by finding the embeddings for each image in the dataset. For simplicity, let us assume that for subject $i$ in the synthetic face dataset, we can have a reference face image $I_{\mathrm{ref},i}$ and reference embedding $\pmb{x}_{\mathrm{ref},i} = F(\pmb{I}_{\mathrm{ref},i})$ . Note that the reference face image $I_{\mathrm{ref},i}$ may already exist in the synthetic dataset $\mathcal{D}$ , otherwise we can assume the reference embedding $\pmb{x}_{\mathrm{ref},i}$ as the average of embeddings of all images for subject $i$ in the dataset $\mathcal{D}$ . Therefore, the synthetic face recognition dataset $\mathcal{D}$ with $n_{\mathrm{id}}$ number of subjects can be represented as a set of reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ . + +![](images/a58f109238afb56a810c5f065bceb9727657f196e118ac4471c1c10732bc5419.jpg) +Figure 2: Block diagram of HyperFace Dataset Generation: We start from randomly synthesized face images and extract their embeddings using a pretrained face recognition model $F$ . The extracted embeddings are normalised and used as initial points $\{x_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ in our HyperFace optimization. The HyperFace optimization tries to increase the intra-class variation for synthetic identities on the manifold of the face recognition model over the hypersphere using a regularization term. The resulting points are then used by a face generator model $G$ , which can generate synthetic face images from the embeddings. + +# 2.2 HYPERFACE SYNTHETIC FACE DATASET + +HyperFace Optimization Problem: By representing a synthetic dataset $\mathcal{D}$ on the identity hypersphere as a set of reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i = 1}^{n_{\mathrm{id}}}$ , we can raise the question that "How should reference embeddings cover the identity hypersphere?" To answer this question, we remind that the distances between reference embeddings indicate the inter-class variation in the synthetic face recognition dataset $\mathcal{D}$ . Therefore, since we would like to have a high inter-class variation in the generated dataset $\mathcal{D}$ , we can say that we need to maximize the distances between reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i = 1}^{n_{\mathrm{id}}}$ . In other words, we need to solve the following optimization problem: + +$$ +\max \quad \min _ {\left\{\boldsymbol {x} _ {\text {r e f}} \right\}, i \neq j} d \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right) \quad \text {s u b j e c t t o} \quad | | \boldsymbol {x} _ {\text {r e f}, k} | | _ {2} = 1, \forall k \in \{1, \dots , n _ {\mathrm {i d}} \} \tag {1} +$$ + +where $d(\cdot ,\cdot)$ is a distance function. + +Solving the HyperFace Optimization: The optimization problem stated in Eq. 1 is a well-known optimization problem, which is known as spherical code optimization (J. H. Conway, 1998) or the Tammes problem (Tammes, 1930), where the goal is to pack a given number of points (e.g., particles, pores, electrons, etc.) on the surface of a unit sphere such that the minimum distance between points is maximized. The optimal solutions for this problem are studied for small dimensions and the number of points (Böroczky, 1983; Hárs, 1986; Musin & Tarasov, 2012; 2015). However, for a large dimension and a high number of points, there is no closed-form solution in the literature (Tokarchuk et al., 2024). For a large dimension and a high number of points, there are different approaches for solving this optimization problem (such as geometric optimization, numerical optimization, etc.). However, for a large dimension of hypersphere (i.e., $n_{\mathcal{X}}$ ) and a very large number of points (i.e., the number of subjects $n_{\mathrm{id}}$ , such as 10,000 identities in our problem), solving this optimization can be computationally expensive. To address this issue, we solve the optimization problem with an iterative approach based on gradient descent. To this end, we can randomly initialize the reference embeddings and find the optimised reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i = 1}^{n_{\mathrm{id}}}$ using the Adam optimizer (Kingma & Ba, 2015). This allows us to solve the optimization with a reasonable computation resource. For example, we can solve the optimization for $n_{\mathcal{X}} = 512$ and $n_{\mathrm{id}} = 10,000$ on a system equipped with a single NVIDIA 3090 GPU in 6 hours. + +Regularization: While we solve the optimization problem in Eq. 1 on the surface of a hypersphere, we should note that the manifold of embeddings $\mathcal{X}$ does not necessarily cover the whole surface of the hypersphere. This means if we get out of the distribution of embeddings $\mathcal{X}$ , we may not be able to generate face images from such embeddings. Therefore, we need to add a regularization term to our optimization problem that tends to keep the reference embeddings on the manifold + +Algorithm 1 HyperFace Optimization for Finding Reference Embeddings +1: Inputs: $\lambda$ : learning rate, $n_{\mathrm{itr}}$ : number of iterations, $\{\pmb{x}_g\}_{g=1}^{n_{\mathrm{gallery}}}$ : embeddings of a gallery of face images, +2: $\alpha$ : hyperparameter (contribution of regularization). +3: Output: $\pmb{X}_{\mathrm{ref}} = \{\pmb{x}_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ : optimized reference embeddings. +4: Procedure: +5: Initialize reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ +6: For $n = 1,..,n_{\mathrm{itr}}$ do +7: Find $\pmb{x}_{\mathrm{ref},i}, \pmb{x}_{\mathrm{ref},j} \in \pmb{X}_{\mathrm{ref}}$ which have minimum distance $d(\pmb{x}_{\mathrm{ref},i}, \pmb{x}_{\mathrm{ref},j})$ +8: Reg $\leftarrow \frac{1}{n_{\mathrm{id}}} \sum_{k=1}^{n_{\mathrm{id}}} \min_{\{\pmb{x}_g\}_{\mathrm{gallery}}} d(\pmb{x}_{\mathrm{ref},k}, \pmb{x}_g)$ +9: cost $\leftarrow -d(\pmb{x}_{\mathrm{ref},i}, \pmb{x}_{\mathrm{ref},j})$ +10: $\pmb{X}_{\mathrm{ref}} \gets \pmb{X}_{\mathrm{ref}} - \text{Adam}(\nabla \text{cost}, \lambda)$ +11: $\pmb{X}_{\mathrm{ref}} \gets \text{normalize}(\pmb{X}_{\mathrm{ref}})$ +12: End For +13: End Procedure + +of embeddings $\mathcal{X}$ . To this end, we consider a set of face images $\{I_i\}_{i=1}^{n_{\mathrm{gallery}}}$ as a gallery of images $^2$ and extract their embeddings to have set of valid embeddings $\{\pmb{x}_i\}_{i=1}^{n_{\mathrm{gallery}}}$ . Then, we try to minimize the distance of our reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ to the set of embeddings $\{\pmb{x}_i\}_{i=1}^{n_{\mathrm{gallery}}}$ , which approximates the manifold of embeddings $\mathcal{X}$ . To this end, for each reference embedding $\{\pmb{x}_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ , we find the closest embedding in $\{\pmb{x}_i\}_{i=1}^{n_{\mathrm{gallery}}}$ and minimize their distance. We can write the optimization in Eq. 1 as a regularized min-max optimization as follows: + +$$ +\min \quad \max _ {\left\{\boldsymbol {x} _ {\text {r e f}} \right\}, i \neq j} - d \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right) + \alpha \underbrace {\frac {1}{n _ {\mathrm {i d}}} \sum_ {k = 1} ^ {n _ {\mathrm {i d}}} \min _ {\left\{\boldsymbol {x} _ {g} \right\} _ {g = 1} ^ {n _ {\text {g a l l e r y}}}} d \left(\boldsymbol {x} _ {\text {r e f}, k}, \boldsymbol {x} _ {g}\right)} _ {\text {r e g u l a r i z a t i o n}}; \tag {2} +$$ + +$$ +\text {s u b j e c t} \quad | | \boldsymbol {x} _ {\text {r e f}, k} | | _ {2} = 1, \forall k \in \{1, \dots , n _ {\text {i d}} \}, +$$ + +where $\alpha$ is a hyperparameter that controls the contribution of the regularization term in the optimization. To provide more flexibility in our optimization, we consider the size of gallery $n_{\mathrm{gallery}}$ to be greater or equal to the number of identities $n_{\mathrm{id}}$ in the synthetic dataset (i.e., $n_{\mathrm{gallery}} \geq n_{\mathrm{id}}$ ). + +Initialization: To solve the HyperFace optimization problem in Eq. 1 using Algorithm 1, we need to initialize the reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ . To this end, we can generate $n_{\mathrm{id}}$ number random synthetic images $\{I_i\}_{i=1}^{n_{\mathrm{id}}}$ using a face generator model, such as StyleGAN (Karras et al., 2020), Latent Diffusion Model (LDM) (Rombach et al., 2022). These models use a noise vector as the input and can generate synthetic face images in an unconditional setting. Then, after generating $\{I_i\}_{i=1}^{n_{\mathrm{id}}}$ images, we can extract their embeddings using the face recognition model $F(\cdot)$ and use the extracted embeddings as initialization values for the reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ in Algorithm 1. + +Image Generation: After we find the reference embeddings $\{\pmb{x}_{\mathrm{ref},i}\}_{i = 1}^{n_{\mathrm{id}}}$ using Algorithm 1, we can use an identity-conditioned image generator model to generate face images from reference embeddings. To this end, we use a recent face generator network (Papantoniou et al., 2024), which is based on probabilistic diffusion models. The diffusion face generator model $G(\cdot ,\cdot)$ can generate a face image $\pmb {I} = G(\pmb{x}_{\mathrm{ref}},\pmb {z})$ from reference embedding $\pmb{x}_{\mathrm{ref}}$ and a random noise $z\sim \mathcal{N}(0,\mathbb{I}^{\mathrm{DM}})$ . Therefore, by changing the random noise $z$ and sampling different noise vectors, we can generate different samples for the reference embedding $\pmb{x}_{\mathrm{ref}}$ . In addition, to increase intra-class variation, we add Gaussian noise $\pmb{v}\sim \mathcal{N}(0,\mathbb{I}^{n_x})$ to the reference embedding $\pmb{x}_{\mathrm{ref}}$ , and then normalize it to locate it on the hypersphere. In summary, we can generate different samples for each reference embedding $\pmb{x}_{\mathrm{ref}}$ by changing $z$ and $\pmb{v}$ noise vectors as follows: + +$$ +\boldsymbol {I} = G \left(\frac {\boldsymbol {x} _ {\text {r e f}} + \beta \boldsymbol {v}}{\left| \left| \boldsymbol {x} _ {\text {r e f}} + \beta \boldsymbol {v} \right| \right| _ {2}}, \boldsymbol {z}\right), \quad \boldsymbol {v} \sim \mathcal {N} \left(0, \mathbb {I} ^ {n _ {\mathcal {X}}}\right), \boldsymbol {z} \sim \mathcal {N} \left(0, \mathbb {I} ^ {\mathrm {D M}}\right), \tag {3} +$$ + +Table 1: Comparison of recognition performance of face recognition models trained with different synthetic datasets and a real dataset (i.e., CASIA-WebFace). The performance reported for each dataset is in terms of accuracy and best value for each benchmark is emboldened. + +
Dataset name#IDs#ImagesLFWCPLFWCALFWCFPAgeDB
SynFace (Qiu et al., 2021)10'000999'99486.5765.1070.0866.7959.13
SFace (Boutrós et al., 2022)10'5721'885'87793.6574.9080.9775.3670.32
Syn-Multi-PIE (Colbois et al., 2021)10'000180'00078.7260.2261.8360.8454.05
IDnet (Kolf et al., 2023)10'5771'057'20084.4868.1271.4268.9362.63
ExFaceGAN (Boutrós et al., 2023b)10'000599'94485.9866.9770.0066.9657.37
GANDiffFace (Melzi et al., 2023)10'080543'89394.3576.1579.9078.9969.82
Langevin-Dispersion (Geissbühler et al., 2024)10'000650'00094.3865.7586.0365.5177.30
Langevin-DisCo (Geissbühler et al., 2024)10'000650'00097.0776.7389.0579.5683.38
DigiFace-1M (Bae et al., 2023)109'9991'219'99590.6872.5573.7579.4368.43
IDiff-Face (Uniform) (Boutrós et al., 2023a)10'049502'45098.1880.8790.8282.9685.50
IDiff-Face (Two-Stage) (Boutrós et al., 2023a)10'050502'50098.0077.7788.5582.5782.35
DCFace (Kim et al., 2023)10'000500'00098.3583.1291.7088.4389.50
HyperFace [ours]10'000500'00098.5084.2389.4088.8386.53
CASIA-WebFace (Yi et al., 2014)10'572490'62399.4290.0293.4394.9794.32
+ +where $\beta$ is a hyperparameter that controls the variations to the reference embedding. Figure 2 depicts the block diagram of our synthetic dataset generation process. Algorithm 3 in Appendix F also present a pseudo-code of dataset generation process. + +# 3 EXPERIMENTS + +# 3.1 EXPERIMENTAL SETUP + +Dataset Generation: For solving the HyperFace optimization in Algorithm 1, we use an initial learning rate of $\lambda = 0.01$ and reduce the learning rate by power 0.75 every 5,000 iterations for a total number of iterations $n_{\mathrm{itr}} = 100,000$ . We also consider cosine distance, which is commonly used in face recognition systems for the comparison of face embeddings, as our distance function $d(\cdot ,\cdot)$ . For the hyperparameters $\alpha$ and $\beta$ , we consider default values of 0.5 and 0.01, respectively, in our experiments. We also consider the size of gallery to be the same as the number of identities, and explore other cases where $n_{\mathrm{gallery}} > n_{\mathrm{id}}$ in our ablation study. We generate 64 images, by default, per each identity in our generated datasets and explore other numbers of images in our ablation study. + +We use ArcFace (Deng et al., 2019) as the pretrained face recognition model $F(\cdot)$ with the embedding dimension of $n_{\mathcal{X}} = 512$ and use a pretrained generator model (Papantoniou et al., 2024) to generate face images from ArcFace embeddings. After generating face images, we align all face images using a pretrained MTCNN (Zhang et al., 2016) face detector model. For our regularization, we randomly generate images with StyleGAN (Karras et al., 2020) as default, and investigate other generator models in our ablation study. + +Evaluation: To evaluate the generated synthetic datasets, we use each generated datasets as a training dataset for training a face recognition model. To this end, we use the iResNet50 backbone and train the model with AdaFace loss function (Kim et al., 2022) using the Stochastic Gradient Descent (SGD) optimizer with the initial learning rate 0.1 and a weight decay of $5 \times 10^{-4}$ for 30 epochs with the batch size of 256. After training the face recognition model with the synthetic dataset, we benchmark the performance of the trained face recognition models on different benchmarking datasets of real images, including Labeled Faces in the Wild (LFW) (Huang et al., 2008), Cross-age LFW (CA-LFW) (Zheng et al., 2017), CrossPose LFW (CP-LFW) (Zheng & Deng, 2018), Celebrities in Frontal-Profile in the Wild (CFP-FP) (Sengupta et al., 2016), and AgeDB-30 (Moschoglou et al., 2017) datasets. For consistency with prior works, we report recognition accuracy calculated using 10-fold cross-validation for each of benchmarking datasets. The source code of our experiments and generated datasets are publicly available3. + +# 3.2 ANALYSIS + +Comparison with Previous Synthetic Datasets: We compare the recognition performance of face recognition models trained with our synthetic dataset and previous synthetic datasets in the literature. We use the published dataset for each method and train all models with the same configuration for different datasets to prevent the effect of other hyperparameters (such as number of epochs, batch size, etc.). For a fair comparison, we consider the versions of datasets with a similar number of identities $^4$ , if there are different datasets available for each method. Table 1 compares the recognition performance of face recognition models trained with different synthetic datasets. As the results in this table show, our method achieves state-of-the-art performance in training face recognition using synthetic data. Figure 1 illustrates sample face images from our synthetic dataset. Figure 4 of appendix also presents more sample images from HyperFace dataset. + +Ablation Study: In our dataset generation method, there are different hyperparameters which can affect the HyperFace optimization and the generated synthetic datasets. Table 2 reports the ablation study on the number of images generated per each synthetic identity in our experiments. As the results in Table 2 show, increasing the number of images per identity + +improves the recognition performance of trained face recognition model, but it tends to saturate after 64 images per identity. + +Table 2: Ablation study on the effect of number of images + +
Image/IDLFWCPLFWCALFWCFPAgeDB
3298.7084.1788.8388.7486.33
5098.5084.2389.4088.8386.53
6498.6784.6889.8289.1487.07
9698.4284.1589.0089.5187.45
12898.2083.6389.8289.3187.62
+ +Table 3 also compares the number of identities in the generated dataset, including 10k, 20k, and 50k identities. As the results in Table 3 show, increasing the number of identities improves the recognition performance of trained face recognition model on the benchmarking datasets. The re + +Table 3: Ablation study on the effect of number of identities + +
#IDsLFWCPLFWCALFWCFPAgeDB
10k98.6784.6889.8289.1487.07
30k98.8285.2391.1291.7489.42
50k98.2785.6091.4892.2490.40
+ +sults in this table demonstrates that we can still increase the number of identities and scale our dataset generation without saturating the performance. The main issue for increasing the size of dataset is computation resource, which is discussed in detail in Appendix A. We can also reduce the complexity of our optimization for large number of identities, which is discussed in detail in Appendix B. + +Table 4 reports the recognition performance achieved for face recognition model trained with datasets with 10k identity and optimized with different numbers of gallery images. As the results in this table shows, increasing the size of gallery improves the performance of the trained model. + +Table 4: Ablation study on the effect of ${n}_{\text{gallery }}$ + +
ngalleryLFWCPLFWCALFWCFPAgeDB
10K98.5384.0088.9289.3485.9
20K98.5084.3289.2889.1786.00
50K98.7284.2388.7289.1986.85
+ +However, with 10,000 images we can still approximate the manifold of face embeddings on the hypersphere. + +As another ablation study, we use different source of images for the gallery set to use in our regularization and solve the HyperFace optimization. We use pretrained StyleGAN (Karras et al., 2020) as a GAN-based generator model and a pretrained latent diffusion model (Rombach et al., 2022) as a diffusion-based generator model. We use these generator models and randomly generate some synthetic face images. In addition, for our ablation study, we consider some real images from BUPT dataset (Wang et al., 2019) as a dataset of real face images. + +As the results in Table 5 show, optimization with images from StyleGAN and LDM lead to comparable performance for the generated face recognition dataset. However, the real images in the BUPT dataset lead to superior performance. This suggests that the synthesized images cannot completely cover the manifold of + +embeddings and if we use real images as our gallery it can improve the generated dataset and recognition performance of our face recognition model. + +Table 5: Ablation study on the type of data in gallery + +
GalleryLFWCPLFWCALFWCFPAgeDB
StyleGAN98.6784.6889.8289.1487.07
LDM98.6584.3589.1789.0986.35
BUPT98.7084.7790.0389.1687.13
+ +We also study the effect of hyperparameters $\alpha$ and $\beta$ on the generated face recognition dataset. Table 6 reports the ablation study for the contribution of regularization in our optimization $(\alpha)$ . As the results in this table show, the regularization enhances the quality of generated dataset and improves the recognition + +performance of face recognition model. In fact, our regularization term helps our optimization to keep the points on the manifold of face recognition over the hypersphere, and therefore improves the quality of our synthetic dataset. + +Similarly, Table 7 reports the ablation study for the effect of noise in data generation and augmentation (i.e., hyperparameter $\beta$ in Eq. 3). As can be seen, the added noise increases the variation for images of each subject and increases the performance of face recognition models trained with the generated datasets. With a larger + +Table 6: Ablation study on the effect of $\alpha$ + +
αLFWCPLFWCALFWCFPAgeDB
098.4084.1588.8789.3186.48
0.5098.6784.6889.8289.1487.07
0.7598.6284.3289.4889.6786.72
1.098.5584.7289.1089.7686.63
+ +value of $\beta$ , the generated images for each identity have more variations, which increases the performance of the face recognition model trained with our synthetic dataset. + +As another experiment, we consider different backbones and train face recognition models with different number of layers. As the results in Table 8 show, increasing the number of layers improves the recognition performance of trained face recognition model. While this is expected and has been observed for training us + +Table 8: Ablation study on the network structure + +
NetworkLFWCPLFWCALFWCFPAgeDB
ResNet1898.3381.3888.5386.0385.27
ResNet3498.583.4788.8888.2986.42
ResNet5098.6784.6889.8289.1487.07
ResNet10198.7385.4390.0589.5487.52
+ +ing large-scale face recognition datasets, it sheds light on more potentials in the generated synthetic datasets. + +# 3.3 DISCUSSION + +Scaling Dataset Generation: To increase the size of the synthetic face recognition dataset, we can increase the number of images per identity and also the number of samples per identity. In our ablation study, we investigated the effect of the number of images (Table 2) and the number of identities (Table 3) on the recognition performance of the face recognition model. However, increasing the size of the dataset requires more computation. Increasing the number of images in the dataset has linear complexity in our image generation step (i.e., $\mathcal{O}(n_{\mathrm{images}})$ , where $n_{\mathrm{images}}$ is the number of images in the generated dataset). However, the complexity of solving the HyperFace optimization problem with iterative optimization in Algorithm 1 has quadratic complexity (i.e., $\mathcal{O}(n_{\mathrm{id}}^2)$ ). Therefore, solving this optimization for a larger number of identities requires much more computation + +![](images/d2e509d2f5d22f2973f43b6678e5f076fe6f21e658aa6b69152740749a862b27.jpg) +Figure 3: Sample pairs of images with the highest similarity between face embeddings of images in synthesized dataset and training dataset of StyleGAN, which was used to generate random images for initialization and regularization in the HyperFace optimization. + +![](images/c482e50309a12f60d18da86c36fd702339455f5981749406b361b621cc83aa06.jpg) + +resources. Meanwhile, most existing synthetic datasets in the literature have a comparable number of identities to our experiments. We should note that in our optimization, we considered all points in each iteration of optimization which introduces quadratic complexity to our optimization. However, we can solve the optimization with stochastic mini-batches of points on the embedding hypersphere, which can reduce the complexity in each iteration (i.e., $\mathcal{O}(b^2)$ , where $b$ is the size of batch and $b \leq n_{\mathrm{id}}$ ). We further discuss the complexity of our optimization and dataset generation in Appendix A and present further analyses for stochastic optimization, that reduces the complexity of our optimization in Appendix B. + +Leakage of Identity: In our dataset generation method, we used images synthesized by StyleGAN for initialization and regularization. Therefore, it is important if there is any leakage of privacy data in the images generated from StyleGAN in the final generated dataset. To this end, we extract and compare embeddings from all the generated images to embeddings of all face images in the training dataset of StyleGAN. The highest similarity score between generated images and training dataset correspond to children images (as shown in Figure 3a) which are difficult to compare visually and conclude potential leakage. Figure 3b illustrates images of highest scores excluding children. While there are some visual similarities in the images, it is difficult to conclude leakage of identity in the generated synthetic dataset. We further study the effect of identity leakage on the recognition performance of face recognition models in Appendix D. + +Ethical Considerations: State-of-the-art face recognition models are trained with large-scale face recognition datasets, which are crawled from the Internet, raising ethical and privacy concerns. To address the ethical and privacy concerns with web-crawled data, we can use synthetic data to train face recognition models. However, generating synthetic face recognition datasets also requires face generator models which are trained from a set of real face images. Therefore, we still rely on real face images in the generation pipeline. In our experiments, we investigated if we have leakage of identity in the generated synthetic dataset based on images used for initialization and regularization. However, there are other privacy-sensitive components used in our method. For example, we defined and solved our optimization problem on the embedding hypersphere of a pretrained face recognition model. Therefore, for generating fully privacy-friendly datasets, the leakage of information by other components needs to be investigated. + +We should also note that while we tried to increase the inter-class variations in our method, there might be still a potential lack of diversity in different demography groups, stemming from implicit biases of the datasets used for training in our pipeline (such as the pretrained face recognition model, the gallery of images used for regularization, etc.). It is also noteworthy that the project on which the work has been conducted has passed an Institutional Ethical Review Board (IRB). + +# 4 RELATED WORK + +With the advances in generative models, several synthetic face recognition datasets have been proposed in the literature. Bae et al. (2023) proposed DigiFace dataset where they used a computer graphic pipeline to render different identities and also generate different images for each identity by introducing different variations based on face attributes (e.g., variation in facial pose, accessories, and textures). In contrast to (Bae et al., 2023), other papers in the literature used Generative Adversarial Networks (GANs) or probabilistic Diffusion Models (PDMs) to generate synthetic face datasets. Qiu et al. (2021) proposed SynFace and utilised DiscoFaceGAN (Deng et al., 2020) to generate their dataset. They generated different synthetic identities using identity mixup by exploring the latent space of DiscoFaceGAN to increase intra-class variation and then used DiscoFaceGAN to generate different images for each identity. + +Boutros et al. (2022) proposed SFace by training an identity-conditioned StyleGAN (Karras et al., 2020) on the CASIA-WebFace (Yi et al., 2014) and then generating the SFace dataset using the trained model. Kolf et al. (2023) also trained an identity-conditioned StyleGAN (Karras et al., 2020) in a three-player GAN framework to integrate the identity information into the generation process and proposed the IDnet dataset. Colbois et al. (2021) proposed the Syn-Multi-PIE dataset using a pretrained StyleGAN (Karras et al., 2020). They trained a support vector machine (SVM) to find directions for different variations (such as pose, illuminations, etc.) in the intermediate latent space of a pretrained StyleGAN. Then, they used StyleGAN to generate different identities and synthesized different images for each identity by exploring the intermediate latent space of StyleGAN using linear combinations of calculated directions. Boutros et al. (2023b) proposed ExFaceGAN, where they used SVM to disentangle the identity information in the latent space of pretrained GANs, and then generated different identities with several images within the corresponding identity boundaries. Geissbühler et al. (2024) used stochastic Brownian forces to sample different identities in the intermediate latent space of pretrained StyleGAN (Karras et al., 2020) and generate different identities (named Langavien). Then they solved a similar dynamical equation in the latent space of StyleGAN to generate different images for each identity (named Langavien-Dispersion) and further explored the intermediate latent space of StyleGAN (named Langavien-DisCo). + +Melzi et al. (2023) proposed GANDiffFace, a hybrid dataset generation framework, where they used StyleGAN to generate face images with different identities, and then used DreamBooth (Ruiz et al., 2023) as a diffusion-based generator, to generate different samples for each identity. Boutros et al. (2023a) trained an identity-conditioned diffusion model to generate synthetic face images and proposed IDiffFace datasets. They generated different samples using an unconditional model, and then generated different samples using their conditional diffusion model (named IDiff-Face Two-Stage). Alternatively, they uniformly sampled different identities and generated different samples for each identity using their identity-conditioned diffusion model (named IDiff-Face Uniform). Kim et al. (2023) proposed DCFace, where they trained a dual condition (style and identity conditions) face generator model based on diffusion models on the CASIA-WebFace dataset. They used their trained diffusion model to generate different identities and different styles for each identity by varying identity and style conditions. + +# 5 CONCLUSION + +In this paper, we formalized the dataset generation as a packing problem on the hypersphere of a pretrained face recognition model. We focused on inter-class variation and designed our packing problem to increase the distance between synthetic identities. Then, we considered our packing problem as a regularized optimization and solved it with an iterative gradient-descent-based approach. Since the manifold of face embeddings does not cover the whole hypersphere, the regularization allows us to approximate the manifold of face embeddings and enhance the quality of generated face images. We used the generated datasets by our method (called HyperFace) to train face recognition models, and evaluated the trained models on several real benchmarking datasets. Our experiments demonstrate the effectiveness of our approach, which achieves state-of-the-art performance for training face recognition using synthetic data. We also presented an extensive ablation study to investigate the effect of each hyperparameter in our dataset generation method. + +# ACKNOWLEDGMENTS + +This research is based upon work supported by the Hasler foundation through the "Responsible Face Recognition" (SAFER) project. + +# REFERENCES + +The rise and fall (and rise) of datasets. Nature Machine Intelligence, 4(1):1-2, 2022. doi: 10.1038/s42256-022-00442-2. URL https://doi.org/10.1038/s42256-022-00442-2. +Gwangbin Bae, Martin de La Gorce, Tadas Baltrusaitis, Charlie Hewitt, Dong Chen, Julien Valentin, Roberto Cipolla, and Jingjing Shen. Digiface-1m: 1 million digital face images for face recognition. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 3526-3535, 2023. +K Boroczky. The problem of tammes for $n = 11$ . Studia Sci. Math. Hungar, 18(2-4):165-171, 1983. +Fadi Boutros, Marco Huber, Patrick Siebke, Tim Rieber, and Naser Damer. Sface: Privacy-friendly and accurate face recognition using synthetic data. In 2022 IEEE International Joint Conference on Biometrics (IJCB), pp. 1-11. IEEE, 2022. +Fadi Boutros, Jonas Henry Grebe, Arjan Kuijper, and Naser Damer. Idiff-face: Synthetic-based face recognition through fizzy identity-conditioned diffusion model. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 19650-19661, 2023a. +Fadi Boutros, Marcel Klemt, Meiling Fang, Arjan Kuijper, and Naser Damer. Exfacegan: Exploring identity directions in gan's learned latent space for synthetic identity generation. In 2023 IEEE International Joint Conference on Biometrics (IJCB), pp. 1-10. IEEE, 2023b. +Qiong Cao, Li Shen, Weidi Xie, Omkar M Parkhi, and Andrew Zisserman. Vggface2: A dataset for recognising faces across pose and age. In 2018 13th IEEE international conference on automatic face & gesture recognition (FG 2018), pp. 67-74. IEEE, 2018. +Eric R Chan, Connor Z Lin, Matthew A Chan, Koki Nagano, Boxiao Pan, Shalini De Mello, Orazio Gallo, Leonidas J Guibas, Jonathan Tremblay, Sameh Khamis, et al. Efficient geometry-aware 3d generative adversarial networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16123-16133, 2022. +Laurent Colbois, Tiago de Freitas Pereira, and Sébastien Marcel. On the use of automatically generated synthetic image datasets for benchmarking face recognition. In 2021 IEEE International Joint Conference on Biometrics (IJCB), pp. 1-8. IEEE, 2021. +Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4690-4699, 2019. +Yu Deng, Jiaolong Yang, Dong Chen, Fang Wen, and Xin Tong. Disentangled and controllable face image generation via 3d imitative-contrastive learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5154-5163, 2020. +David Geissbuhler, Hatef Otroshi Shahreza, and Sébastien Marcel. Synthetic face datasets generation via latent space exploration from brownian identity diffusion. arXiv preprint arXiv:2405.00228, 2024. +Yandong Guo, Lei Zhang, Yuxiao Hu, Xiaodong He, and Jianfeng Gao. Ms-celeb-1m: A dataset and benchmark for large-scale face recognition. In Computer Vision-ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part III 14, pp. 87-102. Springer, 2016. +L Hárs. The tammes problem for $n = 10$ . Studia Sci. Math. Hungar, 21(3-4):439-451, 1986. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. + +Gary B Huang, Marwan Mattar, Tamara Berg, and Eric Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. In Workshop on faces in 'Real-Life' Images: detection, alignment, and recognition, 2008. +N. J. A. Sloane J. H. Conway. Sphere Packings, Lattices and Groups. Springer New York, NY, 1998. ISBN 978-0-387-98585-5. doi: https://doi.org/10.1007/978-1-4757-6568-7. +Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4401-4410, 2019. +Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 8110-8119, 2020. +Minchul Kim, Anil K Jain, and Xiaoming Liu. Adaface: Quality adaptive margin for face recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 18750-18759, 2022. +Minchul Kim, Feng Liu, Anil Jain, and Xiaoming Liu. Dcface: Synthetic face generation with dual condition diffusion model. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12715-12725, 2023. +Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), San Diego, California., USA, May 2015. +Jan Niklas Kolf, Tim Rieber, Jurek Elliesen, Fadi Boutros, Arjan Kuijper, and Naser Damer. Identity-driven three-player generative adversarial network for synthetic-based face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 806-816, 2023. +Pietro Melzi, Christian Rathgeb, Ruben Tolosana, Ruben Vera-Rodriguez, Dominik Lawatsch, Florian Domin, and Maxim Schaubert. Gandifface: Controllable generation of synthetic datasets for face recognition with realistic variations. arXiv preprint arXiv:2305.19962, 2023. +Pietro Melzi, Ruben Tolosana, Ruben Vera-Rodriguez, Minchul Kim, Christian Rathgeb, Xiaoming Liu, Ivan DeAndres-Tame, Aythami Morales, Julian Fierrez, Javier Ortega-Garcia, et al. Frcsyn challenge at wacv 2024: Face recognition challenge in the era of synthetic data. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 892-901, 2024. +Stylianos Moschoglou, Athanasios Papaioannou, Christos Sagonas, Jiankang Deng, Irene Kotsia, and Stefanos Zafeiriou. Agedb: the first manually collected, in-the-wild age database. In proceedings of the IEEE conference on computer vision and pattern recognition workshops, pp. 51-59, 2017. +Oleg R Musin and Alexey S Tarasov. The strong thirteen spheres problem. Discrete & Computational Geometry, 48:128-141, 2012. +Oleg R Musin and Alexey S Tarasov. The tammes problem for $n = 14$ . Experimental Mathematics, 24(4):460-468, 2015. +Foivos Paraperas Papantoniou, Alexandros Lattas, Stylianos Moschoglou, Jiankang Deng, Bernhard Kainz, and Stefanos Zafeiriou. Arc2face: A foundation model of human faces. arXiv preprint arXiv:2403.11641, 2024. +Haibo Qiu, Baosheng Yu, Dihong Gong, Zhifeng Li, Wei Liu, and Dacheng Tao. Synface: Face recognition with synthetic data. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 10880-10890, 2021. +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 10684-10695, 2022. + +Nataniel Ruiz, Yuanzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22500-22510, 2023. +Soumyadip Sengupta, Jun-Cheng Chen, Carlos Castillo, Vishal M Patel, Rama Chellappa, and David W Jacobs. Frontal to profile face verification in the wild. In 2016 IEEE winter conference on applications of computer vision (WACV), pp. 1-9. IEEE, 2016. +Hatef Otroshi Shahreza, Christophe Ecabert, Anjith George, Alexander Unnervik, Sébastien Marcel, Nicolò Di Domenico, Guido Borghi, Davide Maltoni, Fadi Boutros, Julia Vogel, et al. Sdfr: Synthetic data for face recognition competition. In 2024 IEEE 18th International Conference on Automatic Face and Gesture Recognition (FG), pp. 1-9. IEEE, 2024. +Pieter Merkus Lambertus Tammes. On the origin of number and arrangement of the places of exit on the surface of pollen-grains. Recueil des travaux botaniques neerlandais, 27(1):1-84, 1930. +Evgeniia Tokarchuk, Hua Chang Bakker, and Vlad Niculae. On the matter of embeddings dispersion on hyperspheres. In ICML 2024 Workshop on Geometry-grounded Representation Learning and Generative Modeling, 2024. +Mei Wang, Weihong Deng, Jiani Hu, Xunqiang Tao, and Yaohai Huang. Racial faces in the wild: Reducing racial bias by information maximization adaptation network. In Proceedings of the IEEE/cvf international conference on computer vision, pp. 692-702, 2019. +Dong Yi, Zhen Lei, Shengcai Liao, and Stan Z Li. Learning face representation from scratch. arXiv preprint arXiv:1411.7923, 2014. +Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, and Yu Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE signal processing letters, 23(10):1499-1503, 2016. +Tianyue Zheng and Weihong Deng. Cross-posed ffw: A database for studying cross-posed face recognition in unconstrained environments. Beijing University of Posts and Telecommunications, Tech. Rep, 5(7), 2018. +Tianyue Zheng, Weihong Deng, and Jiani Hu. Cross-age lfw: A database for studying cross-age face recognition in unconstrained environments. arXiv preprint arXiv:1708.08197, 2017. +Zheng Zhu, Guan Huang, Jiankang Deng, Yun Ye, Junjie Huang, Xinze Chen, Jiagang Zhu, Tian Yang, Jiwen Lu, Dalong Du, et al. Webface260m: A benchmark unveiling the power of million-scale deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10492-10502, 2021. + +# A COMPLEXITY AND REQUIRED COMPUTATION RESOURCE + +The computation required to generate the synthetic datasets in our approach has two main parts: + +1. HyperFace Optimization: The HyperFace optimization (Algorithm 1) considers all reference points $\{\pmb{x}_{\mathrm{ref},i}\}_{i = 1}^{n_{\mathrm{id}}}$ in the hypersphere and maximizes their distances. Therefore, this optimization considers all pairs of points and has quadratic complexity (i.e., $\mathcal{O}(n_{\mathrm{id}}^2)$ ). + +Table 9 reports the runtime for solving the HyperFace optimization for different numbers of identities (i.e., $n_{\mathrm{id}}$ ) on a system equipped with a single NVIDIA 3090 GPU. Note that this optimization process cannot be parallelized. + +Table 9: Runtime for solving the HyperFace optimization (Algorithm 1) for different numbers of identities on a system equipped with a single NVIDIA 3090 GPU. + +
n_idHyperFace Optimization Runtime
10k6 hours
20k11 hours
30k23 hours
50k84 hours
+ +We should note that instead of solving the HyperFace optimization on all pairs of points, we can solve the optimization stochastically in which in each iteration a mini-batch of points is considered and optimized. Therefore the complexity will become $\mathcal{O}(b^2)$ , where $b$ is size of mini-batch and $b \leq n_{\mathrm{id}}$ . This way the complexity of our method can be independent of the number of identities and significantly reduced (especially for $b \ll n_{\mathrm{id}}$ ). Our stochastic optimization is further studied and discussed in Section B of this Appendix. + +2. Image Generation: After solving the HyperFace optimization, we need to use the generator network in inference mode and generate the required number of images. Therefore, the generation of dataset has a linear complexity with respect to the number of images (i.e., $\mathcal{O}(n_{\mathrm{images}})$ , where $n_{\mathrm{images}}$ is the number of images in the generated dataset). The average runtime for generating a single synthetic face image on a system equipped with a single NVIDIA 3090 GPU is 1.25 seconds. For example, generating a dataset with 500,000 images takes about 174 hours on a single NVIDIA 3090 GPU. Note that this optimization process can be parallelized, and therefore image generation can be deployed on a cluster or a farm of GPUs. + +# B HYPERFACE STOCHASTIC OPTIMIZATION + +As discussed in Appendix A, HyperFace optimization (Algorithm 1) considers all reference points $\{\pmb{x}_{\mathrm{ref},i}\}_{i = 1}^{n_{\mathrm{id}}}$ and has a quadratic complexity $\mathcal{O}(n_{\mathrm{id}}^2)$ . To reduce this complexity, in each iteration, we can randomly select a mini-batch of $b$ points and only optimize the selected $b$ reference points instead of all $n_{\mathrm{id}}$ reference points. This way in each iteration we can compare only $\binom{b}{2}$ pairs instead of $\binom{n_{\mathrm{id}}}{2}$ pairs, and therefore the complexity of our optimization will become $\mathcal{O}(b^2)$ . In the following, we first theoretically prove that the expected mini-batch gradient approximates the full gradient, and then validate it with experimental analyses. + +Theorem 1. Let $X_{ref} = \{x_{ref,i}\}_{i=1}^{n_{id}}$ represent $n_{id}$ points on a $n_{\mathcal{X}}$ -dimensional hypersphere $S$ . Consider an objective function: + +$$ +\mathcal{L}(\boldsymbol{X}_{ref}) = \frac{1}{\binom{n_{id}}{2}}\sum_{i = 1}^{n_{id}}\sum_{j = i + 1}^{n_{id}}\ell (\boldsymbol{x}_{ref,i},\boldsymbol{x}_{ref,j}), +$$ + +where $\ell(\cdot, \cdot)$ denotes a pairwise function. The goal is to minimize $\mathcal{L}(\boldsymbol{X}_{ref})$ for $\boldsymbol{X}_{ref} = \{\boldsymbol{x}_{ref,i}\}_{i=1}^{n_{id}}$ . Suppose in each iteration, instead of computing $\nabla \mathcal{L}(\boldsymbol{X}_{ref})$ over all $\binom{n_{id}}{2}$ pairs, we approximate it using a random mini-batch $B \subset \boldsymbol{X}_{ref}$ of size $b \ll n_{id}$ . Then, the expected batch gradient approximates the full gradient: + +$$ +\mathbb {E} \left[ \nabla \mathcal {L} _ {B} \left(\boldsymbol {X} _ {\text {r e f}}\right) \right] = \nabla \mathcal {L} \left(\boldsymbol {X} _ {\text {r e f}}\right). \tag {4} +$$ + +Proof. For a batch $B$ of size $b$ , the batch objective is: + +$$ +\mathcal {L} _ {B} \left(\boldsymbol {X} _ {\text {r e f}}\right) = \frac {1}{\binom {b} {2}} \sum_ {i \in B} \sum_ {j \in B, j > i} \ell \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right). \tag {5} +$$ + +The full gradient of $\mathcal{L}(\mathbf{X}_{\mathrm{ref}})$ is: + +$$ +\nabla \mathcal {L} \left(\boldsymbol {X} _ {\text {r e f}}\right) = \frac {1}{\binom {n _ {\mathrm {i d}}} {2}} \sum_ {i = 1} ^ {n _ {\mathrm {i d}}} \sum_ {j = i + 1} ^ {n _ {\mathrm {i d}}} \nabla \ell \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right). \tag {6} +$$ + +Similarly, the batch gradient is: + +$$ +\nabla \mathcal {L} _ {B} \left(\boldsymbol {X} _ {\text {r e f}}\right) = \frac {1}{\binom {b} {2}} \sum_ {i \in B} \sum_ {j \in B, j > i} \nabla \ell \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right). \tag {7} +$$ + +The expectation over all possible batches $B$ is: + +$$ +\mathbb {E} \left[ \nabla \mathcal {L} _ {B} \left(\boldsymbol {X} _ {\text {r e f}}\right) \right] = \frac {1}{\binom {b} {2}} \sum_ {i = 1} ^ {n _ {\mathrm {i d}}} \sum_ {j = i + 1} ^ {n _ {\mathrm {i d}}} P [ (i, j) \in B ] \nabla \ell \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right), \tag {8} +$$ + +where $P[(i,j) \in B]$ is the probability of selecting the pair $(i,j)$ in a random batch. For uniformly sampled random batches: + +$$ +P [ (i, j) \in B ] = \frac {\binom {b} {2}}{\binom {n _ {\mathrm {i d}}} {2}} \tag {9} +$$ + +By substituting $P[(i,j) \in B]$ into the expectation in Eq. 8, we will have: + +$$ +\mathbb {E} \left[ \nabla \mathcal {L} _ {B} \left(\boldsymbol {X} _ {\text {r e f}}\right) \right] = \frac {1}{\binom {n _ {\mathrm {i d}}} {2}} \sum_ {i = 1} ^ {n _ {\mathrm {i d}}} \sum_ {j = i + 1} ^ {n _ {\mathrm {i d}}} \nabla \ell \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right) = \nabla \mathcal {L} \left(\boldsymbol {X} _ {\text {r e f}}\right). \tag {10} +$$ + +Thus, the batch gradient is an unbiased estimator of the full gradient. + +![](images/0635f6f272b0d3d7bc910f558c1fae3804cffae37dba7f56616d3770122255c7.jpg) + +Corollary 1. A special case for Theorem 1 is when function $\ell(\boldsymbol{x}_{\text{ref},i}, \boldsymbol{x}_{\text{ref},j})$ is defined as follows: + +$$ +\ell \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right) = \left\{ \begin{array}{l l} - d \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right) & (i, j) = \operatorname {a r g m a x} _ {\boldsymbol {X} _ {\text {r e f}}, i \neq j} - d \left(\boldsymbol {x} _ {\text {r e f}, i}, \boldsymbol {x} _ {\text {r e f}, j}\right) \\ 0 & \text {o t h e r w i s e .} \end{array} \right. \tag {11} +$$ + +Therefore, we can rewrite Algorithm 1 with a stochastic optimization as presented in Algorithm 2. + +# Algorithm 2 HyperFace Stochastic Optimization for Finding Reference Embeddings + +1: Inputs: $\lambda$ : learning rate, $n_{\mathrm{itr}}$ : number of iterations, $\{\pmb{x}_g\}_{g=1}^{n_{\mathrm{gallery}}}$ : embeddings of a gallery of face images, +2: $\alpha$ : hyperparameter (contribution of regularization), $b$ : size of mini-batch. +3: Output: $\mathbf{X}_{\mathrm{ref}} = \{\pmb{x}_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ : optimized reference embeddings. +4: Procedure: +5: Initialize reference embeddings $X_{\mathrm{ref}} = \{\pmb{x}_{\mathrm{ref},i}\}_{i = 1}^{n_{\mathrm{d}}}.$ +6: For $n = 1, \dots, n_{\mathrm{itr}}$ do +7: Sample a random mini-batch $B\subset X_{\mathrm{ref}}$ of size $b$ ▷ Sampling a random mini-batch +8: Find $\pmb{x}_{\mathrm{ref},i}, \pmb{x}_{\mathrm{ref},j} \in B$ which have minimum distance $d(\pmb{x}_{\mathrm{ref},i}, \pmb{x}_{\mathrm{ref},j})$ +9: Reg $\leftarrow \frac{1}{b}\sum_{k = 1}^{b}\min_{\{\pmb{x}_{g}\}_{\mathrm{gallery}}}d(\pmb{x}_{\mathrm{ref},k},\pmb{x}_{g})$ $\triangleright$ Calculate the regularization term +10: $\mathrm{cost}\gets -d(\pmb{x}_{\mathrm{ref},i},\pmb{x}_{\mathrm{ref},j})$ +11: $B\gets B - \mathrm{Adam}(\nabla \mathrm{cost},\lambda)$ +12: $B\gets \mathrm{normalize}(B)$ To ensure that resulting embeddings B remain on the hypersphere. +13: Update $B$ in $\mathbf{X}_{\mathrm{ref}}$ +14: End For +15: End Procedure + +To validate our theoretical analyses, we implement the HyperFace stochastic optimization (Algorithm 2) and use the optimized embeddings to generate synthetic face recognition datasets. We + +consider 30,000 synthetic identities and solve HyperFace stochastic optimization (Algorithm 2) for different batch sizes. In each case, after solving the stochastic optimization, we generate 50 synthetic images per identity as described in Section 2 (Image Generation). Then, we use the generated datasets to train face recognition models and evaluate the performance of trained face recognition models. Table 10 reports the performance of trained face recognition models. As the results in this table show face recognition models trained with datasets that are generated with stochastic minibatch optimization achieve comparable performance to the face recognition model trained with the dataset that is generated based on full-batch optimization. Therefore, our experimental results meet our theoretical prediction in Theorem 1. + +Table 10: Ablation study on the effect of number of batch size in HyperFace stochastic optimization (Algorithm 2). + +
Batch SizeLFWCPLFWCALFWCFPAgeDB
1,000 (mini-batch)98.2885.2391.0591.8689.37
5,000 (mini-batch)98.6284.9890.7390.4188.97
30,000 (full-batch)98.3885.0790.8891.5789.60
+ +In terms of complexity, the HyperFace stochastic optimization (Algorithm 2) requires significantly less computation resources for solving the optimization. Table 11 reports the runtime for solving the HyperFace stochastic optimization (Algorithm 2) for different batch sizes and different numbers of identities and a fixed size of gallery on a system equipped with a single NVIDIA 3090 GPU. As the results in this table show, the complexity is independent of the number of identities (i.e., $n_{\mathrm{id}}$ ) and depends on the size of mini-batch $b$ . Comparing the results in Table 11 and Table 9, we can conclude that our stochastic optimization significantly reduced the complexity. + +Table 11: Runtime for solving the HyperFace stochastic optimization (Algorithm 2) for different numbers of identities on a system equipped with a single NVIDIA 3090 GPU. + +
Batch Size (b)# ID (nid)HyperFace Stochastic Optimization Runtime
1,00030k0.4 hours
50k0.5 hours
100k0.5 hours
5,00030k2.2 hours
50k2.2 hours
100k2.2 hours
10,00030k8.8 hours
50k8.9 hours
100k8.9 hours
+ +# C SYNTHETIC DATASETS AT SCALE + +In Table 1 of the paper, we compared our face recognition models trained with our generated dataset and synthetic datasets in the literature. For previous datasets, we considered the available version of each dataset which has a similar number of identities (10k). In Table 3, we studied the effect of the number of identities in our dataset generation, where the results showed that we can scale our synthetic dataset and achieve a higher recognition performance. In Table 12, we compare the performance of face recognition models trained with our generated datasets and with all publicly available versions (particularly larger scale) of synthetic datasets in the literature. As the results in this table show, our generated datasets achieve competitive performance with synthetic datasets in the literature at scale. Comparing different datasets in the literature, DCFace, which outperformed previous datasets in Table 1, does not achieve the best performance on any of the benchmarks for its larger version. In contrast, Langevin-DisCo achieves a significant improvement for its larger version with 30k identities compared to its smaller version with 10k identities. However, Geissbuhler et al. (2024) reported a lower performance for their dataset with 50k identities compared to 30k identities, indicating limitations in further scaling the Langevin-DisCo dataset for more than 30k identities. + +Table 12: Comparison of recognition performance of face recognition models trained with the largest available versions of different synthetic datasets as well as a real dataset (i.e., CASIA-WebFace). The performance reported for each dataset is in terms of accuracy and best value for each benchmark is emboldened. + +
Dataset name#IDs# ImagesLFWCPLFWCALFWCFPAgeDB
SynFace (Qiu et al., 2021)10'000999'99486.5765.1070.0866.7959.13
SFace (Boutrós et al., 2022)10'5721'885'87793.6574.9080.9775.3670.32
Syn-Multi-PIE (Colbois et al., 2021)10'000180'00078.7260.2261.8360.8454.05
IDnet (Kolf et al., 2023)10'5771'057'20084.4868.1271.4268.9362.63
ExFaceGAN (Boutrós et al., 2023b)10'000599'94485.9866.9770.0066.9657.37
GANDiffFace (Melzi et al., 2023)10'080543'89394.3576.1579.9078.9969.82
Langevin-Dispersion (Geissbühler et al., 2024)10'000650'00094.3865.7586.0365.5177.30
Langevin-DisCo (Geissbühler et al., 2024)10'000650'00097.0776.7389.0579.5683.38
Langevin-DisCo (Geissbühler et al., 2024)30'0001'950'00098.9781.5293.9583.7793.32
DigiFace-1M (Bae et al., 2023)109'9991'219'99590.6872.5573.7579.4368.43
IDiff-Face (Uniform) (Boutrós et al., 2023a)10'049502'45098.1880.8790.8282.9685.50
IDiff-Face (Two-Stage) (Boutrós et al., 2023a)10'050502'50098.0077.7788.5582.5782.35
DCFace (Kim et al., 2023)10'000500'00098.3583.1291.7088.4389.50
DCFace (Kim et al., 2023)60'0001'200'00098.9084.9792.8089.0491.52
HyperFace [ours]10'000640'00098.6784.6889.8289.1487.07
HyperFace [ours]50'0003'200'00098.2785.6091.4892.2490.40
CASIA-WebFace (Yi et al., 2014)10'572490'62399.4290.0293.4394.9794.32
+ +Nevertheless, our method achieves improvement by scaling the number of identities (Table 3). In particular, our dataset with 50k identities and 3.2M images achieves competitive performance with large-scale synthetic datasets in the literature. + +# D IDENTITY LEAKAGE AND RECOGNITION PERFORMANCE + +In Section 3.3, we discussed identity leakage in the generated face datasets. While the leakage of identity is not evident in the generated dataset, it is important to see if identity leakage may affect the recognition performance of face recognition models. To this end, we consider the FFHQ and CASIA-WebFace datasets as two real face datasets and compare all possible pairs from our synthetic dataset with images in the real datasets. Then, for each of these real datasets, we find the top-200 pairs (synthetic-real) and exclude the corresponding synthetic image from our generated dataset. This ensures that images which may contain identity leakage are excluded from the final synthetic datasets. We use the resulting cleaned datasets to train face recognition models and compare them with the face recognition model trained on our original synthetic dataset. Table 13 reports the recognition performance of face recognition models trained with original and cleaned synthetic datasets. + +Table 13: Evaluation of potential identity leakage on the recognition performance. + +
Synthetic DatasetLFWCPLFWCALFWCFPAgeDB
cleaned (Ref.: CASIA-WebFace)98.5284.8089.5289.4387.00
cleaned (Ref.: FFHQ)98.7784.5389.3589.3686.67
original98.6784.6889.8289.1487.07
+ +As the results in Table 13, removing images with similar identities does not impact the recognition performance of the trained face recognition model. However, we would like to highlight that while identity leakage may not affect recognition performance on benchmark datasets, it is an important privacy concern. + +# E ADDITIONAL ABLATION STUDY + +In Section 3, we reported ablation studies on different hyperparameters in our dataset generation. As a new experiment, we consider different optimizers for solving HyperFace optimization (full batch). We consider RMSprop, Adam, and AdamW optimizers. Table 14 compares the performance of the face recognition model trained with datasets that are generated based on different optimizers in HyperFace optimization. As the results in this table show, solving HyperFace optimization with different optimizers leads to comparable performance. + +Table 14: Ablation study on optimizer + +
OptimizerLFWCPLFWCALFWCFPAgeDB
RMSprop98.4784.7389.1889.2786.83
AdamW98.7084.2089.0289.4186.38
Adam98.6784.6889.8289.1487.07
+ +As another experiment, we generate random points on the hypersphere and use random points as reference embeddings without HyperFace optimization to generate a synthetic dataset. We ensure that selected points have at least 0.3 cosine distance. Table 15 compares the performance of the face recognition model trained with the dataset based on random embeddings and HyperFace optimization. As the results in this table show, solving HyperFace optimization achieves superior performance on all benchmarks. Note that with a random selection of points on the hypersphere, there is no guarantee to be on the manifold of embeddings of the face recognition model. However, with our HyperFace optimization, we try to keep points on the face recognition manifold, which results in a dataset that leads to better performance. + +Table 15: Ablation study on using random points vs HyperFace optimization. + +
Reference EmbeddingsLFWCPLFWCALFWCFPAgeDB
Random98.1283.6786.6788.7984.25
HyperFace Optimization98.6784.6889.8289.1487.07
+ +# F HYPERFACE DATASET GENERATION + +We described HyperFace dataset generation in 2. Algorithm 3 summarizes the dataset generation process in our method. + +# Algorithm 3 HyperFace Dataset Generation + +```txt +1: Inputs: $n_{\mathrm{id}}$ : number of synthetic identities, $n_{\mathrm{sample}}$ : number of sample images per identity, +2: $G$ : face generator model, $\beta$ : hyperparameter (controls variations in embeddings) +3: Output: $\mathcal{D}_{\mathrm{HyperFace}} = \{I\}$ : generated dataset. +4: Procedure: +5: Solve HyperFace optimization to find reference embeddings $X_{\mathrm{ref}} = \{x_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ ▷ Algorithm 1 or 2 +6: Initialize $\mathcal{D}_{\mathrm{HyperFace}} = []$ +7: For $x_{\mathrm{ref}} \in \{x_{\mathrm{ref},i}\}_{i=1}^{n_{\mathrm{id}}}$ do +8: For $n = 1,.., n_{\mathrm{sample}}$ do +9: Sample Gaussian noise $z \sim \mathcal{N}(0, \mathbb{I}^{\mathrm{DM}})$ ▷ For diffusion model $G$ +10: Sample Gaussian noise $v \sim \mathcal{N}(0, \mathbb{I}^{n_X})$ ▷ For variations in the embedding $x_{\mathrm{ref}}$ +11: Generate synthetic image $I = G(\frac{x_{\mathrm{ref}} + \beta v}{||x_{\mathrm{ref}} + \beta v||_2}, z)$ +12: $\mathcal{D}_{\mathrm{HyperFace}} \cdot \text{append}(I)$ ▷ Store the generated image $I$ in the dataset $\mathcal{D}_{\mathrm{HyperFace}}$ +13: End For +14: End For +15: End Procedure +``` + +# G VISUALIZATION + +![](images/4e80b43c7c52cd74a4d04ebed0fd0389dbdb045dc497f1ada288fd1695d3f8a1.jpg) +Figure 4 illustrates sample face images from the HyperFace dataset. In addition, Figure 5 and Figure 6 also show intra-class variations for two synthetic identities in the HyperFace dataset. +Figure 4: Sample face images of different synthetic identities from the HyperFace dataset. + +![](images/058440dcfcbfb25961a63e4c0613d0d5240836a3125f362ac16b478f3a203776.jpg) +Figure 5: Sample face images of one subject from the HyperFace dataset (intra-class variations). + +![](images/3d51900938c570074d5a2c9bad35353366ba84c1109def1664da2a77d9db1d05.jpg) +Figure 6: Sample face images of one subject from the HyperFace dataset (intra-class variations). \ No newline at end of file diff --git a/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/images.zip b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..92b93332bb523441a157a49033698b1dd9331b55 --- /dev/null +++ b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:661334cc1b19627e57183aae6124889a583e7791dd9430d99afbeae34a410bdc +size 1489098 diff --git a/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/layout.json b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d3b33defc3637d3b44a1ed2429ac7860466c408b --- /dev/null +++ b/ICLR/2025/HyperFace_ Generating Synthetic Face Recognition Datasets by Exploring Face Embedding Hypersphere/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cfadea45bcbc27b40e7146fefe4ca24edcf15a8e27ac05528bccbd2cdd8b834 +size 578153 diff --git a/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_content_list.json b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a1cc43682f4a1d3d5e6b8b0e313351a10726d7c4 --- /dev/null +++ b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3a458f318d9acc28e9e17a1fff5df33d36ce7f91b222623a1c3bd951633c8d4 +size 98402 diff --git a/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_model.json b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8f5148a4a0f367f0b08b4cbc6b874525e6186251 --- /dev/null +++ b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2de3155c272306dc381be67e73a1205c6671e28414aa89617236b84cf89eb600 +size 116774 diff --git a/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_origin.pdf b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8d5cfff2a2fe24309703258acd351e236b3d0465 --- /dev/null +++ b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/dd4038a7-4b70-4f7c-8b9f-3893b84f25ae_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d4801cefdc7eee437346f65650fac2ec78c73b7da03f96f222af14c186017a6 +size 1935629 diff --git a/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/full.md b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f1936c3beba4d6a12ea370ee536f3bcfe6aec11f --- /dev/null +++ b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/full.md @@ -0,0 +1,332 @@ +# HYPERPLR: HYPERGRAPH GENERATION THROUGH PROJECTION, LEARNING, AND RECONSTRUCTION + +Weihuang Wen, Tianshu Yu * + +School of Data Science + +The Chinese University of Hong Kong, Shenzhen + +weihuangwen1@link.cuhk.edu.cn, yutianshu@cuhk.edu.cn + +# ABSTRACT + +Hypergraphs are essential in modeling higher-order complex networks, excelling in representing group interactions within real-world contexts. This is particularly evident in collaboration networks, where they facilitate the capture of group-wise polyadic patterns, extending beyond traditional pairwise dyadic interactions. The use of hypergraph generators, or generative models, is a crucial method for promoting and validating our understanding of these structures. If such generators accurately replicate observed hypergraph patterns, it reinforces the validity of our interpretations. In this context, we introduce a novel hypergraph generative paradigm, HyperPLR, encompassing three phases: Projection, Learning, and Reconstruction. Initially, the hypergraph is projected onto a weighted graph. Subsequently, the model learns this graph's structure within a latent space, while simultaneously computing a distribution between the hyperedge and the projected graph. Finally, leveraging the learned model and distribution, HyperPLR generates new weighted graphs and samples cliques from them. These cliques are then used to reconstruct new hypergraphs by solving a specific clique cover problem. We have evaluated HyperPLR on existing real-world hypergraph datasets, which consistently demonstrate superior performance and validate the effectiveness of our approach. + +# 1 INTRODUCTION + +Hypergraphs are powerful data structures that go beyond traditional graph theory by enabling a more nuanced representation of multifaceted relationships. Unlike standard graphs, where edges connect merely pairs of nodes, hypergraphs employ hyperedges, each binding multiple nodes, thereby capturing complex, multi-way interactions with higher fidelity. This capability renders hypergraphs indispensable across a vast array of fields such as drug discovery (Kajino, 2019), electronics (Luo et al., 2024), research collaboration networks (Benson et al., 2018), and protein interaction modeling (Feng et al., 2021), where interactions often occur among more than two entities. + +Despite the expansive potential of hypergraphs, the generative models that craft these complex structures are still in their nascent stages. Existing models predominantly cater to simpler graph structures or are bound by pre-assumed hypergraph characteristics, which might not be universally applicable to the diverse and intricate patterns present in the actual datasets (Lee et al., 2021; Do et al., 2020; Kook et al., 2020). Recent advancements include learning-based generative models (Zuo et al., 2023; Gailhard et al., 2024) that attempt to sidestep the necessity for predefined data structures; however, these too often fail to encapsulate critical structural nuances that define hypergraph integrity. + +In light of these challenges, we propose a pioneering framework known as HyperPLR (Projection, Learning, and Reconstruction), which introduces a robust three-phase process for the generation of hypergraphs. Initially, HyperPLR projects the complex hypergraph onto a simplified weighted graph format, essentially maintaining key relationships. It then transitions into a learning phase, wherein it discerns the latent structures within this graph and models the inter-dynamics among the projected entities. + +In the final phase, we define a novel clique cover problem to reconstruct new hypergraphs from the learned weighted projection graph: Weighted Clique Edge Cover (WCEC). It is a common strategy to project hypergraphs onto graphs, but it is evident that this process results in the loss of some higher-order relationships. However, limited research has investigated the reverse direction—reconstructing hypergraphs from graph projections (Bresler et al., 2024; Wang & Kleinberg, 2024). The closest work so far is by Young et al. (2020), which proposes a maximal clique reconstruction that uses the least number of cliques to cover the projected graph, following the principle of parsimony. However, this method does not consider the number of hyperedges or the degree information of vertices. To address these issues, we use a weighted graph as the projection, design the WCEC problem, and show that solving WCEC allows efficient and more controllable hypergraph reconstruction from the projection. Additionally, we develop a fast heuristic for approximating the solution. + +Our extensive evaluations of various real-world datasets underscore HyperPLR's adeptness at weaving hypergraphs that faithfully reflect the underlying complexities of group interactions. Thus, HyperPLR marks a significant technological leap in hypergraph generation. + +The principal contributions of this paper are encapsulated in the following: + +- Introduction and formulation of the WCEC problem, complemented with an efficient algorithmic solution for reconstructing hypergraphs. +- Development of the novel HyperPLR framework, which harmoniously integrates the structure and intricate interactions within a hypergraph. +- Empirical validation of HyperPLR against multiple real-world datasets, showcasing enhanced efficiency and remarkable performance in hypergraph reconstruction. + +# 2 RELATED WORK + +The study of hypergraph generation has garnered increasing attention as an extension of traditional graph generation techniques, addressing higher-order relational structures present in many real-world applications. Traditional graph generation models have advanced significantly with the introduction of deep learning techniques. (Kipf & Welling, 2016; Jin et al., 2018; Bojchevski et al., 2018) generate graphs by imitating the structural properties of given graphs. This is typically achieved by learning node/edge embeddings and injecting appropriate randomness (Grover et al., 2019; Wang et al., 2019; Dai et al., 2020). However, methods relying on node/edge embeddings often focus primarily on local structures, particularly in large graphs. While graph spectral theory offers an alternative approach, some studies incorporate spectral information into deep models to capture global characteristics (Martinkus et al., 2022; Bojchevski et al., 2018; Rendsburg et al., 2020). Among these, CELL (Rendsburg et al., 2020) stands out for its efficiency and scalability, achieved by removing unnecessary operations from Bojchevski et al. (2018). Another consideration is to generate graphs with weights (edge features) (Grover et al., 2019; Niu et al., 2020; Kocayusufoglu et al., 2022), which again heavily relies on embeddings. + +Traditional graph generation models, while effective for molecular graphs and citation networks, are not suitable for hypergraph generation. Hypergraphs, with hyperedges connecting multiple nodes, pose challenges that standard graph models cannot address. Several methods have been proposed for hypergraph generation. HYPERPA (Do et al., 2020) uses a statistical approach, relying on three key metrics from real-world hypergraphs: node count, hyperedge size distribution, and new hyperedges per node. While HYPERPA generates hyperedges based on these metrics, its dependence on precomputed statistics and iterative generation process increases time complexity. HyperDK (Nakajima et al., 2022) generates hypergraphs that preserve local properties of nodes and hyperedges, controlled by two hyperparameters, $d_v$ and $d_e$ . A higher $d_v$ value indicates that higher-order information regarding node degrees is preserved, while a higher $d_e$ value implies the preservation of higher-order information regarding hyperedge sizes. ThERA (Kim et al., 2023) organizes nodes in a hierarchical structure across multiple levels, with nodes divided into disjoint levels and deeper levels containing more nodes. It generates hyperedges locally within each group based on a given probability. Compared to parameter-based methods, only a few deep learning models have explicitly addressed hypergraph generation to date (Zuo et al., 2023; Gailhard et al., 2024), and existing learning-based hypergraph generation approaches are limited by scalability issues. + +![](images/7b44303f98789885a9194bdf4d0957d591fd83732c941ac81fa9410e28e176bd.jpg) +Figure 1: Hypergraph's graph projection (left direction) and weighted graph projection (right direction), with line thickness referring to its weight. + +In summary, while deep learning techniques for graph generation have made significant strides, hypergraph generation remains an emerging area of research. Existing models, though promising, often rely on adaptations of graph generation methods and statistical approaches, with inherent limitations in scalability and evaluation. There is a growing need for more robust models specifically designed for hypergraph generation, particularly ones that can efficiently capture the complex, higher-order relationships that hypergraphs represent. + +# 3 PRELIMINARIES AND NOTATIONS + +Hypergraph. A hypergraph is a generalization of a graph where edges, called hyperedges, can connect more than two vertices. Formally, a hypergraph is defined as $\mathcal{H} = (V,\mathcal{E})$ where $V$ is a set of vertices and $\mathcal{E}$ is a set of hyperedges $(e_1,e_2,\dots ,e_m)$ with $e_i\subseteq V$ . In a hypergraph, hyperedges can be of varying sizes, capturing higher-order relationships between sets of nodes beyond pairwise connections and we assume the hyperedges are distinct in our paper, which means $\forall 1\leq i,j\leq m,e_i\neq e_j$ . + +Graph Projection. A graph projection, or clique expansion, of a hypergraph, is a transformation process that converts a hypergraph into a traditional graph. In this projection, each hyperedge of the hypergraph is mapped to a clique (a complete subgraph) in the graph, where each pair of nodes in the hyperedge is connected by an edge in the projected graph. Formally, if $\mathcal{H} = (V,\mathcal{E})$ is a hypergraph, the projection graph $G = \operatorname {Proj}(\mathcal{H}) = (V,\mathcal{E}')$ , where $\mathcal{E}'$ consists all pairs $(v_{i},v_{j})\in e_{i}$ for hyperedge $e_i\in \mathcal{E}$ . + +Weighted Graph Projection. In this paper, we introduce a novel graph projection method for learning-based hypergraph generation, namely Weighted Graph Projection, which effectively preserves the frequency with which vertices co-occur within hyperedges. Formally, given a hypergraph $\mathcal{H} = (V,\mathcal{E})$ , the weighted graph projection is to project $\mathcal{H}$ into a weighted graph $G_{w} = \mathrm{Proj}_{w}(\mathcal{H}) = (V,\mathcal{E}',w)$ . The $w$ is a weight function that assigns a weight to each edge $e'\in \mathcal{E}'$ . The common way to assign weight is $w(v_{i},v_{j}) = \sum_{e\in \mathcal{E}}\mathbb{I}(v_{i},v_{j}\in e)$ where $\mathbb{I}$ is an indicator function that equals 1 if both vertices $v_{j}$ and $v_{j}$ are part of the same hyperedge. + +Clique Edge Cover Problem. The Clique Edge Cover problem is concerned with covering all the edges of a graph using the minimum number of cliques (complete subgraphs). This problem is also referred to as the Minimum Clique Edge Cover (MCEC) problem. Given a graph $G = (V, \mathcal{E}')$ a clique cover is a collection of cliques such that every edge in $\mathcal{E}'$ belongs to at least one clique. The goal is to minimize the number of cliques in the cover. This problem is closely related to the projection of hypergraphs, as each hyperedge in a hypergraph corresponds to a clique in the projected graph, and reconstructing the original hyperedges can be seen as a clique cover problem in reverse Bresler et al. (2024). + +Fig. 1 illustrates the two different projection methods between hypergraph and traditional graph. + +![](images/d241b4f3a2a900d352bbd6c395932f63a4ba9b60068503b2e31bec9a1cd3a7fc.jpg) +Figure 2: An overview of HyperPLR framework. We use RED and BLUE arrowed lines to indicate flows in the training and the testing phases, respectively. Black arrowed lines are normal flows. + +# 4 HYPERPLR + +In this part, we elaborate on the framework of HyperPLR in detail. A high-level overview of the HyperPLR framework can be found in Fig. 2. As shown, the framework consists of three core blocks: "Projection", "Learning", and "Reconstruction", acting in the presented order. Given an input hypergraph $\mathcal{H}$ , the projection block project $\mathcal{H}$ to the corresponding graph $G$ and weighted graph $G_w$ . In the following learning block, we employ CELL (Rendsburg et al., 2020) to sample the new graph $G'$ . In parallel to CELL, we adopt a GCN (Kipf & Welling, 2017) to train a weight predictor taking node features of $G$ as input, to optimize the MSE error w.r.t. the real edge weight $w$ in $G_w$ . During the testing phase, the sampled graph $G'$ is instead fed into this predictor as the graph topology, and the new weighted graph $G'_w$ is obtained by filling predicted weights into $G'$ . In the last block of reconstruction, GWC performs a heuristic strategy to dynamically produce the most likely overlapping cliques out of $G'_w$ . Finally, this collection of cliques is readily converted to a new hypergraph $\mathcal{H}'$ . We detail each block in the following sections. + +# 4.1 PROJECTION + +Projecting hypergraphs onto graphs and utilizing graph algorithms is a common technique for solving hypergraph-related problems, as it improves storage efficiency, interpretability, and allows for the use of well-established data structures and algorithms. However, hypergraph projection often results in the loss of higher-order relationships. To address this, there has been research on the limitation when reconstructing hypergraphs from their graph projections (Bresler et al., 2024; Wang & Kleinberg, 2024). Although exact reconstruction of the original hypergraph is generally infeasible, we find that with appropriate "guidance", it is possible to effectively reconstruct most of the patterns in the hypergraph. This insight motivates our investigation into the generation of such "guidance". Specifically, we demonstrate that learning to generate this guidance can enable the creation of a new hypergraph that retains most of the information from the original hypergraph's projection. In our study, we show that the weighted graph projection $G_{w}$ serves as an effective form of guidance during the reconstruction process. + +On one hand, the weighted projection offers a more condensed hyperedge information into edges, reducing graph size compared to bipartite representations, which require separate hyperedge nodes. As discussed in Bojchevski et al. (2018); Rendsburg et al. (2020), bipartite graphs are difficult to analyze using spectral tools, as they do not possess steady states. On the other hand, the weighted projection provides a higher representational capacity than the unweighted projection. Notably, in the weighted projection, the weight of each edge in the graph reflects the co-occurrence frequency of its nodes within hyperedges, thereby preserving crucial information for the reconstruction of the original hypergraph. + +# 4.2 LEARNING + +Learning to generate weighted projection $G_{w}$ that resembles the projection from the real-world hypergraph is non-trivial, as 1) $G_{w}$ with weights are hard to model and learn, and 2) real-world hypergraph can easily scale up (to tens of thousands of vertices) with long-range dependencies like overlapping cliques or communities in large hypergraphs. We first present how this can be achieved at a high level. Considering a weighted graph with node feature $X \in \mathbb{R}^{n \times d}$ , adjacency matrix $A$ , and weight matrix $W$ , we have: + +$$ +\begin{array}{l} \mathbb {P} (W, A | X) = \mathbb {P} (W | A, X) \mathbb {P} (A) (1a) \\ = \mathbb {P} (W | A, X) \prod_ {i, j} \mathbb {P} (A _ {i, j}) (1b) \\ = \prod_ {i, j} \mathbb {P} \left(W _ {i, j} \mid A _ {i, j}, X\right) \prod_ {i, j} \mathbb {P} \left(A _ {i, j}\right) (1c) \\ = \prod_ {i, j} \mathbb {P} _ {\alpha} \left(W _ {i, j} \mid A _ {i, j}, X _ {i}, X _ {j}\right) \mathbb {P} _ {\beta} \left(A _ {i, j}\right), (1d) \\ \end{array} +$$ + +where $\mathbb{P}(\cdot)$ measures the probability. Eq. (1a) stands because $A$ is derived solely from a spectral method, independent of $X$ . Eq. (1b) is due to the fact that $A$ is drawn from an edge-independent "score matrix" as in Bojchevski et al. (2018); Rendsburg et al. (2020). Eq. (1c) and (1d) are further built upon the assumption that edge weight $W_{ij}$ is only dependent on the features of the ending nodes $X_{i}$ and $X_{j}$ , and the existence of this edge $A_{i,j}$ , under two distributions parameterized by $\alpha$ and $\beta$ . + +We first introduce $\mathbb{P}_{\beta}(\cdot)$ allowing for generating large-scale graphs with high efficiency. To this end, we employ CELL (Rendsburg et al., 2020). CELL is a graph generative model working in the spectral space by removing redundant computation from NetGAN (Bojchevski et al., 2018). In NetGAN, the following objective is optimized + +$$ +\min _ {Z \in \mathbb {R} ^ {n \times n}} - \sum_ {(u, v) \in \mathcal {R}} \log \sigma_ {\text {r o w s}} (Z) _ {u, v} \quad \text {s . t .} \quad \operatorname {r a n k} (Z) \leq h, \tag {2} +$$ + +where $\mathcal{R}$ is a collection of (massive) random walks and $(u,v)$ is a transition. $\sigma_{\mathrm{rows}}(Z)$ is a row-wise softmax function perform on the low-rank variable $Z$ . In practice, NetGAN needs to sample millions of random walks from a graph with moderate size, which is prohibitively expensive. Besides, the extra computational burden is required as NetGAN trained a generator to produce fixed-length random walks to obtain a new graph. + +CELL (Rendsburg et al., 2020) argued that such a massive amount of sampling procedures and the generator in NetGAN can be avoided by only considering the spectral properties in limit. Concretely, given the adjacency matrix $A$ of a graph, its transition matrix can be obtained via $P = D^{-1}A$ where $D = \mathrm{diag}(d) \in \mathbb{R}_+^{n \times n}$ is the degree matrix. Assuming the stationary state $\pi$ of $P$ exists and is unique, CELL considers acting an infinite number of infinite long random walks and calculates how many times a node can be visited. The time of visit for nodes can be encoded in a "score matrix" $S$ , and the normalized score matrix in limit is + +$$ +\lim _ {\substack {q \to \infty \\ T \to \infty}} \frac {S}{q T} = \operatorname {diag} (\pi) P, \tag{3} +$$ + +where $q$ and $T$ are number and length of random walks, respectively. Thus $S$ can serve as a surrogate of random walk set $\mathcal{R}$ in Eq. (2): + +$$ +\min _ {Z \in \mathbb {R} ^ {n \times n}} - \sum_ {u, v = 1} ^ {n} S _ {u, v} \log \sigma_ {\text {r o w s}} (Z) _ {u, v}. \tag {4} +$$ + +Since $\mathrm{diag}(\pi)P\propto A$ and rescaling $S$ will not change the optima in Eq. (4), the final objective of CELL becomes + +$$ +\min _ {Z \in \mathbb {R} ^ {n \times n}} - \sum_ {u, v = 1} ^ {n} A _ {u, v} \log \sigma_ {\text {r o w s}} (Z) _ {u, v} \quad \text {s . t .} \quad \operatorname {r a n k} (Z) \leq h, \tag {5} +$$ + +whose solution is denoted as $Z^{*}$ . Then $P^{*} = \sigma_{\mathrm{rows}}(Z^{*})$ can be viewed as a low-rank-regularized transition matrix. We can obtain a new score $S^{*} = \mathrm{diag}(\pi^{*})P^{*}$ , where $\pi^{*}$ is the stationary distribution of $P^{*}$ . Finally, the edges of a new graph can be independently sampled according to $S^{*}$ . + +Next, we discuss $\mathbb{P}_{\alpha}(\cdot)$ . To allow generating graphs with weights, we extend CELL by providing predicted weights on the sampled edges, where the edge weight predictor is a Graph Convolutional Network (GCN) (Kipf & Welling, 2017). During the training phase, this predictor takes the vertex embeddings $X^{(0)}$ and the adjacency matrix $A$ as input, and outputs a set of new embedding $X^{(l)}$ : + +$$ +X ^ {(l)} = \operatorname {G C N} \left(X ^ {(0)}, A\right), \tag {6} +$$ + +where $l$ is the number of basic GCN layers. The loss is the MSE between the predicted weights $X^{(l)}X^{(l)^{\top}}$ and the ground-truth weights $W$ of the original WLIG on the observed edge set $A$ : + +$$ +\sum_ {(i, j) \in A} \left(\left(X ^ {(l)} X ^ {(l) \top}\right) _ {i, j} - W _ {i, j}\right) ^ {2}. \tag {7} +$$ + +This weight predictor can be trained not only on a single graph projection (though we train separate embedding networks for each instance) but throughout a set of formulas, since all these formulas may share common structures on weights. In the testing stage, we feed the embedding $X^0$ and a sampled adjacency $A'$ from CELL into the well-trained GCN: + +$$ +X _ {s} ^ {(l)} = \operatorname {G C N} \left(X ^ {(0)}, A ^ {\prime}\right). \tag {8} +$$ + +Then weights can be derived using $X_{s}^{(l)}X_{s}^{(l)\top}$ . We only consider the weights on the edges that appear in $A^{\prime}$ . See the "Learning" block in Fig. 2 for an intuitive view. + +One remaining problem is how to obtain the initial Node Embedding $X^{(0)}$ for each vertex. One of the most intuitive ways is to use a one-hot representation, but as the size of the hypergraph grows, the vertices number $n$ and the required dimension increase rapidly. In practice, we train the node embedding with the Node2Vec algorithm (Grover & Leskovec, 2016) from the simple projection graph $G$ . + +# 4.3 RECONSTRUCTION + +As each hyperedge in the hypergraph $\mathcal{H}$ is mapped to a clique in the graph projection $G$ or $G_{w}$ , it is straightforward to consider the reconstruction as a clique cover problem, for example, MCEC problem (Rodrigues, 2021). Here, we give a proposition about the limitations of the MCEC: + +Proposition 1. One hypergraph $\mathcal{H}$ can be reconstructed by solving the MCEC on the graph projection $G$ if and only if each hyperedge appears as an isolated clique. + +Proof. A hyperedge must be a clique in the graph projection, but not vice versa. A clique may not be a hyperedge in only two cases: 1) for a hyperedge $e$ , there is a hyperedge $e'$ set that $e \subset e'$ ; 2) for several hyperedges $e_1, \dots, e_k$ , which's projections overlap together and form a bigger clique than each other. The first case would lead the solving of MCEC to ignore some hyperedges which are included by other hyperedges. The second case would lead the MCEC solving to produce the new hyperedges. + +Although the MCEC has its limitations, it still can be a strong baseline in the hypergraph reconstruction task (Young et al., 2020). Due to the "principle of parsimony", solving MCEC on the projection graph will ignore the frequency of node level pairwise appearance and always recover fewer hyperedges than the original hypergraph. To address these issues, inspired by MCEC, we make a step to raise a novel Weighed Clique Edge Cover (WCEC) problem and an associated efficient algorithm Greedy Weighted Cover (GWC) in a hill-climbing manner. WCEC substantially differs from MCEC by taking into account an essential but less explored factor-frequency of node level pairwise appearance. + +Weighted Clique Edge Cover Problem (WCEC). Though there exist several variants of clique covering problems, our problem of recovering clique covers from weighted graphs has been less studied. The most related problem in literature is Weighted Edge Clique Partition (WECP), which is + +proposed by Feldmann et al. (2020) and we provide a more comprehensive analysis for the connection and difference between WECP and WCEC in Appendix. A. Here, we define the WCEC problem as follows: + +Problem 1 (Weighted Clique Edge Cover). Given a weighted graph $\mathcal{G}$ with weight matrix $W$ , it asks to select $k$ cliques from $\mathcal{G}$ , such that the distance $d(W, W') \geq 0$ between $W$ and $W'$ is minimized, where weight matrix $W'$ is derived from a new weighted graph $\mathcal{G}'$ by stacking $k$ selected cliques. + +In our setting, we let $d(W, W')$ be the L1-distance: + +$$ +d \left(W, W ^ {\prime}\right) = \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {n} \left| W _ {i j} - W _ {i j} ^ {\prime} \right|, \tag {9} +$$ + +where $W_{ij}$ represents the entry of $W$ at $i$ th row and $j$ th column. Comparing the proposed WCEC and MCEC, we have the following lemma: + +Lemma 2. Suppose a WCEC problem with weight matrix $W$ is obtained by assigning positive weights to edges in adjacency $A$ associated with an MCEC problem. Then a solution clique cover to this WCEC such that $d(W, W') = 0$ must form a cover of the MCEC, but a clique cover of MCEC on $A$ may not satisfy $d(W, W') = 0$ . + +Proof. We first prove the initial part. By definition, $d(W, W') = 0$ implies that for every $(i,j)$ , the weight matrix $G_w$ of the found cover satisfies $W_{i,j}' = W_{i,j}$ . Since $W$ is derived by assigning positive weights to the non-zero entries in $A$ , we have $W_{i,j}' > 0 \Rightarrow A_{i,j} = 1$ and $W_{i,j} = 0 \Rightarrow A_{i,j} = 0$ . Therefore, the solution to the WCEC is a cover of the MCEC. For the second part, it suffices to provide an easily verifiable example, which is presented as a constructive proof in Appendix. B. + +Lemma 2 provides an interpretation of why the proposed framework "weighted projection +WCEC" is more powerful than "projection + MCEC" utilized by Young et al. (2020). In general, solving WCEC provides rich information for solving MCEC, but not vice versa. Nevertheless, solving either of them is NP-complete (Feldmann et al., 2020; Ullah, 2022). + +Greedy Weight Cover (GWC) Algorithm. Due to NP-completeness, an exact solution to WCEC can be infeasible. Therefore, we develop a specialized algorithm to obtain a local optima of WCEC via hill-climbing. Our algorithm works on a local search basis, wherein each iteration will take action with the largest gain. We term this procedure the Greedy Weighted Cover (GWC) algorithm. Concretely, GWC first enumerates or samples the cliques set from the weighted graph projection, whose sizes are below the maximal hyperedge size of the original hypergraph, using the algorithm proposed by Zhang et al. (2005). Then we create a GainTable measuring how much one can improve by decoding the corresponding clique. In each subsequent step, GWC finds a clique with the largest gain and updates the GainTable in a dynamic programming fashion, until the number of found cliques reaches a preset threshold $m$ or distance. To prevent redundant computation, we first build an EdgeTable mapping from an edge to its related cliques (see Alg. 2), which allows GWC only updates the gain of the local cliques in each step. The overall procedure is summarized in Alg. 1. + +# 5 EXPERIMENT + +# 5.1 PROTOCALS + +Implementation details. Throughout all the experiments, HyperPLR is running on an Apple M1 CPU. The dimension of node embedding from Node2Vec is 50. The GCN consists of two layers, with input/output dimensions 50/128 and 128/128, respectively. We employ ADAM as the optimizer for all learning modules (i.e., Node2Vec, GCN, and CELL). For CELL, we set parameter edge_overlap_limit = 0.8 which controls the overlapping portion of the generated and the original graphs. For more details, one can refer to the supplementary material. + +![](images/9c957ada53b539207baa090817424bffe68ec257b734abcfa5b888480399d656.jpg) + +![](images/ef26010eb6dfc5e16eb9aff2174bc705f4479580abf3a5d7b56dc4fb944082ad.jpg) + +Dataset. Following the standard approach outlined in Nakajima et al. (2022); Lee et al. (2021); Kim et al. (2023), we evaluate performance on five datasets across three domains: contact (contact-high-school, contact-primary-school), email (email-Eu, email-Enron), and drug (NDC-classes) (Benson et al., 2018). In the contact datasets, each node represents an individual, and each hyperedge represents a group communication event involving all participating individuals. In the email datasets, each node represents a user, and each hyperedge corresponds to an email, consisting of the sender and all recipients. In the drug dataset, each hyperedge corresponds to an NDC code for a drug, and the nodes represent the substances composing the drug. More details can be found in Appendix. C.1. + +Baselines. We compared the performance of our proposed model against four existing hypergraph generation methods: HyperDK (Nakajima et al., 2022), Hyperlap (Lee et al., 2021), Hyperlap+ (Lee et al., 2021), and THERA (Kim et al., 2023). HyperDK, Hyperlap, and Hyperlap+ are static generators, primarily suited for producing static hypergraphs, while THERA generates dynamic graphs, such as temporal hypergraphs. Since HyperDK is highly sensitive to parameter settings, we evaluated it under two configurations: HyperDK $_{0,0}$ , which aims to generate hypergraphs that preserve the average node degree and the average hyperedge size, and HyperDK $_{1,1}$ , which seeks to preserve the degree of each individual node and the size of each hyperedge. + +# 5.2 RESULTS + +Graph statistics. The results of the comparisons between our model and state-of-the-art methods across five datasets, using various evaluation metrics, are presented in Table 1. We further compare some of the advanced structural properties in Appendix. C.2. Each dataset was generated five times, and the average results were reported. The graph properties evaluated include hypergraph structure-level metrics (density, average hyperedge size, average node degree), graph projection-level metrics ("G coefficient" and "G modularity"), and bipartite graph representation-level metrics ("B modularity"). These properties provide a comprehensive overview of the graph's structural characteristics. The detailed definitions about the metrics can be found in Appendix. C.3. + +Representation ability and reconstruction ability. We investigate how much the graph structure statistics can retain after feeding a hypergraph into different consecutive phases of HyperPLR from projection $G_{w}$ , learning $G_{w}^{L}$ , and reconstruction $G_{w}^{R}$ . Results are in Table 2. We also visualize this process using the email-Enron instance in Fig. 3. It is evident that the main structures of the WLIGs are well-preserved across all three phases. + +![](images/77a76ab065d13962b9ba790da92503740ca286b346c49252d5f7c8a350d892af.jpg) +Figure 3: Visualization of weighted graph projection of hypergraph email-Enron at different phases. Each node corresponds to one vertex and each edge (with thickness) indicates inter-node incidence (with frequency). (a) Weighted graph projection $G_{w}$ derived from original hypergraph; (b) Generated Weighted graph projection $G_{w}^{L}$ based on (a) using hyperPLR; (c) Weighted graph projection $G_{w}^{R}$ of generated hypergraph from (b) with GWC. Zoom in for a better view. + +![](images/43dba963d371ee88ae8c05468c5a8b6255e1a8efb34809f34f8d46ef668286d7.jpg) + +![](images/b6b23ce8727d29f7a4f278ae33e4aa67b58dc173d540f21a1c2ce31aa213e193.jpg) + +Table 1: Results of hypergraph generation in terms of graph metrics with 5 real-world hypergraphs + +
densityaverage sizeaverage degreeG coefficientG modularityB modularity
contact-high-school23.9082.32755.6330.5040.5820.754
HyperDK0,0272.1613.089840.7960.9990.0000.324
HyperDK1,1142.5732.178310.5670.8610.0160.459
Hyperlap23.9382.32755.7010.3410.3940.622
Hyperlap+23.9082.32755.6330.6320.7420.747
THERA23.9082.60962.3820.3540.4050.831
HyperPLR24.0552.70365.0110.4710.5560.649
contact-primary-school52.4962.419126.9790.5260.2840.635
HyperDK0,0229.8963.129719.4291.0000.0000.319
HyperDK1,1143.3432.285327.5160.9240.0100.437
Hyperlap52.4962.419126.9790.4960.2810.620
Hyperlap+52.4962.419126.9790.6550.4960.640
THERA52.4962.767145.2520.4460.1500.758
HyperPLR52.7142.648139.5930.4910.2810.600
email-Enron10.5733.00931.8180.5930.3520.656
HyperDK0,052.0453.188165.9330.9580.0070.322
HyperDK1,139.5962.885114.2520.7960.0400.355
Hyperlap10.2323.13132.0340.6460.2750.576
Hyperlap+10.2033.13131.9440.8410.5820.738
THERA10.2033.38634.5450.6740.1660.736
HyperPLR10.7233.24434.7820.5930.3510.569
email-Eu25.0773.42685.9090.4920.3710.675
HyperDK0,0156.1303.125487.9650.7230.0150.327
HyperDK1,1114.0402.887329.2230.7880.0350.353
Hyperlap25.7783.62193.3380.6230.2800.571
Hyperlap+25.8603.62193.6330.7850.7450.751
THERA24.8684.696116.7920.8370.0990.793
HyperPLR29.0813.13591.1550.4460.3190.493
NDC-classes0.9375.9225.5500.6110.6100.741
HyperDK0,036.1123.583129.3920.3110.0380.303
HyperDK1,131.0833.594111.7110.7540.0580.296
Hyperlap1.0896.1666.7180.6720.4560.575
Hyperlap+1.0986.1666.7670.7500.7930.836
THERA0.9996.2826.2770.7930.5200.892
HyperPLR1.2105.5016.6550.7910.6230.733
+ +# 5.3 ANALYSIS AND DISCUSSION + +The experimental results demonstrate several key findings regarding the performance and capabilities of the proposed HyperPLR framework: + +Graph Statistics Comparison. Towards graph-level metrics, HyperPLR outperformed traditional hypergraph generation models, including HyperDK, Hyperlap, and ThERA, across various datasets. Remarkably, despite not receiving any direct structural parameters from the original hypergraph, + +Table 2: Results of the graph metrics for the weighted graph projection $G_{w}$ derived from original hypergraph; Generated Weighted graph projection $G_{w}^{\bar{L}}$ ; and weighted graph projection $G_{w}^{R}$ of generated hypergraph + +
HypergraphGw coefficientGw modularityGL coefficientGWLmodularityGRcoefficientGRWmodularity
contact-high-school0.5040.5820.3880.5460.4720.556
contact-primary-school0.5260.2840.4530.3080.4910.277
email-Enron0.5930.3520.5080.4330.5930.347
email-Eu0.4920.3710.3660.4480.4460.315
NDC-classes0.6110.6100.4520.5380.7880.625
+ +HyperPLR consistently demonstrates competitive similarity across nearly all graph metrics when compared to other parameter-based methods, underscoring its superior potential in hypergraph generation. Additionally, the clustering coefficient distribution of the hypergraphs generated by HyperPLR exhibits the highest degree of similarity to real-world datasets. Furthermore, HyperPLR is parameter-insensitive, delivering stable and robust results with default parameter settings. For example, the default rank number of CELL Rendsburg et al. (2020) is 9. To investigate how much this parameter impacts the generated results, we conduct extra experiments on varying rank $= 8, 10, 12$ . We also present three generated weighted graph projections in Appendix. D. Additionally, a brief discussion on the trade-off between the fidelity and diversity of HyperPLR is provided in Appendix. E. All these result indicate that the HyperPLR framework, despite not requiring parameter tuning specific to each dataset, can generalize effectively across different domains. This robustness and parameter insensitivity highlight HyperPLR's advantage in practical applications, where real-world datasets can vary widely in structure. + +Representation and Reconstruction Ability. Table 2 and Figure 3 provide insights into how HyperPLR maintains structural properties throughout the projection, learning, and reconstruction phases. The close similarity between the weighted graph projections derived from the original hypergraph $(G_w)$ and the generated hypergraph $(G_w^R)$ demonstrates that HyperPLR effectively preserves critical structural information. The consistency in clustering coefficients and modularity across the different phases (as seen in Table 2) suggests that the proposed weighted graph projection method captures essential high-order relationships. This is further confirmed by the visualization in Figure 3, where the main structures are visibly well-retained, implying that the framework's learning and reconstruction processes are efficient in preserving hypergraph topology. + +Limitations and Future Directions. Despite its strengths, HyperPLR has limitations. It requires significant computational resources, especially for larger datasets, and the GWC heuristic algorithm, while effective, doesn't guarantee optimality. Future research could explore advanced optimization techniques like reinforcement learning or MCTS for improving clique selection. Additionally, the complexity of HyperPLR is constrained by the exponential nature of the maximal clique enumeration problem, though it remains manageable for real-world hypergraphs. Future work could also focus on accelerating clique enumeration using hyperedges as prior information. + +# 6 CONCLUSION + +Deep hypergraph generation models have demonstrated their ability to capture the complex distribution of hypergraphs by leveraging the rich information embedded within them to generate more realistic structures. In this paper, we address a novel clique cover problem—WCEC—for reconstructing hypergraphs from weighted graph projections, and we propose an efficient and effective framework, HyperPLR, for generating real-world hypergraphs. The weighted graph projection shows strong representational power compared to existing inexact graph representations, while also significantly enhancing learning and generation against the exact representation. This is the first work to achieve both. Our method demonstrated superior efficiency and stability compared to previous state-of-the-art methods across various graph-based metrics. In the future, we aim to extend HyperPLR's capabilities to additional generation tasks, such as bipartite network generation or SAT instance generation, in order to capture the rich information inherent in these structures. + +# ACKNOWLEDGMENTS + +This work was supported by the National Science and Technology Major Project of China under Grant 2022ZD0116408. This work is also supported by the Guangdong Provincial Key Laboratory of Mathematical Foundations for Artificial Intelligence (2023B1212010001). We would like to thank all the anonymous reviewers for their insightful comments. We also sincerely thank Chaolong Ying and Huizhi Zhu for their valuable discussions, which greatly contributed to the development of this work. + +# REFERENCES + +Austin R. Benson, Rediet Abebe, Michael T. Schaub, Ali Jabbabaie, and Jon M. Kleinberg. Simplicial closure and higher-order link prediction. Proc. Natl. Acad. Sci. USA, 115(48):E11221-E11230, 2018. doi: 10.1073/PNAS.1800683115. URL https://doi.org/10.1073/pnas.1800683115. +Aleksandar Bojchevski, Oleksandr Shchur, Daniel Zügner, and Stephan Gunnemann. Netgan: Generating graphs via random walks. In ICML, 2018. +Guy Bresler, Chenghao Guo, and Yury Polyanskiy. Thresholds for reconstruction of random hypergraphs from graph projections. In Shipra Agrawal and Aaron Roth (eds.), The Thirty-Seventh Annual Conference on Learning Theory, June 30 - July 3, 2023, Edmonton, Canada, volume 247 of Proceedings of Machine Learning Research, pp. 632-647. PMLR, 2024. URL https://proceedings.mlr.press/v247/bresler24a.html. +Hanjun Dai, Azade Nazi, Yujia Li, Bo Dai, and Dale Schuurmans. Scalable deep generative modeling for sparse graphs. In ICML, 2020. +Manh Tuan Do, Se-eun Yoon, Bryan Hooi, and Kijung Shin. Structural patterns and generative models of real-world hypergraphs. In Rajesh Gupta, Yan Liu, Jiliang Tang, and B. Aditya Prakash (eds.), KDD '20: The 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, CA, USA, August 23-27, 2020, pp. 176-186. ACM, 2020. doi: 10.1145/3394486.3403060. URL https://doi.org/10.1145/3394486.3403060. +Andreas Emil Feldmann, Davis Issac, and Ashutosh Rai. Fixed-parameter tractability of the weighted edge clique partition problem. In 15th International Symposium on Parameterized and Exact Computation, 2020. +Song Feng, Emily Heath, Brett A. Jefferson, Cliff A. Joslyn, Henry Kvinge, Hugh D. Mitchell, Brenda Praggastis, Amie J. Eisfeld, Amy C. Sims, Larissa B. Thackray, Shufang Fan, Kevin B. Walters, Peter J. Halfmann, Danielle Westhoff-Smith, Qing Tan, Vineet D. Menachery, Timothy P. Sheahan, Adam S. Cockrell, Jacob F. Kocher, Kelly G. Stratton, Natalie C. Heller, Lisa M. Bramer, Michael S. Diamond, Ralph S. Baric, Katrina M. Waters, Yoshihiro Kawaoka, Jason E. McDermott, and Emilie Purvine. Hypergraph models of biological networks to identify genes critical to pathogenic viral response. BMC Bioinform., 22(1):287, 2021. doi: 10.1186/S12859-021-04197-2. URL https://doi.org/10.1186/s12859-021-04197-2. +Dorian Gailhard, Enzo Tartaglione, Lirida Naviner, and Jhony H Giraldo. Hygiene: A diffusion-based hypergraph generation method. arXiv preprint arXiv:2408.16457, 2024. +Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Balaji Krishnapuram, Mohak Shah, Alexander J. Smola, Charu C. Aggarwal, Dou Shen, and Rajeev Rastogi (eds.), Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, August 13-17, 2016, pp. 855-864. ACM, 2016. doi: 10.1145/2939672.2939754. URL https://doi.org/10.1145/2939672.2939754. +Aditya Grover, Aaron Zweig, and Stefano Ermon. Graphite: Iterative generative modeling of graphs. In ICML, 2019. +Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. In ICML, 2018. + +Hiroshi Kajino. Molecular hypergraph grammar with its application to molecular optimization. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 3183-3191. PMLR, 2019. URL http://proceedings.mlr.press/v97/kajino19a.html. +Sunwoo Kim, Fanchen Bu, Minyoung Choe, Jaemin Yoo, and Kijung Shin. How transitive are real-world group interactions? - measurement and reproduction. In Ambuj K. Singh, Yizhou Sun, Leman Akoglu, Dimitrios Gunopoulos, Xifeng Yan, Ravi Kumar, Fatma Ozcan, and Jieping Ye (eds.), Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, KDD 2023, Long Beach, CA, USA, August 6-10, 2023, pp. 1132-1143. ACM, 2023. doi: 10.1145/3580305.3599382. URL https://doi.org/10.1145/3580305.3599382. +Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016. +Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017. +Furkan Kocayusufoglu, Arlei Silva, and Ambuj K Singh. Flowgen: A generative model for flow graphs. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2022. +Yunbum Kook, Jihoon Ko, and Kijung Shin. Evolution of real-world hypergraphs: Patterns and models without oracles. In Claudia Plant, Haixun Wang, Alfredo Cuzzocrea, Carlo Zaniolo, and Xindong Wu (eds.), 20th IEEE International Conference on Data Mining, ICDM 2020, Sorrento, Italy, November 17-20, 2020, pp. 272-281. IEEE, 2020. doi: 10.1109/ICDM50108.2020.00036. URL https://doi.org/10.1109/ICDM50108.2020.00036. +Geon Lee, Minyoung Choe, and Kijung Shin. How do hyperedges overlap in real-world hypergraphs? - patterns, measures, and generators. In Jure Leskovec, Marko Grobelnik, Marc Najork, Jie Tang, and Leila Zia (eds.), WWW '21: The Web Conference 2021, Virtual Event / Ljubljana, Slovenia, April 19-23, 2021, pp. 3396-3407. ACM / IW3C2, 2021. doi: 10.1145/3442381.3450010. URL https://doi.org/10.1145/3442381.3450010. +Zhishang Luo, Truong Son Hy, Puoya Tabaghi, Michael Defferrard, Elahe Rezaei, Ryan Carey, W. Rhett Davis, Rajeev Jain, and Yusu Wang. DE-HNN: an effective neural model for circuit netlist representation. In Sanjoy Dasgupta, Stephan Mandt, and Yingzhen Li (eds.), International Conference on Artificial Intelligence and Statistics, 2-4 May 2024, Palau de Congressos, Valencia, Spain, volume 238 of Proceedings of Machine Learning Research, pp. 4258-4266. PMLR, 2024. URL https://proceedings.mlr.press/v238/luo24a.html. +Karolis Martinkus, Andreas Loukas, Nathanaël Perraudin, and Roger Wattenhofer. Spectre: Spectral conditioning helps to overcome the expressivity limits of one-shot graph generators. In ICML, 2022. +Kazuki Nakajima, Kazuyuki Shudo, and Naoki Masuda. Randomizing hypergraphs preserving degree correlation and local clustering. IEEE Trans. Netw. Sci. Eng., 9(3):1139-1153, 2022. doi: 10.1109/TNSE.2021.3133380. URL https://doi.org/10.1109/TNSE.2021.3133380. +Chenhao Niu, Yang Song, Jiaming Song, Shengjia Zhao, Aditya Grover, and Stefano Ermon. Permutation invariant graph generation via score-based generative modeling. In International Conference on Artificial Intelligence and Statistics, 2020. +Luca Rendsburg, Holger Heidrich, and Ulrike Von Luxburg. Netgan without gan: From random walks to low-rank approximations. In ICML, 2020. +Marcos Okamura Rodrigues. Fast constructive and improvement heuristics for edge clique covering. Discret. Optim., 39:100628, 2021. doi: 10.1016/J.DISOPT.2021.100628. URL https://doi.org/10.1016/j.disopt.2021.100628. + +Hannah Sansford, Alexander Modell, Nick Whiteley, and Patrick Rubin-Delanchy. Implications of sparsity and high triangle density for graph representation learning. In Francisco J. R. Ruiz, Jennifer G. Dy, and Jan-Willem van de Meent (eds.), International Conference on Artificial Intelligence and Statistics, 25-27 April 2023, Palau de Congressos, Valencia, Spain, volume 206 of Proceedings of Machine Learning Research, pp. 5449-5473. PMLR, 2023. URL https://proceedings.mlr.press/v206/sansford23a.html. +Anton Tsitsulin, Davide Mottin, Panagiotis Karras, Alexander M. Bronstein, and Emmanuel Müller. Netlsd: Hearing the shape of a graph. In Yike Guo and Faisal Farooq (eds.), Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2018, London, UK, August 19-23, 2018, pp. 2347-2356. ACM, 2018. doi: 10.1145/3219819.3219991. URL https://doi.org/10.1145/3219819.3219991. +Ahammed Ullah. Computing clique cover with structural parameterization. arXiv preprint arXiv:2208.12438, 2022. +Fedor Velikonqvitsev, Mikhail Mironov, and Liudmila Prokhorenkova. Challenges of generating structurally diverse graphs. In Amir Globersons, Lester Mackey, Danielle Belgrave, Angela Fan, Ulrich Paquet, Jakub M. Tomczak, and Cheng Zhang (eds.), Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024, 2024. URL http://papers.nips.cc/paper_files/paper/2024/bit/6ac807c9b296964409b277369e55621a-Abstract-Conference.html. +Hongwei Wang, Jialin Wang, Jia Wang, Miao Zhao, Weinan Zhang, Fuzheng Zhang, Wenjie Li, Xing Xie, and Minyi Guo. Learning graph representation with generative adversarial nets. IEEE Transactions on Knowledge and Data Engineering, 33(8):3090-3103, 2019. +Yanbang Wang and Jon M. Kleinberg. From graphs to hypergraphs: Hypergraph projection and its reconstruction. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=qwYKE3VB2h. +Jean-Gabriel Young, Giovanni Petri, and Tiago P. Peixoto. Hypergraph reconstruction from network data. CoRR, abs/2008.04948, 2020. URL https://arxiv.org/abs/2008.04948. +Yun Zhang, Faisal N Abu-Kh Zam, Nicole E Baldwin, Elissa J Chesler, Michael A Langston, and Nagiza F Samatova. Genome-scale computational approaches to memory-intensive applications in systems biology. In SC'05: Proceedings of the 2005 ACM/IEEE Conference on Supercomputing, pp. 12-12. IEEE, 2005. +Xianglin Zuo, Wenqi Chen, Song Xianduo, Xin Wang, and Ying Wang. Generating real-world hypergraphs via deep generative models. Inf. Sci., 647:119412, 2023. doi: 10.1016/J.INS.2023.119412. URL https://doi.org/10.1016/j.ins.2023.119412. + +# A WECP PROBLEM + +Problem 2 (Weighted Edge Clique Partition). Given a graph $\mathcal{G}$ with weight function $w_{e}:E(G)\to \mathbb{Z}^{+}$ and a positive integer $k$ , it asks to select at most $k$ cliques such that each edge appears in exactly as many cliques as its weight (if it exists, otherwise output NO). + +Note that although the WECP may appear similar to the WCEC problem, they have essential differences. In WECP, the objective is to partition the edges such that each edge is covered exactly as many times as indicated by its given weight. This means that if an edge has a weight greater than one, it must be covered by multiple cliques, and no edge can be covered more or fewer times than specified. This strict covering constraint makes the problem more restrictive. The solution either finds such a partition or determines that it is impossible, framing WECP as a Constraint Satisfaction Problem (CSP). + +In contrast, the WCEC problem aims to minimize the distance between the original weight matrix $W$ of the graph and a derived weight matrix $W'$ , which is formed by stacking the selected cliques. In this sense, it approximates or covers the edge weights using cliques. Unlike WECP, there is no strict requirement for how many times each edge must be covered; instead, the focus is on minimizing the difference between the original and derived weight distributions. Therefore, WCEC is essentially a combinatorial optimization problem. + +# B ADDITIONAL PROOF FOR THE SECOND PART OF LEMMA 2 + +Proof. Consider a simple hypergraph $\mathcal{H} = (V, \mathcal{E})$ where $V = \{v_1, v_2, v_3, v_4\}$ and $\mathcal{E} = \{(v_1, v_2, v_4), (v_2, v_3, v_4), (v_1, v_3)\}$ . The graph projection $G$ of $\mathcal{H}$ will be a complete graph. If $G$ is used as the input for the minimum clique edge cover problem, the optimal solution will be a clique $c = (v_1, v_2, v_3, v_4)$ . In the WCEC setting, let $W$ be the weighted matrix of the weighted graph projection of hypergraph $\mathcal{H}$ , and let $W'$ be the weighted matrix derived from the solution of the MCEC. Then we have: + +$$ +W = \left[ \begin{array}{c c c c} 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 2 \\ 1 & 1 & 0 & 1 \\ 1 & 2 & 1 & 0 \end{array} \right], \qquad W ^ {\prime} = \left[ \begin{array}{c c c c} 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0 \end{array} \right]. +$$ + +It is evident that $d(W, W') = \sum_{i=1}^{n} \sum_{j=1}^{n} |W_{ij} - W_{ij}'| = 2$ , which is not the optimal solution for WCEC problem. + +# C EXPERIMENTAL DETAILS + +The code of our experiments is publicly available at https://github.com/LOGO-CUHKSZ/HyperPLR. + +# C.1 DATASETS + +Our experimental evaluation utilizes five real-world datasets from Benson et al. (2018): + +- contact-high-school: This dataset is constructed from interactions recorded by wearable sensors at a high school, consisting of 327 nodes, 172,035 timestamped hyperedges, and 7,818 unique hyperedges. The projected graph contains 5,818 edges and 6,151 maximum cliques. +- contact-primary-school: This dataset is constructed from interactions recorded by wearable sensors at a primary school, consisting of 242 nodes, 106,879 timestamped hyperedges, and 12,704 unique hyperedges. The projected graph contains 8,317 edges and 100,153 maximum cliques. +- email-Enron: In this dataset, nodes represent email addresses at Enron, and each hyperedge comprises the sender and all recipients of an email. The dataset contains 143 nodes, + +Table 3: Comparative result of advanced properties of the ground-truth hypergraphs and generation hypergraphs. + +
Diametercontact-high-schoolcontact-primary-schoolemail-Enronemail-EuNDC-classes
HyperDK0,00.5000.3330.5000.6670.778
HyperDK1,10.2500.3330.2500.3330.533
Hyperlap0.2000.0670.2500.3330.422
Hyperlap+0.2500.3330.0500.1330.289
TheRA0.2500.0000.2500.6670.222
HyperPLR0.2500.0000.0000.0330.000
Triangles Num
HyperDK0,0167.11721.45641.427156.738184.785
HyperDK1,184.44015.98810.86741.22779.077
Hyperlap0.5990.4093.3158.9983.536
Hyperlap+0.9420.2841.5172.9812.124
TheRA0.4680.1982.4513.7251.638
HyperPLR0.3160.3540.0550.7420.281
Degree Distribution
HyperDK0,023.02623.02623.02623.02623.026
HyperDK1,121.00222.63512.4068.4903.960
Hyperlap5.9588.0729.2946.9464.415
Hyperlap+5.3368.8129.0236.4484.474
TheRA6.63410.5307.98615.31514.325
HyperPLR5.0657.6574.6397.4244.020
Singular Value Distribution
HyperDK0,06.2125.7304.6536.4226.750
HyperDK1,15.4625.1474.5136.3457.008
Hyperlap5.3695.0434.4706.2936.589
Hyperlap+5.3725.0564.5206.3196.560
TheRA5.3775.0544.4656.3396.620
HyperPLR5.3475.0324.4516.2786.432
+ +10,883 timestamped hyperedges, and 1,512 unique hyperedges. The projected graph contains 1,800 edges and 10,883 maximum cliques. + +- email-Eu: This dataset includes email addresses at a European research institution, with hyperedges representing the sender and all recipients of an email with the same timestamp. The dataset consists of 998 nodes, 234,760 timestamped hyperedges, and 25,027 unique hyperedges. The projected graph contains 29,299 edges and 237,231 maximum cliques. +- NDC-classes: In this dataset, each hyperedge corresponds to a drug, and the nodes are the class labels assigned to the drugs. The dataset consists of 1,161 nodes, 49,724 timestamped hyperedges, and 1,088 unique hyperedges. The projected graph contains 6,222 edges and 624 maximum cliques. + +# C.2 ADVANCED PROPERTIES + +Inspired by the reviewer, we expand the evaluation metrics to some advanced properties like SHyRe in Wang & Kleinberg (2024). The result is presented in Table 3. Notably, the simplicial closure metric from SHyRe evaluates the temporal evolution process of dynamic hypergraphs, is not applicable to our work or the baseline static generation models. Therefore, we use a similar concept, triangle numbers, which is a widely used graph structural metric (Sansford et al., 2023). For density, we have already presented the results in Table 1, so it is not repeated here. Similar to the approach in SHyRe, we standardized the metrics for triangle numbers and diameter using the formula: $\frac{|x_1 - x_2|}{x_1}$ , where $x_1$ and $x_2$ represent the values of the ground truth and the generated graphs, respectively. For degree distribution and singular value distribution, we compared their cross-entropy. A smaller value indicates better alignment for all the metrics. From the results, we observe that HyperPLR outperforms or is competitive with other models across most datasets and metrics. + +# C.3 EVALUATION METRICS + +We evaluate the training and generated hypergraphs using the following six metrics: + +- Density: While multiple definitions of hypergraph density exist in different contexts, we adopt a most straightforward definition as the ratio of the number of hyperedges to the number of nodes, given by Density = |E| / |V|. +- Average Hyperedge Size: The average hyperedge size is calculated as: Average Hyperedge Size = $\frac{1}{|\mathcal{E}|}\sum_{e\in \mathcal{E}}|e|$ . +- Average Node Degree: The average node degree represents the average number of hyperedges in which each node participates, given by: Average Node Degree = $\frac{1}{|V|}\sum_{v\in V}d(v)$ . +- Clustering Coefficient of Graph Projection: The clustering coefficient is computed for the 2-section (or graph projection) of the hypergraph, where each hyperedge induces a clique among its nodes. This coefficient measures the likelihood that two neighbors of a node are also neighbors. It is calculated as: $C = \frac{1}{|V|} \sum_{v \in V} C(v)$ , where $C(v)$ is the local clustering coefficient of node $v$ in the projected graph. +- Modularity of Graph Projection: The modularity of the graph projection measures the quality of a partition of the graph into communities, with higher values indicating a stronger community structure. It is given by: $Q = \frac{1}{2m}\sum_{i,j}\left[A_{ij} - \frac{k_ik_j}{2m}\right]\delta (c_i,c_j)$ , where $A_{ij}$ represents the adjacency matrix, $k_{i}$ and $k_{j}$ are the node degrees, $m$ is the total number of edges, and $\delta (c_i,c_j)$ equals 1 if nodes $i$ and $j$ belong to the same community, and 0 otherwise. +- Modularity of Bipartite Graph Representation: The modularity of the bipartite graph representation measures the quality of a partition of the bipartite graph, considering nodes representing original vertices and hyperedges. The formula for modularity is similar to that used for the projected graph. + +# D IMPACT OF RANK VALUE IN CELL + +![](images/042e430b75aeeaec961b4fb922000c11db3ebaefa4e197e284710e86ed2b2ea2.jpg) +(a) rank $= 8$ + +![](images/2c833f1579748bde899058f55a842cad140dec11fa9114f1a46c8e2f4b3c8c57.jpg) +(b) rank $= 10$ +Figure 4: Visualization of generated weighted graph projection of Hypergraph email-Enron with different rank values. Zoom in for a better view. + +![](images/a22c97e7dfda903f66a3fdb2527d7f6e4aa8b652b45eb05153f8ff244f4df752.jpg) +(c) rank $= 12$ + +From fig. 4, we can conclude that, in terms of graph structure, there is almost no influence from rank value. However, rank greatly impacts the generation speed in the CELL module. High rank can accelerate the generation greatly but lose some diversity in the generated hypergraph, which is also discussed in Rendsburg et al. (2020). + +# E DIVERSITY OF THE GENERATION + +To the best of our knowledge, this is an essential yet unresolved problem in the graph (and hypergraph) generation task. Below, we make the best effort to provide a fair comparison and discussion of the diversity of hypergraphs generated by our model and HyperLap. Despite the lack of discussion on diversity in hypergraph generation directly, Velikonivtsev et al. (2024) proposed a theoretical framework for evaluating graph diversity. In summary, the paper defines the diversity of a set of graphs $S$ as $\text{Diversity}(S) = F(D(G, G') : G, G' \in S)$ , where $D(G, G')$ is a distance measure between two graphs, and $F$ is a function that computes the overall diversity from the set of pairwise + +distances. Building on this theory, we conducted the following experiments. First, we converted the hypergraphs generated by HyperLap, HyperLap+, and HyperPLR into bipartite graph representations for each dataset1. In this representation, one set of vertices corresponds to the hyperedges, and the other set corresponds to the vertices connected by these hyperedges. This conversion is lossless with respect to the original hypergraph structure. + +Given the large size of the graphs, classical graph distance measures like graph edit distance are NP-hard and computationally prohibitive. Instead, we followed the suggestions of Tsitsulin et al. (2018) and utilized two spectral-based distance measures introduced in: NetLSD-heat and NetLSD-wave. For the function $F$ , we adopted the sum of pairwise distances between elements, as it is the most natural and widely used approach. The Table 4 presents the results of our experiments. From the results, we can see that in most cases, HyperPLR achieves graph diversity that either surpasses or is competitive to that of random generators like HyperLAP and HyperLap+. At the same time, we believe that the concept of diversity in the hypergraph generation task requires a more targeted definition and evaluation method. + +Table 4: NetLSD-Heat&NetLSD-Wave results across various datasets. + +
NetLSD-Heatcontact-high-schoolcontact-primary-schoolemail-Enronemail-EuNDC-classes
HyperLap0.0060.0020.0110.0150.094
HyperLap+0.0070.0560.0090.0070.087
HyperPLR0.0080.0060.0170.0220.354
NetLSD-Wave
HyperLap0.0700.0330.1580.2621.216
HyperLap+0.0860.9750.0970.1270.562
HyperPLR0.1130.1070.1830.2511.479
\ No newline at end of file diff --git a/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/images.zip b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..97acc326483732f10defc77e2b604b5e18df0f04 --- /dev/null +++ b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fab9dcbbb27054018666953a1a4130c9bd5d73fbc078154233e832ea4e54f02c +size 730801 diff --git a/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/layout.json b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..09ead552fa12f6dbc7b117a2fe11b57f61808b85 --- /dev/null +++ b/ICLR/2025/HyperPLR_ Hypergraph Generation through Projection, Learning, and Reconstruction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c4ff7158fe7748fa9295f79ec754cb3a98ab07a9eeb0315ed101ece7de16360 +size 507190 diff --git a/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_content_list.json b/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d66715b9737db089101837dbebc50ad27aa0719f --- /dev/null +++ b/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80c6ffd06952751e70c4ab8f15b556ece866bb748a08dccb15d950c69033c8cb +size 161676 diff --git a/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_model.json b/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6015ae26aec5f4fdfd68c9ae415b541da05baabb --- /dev/null +++ b/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:befe40d653a7ea913da8d97302403689f956edc4a33f2ed8d35d2266cb41f7e2 +size 196596 diff --git a/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_origin.pdf b/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..764414bf639eb3b695200440a5ed033a1d442672 --- /dev/null +++ b/ICLR/2025/Hyperbolic Genome Embeddings/0342de7a-6bdd-4c01-8024-1af199be6908_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63533a3df45cf241d713e144d0ea3ec89e4373aed7ec9d19f1a04923556ae91d +size 9646726 diff --git a/ICLR/2025/Hyperbolic Genome Embeddings/full.md b/ICLR/2025/Hyperbolic Genome Embeddings/full.md new file mode 100644 index 0000000000000000000000000000000000000000..52268dbca180190cc4956d489c38244c8ec0c840 --- /dev/null +++ b/ICLR/2025/Hyperbolic Genome Embeddings/full.md @@ -0,0 +1,565 @@ +# HYPERBOLIC GENOME EMBEDDINGS + +Raiyan R. Khan, Philippe Chlenski, Itsik Pe'er + +Columbia University + +{raiyan, pac, itsik}@cs.columbia.edu + +# ABSTRACT + +Current approaches to genomic sequence modeling often struggle to align the inductive biases of machine learning models with the evolutionarily-informed structure of biological systems. To this end, we formulate a novel application of hyperbolic CNNs that exploits this structure, enabling more expressive DNA sequence representations. Our strategy circumvents the need for explicit phylogenetic mapping while discerning key properties of sequences pertaining to core functional and regulatory behavior. Across 37 out of 42 genome interpretation benchmark datasets, our hyperbolic models outperform their Euclidean equivalents. Notably, our approach even surpasses state-of-the-art performance on seven GUE benchmark datasets, consistently outperforming many DNA language models while using orders of magnitude fewer parameters and avoiding pretraining. Our results include a novel set of benchmark datasets—the Transposable Elements Benchmark—which explores a major but understudied component of the genome with deep evolutionary significance. We further motivate our work by exploring how our hyperbolic models recognize genomic signal under various data-generating conditions and by constructing an empirical method for interpreting the hyperbolicity of dataset embeddings. Throughout these assessments, we find persistent evidence highlighting the potential of our hyperbolic framework as a robust paradigm for genome representation learning. Our code and benchmark datasets are available at https://github.com/rrkhan/HGE. + +# 1 INTRODUCTION + +Representation learning of genome sequences has enabled the exploration of critical unsolved problems in biology, particularly the understanding of genome function and organization (Avsec et al., 2021; Chen et al., 2022a; Dudnyk et al., 2024). Many effective approaches used for genomic sequence modeling have arisen from the same machine learning methods that have powered natural language and image embeddings (Yue et al., 2023; Zhou, 2022; Consens et al., 2023). While the field has made progress by utilizing these methods, the inductive biases of these models are not usually bespoke to genomic data, limiting the expressive power of the resulting sequence representations. Given the tremendous amount of information sequestered within DNA sequences encoding cellular and molecular activity, an efficient and nuanced representation is necessary for genome interpretation and downstream analyses. + +Genome organization is complex, and much of this complexity is the product of evolutionary processes. Any single genome represents the culmination of information diffusion across generations. However, this information transfer occurs through noisy channels, as background mutation rates may degrade the sequence signal (Lu et al., 2020). Accounting for phylogenetic relationships may therefore contextualize the content of the genome and ultimately benefit genome interpretation attempts. The shared influence of a common ancestor across all genomes imbues DNA sequence data with underlying hierarchical structure. These hierarchical relationships emerge through a variety of mechanisms, such as orthology and paralogy, which both codify homologous sequences but occur under different circumstances. Further compounding these interdependencies are the multiple overlapping grammatical structures for different regulatory pathways that characterize the language of the genome. Altogether, these nested levels of latent hierarchies confound genome interpretation. + +In developing a modeling paradigm better suited to handling the hierarchical nature of DNA sequences, considering the geometry of the embedding spaces is essential. While most embeddings are Euclidean + +by default, non-Euclidean spaces may offer a compelling alternative. Specifically, hyperbolic spaces, which have the representational capacity to capture tree-structured data with high fidelity, are well-equipped to manage the hierarchical patterns ubiquitous in genomic sequences. The negative curvature of hyperbolic spaces facilitates the continuous embedding of exponentially growing structures like phylogenetic trees with relatively low distortion. + +In this work, we contend that hyperbolic spaces may be appropriate for learning meaningful representations of the genome. We leverage a fully hyperbolic framework to embed DNA sequences, implicitly handling the latent hierarchies present in the data. Our main contributions are: + +1. We adopt the machinery of fully hyperbolic convolutional neural networks (HCNNs), building two classes of HCNNs for genome sequence learning. We contrast hyperbolic and Euclidean approaches to sequence representation. +2. We introduce a novel, curated set of datasets—the Transposable Elements Benchmark—designed to investigate transposable elements, which remain an underexplored area of the genome with deep evolutionary roots. +3. We demonstrate the performance potential of our HCNNs across 42 real-world datasets addressing foundational challenges in genomics. +4. We elucidate the underlying mechanism by which HCNNs parse genomic signal by simulating and testing plausible data-generating processes for biological sequences. +5. We further motivate our work by formulating an empirical method for interpreting the hyperbolicity of dataset embeddings and use this technique to interrogate properties of genome representations generated by our models. + +# 2 PRELIMINARIES + +# 2.1 RELATED WORK + +Driven by the limitations of traditional Euclidean-based approaches in capturing relationships within complex data structures, hyperbolic deep learning methods have materialized as a promising research area. Early iterations of these methods introduced formalizations for performing the core operations of neural networks in hyperbolic space (Ganea et al., 2018; Nickel & Kiela, 2018), alongside optimization techniques generalized to Riemannian manifolds (Bécigneul & Ganea, 2019). These approaches have been further extended to a variety of frameworks, including fully hyperbolic neural networks (Chen et al., 2022b), hyperbolic graph convolutional networks (Chami et al., 2019), hyperbolic attention networks (Gulcehre et al., 2018), and hyperbolic variational auto-encoders (Mathieu et al., 2019). These models, among others, have proven effective across a variety of real-world domains, including vision (Liu et al., 2020; Hsu et al., 2021; Mathieu et al., 2019), natural language (Tifrea et al., 2019; Chen et al., 2024), and computational biology (Zhou & Sharpee, 2021; Tian et al., 2023). + +In genomics, hyperbolic methods have correctly modeled established phylogenies, showcasing their supremacy in representing tree-structured data (Chami et al., 2020a; Jiang et al., 2022b; Hughes et al., 2004; Chen et al., 2025). These methods assume that the phylogenetic tree is known a priori; thus, the scope of these techniques is limited by the availability of evolutionary metadata. A subset of these methods produces representations of DNA sequences but relies on an explicit mapping of phylogenetic relationships (Corso et al., 2021; Jiang et al., 2022a) in the form of pairwise edit distances or incomplete phylogenies. + +# 2.2 BACKGROUND + +The $n$ -dimensional hyperbolic space $\mathbb{H}_K^n$ is a homogeneous, simply connected Riemannian manifold, $(\mathcal{M}^n,\mathfrak{g}_x^K)$ , consisting of a smooth manifold $\mathcal{M}^n$ with Riemannian metric $\mathfrak{g}_x^K$ , and described by a constant negative curvature $K < 0$ . Several equivalent formulations of hyperbolic space exist, including the Lorentz model, the Poincaré disk model, and the (Beltrami-)Klein model. Here, we use the Lorentz model, $\mathbb{L}_K^n = (\mathcal{L}^n,\mathfrak{g}_x^K)$ , with manifold $\mathcal{L}^n$ , Riemannian metric tensor $\mathfrak{g}_x^K = \mathrm{diag}(-1,1,\ldots ,1)$ , and origin $\overline{\mathbf{0}} = [\sqrt{-1 / K},0,\dots ,0]^T$ . The Lorentz model describes points by their configurations on the forward sheet of a two-sheeted hyperboloid $\mathbb{L}_K^n$ in $(n + 1)$ -dimensional + +Minkowski space, defining the manifold as: + +$$ +\mathcal {L} ^ {n} := \left\{\boldsymbol {x} \in \mathbb {R} ^ {n + 1} \mid \langle \boldsymbol {x}, \boldsymbol {x} \rangle_ {\mathcal {L}} = \frac {1}{K}, x _ {t} > 0 \right\}, \tag {1} +$$ + +where the Lorentzian inner product is as follows: + +$$ +\langle \boldsymbol {x}, \boldsymbol {y} \rangle_ {\mathcal {L}} := - x _ {t} y _ {t} + \boldsymbol {x} _ {s} ^ {T} \boldsymbol {y} _ {s} = \boldsymbol {x} ^ {T} \operatorname {d i a g} (- 1, 1, \dots , 1) \boldsymbol {y}. \tag {2} +$$ + +Utilizing special relativity conventions, the zeroth element in $\pmb{x}$ is denoted as the timelike component $x_{t}$ and the remaining $n - 1$ elements form the spacelike components $\pmb{x}_s$ , giving $\pmb{x} = [x_t,\pmb{x}_s]^T$ , where we can further define the timelike component $x_{t} = \sqrt{||\pmb{x}_{s}||^{2} - 1 / K}$ . + +Exponential and logarithmic maps are used to map between the manifold $\mathcal{M}$ and tangent space $T_{\pmb{x}}\mathcal{M}$ with $\pmb{x} \in \mathcal{M}$ . For mapping a tangent vector $\pmb{z} \in T_{\pmb{x}}\mathbb{L}_K^n$ onto the Lorentz manifold, we can use the exponential map which is defined as: + +$$ +\exp_ {\boldsymbol {x}} ^ {K} (\boldsymbol {z}) = \cosh (\alpha) \boldsymbol {x} + \sinh (\alpha) \frac {\boldsymbol {z}}{\alpha}, \quad \text {w h e r e} \alpha = \sqrt {- K} | | \boldsymbol {z} | | _ {\mathcal {L}}, \quad | | \boldsymbol {z} | | _ {\mathcal {L}} = \sqrt {\langle \boldsymbol {z} , \boldsymbol {z} \rangle_ {\mathcal {L}}}. \tag {3} +$$ + +Conversely, to map a point $\pmb{y} \in \mathbb{L}_K^n$ to the tangent space, we use the logarithmic map: + +$$ +\log_ {\boldsymbol {x}} ^ {K} (\boldsymbol {y}) = \frac {\cosh^ {- 1} (\beta)}{\sqrt {\beta^ {2} - 1}} \cdot (\boldsymbol {y} - \beta \boldsymbol {x}), \quad \beta = K \langle \boldsymbol {x}, \boldsymbol {y} \rangle_ {\mathcal {L}}. \tag {4} +$$ + +Furthermore, in order to move points along geodesics, the parallel transport operation $\mathrm{PT}_{\pmb{x} \to \pmb{y}}^{K}(\pmb{v})$ maps a vector $\pmb{v} \in T_{\pmb{x}}\mathcal{M}$ from the tangent space of $\pmb{x} \in \mathcal{M}$ to the tangent space of $\pmb{y} \in \mathcal{M}$ . The Lorentzian formula for parallel transport is: + +$$ +\mathrm {P T} _ {\boldsymbol {x} \rightarrow \boldsymbol {y}} ^ {K} (\boldsymbol {v}) = \boldsymbol {v} + \frac {\langle \boldsymbol {y} , \boldsymbol {v} \rangle_ {\mathcal {L}}}{\frac {1}{- K} - \langle \boldsymbol {x} , \boldsymbol {y} \rangle_ {\mathcal {L}}} (\boldsymbol {x} + \boldsymbol {y}). \tag {5} +$$ + +# 3 METHODS + +# 3.1 FULLY HYPERBOLIC CNN + +We leverage the HCNN methodology proposed by Bdeir et al. (2024) in the development of our fully hyperbolic genome sequence model. Under this framework, the elements of the traditional CNN model are reinterpreted in the context of the Lorentz model of hyperbolic space. Briefly, we describe the main Lorentzian components utilized in our model. + +Lorentz Convolutional Layer. In a Euclidean setting, a convolutional layer constitutes matrix multiplication between a linearized kernel and input feature maps. In the hyperbolic analogue, each channel is defined as a separate point on the hyperboloid, with the input to each layer forming an ordered set of $n$ -dimensional hyperbolic vectors in $\mathbb{L}_K^n$ . This formulation enforces the constraint that operations on points remain on the hyperboloid, as $\mathbb{L}_K^n \subset \mathbb{R}^{n + 1}$ . In the context of this work, each sequence is thus an ordered set of $n$ -dimensional hyperbolic vectors, where each position describes a nucleotide in the sequence. + +For a one-dimensional hyperbolic convolutional layer with input feature map $\pmb{x} = \{\pmb{x}_l\in \mathbb{L}_K^n\}_{l = 1}^L$ the features contained in the receptive field of kernel $\mathbf{G}\in \mathbb{R}^{m\times n\times \tilde{L}}$ are $\{\pmb{x}_{l^{\prime} + \epsilon \tilde{l}}\in \mathbb{L}_K^n\}_{\tilde{l} = 1}^{\tilde{L}}$ , in which $l^{\prime}$ marks the starting position and $\epsilon$ is the stride. Given this parameterization, we can express the convolution layer as the output of two transformations: + +$$ +\boldsymbol {y} _ {l} = \operatorname {L F C} \left(\operatorname {H C a t} \left(\left\{\boldsymbol {x} _ {l ^ {\prime} + \epsilon \tilde {l}} \in \mathbb {L} _ {K} ^ {n} \right\} _ {\tilde {l} = 1} ^ {\tilde {L}}\right)\right), \tag {6} +$$ + +where HCat is an operation concatenating hyperbolic vectors, and LFC is a Lorentz fully-connected layer performing the affine transformation of the kernel (refer to A.1.1). Next, Lorentz batch normalization (LBN) reframes the underlying operations of batch normalization by using Fréchet mean (Lou et al., 2020) for re-centering points and Fréchet variance (Kobler et al., 2022) for re-scaling them. The algorithm is expressed as: + +$$ +\operatorname {L B N} (\boldsymbol {x}) = \exp_ {\beta} ^ {K} \left(\mathrm {P T} _ {\bar {\mathbf {0}} \rightarrow \beta} ^ {K} \left(\gamma \cdot \frac {\mathrm {P T} _ {\mu_ {B} \rightarrow \bar {\mathbf {0}}} ^ {K} \left(\log_ {\mu_ {B}} ^ {K} (\boldsymbol {x})\right)}{\sqrt {\sigma_ {B} ^ {2} + \epsilon}}\right)\right). \tag {7} +$$ + +Finally, Lorentz multinomial logistic regression (MLR) builds upon the original formulation of a Euclidean MLR (Lebanon & Lafferty, 2004), which is defined using input $\pmb{x} \in \mathbb{R}^n$ and $C$ classes: + +$$ +p (y = c | \boldsymbol {x}) \propto \exp \left(v _ {\boldsymbol {w} _ {c}} (\boldsymbol {x})\right), \quad v _ {\boldsymbol {w} _ {c}} (\boldsymbol {x}) = \operatorname {s i g n} \left(\left\langle \boldsymbol {w} _ {c}, \boldsymbol {x} \right\rangle\right) \| \boldsymbol {w} _ {c} \| d \left(\boldsymbol {x}, H _ {\boldsymbol {w} _ {c}}\right), \quad \boldsymbol {w} _ {c} \in \mathbb {R} ^ {n}, \tag {8} +$$ + +in which $H_{\mathbf{w}_c}$ is the decision hyperplane of class $c$ . Bdeir et al. (2024) replace component operations with their Lorentzian interpretations to produce the Lorentz MLR formulation. Using parameters $a_c \in \mathbb{R}$ and $\mathbf{z}_c \in \mathbb{R}^n$ , the Lorentz MLR's output logit for class $c$ given input $\mathbf{x} \in \mathbb{L}_K^n$ is expressed as: + +$$ +v _ {\boldsymbol {z} _ {c}, a _ {c}} (\boldsymbol {x}) = \frac {1}{\sqrt {- K}} \operatorname {s i g n} (\alpha) \beta \left| \sinh^ {- 1} \left(\sqrt {- K} \frac {\alpha}{\beta}\right) \right|, \tag {9} +$$ + +$$ +\alpha = \cosh (\sqrt {- K} a) \langle z, x _ {s} \rangle - \sinh (\sqrt {- K} a), +$$ + +$$ +\beta = \sqrt {\| \cosh (\sqrt {- K} a) \pmb {z} \| ^ {2} - (\sinh (\sqrt {- K} a) \| \pmb {z} \|) ^ {2}}. +$$ + +For further details, including Lorentz formulations of residual connections and nonlinear activation, we refer the reader to Bdeir et al. (2024). + +# 3.2 MODEL OVERVIEW + +As our goal is to distill the difference between using Euclidean versus hyperbolic embedding spaces, we employ a relatively simple model design. The HCNN architecture consists of three major components: (1) hyperbolic convolutional blocks, (2) a flattening layer, and (3) MLR (Figure 1). Each input DNA sequence $\mathbf{x}$ is one-hot encoded at the nucleotide level, and then projected channelwise onto a hyperbolic manifold $(\varphi : \mathbb{R}^{4\times L} \to \mathbb{L}^{4\times L})$ . The result of this transformation serves as the input to the hyperbolic convolutional blocks, which produce output feature maps $\mathbf{x} \in \mathbb{L}^{C\times L}$ , where $C$ is the channel dimension. After a flattening step, the model performs classification using Lorentz MLR to find the hyperbolic decision hyperplanes splitting the sequences by label. + +For each hyperbolic component in our models, there exists an equivalent Euclidean counterpart, ensuring architectural parity across models for a fair comparison (Appendix Figure 4). However, the layers in the HCNNs also include a learnable $K$ parameter corresponding to the curvature of the hyperboloid on which the points reside. For our downstream experiments, we evaluate two versions of the HCNN model: HCNN-S (single $K$ ) and HCNN-M (multiple $K\mathrm{s}$ ). In HCNN-S, a single manifold with a fixed curvature $K$ is used across all layers, offering a more direct comparison with CNNs. In contrast, HCNN-M assigns distinct curvatures $[K_1,\dots,K_u]$ to each of the $u$ designated blocks, with intermediary steps mapping points between manifolds (see A.1.2). By constructing two classes of HCNN models, we analyze the trade-offs between the enhanced representational flexibility of multiple curvatures and the potential instability introduced by the additional exponential and logarithmic mapping steps required for projecting points onto different manifolds. Additional modeling details are provided in A.2. + +# 3.3 $\delta$ -HYPERBOLICITY + +Gromov introduces the notion of $\delta$ -hyperbolicity as a measure of the deviation of a metric space from perfect tree-like structure (Gromov, 1987). We can define a metric space $(M,d)$ , in which the Gromov product of $z,y\in M$ with respect to $x\in M$ is: + +$$ +(x, y) _ {z} = \frac {1}{2} (d (x, z) + d (y, z) - d (x, y)). \tag {10} +$$ + +Then, the metric space is characterized as $\delta$ -hyperbolic for some $\delta \geq 0$ if it satisfies the four point condition, which states that for any four points $x, y, z, w \in M$ : + +$$ +(x, y) _ {w} \geq \min \{(x, z) _ {w}, (y, z) _ {w} \} - \delta . \tag {11} +$$ + +The smallest $\delta$ for which this inequality holds is the Gromov $\delta$ -hyperbolicity of $(M,d)$ . + +$\delta$ -hyperbolicity has been an important tool in elucidating innate properties of metric spaces (Fournier et al., 2015; Albert et al., 2014). Recently, this measure has been extended to explore the hyperbolic + +![](images/59f309c134543c1a3264590c9321f1917a1066f7dd46320c5612d041318ae713.jpg) +Figure 1: Overview of our HCNNs. Model inputs are sequences with latent phylogenetic structure (bottom left). As sequences pass through the hyperbolic convolutional module, they are projected onto a hyperboloid before the model's convolutional and flattening steps (top insert). Using hyperbolic MLR, each sequence is classified according to the hyperplane boundaries (bottom right). + +behavior of specific datasets and their respective embeddings within the domains of computer vision (Khrulkov et al., 2020), and natural language processing (Yang et al., 2024). While the original Gromov's $\delta$ (which we will denote as $\delta_{\mathrm{worst}}$ hereinafter) is designed to represent the upper bound in terms of deviation from tree-like structure, other approaches have argued in favor of utilizing an average Gromov hyperbolicity, $\delta_{\mathrm{avg}}$ , on the grounds that a worst case analysis of a space may not ultimately be representative of the true hyperbolic capacity of the space (Chatterjee & Sloman, 2021; Albert et al., 2014; Tifrea et al., 2019). We further develop these ideas in the context of the genomic datasets used in this paper. + +As in previous approaches, we examine the behavior of $\delta_{\mathrm{worst}}$ and $\delta_{\mathrm{avg}}$ in high dimensional feature space. As a comparative measure, we compute a scale-invariant value of $\delta$ , defined as $\delta_{\mathrm{rel}} := \frac{2\delta}{D_{\mathrm{max}}}$ (Borassi et al., 2015), where $D_{\mathrm{max}}$ denotes the maximal pairwise distance, or set diameter. $\delta_{\mathrm{rel}}$ is constrained to $[0,1]$ , with a value of 0 denoting complete hyperbolicity, or perfect tree structure. Unless otherwise specified, all $\delta_{\mathrm{s}}$ referred to in this work are the scale-invariant value. + +Ultimately, both $\delta_{\mathrm{worst}}$ and $\delta_{\mathrm{avg}}$ are point estimates over what may be a complex landscape of $\delta$ values. To offer a more comprehensive evaluation, we examine the entire distribution of $\delta$ values across each dataset to thoroughly assess the hyperbolic underpinnings of DNA sequence data. By appraising the full landscape of $\delta$ -hyperbolicity in our embedding space, we gain a richer understanding of the intrinsic tree structure across each dataset. We provide further details on $\delta$ computation and other experimental configurations in A.9.1. + +# 4 DATA + +Synthetic Datasets. In order to rigorously interrogate the applicability of hyperbolic architectures in genomics, we create several synthetic datasets to illuminate the underlying biological processes being captured by our models. Our approach considers various plausible data-generating processes for biological sequences, and defines three potential cases of biological signal transmission learned by the models. Additionally, given prior evidence from Corso et al. (2021) that purely artificial sequences may not always be indicative of performance on real-world datasets, we explore this phenomenon by creating two sets of data for each case: one where sequences are completely randomly generated and one where sequences are randomly sampled from existing genomes. + +![](images/c1bfd6b373f66b361b9883b2455b29d781d913d57c656b5332ad5ab29013017a.jpg) +Figure 2: The various plausible evolutionary scenarios informing genomic sequence learning. Leaf coloring (blue vs. red) represents label assignments for A) intra-tree differentiation, B) inter-tree differentiation, and C) tree identification scenarios. + +![](images/11df2a90ebcf7a2a2903f85ff270d886830a9de9a3df10a8e7f6adac9f044360.jpg) + +![](images/1d1589c762a5c387fb1059547bfeb8a80bfee7c5b80113122cd99f9370830a21.jpg) + +![](images/4fc51e7d7603dc96ffd93cb592408eb34af5343ad603b0c3d9cfa32fd1fd8d2e.jpg) + +We mimic evolutionary dynamics in our synthetic datasets by perturbing input sequences based on phylogenetic tree structure. After establishing an initial input sequence, we simulate sequence evolution along tree branches with the generalized time-reversible (GTR) nucleotide model (Tavaré, 1984). Each scenario, visualized in Figure 2, is defined as follows: + +(A) Intra-tree differentiation: sequences are generated from a single phylogenetic tree, with labels assigned based on clade membership. +(B) Inter-tree differentiation: sequences are generated from different phylogenetic trees, with labels derived from phylogeny membership. +(C) Tree identification: sequences are labeled based on the generating process: phylogenetic tree generation or non-phylogenetic (random) generation. + +We leverage these scenarios to better understand the specific advantages of hyperbolic models and identify the conditions under which they demonstrate the greatest effectiveness. For full details regarding dataset generation, see A.6. + +Transposable Elements Benchmark. We introduce a multi-species benchmark for exploring how transposable elements (TEs) are codified in sequence. TEs are highly abundant, mobile elements of genomic sequence that represent specific evolutionary trajectories within organisms (Hayward & Gilbert, 2022; Wells & Feschotte, 2020). Due to their ability to move within genomes, TEs drive genomic plasticity and have been identified as key players in the evolution of genomic complexity (Schrader & Schmitz, 2019; Bowen & Jordan, 2002). TEs can influence gene expression and regulation by acting as alternative promoters (Faulkner et al., 2009), providing transcription factor binding sites (Sundaram et al., 2014), introducing alternative splicing (Shen et al., 2011), and mediating epigenetic modifications (Drongitis et al., 2019). As such, TEs have also been implicated in disease pathogenesis (Jönsson et al., 2020; Hancks & Kazazian, 2016). Overall, TEs represent a powerful force in evolutionary biology, continually shaping the genetic landscape. + +A variety of TEs exist across genomes and can be categorized into several subclasses. The genetic structure of TE types follows regular patterns of structural features and motifs, and thus represents an interesting learning opportunity for sequence models. The Transposable Elements Benchmark (TEB) presents a novel resource for investigating TEs, which represent an area of genome organization that remains underexplored in the genomics deep learning literature. TEB surveys several different TE classes across plant and human genomes. Specifically, TEB offers binary classification datasets for identifying seven specific elements across three different TE classes: retrotransposons, DNA transposons, and pseudogenes. Detailed data preprocessing and dataset statistics are further presented in A.3. + +Genome Understanding Evaluation. The Genome Understanding Evaluation (GUE) benchmark is a recently published tool that contains seven biologically significant genome analysis tasks that span 28 datasets. Designed to scrutinize the capabilities of genome foundation models, GUE prioritizes genomic datasets that are challenging enough to discern differences between models. The datasets contain sequences ranging from 70-1000 base pairs in length and originating from yeast, mouse, human, and virus genomes. Further details can be found in Zhou et al. (2024). + +Genomic Benchmarks. We utilize the Genomic Benchmarks (GB) resource, which consists of eight separate classification datasets that spotlight regulatory elements across three different model organisms: human, mouse, and roundworm. Datasets were carefully constructed from published data repositories and consist of input sequences of length 200-500, with the exception of the drosophila enhancers stark dataset, in which sequences have a median length of 2,142. Full details on data preprocessing and dataset summary statistics can be found in Grešová et al. (2023). As the human non-tata promoters dataset in GB was compiled using data that was also used to create the promoter detection datasets in GUE (Dreos et al., 2013), we handle this redundancy by only counting non-overlapping datasets when discussing model performance. + +# 5 EXPERIMENTS + +# 5.1 GENOMIC CLASSIFICATION + +Data-Generating Scenarios. The synthetic dataset experiments offer deeper insight into how the hyperbolic inductive bias operates in a genomic learning context. Table 1 suggests that this bias is particularly beneficial in Scenario C, where it aids in uncovering the underlying phylogenetic tree structure in the presence of noise. While this learning mechanism may also help disentangle distinct evolutionary patterns (Scenario B), the results further indicate that discernment in Scenario C may be unrelated to discernment in Scenario A. This distinction likely arises because sequence differentiation occurs at the tree level rather than the clade level. + +In evaluating predictive models for biological sequence data, homology splitting is commonly used to assess a model's ability to generalize by excluding homologous sequences. We investigate how this partitioning impacts HCNNs by measuring their zero-shot capability in distinguishing sequences from an unseen phylogenetic tree against randomly sampled background sequences. This experiment, detailed in A.7, demonstrates that hyperbolic models outperform Euclidean models in generalizing to unseen homology branches. These findings suggest that the inductive biases of hyperbolic models offer an even greater advantage than previously estimated, as most genomic datasets overlook this effect and may thus overestimate the performance of predictive methods (Teufel et al., 2023). + +# Classification Tasks. The results from the + +three classification benchmarks are summarized in Table 2. Across the 42 distinct datasets, the hyperbolic models outperform the equivalent Euclidean model on 37 tasks, as measured by the Matthews correlation coefficient (MCC). In 29 of these datasets, the improvement in score by a hyperbolic model is statistically significant when accounting for variance across different model initializations, whereas the Euclidean CNN statistically outperforms HCNNs in only two datasets. + +Further examination of the results suggests that HCNNs confer a particularly strong advantage in distinguishing transcription factor binding sites, epigenetic marks, and TEs in sequence. Across promoter detec + +Table 1: Model performance (MCC) under different synthetic data-generating scenarios, averaged over five random seeds (mean ± standard deviation). The highest-scoring model is in bold, while $\dagger$ denotes a statistically significant improvement over the opposite geometry model(s) with $p < 0.05$ , Wilcoxon rank-sum test. + +
ScenarioSequenceModel
Euclidean CNNHyperbolic HCNN-SHyperbolic HCNN-M
AArtificial62.38±2.2865.25±3.2759.25±2.60
Real61.72±3.0866.44±3.1461.26±2.99
BArtificial58.50±0.8260.53±0.8059.75±0.54
Real57.50±0.8862.53±6.9459.12±0.54
CArtificial62.05±1.6267.65±1.09†67.43±1.57†
Real66.22±0.4473.62±0.62†69.30±2.34†
+ +tion tasks, hyperbolic embeddings provide no apparent benefit. Since promoters likely function through more complex combinatorial interactions, these dynamics may be more challenging for HCNNs to effectively represent. HCNNs also seem to be significantly disadvantaged in the Covid variant prediction task, which requires distinguishing nine different COVID variants based on their sequences. These findings appear consistent with the synthetic dataset results: the most significant performance gains are observed in scenarios where an evolutionary signal (e.g., transcription factor binding sites, epigenetic marks, TEs) is distinguished from background noise (e.g., non-functional or background sequences). In contrast, the Covid task closely resembles Scenario A, in which a single ancestral sequence evolves along multiple paths. + +![](images/be46401c525789dbfaa60d9684657581d3ccc190a4bad295a09e5ea1a1444837.jpg) +Figure 3: Decision boundaries learned by 2-dimensional HCNNs (circles) and CNNs (squares) for differentiating genomic sequence classes. Boundaries for transposon sequences and processed pseudogenes are visualized on the Poincaré disk and Euclidean plane. Regions are colored by predicted class labels, while points are colored based on their true class labels. + +Notably, when comparing the best scoring model across runs, HCNNs outperform DNA language models (LMs) in seven of the 28 GUE datasets (A.4 and Appendix Table 5). Across the majority of tasks, HCNNs outpace HyenaDNA (Nguyen et al., 2024), Caduceus-Ph (Schiff et al., 2024), DNABERT (5-mer), DNABERT (6-mer) (Ji et al., 2021), NT-500M human, NT-500M-1000g, and NT-25000M-1000g (Dalla-Torre et al., 2024). The performance gap between HCNNs and the aforementioned LMs is especially striking given the immense scale of these LMs, which contain $1.7 \times$ to $543 \times$ more trainable parameters than HCNNs and have undergone pretraining on the entire human genome and 1000 Genomes Project sequences (Byrska-Bishop et al., 2022). HCNNs appear to have a consistent advantage over Euclidean models across many of the core deep learning genomics tasks. + +Expressive Power. By directly comparing the embeddings and decision boundaries learned by each class of model, we can begin to infer differences in their expressiveness. Figure 3 visualizes the distinctive class boundaries and sequence relationships learned by HCNNs and CNNs, following the setup in (Chlenski et al., 2024). We observe far better separation of classes in the hyperbolic embeddings than in the Euclidean case, lending further credence to the appropriateness of hyperbolic embeddings in a genomic setting. + +Additional experiments, detailed in A.10, develop intuition for factors informing the positioning of genomic sequence embeddings in the latent space. + +Embedding Dimensionality. Prior work on hyperbolic neural networks has demonstrated that the effectiveness of hyperbolic embeddings is especially pronounced in lower dimensions (Chami et al., 2020b; Chamberlain et al., 2017). We probed whether this trend holds under our study conditions by varying the number of channels in the convolutional blocks in both the CNNs and HCNNs. Each distinct model was then trained and evaluated on TEB. The results in Appendix Figure 5 show that HCNN-S exhibits a marginal increase in improvement over CNNs at lower channel dimensions and HCNN-M shows no gains. + +Next, we evaluated the potential of the HCNN model class as a foundational framework for DNA LMs. To align more closely with the parameter scales of DNA LMs, we expanded HCNN-S and HCNN-M. Benchmarking these larger models against the two leading model classes that achieve state-of-the-art (SOTA) performance on GUE, DNABERT-2 (Zhou et al., 2024) and NT-2500-multi, suggests that the hyperbolic framework holds promise for DNA LM adoption. As shown in Appendix Table 6, despite having fewer parameters than their competitors, the larger HCNNs achieve SOTA performance on 12 GUE datasets—outperforming DNABERT-2 (11 datasets) and NT-2500-multi (five datasets). + +Learned Curvature. The curvature of the hyperbolic manifold is a learnable parameter. Exploration of this parameter in TEB (detailed in A.5) illustrates that the value of $K$ does not deviate significantly from its default initialization value of -1. However, the HCNN-S and HCNN-M models gravitate towards different curvature values ( $K > -1$ and $K < -1$ , respectively), with small adjustments in the curvature of the embedding spaces for each block of the model. + +Hybrid Models. We construct hybrid models that combine Lorentzian and Euclidean components (see A.8 for details). Our results indicate that Euclidean embeddings may still benefit from hyperbolic decision boundaries. + +# 5.2 $\delta$ -HYPERBOLICITY ESTIMATION + +As presented in Appendix Figure 10, our investigation reveals several notable characteristics of $\delta$ -hyperbolicity values in finite datasets. The $\delta$ (Appendix Figure 10) and $\delta_{\mathrm{worst}}$ (Appendix Table 9) values computed from the final embedding layer are ostensibly hyperbolic; all values are closer to 0 than 1, indicating tree-like tendencies. However, we observe that the increase in values of $\delta_{\mathrm{worst}}$ are only weakly anticorrelated with relative improvements in performance on learning tasks ( $r_S = -0.35$ , $r_M = -0.21$ , Appendix Figure 11). An outlier to this pattern appears to be the Covid dataset, which has low hyperbolicity and poor performance from HCNNs. + +Table 2: Model performance (MCC) on all real-world genomics datasets, averaged over five random seeds (mean ± standard deviation). The highest-scoring model is in bold, while $\dagger$ denotes a statistically significant improvement over the opposite geometry model(s) with $p < 0.05$ , Wilcoxon rank-sum test. Note: the GB human non-tata promoters dataset and GUE promoter detection datasets overlap. + +
BenchmarkTaskDatasetModel
Euclidean CNNHyperbolic HCNN-SHyperbolic HCNN-M
TEBRetrotransposonsLTR Copia54.73±1.4564.58±3.07†68.05±2.80†
LINEs70.63±1.2476.12±2.16†77.10±2.92†
SINEs85.15±1.6485.45±1.1681.85±2.95
DNA transposonsCMC-EnSpm72.18±0.3280.98±1.48†80.65±1.30†
hAT-Ac87.45±0.9089.61±1.3491.04±1.58†
Pseudogenesprocessed60.66±0.8268.30±0.93†65.41±5.54
unprocessed51.94±2.6956.13±0.56†58.36±1.80†
GUEEpigenetic Marks PredictionH364.83±2.1768.14±1.4468.32±2.12†
H3K14ac34.27±6.1450.37±8.14†45.69±1.95†
H3K36me343.74±2.3253.28±1.94†43.41±2.00
H3K4me128.76±3.0040.84±1.18†34.71±3.70
H3K4me225.38±5.4039.74±4.61†29.53±1.97
H3K4me321.77±5.5849.51±0.96†30.39±3.32†
H3K79me354.88±2.0962.39±2.14†58.48±1.88
H3K9ac40.37±3.8952.90±1.12†50.21±1.52†
H4ac31.59±8.4552.29±0.93†44.88±4.70
H474.81±0.9275.43±1.4976.20±0.61
Human Transcription Factor Prediction058.65±3.4062.84±0.6460.92±1.72
161.41±1.6067.13±2.59†66.76±1.25†
249.79±0.5167.17±5.26†68.36±2.70†
335.67±0.3041.96±2.9542.93±2.30†
457.68±0.2666.01±1.88†67.99±2.30†
Splice Site Predictionreconstructed78.64±0.4380.32±1.24†80.76±1.06†
Mouse Transcription Factor Prediction022.51±2.7846.09±2.17†47.96±5.01†
176.56±0.5178.93±0.31†76.68±0.81
262.69±1.5274.76±3.07†74.78±2.98†
336.93±8.3568.61±4.24†66.58±3.24†
430.23±3.1340.07±0.83†40.57±2.09†
Covid Variant ClassificationCovid66.43±0.48†36.71±9.6914.81±0.46
Core Promoter Detectiontata78.26±2.8579.54±1.6179.87±2.50
notata66.60±1.0766.52±0.2865.95±0.51
all66.47±0.7465.26±1.1167.16±0.55
Promoter Detectiontata78.58±3.3979.74±2.6678.77±0.78
notata90.81±0.5189.86±0.7690.28±0.37
all88.00±0.3987.60±0.5187.93±0.76
GBDemocoding vs intergenomic seqs75.14±0.3580.04±0.28†80.25±0.24†
human or worm89.89±0.1592.65±0.11†92.71±0.27†
Enhancersdrosophila enhancers stark7.99±3.0110.77±2.3410.87±3.32
human enhancers cohn30.76±2.0546.63±0.88†46.68±1.11†
human enhancers ensembl79.48±0.10†44.48±2.9472.99±0.36
Regulatoryhuman ensembl regulatory89.73±0.2189.91±0.7290.21±1.37
human non-tata promoters*64.98±0.2183.57±0.73†79.90±1.48†
Open Chromatin RegionshumanOCR ensembl39.92±0.8556.22±0.28†55.36±2.52†
+ +Previous studies have attempted to calibrate their reported $\delta_{\mathrm{worst}}$ values by comparing them to empirical estimates of $\delta_{\mathrm{worst}}$ for the Poincaré disk $\mathbb{D}^2$ , and the 2-sphere $S^2$ (Khrulkov et al., 2020; Yang et al., 2024), however we note that these empirical estimates are for metric spaces that are categorically much lower in dimensionality than the feature spaces used for the dataset embeddings, leading to potentially incongruous comparisons. Indeed, we find that high-dimensional data produces "emergent hyperbolicity", with points at higher dimensions producing smaller $\delta_{\mathrm{worst}}$ and $\delta_{\mathrm{avg}}$ values (detailed in A.9.2). Our results highlight a pronounced disparity: the difference in empirical $\delta$ values between embeddings sampled on $\mathbb{H}^2$ and those sampled on higher-dimensional hyperbolic spaces $(\mathbb{H}^d$ , where $d \in [200,1000]$ ) – with comparable magnitudes to the sequence embeddings – can be as large as 0.2 (Appendix Figure 12). This disparity becomes even more pronounced on Euclidean $(\mathbb{R}^d)$ and hyperspherical $(\mathbb{S}^d)$ manifolds. Such significant differences in $\delta$ values may largely determine whether the estimated $\delta$ indicates a more hyperbolic nature of the underlying space or otherwise. + +To provide a more equitable calibration of hyperbolicity, we compare the $\delta$ distributions from our genomic datasets to those from simulated datasets of matching dimensionality. We generate these simulated datasets on both Euclidean and hyperbolic ( $K = -1$ ) manifolds. Appendix Figure 10 illustrates the $\delta$ distributions for each set of dataset embeddings, where each embedding $G \in \mathbb{R}^{d_F}$ , with $d_F$ as the final embedding layer size. Our results reveal that the majority of the genomic dataset embeddings exhibit greater hyperbolicity (lower $\delta$ values) compared to embeddings simulated from a baseline Gaussian distribution on a Euclidean manifold of the same dimensionality. To quantify this difference, we employ the Wilcoxon rank-sum test between the baseline and the genome dataset distributions. This analysis shows that 25 out of 43 sequence datasets have significantly lower $\delta$ values than the baseline ( $p < 0.05$ ). These findings support the hypothesis that genomic sequence data may possess an innate hyperbolicity, making them better suited to hyperbolic representations. + +Our approach of examining the entire distribution of $\delta$ values, rather than relying on a single scalar measure, reveals nuanced insights into the hyperbolic tendencies of different datasets. This comprehensive view allows us to capture subtleties that might otherwise be overlooked. For instance, the H3K36me3 dataset exhibits a $\delta$ distribution that is significantly lower in hyperbolicity compared to the baseline. However, its high $\delta_{\mathrm{worst}}$ estimate suggests that it may be less hyperbolic than the baseline when considering only this single metric. Similarly, while the TEB datasets show relatively large $\delta_{\mathrm{worst}}$ estimates, their $\delta$ distributions are notably right-skewed. These characteristics appear more consistent with the superior performance of HCNN models on these datasets. + +The discrepancies between single-point estimates $(\delta_{\mathrm{worst}}, \delta_{\mathrm{avg}})$ and full distributions underscore the importance of a more holistic approach. By considering the entire spectrum of $\delta$ values across the feature space, we gain a more accurate characterization of the data's tree-like properties. This comprehensive perspective not only provides a richer understanding of the dataset's geometric structure but also offers better insights into why models like HCNNs perform well. Expanding this analysis to DNA LMs (Section A.9.3) reveals that these characteristics generalize across a broader range of models. Still, while moving beyond scalar metrics and calibrating against dimensionality-matched geometries has uncovered hyperbolic tendencies in genomic data that point estimates miss, critical challenges persist: formalizing the behavior of $\delta$ -distributions statistically, particularly in the face of emergent hyperbolicity, and exploring their robustness to the choice of metric would significantly clarify in which situations hyperbolic representation learning is applicable. + +# 6 CONCLUSION + +We introduce a novel application of HCNNs for genomic sequence modeling, critically evaluating their strengths and limitations. Our findings show that hyperbolic embeddings offer a distinct performance advantage in key genomics tasks, particularly under resource constraints. Additionally, our analysis of dataset embeddings uncovers significant correlations between dimensionality and $\delta$ -hyperbolicity, reinforcing the value of hyperbolic space for genome representation. + +HCNNs are lightweight, modular models with the scalability to produce competitive DNA LMs, offering additional performance gains through pretraining and complementary techniques. Moreover, this work drives future research toward developing robust metrics for evaluating dataset hyperbolicity and formalizing its relationship with curvature and dimensionality. By advancing the understanding and optimization of hyperbolic models in genomics, our study encourages deeper exploration of this promising paradigm. + +# REFERENCES + +Réka Albert, Bhaskar DasGupta, and Nasim Mobasheri. Topological implications of negative curvature for biological and social networks. Physical Review E, 89(3):032811, 2014. +Žiga Avsec, Vikram Agarwal, Daniel Visentin, Joseph R Ledsam, Agnieszka Grabska-Barwinska, Kyle R Taylor, Yannis Assael, John Jumper, Pushmeet Kohli, and David R Kelley. Effective gene expression prediction from sequence by integrating long-range interactions. Nature methods, 18 (10):1196-1203, 2021. +Ahmad Bdeir, Kristian Schwethelm, and Niels Landwehr. Fully hyperbolic convolutional neural networks for computer vision. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=ekz1hN5QNh. +Gary Bécigneul and Octavian-Eugen Ganea. Riemannian adaptive optimization methods. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id=rleiqi09K7. +Michele Borassi, Alessandro Chessa, and Guido Caldarelli. Hyperbolicity measures democracy in real-world networks. *Physical Review E*, 92(3):032812, 2015. +Nathan J Bowen and I King Jordan. Transposable elements and the evolution of eukaryotic complexity. Current issues in molecular biology, 4(3):65-76, 2002. +Marta Byrska-Bishop, Uday S Evani, Xuefang Zhao, Anna O Basile, Haley J Abel, Allison A Regier, André Corvelo, Wayne E Clarke, Rajeeva Musunuri, Kshithija Nagulapalli, et al. High-coverage whole-genome sequencing of the expanded 1000 genomes project cohort including 602 trios. Cell, 185(18):3426-3440, 2022. +Benjamin Paul Chamberlain, James R. Clough, and Marc Peter Deisenroth. Neural embeddings of graphs in hyperbolic space. CoRR, abs/1705.10359, 2017. URL http://arxiv.org/abs/1705.10359. +Ines Chami, Zhitao Ying, Christopher Ré, and Jure Leskovec. Hyperbolic graph convolutional neural networks. Advances in neural information processing systems, 32, 2019. +Ines Chami, Albert Gu, Vaggos Chatziafratis, and Christopher Ré. From trees to continuous embeddings and back: Hyperbolic hierarchical clustering. Advances in Neural Information Processing Systems, 33:15065-15076, 2020a. +Ines Chami, Adva Wolf, Da-Cheng Juan, Frederic Sala, Sujith Ravi, and Christopher Ré. Low-dimensional hyperbolic knowledge graph embeddings. In Dan Jurafsky, Joyce Chai, Natalie Schluter, and Joel R. Tetreault (eds.), Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pp. 6901-6914. Association for Computational Linguistics, 2020b. doi:10.18653/V1/2020.ACL-MAIN.617. URL https://doi.org/10.18653/v1/2020.acl-main.617. +Sourav Chatterjee and Leila Sloman. Average gromov hyperbolicity and the parisi ansatz. Advances in Mathematics, 376:107417, 2021. +Alex Chen, Philippe Chlenski, Kenneth Munyuza, Antonio Khalil Moretti, Christian A. Naesseth, and Itsik Pe'er. Variational combinatorial sequential monte carlo for bayesian phylogenetics in hyperbolic space, 2025. URL https://arxiv.org/abs/2501.17965. +Kathleen M Chen, Aaron K Wong, Olga G Troyanskaya, and Jian Zhou. A sequence-based global map of regulatory activity for deciphering human genetics. Nature genetics, 54(7):940-949, 2022a. +Weize Chen, Xu Han, Yankai Lin, Hexu Zhao, Zhiyuan Liu, Peng Li, Maosong Sun, and Jie Zhou. Fully hyperbolic neural networks. In Smaranda Muresan, Preslav Nakov, and Aline Villavicencio (eds.), Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2022, Dublin, Ireland, May 22-27, 2022, pp. 5672-5686. Association for Computational Linguistics, 2022b. doi:10.18653/V1/2022.ACL-LONG.389. URL https://doi.org/10.18653/v1/2022.acl-long.389. + +Weize Chen, Xu Han, Yankai Lin, Kaichen He, Ruobing Xie, Jie Zhou, Zhiyuan Liu, and Maosong Sun. Hyperbolic pre-trained language model. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 2024. +Philippe Chlenski, Ethan Turok, Antonio Khalil Moretti, and Itsik Pe'er. Fast hyperboloid decision tree algorithms. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=TTonmgTT9X. +Philippe Chlenski, Kaizhu Du, Dylan Satow, and Itsik Pe'er. Manify: A python library for learning non-euclidean representations, 2025. URL https://arxiv.org/abs/2503.09576. +Nathann Cohen, David Coudert, and Aurélien Lancin. On computing the gromov hyperbolicity. Journal of Experimental Algorithms (JEA), 20:1-18, 2015. +Micaela E Consens, Cameron Dufault, Michael Wainberg, Duncan Forster, Mehran Karimzadeh, Hani Goodarzi, Fabian J Theis, Alan Moses, and Bo Wang. To transformers and beyond: large language models for the genome. arXiv preprint arXiv:2311.07621, 2023. +Gregory M Cooper, Eric A Stone, George Asimenos, Eric D Green, Serafim Batzoglou, and Arend Sidow. Distribution and intensity of constraint in mammalian genomic sequence. Genome research, 15(7):901-913, 2005. +Gabriele Corso, Zhitao Ying, Michal Pandy, Petar Velicković, Jure Leskovec, and Pietro Lio. Neural distance embeddings for biological sequences. Advances in Neural Information Processing Systems, 34:18539-18551, 2021. +Hugo Dalla-Torre, Liam Gonzalez, Javier Mendoza-Revilla, Nicolas Lopez Carranza, Adam Henryk Grzywaczewski, Francesco Oteri, Christian Dallago, Evan Trop, Bernardo P de Almeida, Hassan Sirelkhatim, et al. Nucleotide transformer: building and evaluating robust foundation models for human genomics. Nature Methods, pp. 1-11, 2024. +René Dreos, Giovanna Ambrosini, Rouayda Cavin Périer, and Philipp Bucher. Epd and epdnew, high-quality promoter resources in the next-generation sequencing era. *Nucleic acids research*, 41 (D1):D157–D164, 2013. +Denise Drongitis, Francesco Aniello, Laura Fucci, and Aldo Donizetti. Roles of transposable elements in the different layers of gene expression regulation. International Journal of Molecular Sciences, 20(22):5755, 2019. +Kseniia Dudnyk, Donghong Cai, Chenlai Shi, Jian Xu, and Jian Zhou. Sequence basis of transcription initiation in the human genome. Science, 384(6694):eadj0116, 2024. +Geoffrey J Faulkner, Yasumasa Kimura, Carsten O Daub, Shivangi Wani, Charles Plessy, Katharine M Irvine, Kate Schroder, Nicole Cloonan, Anita L Steptoe, Timo Lassmann, et al. The regulated retrotransposon transcriptome of mammalian cells. Nature Genetics, 41(5):563-571, 2009. doi:10.1038/ng.368. +Hervé Fournier, Anas Ismail, and Antoine Vigneron. Computing the gromov hyperbolicity of a discrete metric space. Information Processing Letters, 115(6-8):576-579, 2015. +Adam Frankish, Mark Diekhans, Anne-Maud Ferreira, Rory Johnson, Irwin Jungreis, Jane Loveland, Jonathan M Mudge, Cristina Sisu, James Wright, Joel Armstrong, et al. Gencode reference annotation for the human and mouse genomes. Nucleic acids research, 47(D1):D766-D773, 2019. +Octavian Ganea, Gary Bécigneul, and Thomas Hofmann. Hyperbolic neural networks. Advances in neural information processing systems, 31, 2018. +Katarína Grešová, Vlastimil Martinek, David Čechák, Petr Šimeček, and Panagiotis Alexiou. Genomic benchmarks: a collection of datasets for genomic sequence classification. BMC Genomic Data, 24(1):25, 2023. +M Gromov. Hyperbolic groups. Essays in Group Theory, pages/Springer-Verlag, 1987. + +Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces. In First Conference on Language Modeling, 2024. URL https://openreview.net/forum?id= tEYskw1VY2. +Caglar Gulcehre, Misha Denil, Mateusz Malinowski, Ali Razavi, Razvan Pascanu, Karl Moritz Hermann, Peter Battaglia, Victor Bapst, David Raposo, Adam Santoro, et al. Hyperbolic attention networks. arXiv preprint arXiv:1805.09786, 2018. +Aric Hagberg, Pieter J Swart, and Daniel A Schult. Exploring network structure, dynamics, and function using networkx. Technical report, Los Alamos National Laboratory (LANL), Los Alamos, NM (United States), 2008. +Dustin C Hancks and Haig H Kazazian. Mobilization of transposable elements by environmental and endogenous factors. Human Molecular Genetics, 25(R2):R45-R50, 2016. doi:10.1093/hmg/ddw025. +Alexander Hayward and Clément Gilbert. Transposable elements. Current Biology, 32(17):R904-R909, 2022. +Joy Hsu, Jeffrey Gu, Gong Wu, Wah Chiu, and Serena Yeung. Capturing implicit hierarchical structure in 3d biomedical images with self-supervised hyperbolic representations. Advances in neural information processing systems, 34:5112-5123, 2021. +Jaime Huerta-Cepas, François Serra, and Peer Bork. Ete 3: reconstruction, analysis, and visualization of phylogenomic data. Molecular biology and evolution, 33(6):1635-1638, 2016. +Timothy Hughes, Young Hyun, and David A Liberles. Visualising very large phylogenetic trees in three dimensional hyperbolic space. BMC bioinformatics, 5:1-6, 2004. +Yanrong Ji, Zhihan Zhou, Han Liu, and Ramana V Davuluri. Dnabert: pre-trained bidirectional encoder representations from transformers model for dna-language in genome. Bioinformatics, 37 (15):2112-2120, 2021. +Yueyu Jiang, Puoya Tabaghi, and Siavash Mirarab. Learning hyperbolic embedding for phylogenetic tree placement and updates. *Biology*, 11(9):1256, 2022a. +Yueyu Jiang, Puoya Tabaghi, and Siavash Mirarab. Phylogenetic placement problem: A hyperbolic embedding approach. In *RECOMB International Workshop on Comparative Genomics*, pp. 68-85. Springer, 2022b. +Martin E Jonsson, Rebecca Garza, Per A Johansson, and Johan Jakobsson. Transposable elements: a common feature of neurodegenerative disorders. Mobile DNA, 11(1):1-15, 2020. doi:10.1186/s13100-020-00207-x. +Valentin Khrulkov, Leyla Mirvakhabova, Evgeniya Ustinova, Ivan Oseledets, and Victor Lempitsky. Hyperbolic image embeddings. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6418-6428, 2020. +Reinmar J Kobler, Jun-ichiro Hirayama, and Motoaki Kawanabe. Controlling the fréchet variance improves batch normalization on the symmetric positive definite manifold. In ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3863-3867. IEEE, 2022. +Guy Lebanon and John Lafferty. Hyperplane margin classifiers on the multinomial manifold. In Proceedings of the twenty-first international conference on Machine learning, pp. 66, 2004. +Shaoteng Liu, Jingjing Chen, Liangming Pan, Chong-Wah Ngo, Tat-Seng Chua, and Yu-Gang Jiang. Hyperbolic visual embedding learning for zero-shot recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9273-9281, 2020. +Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7. + +Aaron Lou, Isay Katsman, Qingxuan Jiang, Serge Belongie, Ser-Nam Lim, and Christopher De Sa. Differentiating through the fréchet mean. In International conference on machine learning, pp. 6393-6403. PMLR, 2020. +Amy X Lu, Alex X Lu, and Alan Moses. Evolution is all you need: phylogenetic augmentation for contrastive learning. arXiv preprint arXiv:2012.13475, 2020. +Xizhi Luo, Shiyu Chen, and Yu Zhang. Plantrep: a database of plant repetitive elements. Plant cell reports, pp. 1-4, 2022. +Emile Mathieu, Charline Le Lan, Chris J Maddison, Ryota Tomioka, and Yee Whye Teh. Continuous hierarchical representations with poincaré variational auto-encoders. Advances in neural information processing systems, 32, 2019. +Yoshihiro Nagano, Shoichiro Yamaguchi, Yasuhiro Fujita, and Masanori Koyama. A wrapped normal distribution on hyperbolic space for gradient-based learning. In International Conference on Machine Learning, pp. 4693-4702. PMLR, 2019. +Eric Nguyen, Michael Poli, Marjan Faizi, Armin Thomas, Michael Wornow, Callum Birch-Sykes, Stefano Massaroli, Aman Patel, Clayton Rabideau, Yoshua Bengio, et al. Hyenadna: Long-range genomic sequence modeling at single nucleotide resolution. Advances in neural information processing systems, 36, 2024. +Maximillian Nickel and Douwe Kiela. Learning continuous hierarchies in the lorentz model of hyperbolic geometry. In International conference on machine learning, pp. 3779-3788. PMLR, 2018. +Michael Poli, Stefano Massaroli, Eric Nguyen, Daniel Y Fu, Tri Dao, Stephen Baccus, Yoshua Bengio, Stefano Ermon, and Christopher Ré. Hyena hierarchy: Towards larger convolutional language models. In International Conference on Machine Learning, pp. 28043-28078. PMLR, 2023. +Eric Qu and Dongmian Zou. Autoencoding hyperbolic representation for adversarial generation. arXiv preprint arXiv:2201.12825, 2022. +Yair Schiff, Chia Hsiang Kao, Aaron Gokaslan, Tri Dao, Albert Gu, and Volodymyr Kuleshov. Caduceus: Bi-directional equivariant long-range DNA sequence modeling. In First Workshop on Long-Context Foundation Models @ ICML 2024, 2024. URL https://openreview.net/forum?id=iYNSCJTlPO. +Lukas Schrader and Jürgen Schmitz. The impact of transposable elements in adaptive evolution. Molecular Ecology, 28(6):1537-1549, 2019. +Shihao Shen, Lan Lin, James J Cai, Peng Jiang, Emily J Kenkel, Miranda R Stroik, Shigeo Sato, Beverly L Davidson, and Yi Xing. Widespread establishment and regulatory impact of alu exons in human genes. Proceedings of the National Academy of Sciences, 108(7):2837-2842, 2011. doi:10.1073/pnas.1012834108. +Ondrej Skopek, Octavian-Eugen Ganea, and Gary Bécigneul. Mixed-curvature variational autoencoders. In 8th international conference on learning representations (ICLR 2020)(virtual). International Conference on Learning Representations, 2020. +Stephanie J Spielman and Claus O Wilke. Pyvolve: a flexible python module for simulating sequences along phylogenies. *PloS one*, 10(9):e0139047, 2015. +Vasavi Sundaram, Yong Cheng, Zhihai Ma, Daofeng Li, Xiaoyun Xing, Peter Edge, Michael P Snyder, and Ting Wang. Widespread contribution of transposable elements to the innovation of gene regulatory networks. Genome Research, 24(12):1963-1976, 2014. doi:10.1101/gr.168872.113. +Simon Tavaré. Line-of-descent and genealogical processes, and their applications in population genetics models. Theoretical population biology, 26(2):119-164, 1984. + +Felix Teufel, Magnus Halldór Gíslason, José Juan Almagro Armenteros, Alexander Rosenberg Johansen, Ole Winther, and Henrik Nielsen. Graphpart: homology partitioning for biological sequence analysis. NAR genomics and bioinformatics, 5(4):lqad088, 2023. +Tian Tian, Cheng Zhong, Xiang Lin, Zhi Wei, and Hakon Hakonarson. Complex hierarchical structures in single-cell genomics data unveiled by deep hyperbolic manifold learning. Genome Research, 33(2):232-246, 2023. +Alexandru Tifrea, Gary Bécigneul, and Octavian-Eugen Ganea. Poincare glove: Hyperbolic word embeddings. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id=Ske5r3AqK7. +Jonathan N Wells and Cedric Feschotte. A field guide to eukaryotic transposable elements. Annual review of genetics, 54(1):539-561, 2020. +Menglin Yang, Aosong Feng, Bo Xiong, Jiahong Liu, Irwin King, and Rex Ying. Enhancing llm complex reasoning capability through hyperbolic geometry. In ICML 2024 Workshop on LLMs and Cognition, 2024. +Tianwei Yue, Yuanxin Wang, Longxiang Zhang, Chunming Gu, Haoru Xue, Wenping Wang, Qi Lyu, and Yujie Dun. Deep learning for genomics: From early neural nets to modern large language models. International Journal of Molecular Sciences, 24(21):15858, 2023. +Jian Zhou. Sequence-based modeling of three-dimensional genome architecture from kilobase to chromosome scale. Nature genetics, 54(5):725-734, 2022. +Yuansheng Zhou and Tatyana O Sharpee. Hyperbolic geometry of gene expression. Iscience, 24(3), 2021. +Zhihan Zhou, Yanrong Ji, Weijian Li, Pratik Dutta, Ramana V. Davuluri, and Han Liu. DNABERT-2: efficient foundation model and benchmark for multi-species genomes. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=oMLQB4EZE1. + +# A APPENDIX + +# A.1 LORENTZ CONVOLUTIONAL LAYER + +# A.1.1 LAYER COMPONENTS + +We further break down the Lorentz convolutional layer by defining each separate transformation. First, given hyperbolic points $\{\pmb{x}_i\}_{i=1}^N$ , the Lorentz direct concatenation (HCat) (Qu & Zou, 2022) is defined as: + +$$ +\boldsymbol {y} = \operatorname {H C a t} \left(\left\{\boldsymbol {x} _ {i} \right\} _ {i = 1} ^ {N}\right) = \left[ \sqrt {\sum_ {i = 1} ^ {N} x _ {i t} ^ {2} + \frac {N - 1}{K}}, \boldsymbol {x} _ {1 s} ^ {T}, \dots , \boldsymbol {x} _ {N s} ^ {T} \right] ^ {T} \tag {12} +$$ + +with $\pmb{y} \in \mathbb{L}_K^{nN} \subset \mathbb{R}^{nN + 1}$ . This manipulation provides a numerically stable way to concatenate hyperbolic representations. Next, Chen et al. (2022b) introduced a Lorentz fully-connected layer. Given the input vector $\pmb{x}$ and the weight parameters $\mathbf{W} \in \mathbb{R}^{m \times n + 1}, \pmb{v} \in \mathbb{R}^{n + 1}$ for the fully connected layer, the transformation matrix is defined as: + +$$ +f _ {\boldsymbol {x}} \left(\left[ \begin{array}{l} \boldsymbol {v} ^ {T} \\ \mathbf {W} \end{array} \right]\right) = \left[ \begin{array}{c} \frac {\sqrt {\| \mathbf {W} \boldsymbol {x} \| ^ {2} - 1 / K}}{\boldsymbol {v} ^ {T} \boldsymbol {x}} \boldsymbol {v} ^ {T} \\ \mathbf {W} \end{array} \right]. \tag {13} +$$ + +Then, adding in other layer components (except for internal layer normalization) results in the following formula: + +$$ +\boldsymbol {y} = \operatorname {L F C} (\boldsymbol {x}) = \left[ \begin{array}{c} \sqrt {\| \psi (\mathbf {W} \boldsymbol {x} + \mathbf {b}) \| ^ {2} - 1 / K} \\ \psi (\mathbf {W} \boldsymbol {x} + \mathbf {b}) \end{array} \right] \tag {14} +$$ + +where $\mathbf{b} \in \mathbb{R}^n$ and $\psi$ denote the bias and activation, respectively. + +# A.1.2 LAYER MAPPING + +HCNN-M models leverage multiple manifolds with corresponding curvatures $[K_1, \dots, K_u]$ for each of $u$ designated blocks. Therefore, we define the mapping between manifolds as follows, using the definitions of exponential and logarithmic maps defined in equations 3 and 4, respectively. For a mapping of point $\mathbf{x} \in \mathcal{M}_1$ (where $\mathcal{M}_1$ has corresponding curvature $K_1$ ) to the manifold $\mathcal{M}_2$ (with curvature $K_2$ ), we must first apply a logarithmic map at the origin to bring $\mathbf{x}$ to the tangent space $T_0\mathcal{M}_1$ . Then, we apply an exponential map at the origin of the resulting point to the new manifold $\mathcal{M}_2$ . The layer map operation $\mathbf{L}\mathbf{M}_{\mathcal{M}_1 \to \mathcal{M}_2}(\mathbf{x})$ can therefore be defined as follows: + +$$ +\mathbf {L M} _ {\mathcal {M} _ {1} \rightarrow \mathcal {M} _ {2}} (\mathbf {x}) = \exp_ {\overline {{\mathbf {0}}}} ^ {K _ {2}} \left(\log_ {\overline {{\mathbf {0}}}} ^ {K _ {1}} (\mathbf {x})\right). \tag {15} +$$ + +# A.2 MODELING DETAILS + +# A.2.1 MODEL + +A detailed breakdown of the CNN/HCNN model architecture is visualized in Figure 4. The HCNNs use the Lorentz formulation of each model component. For HCNN-M, we show the partition of each manifold across each segment of the architecture. We use cross-entropy loss as our objective and train each model end-to-end on each dataset. + +![](images/e6ebb0c0b2f7648a6888e8168cf7e83b364bd16ed1e12c9eefbf3eada3e7f85c.jpg) +Figure 4: The generalized block architecture for the CNNs/HCNNs. On the left, we delineate the manifold partitions used in our HCNN-M models. + +# A.2.2 HYPERPARAMETERS + +When possible, we keep the hyperparameters constant across the different model types (Table 3). However, we train the Euclidean CNN using the AdamW optimizer (Loshchilov & Hutter, 2019) and the HCNNs using RiemannianAdam (Bécigneul & Ganea, 2019). + +Table 3: Hyperparameter settings for CNN/HCNN training. + +
Euclidean CNNHCNN-SHCNN-M
OptimizerAdamWRiemannianAdamRiemannianAdam
Learning Rate (TEB/GUE/GB)1e-4, 1e-4, 1e-51e-4, 1e-4, 1e-51e-4, 1e-4, 1e-5
Manifold Learning RateN/A2e-22e-2
Batch size100100100
Weight decay0.10.10.1
Epochs100100100
β1, β20.9, 0.9990.9, 0.9990.9, 0.999
+ +# A.3 TRANSPOSABLE ELEMENTS BENCHMARK + +TEB presents seven distinct sequence classification datasets categorized within three prediction tasks. An overview of the datasets is presented in Table 4. Sequence and annotation data were integrated from both human and plant genome datasets. + +For the retrotransposon and DNA transposon tasks, we crafted a dataset by employing annotations from PlantRep (Luo et al., 2022), a database that provides comprehensive annotations of plant repetitive elements across 459 plant genomes. We narrowed the number of candidate species to those that had an appropriate number of TEs of interest to power deep learning tasks, as well as an average TE sequence length of similar magnitude to the other benchmark datasets (200-1000 bp). Then, we randomly selected Oryza glumipatula from the set of candidate species to use as the plant species for our benchmark. Annotations were downloaded from PlantRep, while the Oryza glumipatula genome (v1.5) was downloaded from the NCBI genome browser (https://ftp.ncbi.nlm.nih.gov). Within the retrotransposon group, there are three datasets: LTR Copia, LINEs, and SINEs. LTR Copia are a type of retrotransposon characterized by a pair of identical flanking repetitive regions called long terminal repeats (LTRs). Conversely, long interspersed nuclear elements (LINEs), and short interspersed nuclear elements (SINEs) are retrotransposons that do not contain LTRs, and generally contain a promoter while varying by length. Next, within the DNA transposon group, we target two + +of the most ubiquitous subfamilies: CMC-EnSpm and hAT-Ac, each of which is distinguished by specific short terminal inverted repeats. + +While pseudogenes themselves are not a type of TE, they are often the result of TE activity. Therefore, we examine the presence of pseudogenes in the human reference genome (GRCh38.p12), using gene/transcript biotype annotations from GENCODE and Ensembl (Frankish et al., 2019). Pseudogenes are classified as processed and unprocessed, each of which results from a different mechanism of action. A processed pseudogene lacks introns and arises from reverse transcription of mRNA followed by reinsertion of DNA into the genome, while an unprocessed pseudogene may contain introns and is the product of a gene duplication event. + +For dataset construction, we created a positive set of sequences spanning each TE of interest. We then generated a negative set by randomly sampling non-overlapping, remaining portions of the genome (without replacement) until we had a matching number of negative sequences. We used a chromosome level train/Validation/test split for our sequences, separating out chromosomes 8/9 and 20-22/17-19 for validation/test sets in Oryza glumipatula and human, respectively, while the remaining chromosomes were used for the training sets. + +Table 4: Summary statistics for TEB, including the specific type of TE and the number of training, validation, and test samples in each dataset. + +
Prediction TaskSpeciesMax LengthDatasetsTrain / Dev / Test
RetrotransposonsPlant500LTR Copia7666 / 682 / 568
1000LINEs22502 / 2030 / 1782
500SINEs21152 / 1836 / 1784
DNA TransposonsPlant200CMC-EnSpm19912 / 1872 / 1808
1000hAT-Ac17322 / 1822 / 1428
PseudogenesHuman1000processed17956 / 1046 / 1740
1000unprocessed12938 / 766 / 884
+ +# A.4 DNA LANGUAGE MODELS + +We compare the best classification performance of our HCNN models to that of several DNA LMs. Table 5 documents the performance of ten large DNA LMs on the GUE datasets, along with the number of trainable parameters present in each model. We benchmarked HyenaDNA and Caduceus-Ph, while for other models, we used the benchmarking results reported in (Zhou et al., 2024). For the HCNN-S and HCNN-M models, we report the average number of model parameters used across all GUE datasets. Below, we provide a short description of each model class: + +- HyenaDNA: A long-context DNA LM that uses the Hyena operator as a basic building block (Poli et al., 2023), which is a subquadratic alternative to attention. HyenaDNA utilizes extended convolutions and data-controlled gating mechanisms to identify long-range genomic effects (Nguyen et al., 2024). +- Caduceus-Ph: A bidirectional DNA LM for long-range sequence modeling that builds on the Mamba module (Gu & Dao, 2024; Schiff et al., 2024). +- DNABERT (5-mer, 6-mer): An early iteration of a pretrained transformer model for the genome, DNABERT (Ji et al., 2021) uses the BERT architecture and is trained on human DNA sequences. There are four variants of the model, and here we list the results for the 5-mer and 6-mer versions, which use overlapping 5-mer and 6-mer tokenization of sequences. +- Nucleotide Transformer (500M human, 500M 1000g, 2500M 1000g, 2500M multi): Nucleotide Transformer (NT) represents the largest class of models in terms of parameters and training data. There are four variants of NT. The labels "500M" and "2500M" correspond to the number of trainable parameters in the model (Dalla-Torre et al., 2024). For the training data, the categories "human", "1000g", and "multi" refer to the human reference genome, + +the 3203 human genomes from the 1000 Genome project, and genomes from 850 different species, respectively. + +- DNABERT-2, DNABERT-2-PT: A refinement of DNABERT, DNABERT-2 incorporates Byte-Pair Encoding and several architectural upgrades for improved learning capabilities. DNABERT-2 is pretrained on the human reference genome, whereas DNABERT-2-PT is further pretrained on the training sets of the 28 GUE datasets (Zhou et al., 2024). + +Table 5: The performance (F1-score for Covid, MCC for all other datasets) of several prominent DNA LMs in comparison to the HCNNs on GUE. The best-performing score for each GUE dataset is bolded. + +
Caduceus -PhHyena DNADNA BERT (5-mer)DNA BERT (6-mer)NT -500M humanNT -500M 1000gNT -2500M 1000gNT -2500M multiDNA BERT-2DNA BERT-2 -PTHCNN -SHCNN -M
Parameters7.7M28.2M87M89M500M500M2.5B2.5B117M117M4.6M4.6M
H377.0967.1773.4073.1069.6772.5274.6178.7778.2780.1769.4269.95
H3K14ac41.4431.9840.6840.0633.5539.3744.0856.2052.5757.4256.0348.25
H3K36me346.4948.2748.2947.2544.1445.5850.8661.9956.8861.9055.2745.76
H3K4me137.7635.8340.6541.4437.1540.4543.1055.3050.5253.0041.8639.78
H3K4me228.1625.8130.6732.2730.8731.0530.2836.4931.1339.8943.8831.27
H3K4me324.4023.1527.1027.8124.0626.1630.8740.3436.2741.2050.5833.59
H3K79me360.3154.0959.6161.1758.3559.3361.2064.7067.3965.4664.6263.35
H3K9ac52.7050.8451.1151.2245.8149.2952.3656.0155.6357.0754.0952.25
H479.9173.6977.2779.2676.1776.2979.7681.6780.7181.8677.2476.94
H4ac40.9038.4437.4837.4333.7436.7941.4649.1350.4350.3552.9451.86
prom all85.8747.3890.1690.4887.7189.7690.9591.0186.7788.3188.2388.83
prom notata93.2352.2492.4593.0590.7591.7593.0794.0094.2794.3490.9290.74
prom tata66.075.3469.5161.5678.0778.2375.8079.4371.5968.7982.7079.80
Human TF 067.3262.3066.9766.8461.5963.6466.3166.6471.9969.1263.5663.35
Human TF 172.1067.8669.9870.1466.7570.1768.3070.2876.0671.8769.3968.48
Human TF 258.9246.8559.0361.0353.5852.7358.7058.7266.5262.9673.8071.40
Human TF 354.8541.7852.9551.8942.9545.2449.0851.6558.5455.3544.0843.66
Human TF 469.4561.2369.2670.9760.8162.8267.5969.3477.4374.9468.4370.01
c. prom all67.2836.9569.4868.9063.4566.7067.3970.3369.3767.5066.3367.84
c. prom notata66.0735.3869.8170.4764.8267.1767.4671.5868.0469.5366.7866.48
c. prom tata72.9472.8776.7976.0671.3473.5269.6672.9774.1776.1881.3482.07
Mouse TF 056.1835.6242.4544.4231.0439.2648.3163.3156.7664.2348.4152.31
Mouse TF 180.3180.5079.3278.9475.0475.4980.0283.7684.7786.2879.2677.41
Mouse TF 275.8965.3462.2271.4461.6764.7070.1471.5279.3281.2877.8677.51
Mouse TF 373.4754.2049.9244.8929.1733.0742.2569.4466.4773.4973.5169.73
Mouse TF 447.9819.1740.3442.4829.2734.0143.4047.0752.6650.8041.2743.62
Covid45.1923.2750.4655.5050.8252.0666.7373.0471.0268.4946.4324.74
Splice81.5972.6784.0284.0779.7180.9785.7889.3584.9985.9381.9682.23
+ +# A.5 MANIFOLD CURVATURE + +Figure 6 depicts the learned curvatures for models trained on TEB. In the HCNN-M models, blocks 1-3 represent the hyperbolic convolutional blocks in the model, each associated with a corresponding manifold that has its own curvature. Block 4 represents the portion of the model that involves a flattening step, a dense layer, and MLR, operations that all occur on a single hyperbolic manifold (Figure 4). In the HCNN-S models, the value of $K$ is fixed, as a single manifold is used across the entire model. + +# A.6 SYNTHETIC DATASETS + +We construct each synthetic dataset by randomly sampling a phylogenetic tree using the Environment for Tree Exploration (ETE) toolkit Huerta-Cepas et al. (2016). To simulate nucleotide sequence evolution along the tree's branches, we use the PYVOLVE package (Spielman & Wilke, 2015), specifically for its implementation of the Generalized Time-Reversible (GTR) model (Tavaré, 1984) + +![](images/666fe46432c4ca3c3f3fa6a4fc730f9a1dd7c6ceddbabecf7210ae4f00671423.jpg) +Figure 5: On the left, we show the average improvement in performance (MCC) on TEB datasets for HCNNs compared to CNNs as the channel dimension in the convolutional layers varies. On the right, we present the mean MCC achieved by the models across TEB datasets, for each channel dimension. + +![](images/a9e7b46fe2efa80da85b4c9d1dd527f55798a90ceef891eada9ee7a8b8df86e0.jpg) + +![](images/52bce5fea4db87c2f59c26b6f94b3f2c76ed04e45f6c5caceb724c70abc1dd97.jpg) +Figure 6: Average values of $K$ , the curvature parameter in the HCNNs, as they vary across each block of the model. Values are reported for models trained on each of the seven classification tasks in TEB. + +with default parameters. Four types of fixed-length sequences are generated and used across Scenarios A, B, and C: + +Artificial tree: The starting ancestral (root) sequence is randomly generated. + +Real tree: The starting ancestral sequence is sampled from the human genome. + +Artificial background sequence: Sequences are generated randomly and independently by sampling nucleotides. + +Real background sequence: Sequences are sampled from independent (different chromosome) regions of the human genome relative to the starting ancestral sequence. + +We define the task for each scenario as follows: + +(A) Intra-tree differentiation: A single tree is sampled, with clade membership determining class labels. The model's task is to differentiate clades. +(B) Inter-tree differentiation: A different tree (with a different starting ancestral sequence) is sampled for each label. The model's task is to differentiate trees. +(C) Tree identification: A single tree is sampled, and all sequences from this tree share the same label. Independently sampled background sequences are assigned a separate label. The model's task is to differentiate the tree from the background sequences. + +Table 6: The performance (F1-score for Covid, MCC for all other datasets) of SOTA DNA LMs and scaled HCNNs on GUE benchmark datasets. The best-performing score for each dataset is bolded. For the scaled HCNN-S and HCNN-M models, we report the average number of model parameters used across all GUE datasets. + +
NT -2500M -multiDNABERT-2DNABERT-2 -PTHCNN-S (Large)HCNN-M (Large)
Parameters2.5B117M117M43M43M
H378.7778.2780.1772.1772.21
H3K14ac56.2052.5757.4270.5669.87
H3K36me361.9956.8861.9068.0667.92
H3K4me155.3050.5253.0053.3355.45
H3K4me236.4931.1339.8954.6752.50
H3K4me340.3436.2741.2067.2564.61
H3K79me364.7067.3965.4670.4970.65
H3K9ac56.0155.6357.0763.3660.66
H481.6780.7181.8676.5474.78
H4ac49.1350.4350.3562.1667.30
promoter all91.0186.7788.3183.3583.73
promoter notata94.0094.2794.3488.3690.67
promoter tata79.4371.5968.7981.8679.19
Human TF 066.6471.9969.1265.0962.85
Human TF 170.2876.0671.8767.5969.91
Human TF 258.7266.5262.9670.7363.79
Human TF 351.6558.5455.3542.1246.26
Human TF 469.3477.4374.9471.9570.33
core promoter all70.3369.3767.5061.7762.56
core promoter notata71.5868.0469.5366.0165.71
core promoter tata72.9774.1776.1880.2080.26
Mouse TF 063.3156.7664.2348.8449.24
Mouse TF 183.7684.7786.2881.0779.43
Mouse TF 271.5279.3281.2880.5175.61
Mouse TF 369.4466.4773.4981.5778.77
Mouse TF 447.0752.6650.8041.7943.70
Covid73.0471.0268.4945.0631.09
Splice89.3584.9985.9379.2378.84
+ +Representative simulated phylogenetic trees and their corresponding labels are visualized in Figures 7 and 8. We introduce noise into the datasets by randomly swapping $10\%$ of the labels in the training and validation sets. + +# A.7 HOMOLOGY SPLITTING + +The experimental setup for homology splitting is visualized in Figure 9. For the training and validation data, we generate a synthetic dataset as in Scenario C, where sequences generated from the tree share the same label, and background sequences not originating from the tree share a different label. However, instead of creating a test set from this dataset, we create the test set by generating a completely new phylogenetic tree and sampling sequences from it. The tree-generated sequences in the test dataset thus originate from entirely unseen homology branches. + +Results of this experiment are presented in Table 7. Hyperbolic models show significantly improved generalization over the Euclidean model in an evolutionary and phylogenetic context. + +![](images/d051e3a22b81f0138d6642b7f409a84047982c6b4468b1cd1ffa24139015a193.jpg) +Figure 7: Leaf node sequence classifications (with added noise) in Scenario A for the simulated phylogenetic tree (structure visible on the left). + +![](images/3423b6c24c0a1d921a5f17611a0c2ed75158dd038d63469faaa2468fe3951244.jpg) +Figure 8: Hamming distance matrix for all leaves in the simulated phylogenetic tree for Scenario A. + +Table 7: Model performance (MCC) on the homology splitting experiment, averaged over five random seeds (mean ± standard deviation). The highest-scoring model is in bold, while $\dagger$ denotes a statistically significant improvement over the opposite geometry model(s) with $p < 0.05$ , Wilcoxon rank-sum test. + +
CNNHCNN-SHCNN-M
24.31±7.9945.73±8.93†40.87±8.93†
+ +![](images/ac9bb219c6057a7256987462633931b995da8faafc1f35334832568b33500d7a.jpg) +Train + Validation + +![](images/5e375a0896a54f2a248c19200f4ba23661798543a191f14e6393794a9b556558.jpg) +Test +Figure 9: Overview of the homology splitting experiment. A training and validation dataset (left) are generated in the same manner as the synthetic dataset used for Scenario C. For the test dataset (right), a completely new tree and ancestral sequence are used to generate the tree class. + +# A.8 HYBRID MODELS + +Following Bdeir et al. (2024), we evaluate hybrid CNN models, in which we substitute components of our models across different manifolds. We construct two hybrid model variants: E2H-CNN and H2E-CNN. In E2H-CNN, we use a Euclidean CNN head and a Lorentzian MLR, whereas H2E-CNN employs an HCNN head and a Euclidean MLR. We compare the performance of the two hybrid models to the other three models in Table 8. On TEB datasets, we observe that incorporating a Lorentzian component generally improves performance over a fully Euclidean model, with larger gains from E2H-CNN. These results suggest that using hyperbolic hyperplanes to separate classes may be beneficial, even for Euclidean embeddings. Overall, the results highlight the potential of hybrid models. + +Table 8: Model performance (MCC) in TEB, averaged over five random seeds. The best-performing model is bolded. + +
DatasetCNNHCNN-SHCNN-ME2H-CNNH2E-CNN
LTR Copia54.73±1.4564.58±3.0768.05±2.8061.82±2.2163.95±3.52
LINEs70.63±1.2476.12±2.1677.10±2.9275.65±0.8379.15±2.36
SINEs85.15±1.6485.45±1.1681.85±2.9589.65±2.1379.49±3.40
CMC-EnSpm72.18±0.3280.98±1.4880.65±1.3076.75±0.6077.15±3.43
hAT-Ac87.45±0.9089.61±1.3491.04±1.5889.76±0.8585.63±1.44
processed60.66±0.8268.30±0.9365.41±5.5466.68±1.3166.12±0.43
unprocessed51.94±2.6956.13±0.5658.36±1.8058.09±0.9658.16±1.40
+ +# A.9 $\delta$ -HYPERBOLICITY + +# A.9.1 ESTIMATION PROCEDURE + +Computing $\delta_{\mathrm{worst}}$ naively is an $\mathcal{O}(n^4)$ operation for a set of $n$ points, therefore we use the efficient approach introduced in Khrulkov et al. (2020) and Cohen et al. (2015). Specifically, we incorporate a sampling procedure to estimate hyperbolicity in a computationally tractable manner. The steps are as follows: + +1. Sample $N_{s}$ points from the dataset (we set $N_{s} = 1000$ ). +2. Compute the matrix $A$ of pairwise Gromov products using equation 10, and a fixed point $z = z_0$ (detailed in Cohen et al. (2015)). +3. Determine the matrix $C = (A \otimes A) - A$ , where $\otimes$ represents the min-max matrix product: $(A \otimes B)_{ij} = \max \min_k \{A_{ik}, B_{kj}\}$ . +4. For $\delta_{\mathrm{worst}}$ , we take the maximum value from $C$ , and for $\delta_{\mathrm{avg}}$ , we compute the expected value over the unique elements of $C$ pertaining to valid tuples. We apply the scale-invariant + +transformation mentioned in the main text to the $\delta$ values to determine the final values reported. However, for the $\delta_{\mathrm{avg}}$ values, we instead transform the raw values using the scale-invariant ratio introduced in Borassi et al. (2015): $\frac{2\delta_{\mathrm{avg}}}{D_{\mathrm{avg}}}$ , where $D_{\mathrm{avg}}$ is the average distance between two randomly selected points. + +Results are averaged across multiple runs, and we provide the resulting mean and standard deviation. For the genomic datasets, we use the test set of sequence embeddings generated from the final embedding layer of the trained Euclidean CNN models (Table 9). + +# A.9.2 METRIC SPACE CALIBRATIONS + +In order to calibrate our $\delta$ -hyperbolicity measurements, we scrutinize the behavior of $\delta$ approximations at various fixed curvatures $(K)$ and dimensionalities $(d)$ . We use the MANIFY package, introduced in Chlenski et al. (2025), to randomly sample data points from a Gaussian distribution across different manifolds, using the wrapped normal distribution in the hyperbolic $(K = -1, -2)$ (Nagano et al., 2019) and the hyperspherical $(K = 1, 2)$ (Skopek et al., 2020) cases. We then compute $\delta$ estimates according to the procedure in A.9.1. We use the geodesic distance of each manifold to determine the distance matrix between points. + +The results of the simulations are visualized in Figure 12. The decreasing trend in both $\delta_{\mathrm{worst}}$ and $\delta_{\mathrm{avg}}$ estimates across curvatures suggests that a higher dimensionality of data points may lead to increased hyperbolicity in datasets. For discrete metric spaces, we confirm that for trees, $\delta_{\mathrm{worst}} = \delta_{\mathrm{avg}} = 0$ by using the NETWORKX package (Hagberg et al., 2008) to generate random tree graphs and compute the distance matrix based on shortest paths within each graph. + +# A.9.3 DNA LANGUAGE MODELS + +We explore the hyperbolicity of sequences embedded by large DNA LMs. Our analysis encompasses a diverse range of pretrained models, selected to represent various architectural approaches and scales. The models under examination are HyenaDNA, DNABERT-2, and NT-500M human. + +As a case study, we probe a subset of sequences that likely reflect strongly conserved evolutionary relationships. We therefore generate LM embeddings for a randomly sampled set of SINE sequences from TEB. The embeddings are derived by applying mean pooling over the final layer embedding output of each model. To establish a comparative baseline, we juxtapose the underlying $\delta$ distribution of each LM with a distribution generated from randomly sampled points from a Gaussian of equivalent dimensionality, following the procedure outlined in Section 5.2. + +The results of our analysis are presented in Figure 13. Notably, the embeddings produced by HyenaDNA and DNABERT-2 exhibit significantly higher hyperbolicity compared to the baseline embeddings $(p < 0.01$ , Wilcoxon rank-sum test). In contrast, the representations generated by the NT-500M human display substantially lower hyperbolicity than the baseline. This disparity may stem from the higher dimensionality of the NT-500M human embeddings, suggesting that hyperbolicity may become less critical at sufficiently large embedding scales. + +# A.10 HYPERBOLIC SEQUENCE REPRESENTATIONS + +In exploring the sequence representations learned by HCNNs, we build on the intuition introduced by Khrulkov et al. (2020), where hyperbolic image embeddings of MNIST show that ambiguous digits tend to cluster near the center of the Poincaré disk, while clearer, more confidently classified digits lie closer to the boundary. Similarly, in Figure 14, we observe that in the processed pseudogene dataset from TEB, sequence embeddings located near the center of the Poincaré disk (representing the top of the hierarchy) correspond to low-confidence predictions by HCNNs, approximated using model loss. In contrast, embeddings near the boundary exhibit the highest classification confidence. This pattern supports the notion that well-defined sequences occupy lower regions in the hierarchy, where the increased representational capacity of hyperbolic space allows for finer-grained separation based on distinctive sequence features. + +To systematically investigate the underlying sequence features informing these hyperbolic genome embeddings, we performed an in silico mutagenesis experiment using the processed pseudogene + +![](images/967b308b027da985eeabfd9f498152ad2b4e8c26485043c4caace7211b206f1c.jpg) +Figure 10: Distribution of scaled $\delta$ -hyperbolicity values across each genomic dataset. Colors delineate different task categories, while the bottom two rows provide reference distributions for $\delta$ values computed from a set of points sampled from the normal distribution on a Euclidean $(K = 0$ , red) and a hyperbolic $(K = -1$ , blue) manifold. Dashed lines indicate the $\delta_{\mathrm{avg}}$ values for the hyperbolic reference (blue) and the Euclidean reference (red). An asterisk (*) denotes that the corresponding distribution constitutes smaller $\delta$ values (i.e., is more hyperbolic) than the Euclidean reference based on the Wilcoxon rank-sum test $(p < 0.01)$ . + +Table 9: $\delta$ -Hyperbolicity values of the final embeddings for CNNs trained on each genomic dataset. Results are averaged over 10 sampling runs (mean $\pm$ standard deviation). + +
BenchmarkTaskDatasetδworstδavg
TEBRetrotransposonsLTR Copia0.36±0.01750.145±0.0019
LINEs0.40±0.01100.164±0.0004
SINEs0.08±0.00760.170±0.0016
DNA transposonsCMC-EnSpm0.18±0.01810.163±0.0009
hAT-Ac0.37±0.02200.215±0.0026
Pseudogenesprocessed0.36±0.02040.189±0.0007
unprocessed0.35±0.01400.157±0.0003
GUEEpigenetic Marks PredictionH30.10±0.00720.098±0.0005
H3K14ac0.09±0.00900.101±0.0030
H3K36me30.26±0.05410.251±0.0014
H3K4me10.21±0.01850.225±0.0056
H3K4me20.13±0.01120.125±0.0039
H3K4me30.14±0.01680.169±0.0020
H3K79me30.15±0.02550.122±0.0067
H3K9ac0.21±0.01600.265±0.0058
H4ac0.18±0.01560.186±0.0024
H40.10±0.00580.082±0.0041
Human Transcription Factor Prediction00.20±0.01140.160±0.0026
10.20±0.02450.152±0.0044
20.19±0.01890.148±0.0021
30.19±0.01890.141±0.0004
40.18±0.00980.140±0.0009
Splice Site Predictionsplice0.29±0.03630.256±0.0012
Mouse Transcription Factor Prediction00.21±0.01470.140±0.0043
10.35±0.03010.249±0.0032
20.21±0.02260.139±0.0011
30.19±0.02370.131±0.0009
40.19±0.01120.148±0.0022
Covid Variant Classificationcovid0.50±0.03880.417±0.0030
Core Promoter Detectionall0.29±0.01050.229±0.0034
notata0.28±0.01840.212±0.0010
tata0.22±0.00820.138±0.0013
Promoter Detectionall0.29±0.01460.260±0.0024
notata0.31±0.02100.257±0.0043
tata0.16±0.01270.138±0.0069
GBDemocoding vs intergenomic seqs0.21±0.01800.118±0.0019
human or worm0.19±0.01890.121±0.0010
Enhancersdrosophila enhancers stark0.30±0.01740.209±0.0012
human enhancers cohn0.19±0.01370.092±0.0002
human enhancers ensemble0.19±0.01980.109±0.0001
Regulatoryhuman ensembl regulatory0.23±0.02820.148±0.0013
human non-tata promoters0.19±0.00530.103±0.0002
Open Chromatin RegionshumanOCR ensemble0.24±0.04000.189±0.0011
+ +![](images/94046013b45ce05e4c3ae4dc6d218f0fe61159c4aa374c290f0abab104b15fa5.jpg) +Figure 11: Correlation between $\delta_{\mathrm{worst}}$ and the performance differential between HCCN-S and CNN models. $r_{\mathrm{outliers}}$ includes outliers in the Pearson correlation coefficient calculation, while $r$ excludes them ( $p < 0.05$ , except for HCNN-M $r$ ). + +![](images/b698e8c70376309b88c3990173b1793d6afdff2d8dae3dd4a073c4aec4328d82.jpg) + +dataset. Our methodology involves a structured approach to dissecting sequence representations. For a given sequence, we: + +1. Retrieve the Genomic Evolutionary Rate Profiling (GERP) Cooper et al. (2005) score for each nucleotide along the sequence. GERP scores quantify evolutionary constraints at specific genomic positions, identifying which positions are functionally important based on selective pressure. GERP uses multiple sequence alignments across species to identify conserved regions. +2. Strategically mutate a subset of nucleotides under the highest selective pressure, generating multiple perturbed sequence variants. +3. Generate embeddings for each perturbed sequence using the trained HCNN. + +Figure 15 visualizes this experiment using both a processed pseudogene sequence and a background sequence. As mutations progressively erode the evolutionary signal associated with strong selection (corresponding to the nucleotides with the highest GERP scores), the features rendering the pseudogene "gene-like" may deteriorate. This degradation increases sequence ambiguity from the HCNN's perspective, manifesting as a shift of the perturbed representations toward the top of the hierarchy—near the center of the Poincaré disk—where low-confidence sequences typically reside. The loss of these evolutionary features actively hinders the model's ability to recognize pseudogenes. + +Critically, this effect is sequence-specific: perturbing conserved regions within noisy background sequences fails to produce an equivalent shift, suggesting the model prioritizes features consistently associated with the pseudogene class. + +To validate the generalizability of this phenomenon, we conducted a comprehensive analysis on a randomly sampled set of 10,000 sequences from the processed pseudogene dataset, ensuring balanced class representation. For each sequence, we applied our mutagenesis protocol (steps 1-3), generating 10 perturbed sequence variants and corresponding HCNN representations. + +We quantify this effect by measuring the embedding shifts of these perturbed sequences relative to their original embeddings, specifically tracking their movement toward the representation space's origin. This directional analysis provides insight into the HCNN's representational sensitivity: a trajectory toward the origin likely indicates increased representational ambiguity for the perturbed sequence. The distance between each sequence (perturbed and original) and the origin in the embedding space is computed using Poincaré geodesics. + +![](images/4ceeb2e331a375e1b1a858efdcbdf7eeb6e7396894cd43aeca3369fcbf841fe6.jpg) + +![](images/8d580a0e382e2ae1688740d9caab8bea525c65f11675e899b8111d1e89a39596.jpg) +Figure 12: Estimates for $\delta_{\mathrm{worst}}$ (top) and $\delta_{\mathrm{avg}}$ (bottom) using simulated data points from a wrapped normal distribution on manifolds with varying curvatures $(K)$ and dimensionalities. + +When comparing representational shifts between perturbed processed pseudogene and background sequences, we observe significantly greater movement toward the Poincaré disk's origin for perturbed pseudogene sequences. This difference, statistically validated by the Wilcoxon rank-sum test $(p < 0.05)$ , demonstrates the robustness of our findings. We tested a range of mutation rates, altering $10 - 30\%$ of nucleotides per sequence, and found that the effect remained consistent and statistically significant across all rates. + +![](images/5912abed2ba9a98b6054dd22140a34b95fcd37d8ebcf58cf2a6a9f4ce369b1c4.jpg) +Figure 13: Distribution of scaled $\delta$ -hyperbolicity values using embeddings from various DNA LMs. The distribution of each model is overlaid with the $\delta$ distribution of randomly sampled points from a Gaussian of equal dimensionality (red). An asterisk (*) denotes that the corresponding distribution has significantly smaller smaller $\delta$ values (i.e., is more hyperbolic) than the Euclidean reference, based on the Wilcoxon rank-sum test ( $p < 0.01$ ). + +Table 10: Mean model performance (MCC) aggregated by genomics task (mean ± standard error). + +
BenchmarkTaskModel
Euclidean CNNHyperbolic HCNN-SHyperbolic HCNN-M
TEBRetrotransposon Prediction70.48±8.0274.80±13.4875.98±12.48
DNA transposon Prediction79.91±10.8585.30±13.8285.77±20.37
Pseudogene Prediction56.30±7.4062.22±10.2660.31±11.66
GUEEpigenetic Marks Prediction40.76±4.0755.31±2.6448.18±2.81
Human Transcription Factor Prediction52.52±3.6361.12±3.1261.25±2.86
Splice Site Prediction78.64±0.1980.32±0.5580.76±0.47
Mouse Transcription Factor Prediction45.79±4.7261.93±5.5261.52±5.08
Core Promoter Detection70.13±2.0670.12±3.4870.99±2.39
Promoter Detection85.80±1.7585.73±1.3785.66±1.82
Covid Variant Classification66.43±0.2136.71±4.3314.81±0.21
GBDemo82.52±2.7986.34±2.8386.48±2.83
Enhancers39.41±9.0034.18±7.4628.77±2.83
Regulatory77.36±4.7386.74±1.3585.05±2.34
Open Chromatin Regions39.92±0.3856.22±0.1355.36±1.23
+ +![](images/d1b7cc538b09a234e9c17136000f29d87517c5905fd021cf3a9a15b097f2f8b9.jpg) +Figure 14: HCNN embeddings for the processed pseudogene dataset, colored by model confidence on the left and by the probability that a sequence is a processed pseudogene (vs. a background sequence) on the right. Sequence embeddings are visualized on the Poincaré disk. + +![](images/7e01983d53acbb8d7d6831b7ba56ec50d5865be56113026166c496c087a5a49a.jpg) + +![](images/6a753761f64e7f5967c9ac7211bc9c0f741b0b07e6157c17bbf653475dab45a3.jpg) + +Figure 15: HCNN embeddings for a processed pseudogene sequence and a background sequence. Each sequence has been perturbed multiple times, with different instances shown on the Poincaré disk. +![](images/18a8701ddaf2f3f0459bae67a3f719ead11a33d0ee20694a745ecf95d9a74294.jpg) +Sequence Type +Original pseudogene sequence +$\odot$ Perturbed pseudogene sequence +- Original background sequence +$\bigcirc$ Perturbed background sequence + +![](images/e5fd1c88f7e0388ec47d6e873f6bb39df026fc5c6c334f9419f512c1c096e8fa.jpg) +Figure 16: UMAP visualizations of the embeddings generated by the HCNN (left) and CNN (right) trained on the processed pseudogene dataset in TEB. + +![](images/aadd6acfff85ce6b5172c9fc9bf9dffd77dd5932650c5911fab5ffaf88700304.jpg) \ No newline at end of file diff --git a/ICLR/2025/Hyperbolic Genome Embeddings/images.zip b/ICLR/2025/Hyperbolic Genome Embeddings/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d12d4afb8ec11e92fb86d6de0ab21afdb4f9d527 --- /dev/null +++ b/ICLR/2025/Hyperbolic Genome Embeddings/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3680719a2538c646b5f33c363c591d0c77d944085dfebac24a2d455800be75d6 +size 1772809 diff --git a/ICLR/2025/Hyperbolic Genome Embeddings/layout.json b/ICLR/2025/Hyperbolic Genome Embeddings/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..798057a366a7517372fe8ca910c470bfe7378dc6 --- /dev/null +++ b/ICLR/2025/Hyperbolic Genome Embeddings/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67a5e21f3838f2b7a628ea23b1a94653fae63dc9e24ce0507c89794bd275598f +size 795316 diff --git a/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_content_list.json b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..412efe20d81326b9b214656a5bb43bc974d13125 --- /dev/null +++ b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9555a94e767c4f8d6fa595ac622d88b14b6cbca5059151662f6b0bed3d60f44b +size 217578 diff --git a/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_model.json b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4674ab1532ef07e2408b64fc3fd5c6ba36f09284 --- /dev/null +++ b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b91821e4407d1170def9379aad6a89b35b75691306ec1aa3167dc31ed393faaf +size 259462 diff --git a/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_origin.pdf b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e49f4f9ce42f71141568f0e906bf95487a789817 --- /dev/null +++ b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/518eb052-210a-4c7f-90bf-f2e076fe4212_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:085b5adf4688ded62f6c405fa834cc62998a078f652b074bac8da40442f5ace5 +size 7042944 diff --git a/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/full.md b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e2cffdae428d85e2dacfd99ba69b99a663025def --- /dev/null +++ b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/full.md @@ -0,0 +1,910 @@ +# HYPOTHETICAL MINDS: SCAFFOLDING THEORY OF MIND FOR MULTI-AGENT TASKS WITH LARGE LANGUAGE MODELS + +Logan Cross* Violet Xiang² Agam Bhatia¹ Daniel L.K. Yamins¹,² Nick Haber³ + +Stanford University +$^{1}$ Department of Computer Science +$^{2}$ Department of Psychology +3Graduate School of Education + +# ABSTRACT + +Multi-agent reinforcement learning methods struggle with the nonstationarity of multi-agent systems and fail to learn online when tested with novel agents. Here, we leverage large language models (LLMs) to create an autonomous agent that can handle these challenges. Our agent, Hypothetical Minds, consists of a cognitively-inspired architecture, featuring modular components for perception, memory, and hierarchical planning over two levels of abstraction. We introduce the Theory of Mind module that scaffolds the high-level planning process by generating hypotheses about other agents' strategies in natural language. It then evaluates and iteratively refines these hypotheses by reinforcing hypotheses that make correct predictions about the other agents' behavior. Hypothetical Minds significantly improves performance over previous LLM-agent and RL baselines on a range of competitive, mixed motive, and collaborative domains in the Melting Pot benchmark, including both dyadic and population-based environments. Additionally, comparisons against LLM-agent baselines and ablations reveal the importance of hypothesis evaluation and refinement for succeeding on complex scenarios. + +# 1 INTRODUCTION + +A fundamental challenge in artificial intelligence is creating agents that can rapidly adapt to others in multi-agent environments. Whether in competitive settings like games, collaborative tasks like team projects, or mixed-motive scenarios like negotiation, success requires building predictive models of another agent's behavior by inferring their hidden strategies and latent capabilities. One approach involves training reinforcement learning models that can learn adaptive policies. However, multi-agent reinforcement learning (MARL) methods suffer from various drawbacks, including high sample complexity, poor generalization to agents not seen in training, and limited reasoning capabilities (Wong et al., 2023). + +Another approach deploys foundation models as the backbone to agents, with specialized modules that mediate the decomposition of long horizon planning (Wang et al., 2024; 2023a; Brohan et al., 2023a; Park et al., 2023). LLMs are not only powerful reasoners and in-context learners, but they are also particularly suited for social tasks given the utility of language for scaffolding Theory of Mind (ToM) (Astington & Baird, 2005; de Villiers, 2007; 2021; Kosinski, 2023; Gandhi et al., 2024). Thus, we introduce Hypothetical Minds (HM), a LLM agent that produces adaptive policies in competitive, cooperative, and mixed-motive multi-agent scenarios. At its core, HM addresses the challenge of interacting with agents whose behavior is driven by latent features - first inferring these features through a natural language approximation of Bayesian inference, then conditioning its policy on these inferences. + +![](images/544230acdefa8cd0b0deef93c53a57a4c102036245dcaa33dba031931f1f73cd.jpg) + +![](images/89610d6cdb138190d3a5617a58d30ed4676bbde1c6beeb2059388995d9e4f13f.jpg) +Figure 1: A. Hypothetical Minds architecture and model workflow. B. ToM module generates hypotheses about agent strategies. Previously generated hypotheses and values are shown for refinement. Top k hypotheses predict agent's next behavior $\phi(\tau)$ , considering counterfactual scenarios. Highest-valued hypothesis informs high-level planning. Later, hypotheses are evaluated against observed behavior $\phi(\tau)$ , updating values with intrinsic reward. Hypotheses are validated at a threshold. + +HM builds on the generative agents architecture, integrating modules for perception, memory, and hierarchical planning with novel ToM machinery (Park et al., 2023). The Theory of Mind module generates and evaluates hypotheses about other agents' strategies, scoring them based on their ability to predict future actions. Thus, our agent finds useful explanations of other agents' behaviors in-context, affording it the ability to adapt to the inferred strategies and achieve high rewards. + +We evaluate our model on the Melting Pot MARL benchmark that encompasses diverse challenges and social dynamics (Agapiou et al., 2022). Collaborative Cooking Asymmetric requires effective coordination and division of labor among agents. Running With Scissors necessitates strategic reasoning about opponents' policies and the ability to exploit predictable patterns in a competitive setting, with the eight-player version offering a unique challenge to the model's scalability. Moreover, the mixed-motive environment Prisoner's Dilemma involves a tension between individual and collective interests. Diverse evaluation scenarios stress test playing with a wide array of agents with fixed or adaptive policies, necessitating contextual adaption. Hypothetical Minds surpasses LLM agent baselines on a majority of evaluation scenarios in every environment, and performs better than MARL baselines on 3/4 environments despite the fact that those methods are trained on upwards of a billion steps. To our knowledge, Hypothetical Minds is the first LLM agent for diverse multi- + +agent environments, with strong performance across collaborative, competitive, and mixed-motive domains, unlike previous works limited to collaborative settings. Our contributions are as follows: + +- We propose the Hypothetical Minds model (HM), an embodied LLM agent for multi-agent environments that integrates modular components for perception, memory, and hierarchical planning conditioned on ToM inferences. +- HM incorporates a novel Theory of Mind (ToM) module, which generates, evaluates, and refines hypotheses about other agents' strategies or goals in natural language. Through ablations and comparisons against LLM-agent baselines, we identify the critical role of hypothesis evaluation and refinement within the ToM Module. +- We demonstrate the effectiveness of HM Minds across multiple multi-agent environments, including competitive, collaborative, and mixed-motive domains, and 30 distinct evaluation scenarios. Our agent significantly outperforms LLM-agent and RL baselines in every environment and in a large majority of evaluation scenarios, showcasing its generalizability. + +# 2 RELATED WORK + +# 2.1 LLM-BASED AGENTS + +A burgeoning area of research involves building autonomous agents rooted in large language models Wang et al. (2024); Sumers et al. (2023). This involves deploying LLMs as central controllers across many different domains by leveraging their extensive background knowledge from training. Applications span a wide range from equipping LLMs with external tools to interface with databases and APIs (Schick et al., 2024; Shen et al., 2023; Qin et al., 2023) to using them for high-level planning and control in robotics (Huang et al., 2022; Brohan et al., 2023b; Rana et al., 2023; Brohan et al., 2023a). The most relevant branch of this research direction includes works where LLMs are used as planners in embodied virtual environments. Voyager autonomously builds complex skills in Minecraft by storing and retrieving behaviors in a skill library of executable code and uses the skill library to solve progressively harder tasks (Wang et al., 2023a; 2024). In this work, we use an LLM for long horizon high-level planning and predicting the future states of other agents in multi-agent environments. Previous papers have also incorporated LLM-based agents into embodied multi-agent environments (Liu et al., 2023a). Park et al. (2023) introduce a interactive simulation of a rich social environment, where each agent autonomously selects goals and builds relationships with others. We extend the cognitive module framework developed in this work for multi-agent environments of varied dynamics by introducing the novel Theory of Mind module. SAMA uses an LLM to plan out sequences of subgoals for language-based goal-conditioned RL policies in environments requiring multi-agent coordination Li et al. (2023). Another study builds cooperative embodied agents, by using an LLM for planning and communication between agents Zhang et al. (2023b). ProAgent develops a method for improving zero-shot coordination in Overcooked by using an LLM to infer the intentions of teammates based on the present state Zhang et al. (2023a). As these works have focused solely on collaborative domains, here we present a generalizable and scalable method that addresses the challenge of inferring other agents intentions' across a wide spectrum of social dynamics. + +# 2.2 REASONING AND HYPOTHESIS SEARCH WITH LLMS + +LLMs have shown impressive reasoning abilities, augmented by Chain-of-Thought methods that scaffold the thought process (Wei et al., 2022; Zhang et al., 2023c). Our hypothesis generation approach builds on this work by implementing structured reasoning steps for theory of mind inference and decision-making. Tree-of-Thoughts (Yao et al., 2024) extends chain-of-thought by maintaining and evaluating multiple reasoning paths in parallel, similar to our parallel evaluation of multiple hypotheses about opponent strategies. ToT evaluates different solution paths of a reasoning trajectory with an external verifier or LLM as judge, whereas we score hypotheses about an agent based on the quality of predictions they make about that agent's behavior. The structured prompting in our ToM module draws on broader findings about effective prompt engineering for complex reasoning (Zhang et al., 2023c). For example, our separation between reasoning and action in our prompts draws inspiration from the ReAct framework (Yao et al., 2023). + +Recent work has specifically investigated LLMs' capabilities for hypothesis generation and testing. Wang et al. (2023b) explores LLMs' inductive reasoning by generating and evaluating hypotheses on the Abstraction and Reasoning Corpus (ARC), while Qiu et al. (2023) refines LLM-generated + +hypotheses using task-specific symbolic interpreters. Similarly, we generate, evaluate, and refine hypotheses based on feedback, though in our case computing values for each hypothesis by predicting another agent's goals. STaR (Zelikman et al., 2022) also learns from feedback by finetuning language models on rationales that produced correct answers. + +# 2.3 MULTI-AGENT DECISION-MAKING AND THEORY OF MIND + +Decision-making in multi-agent settings has been extensively studied through multi-agent reinforcement learning (MARL), with benchmarks like Melting Pot providing diverse social interaction scenarios to evaluate agents (Agapiou et al., 2022). While algorithms like MADDPG (Lowe et al., 2017) and MAPPO (Yu et al., 2022a) have advanced MARL through centralized training approaches, specialized models incorporating Theory of Mind principles (Rabinowitz et al., 2018; Wang et al., 2021; Yu et al., 2022b; Huh & Mohapatra, 2024; Vezhnevets et al., 2020; Sclar et al., 2022) have shown promise in modeling other agents' intentions. However, even sophisticated approaches like OPRE (Vezhnevets et al., 2020) struggle to generalize in complex environments like Melting Pot's Running With Scissors (Agapiou et al., 2022), highlighting MARL's limitations in compute requirements and training stability. In cognitive science, the Rational Speech Act framework (Goodman & Frank, 2016) and Bayesian inverse planning (Baker et al., 2009) model how humans infer others' goals and beliefs through Bayesian inference, providing inspiration for our ToM module. + +# 3 METHOD + +# 3.1 PARTIALLY-OBSERVABLE MARKOV GAMES + +Our method is directly applicable to any multi-agent environment where states are partially observable and agent(s) policies are hidden. We formally define this as a Markov game for $N$ players in a partially observable setting. Let the finite set $S$ represent the possible states of the game. Each player $i$ receives observations given an observation function $\chi^i: S \to \mathcal{O}$ , representing their limited point of view. Additionally, each player $i$ can take actions from their action space $A^i$ , and when all players choose actions $(a^1, \ldots, a^N) \in A^1 \times \dots \times A^N \coloneqq A$ , the state transitions according to a probability distribution $T: S \times A \to \mathcal{D}(S)$ . The reward function for each player $i$ is represented as $r^i: S \times A \to \mathbb{R}$ , mapping the current state and joint actions to a real-valued reward. + +# 3.2 HYPOTHETICAL MINDS MODEL + +HM consists of several cognitive modules that altogether form an embodied LLM agent (Figure 1). The egocentric observations are represented by a textual map/state representation, which is added to a memory system after every step. The memory system also logs rewards and other important state information like the inventories from previous interactions in Running With Scissors. Two cognitive modules depend on an LLM, a Theory of Mind module and a Subgoal module, which output high-level goals and action plans respectively. An action planner takes an action plan (i.e. "move to coordinate (13, 5)") and creates a sequence of actions that achieves that action plan with a pathfinding algorithm. Each cognitive module is explained in more detail in the Appendix. Below we describe the key novel contributions of our method that implement hierarchical planning. + +Theory of Mind Module In multi-agent environments, other agents' behavior can be influenced by various latent variables, such as their strategies (e.g., "always defect"), goals (e.g., "trying to pick up an object"), competence levels (e.g., "highly skilled" vs. "negligent") and locations in an environment. These latent variables are often not directly observable and must be inferred from partially-observable information from your perspective as the ego agent. We represent these latent variables as a multidimensional space $\Theta = \theta_{1},\theta_{2},\ldots ,\theta_{m}$ , where each dimension $\theta_{i}$ corresponds to a specific latent variable in an embedding. The ToM module generates hypotheses about these latent variables in natural language. It then maintains a set of hypotheses $\mathcal{H} = h_1,h_2,\dots ,h_n$ in its working memory, where each hypothesis $h_t$ represents a belief about the latent variables $h_i = p(\Theta)$ . A hypothesis at time $t$ is generated by asking an LLM to infer another agent's strategy, conditioned on HM's memory $\mathcal{M}$ of important past observations $\mathcal{O}$ . Additionally, the LLM is shown the top k valued previously generated hypotheses, such that it can perform hypothesis refinement (see Appendix and code for more details and prompts): + +$$ +h _ {t} = \operatorname {L L M} (\mathcal {M}, h _ {< } t) \tag {1} +$$ + +where $\mathcal{M}$ is a memory buffer storing an agent's past actions, observations, and rewards. + +Each hypothesis $h_i$ is scored based on how well it predicts the other agent's future behavior, noted here formally as a distribution of trajectories $p(\tau)$ . We formalize this scoring mechanism using a likelihood function $p(\tau | h_i)$ representing the probability of an agent exhibiting trajectory $\tau$ given the hypothesis $h_i$ . The best hypothesis $h^*$ is selected using the Maximum a Posteriori (MAP) estimate: + +$$ +h ^ {*} = \underset {h _ {i} \in \mathcal {H}} {\arg \max } p \left(h _ {i} \mid \tau\right) = \underset {h _ {i} \in \mathcal {H}} {\arg \max } \frac {p (\tau \mid h _ {i}) p \left(h _ {i}\right)}{p (\tau)} \tag {2} +$$ + +where $p(h_{i})$ is the prior probability of hypothesis $h_{i}$ and $p(\tau)$ is the marginal probability of the observed action $a$ and has no effect on the argmax. The likelihood is approximated by a hypothesis evaluation mechanism described below. The LLM predicts the other agent's future behavior conditioned on each hypothesis separately. Hypotheses leading to correct predictions will have higher values reflecting higher likelihoods. The prior $p(h_{i})$ corresponds both to the background knowledge embedded in the weights of an LLM from pretraining and to the refinement mechanism that shows the top valued hypotheses to the LLM when the LLM generates a hypothesis. By continuously updating and selecting the best hypothesis based on observed information, the ToM module can effectively infer the latent variables governing the other agents' behavior and adapt its own strategies accordingly. When the environment has more than one other agent, the ToM module maintains separate hypothesis streams for each other agent, with unique hypotheses and values tracked per agent. + +Hypothesis Evaluation Drawing on cognitive modeling approaches (Rescorla, 1972; Daw & Tobler, 2014), multiple hypotheses are scored with a value system $V_{h_i} = \mathbb{E}[r]$ where $r$ reflects intrinsic reward based on the accuracy of the predictions the hypothesis generates. We compute self-supervised intrinsic rewards bootstrapped from the LLM's own predictions. Let $\phi(\tau)$ be a particular behavior, a feature from an observed trajectory, and $\hat{\phi(\tau)}$ be the predicted behavior by the LLM, such as the inventory played by an agent in Melting Pot environments. The intrinsic reward function $r_i$ can then be defined as: + +$$ +r _ {i} = \left\{ \begin{array}{l l} c & \text {i f} \phi (\tau) = \phi (\tau) \\ - c & \text {i f} \phi (\tau) \neq \phi (\tau) \end{array} \right. +$$ + +where $c$ is a hyperparameter. $V_{h_i}$ is then dynamically updated with a Rescorla Wagner update rule (Rescorla, 1972), expressed as: + +$$ +\delta = r _ {i} - V _ {h _ {i}} +$$ + +$$ +V _ {h _ {i}} \leftarrow V _ {h _ {i}} + \alpha \cdot \delta +$$ + +modulated by learning rate $\alpha$ via a prediction error $\delta$ . The learning rate dictates how much to weigh recent interactions, a useful property when playing against evaluation scenarios where agents change their strategy within an episode. When the value of a hypothesis meets a threshold $V_{\mathrm{thr}}$ , the ToM module marks the hypothesis as validated and uses this hypothesis to condition high-level plans (using the highest-valued one if multiple pass the threshold). This hypothesis will then continue to be used for planning until it no longer makes good predictions and its value subsequently falls below the threshold. If no hypothesis meets the threshold, by default the latest generated hypothesis (with the most updated information) is used for conditioning high-level plans. The highest value hypothesis could also be used in our code. We set the validation threshold $V_{\mathrm{thr}} = 0.7$ apriori based on analysis of the Rescorla-Wagner dynamics. With reward values of $c = 1$ and learning rate $= 0.3$ , a hypothesis requires consistent predictive accuracy to reach and maintain this threshold. The top_k hyperparameter mediates cost trade-offs, representing how many of the top_k old hypotheses are continually evaluated in parallel. Each ToM module call uses $(3 + \mathrm{top\_k})$ LLM calls if no hypothesis is validated yet and only 2 calls after validation, thus scaling linearly at the step in computational cost when hypotheses are not validated and sublinearly when they are frequently validated. (See Table 4 in Appendix for all hyperparameters and Table 5 and Appendix Section B for information about computational costs). The default value as reported in the results use top_k = 5. + +Conditioning High-Level Plans The ToM module then conditions its high-level plans on the inferred latent variables represented by the hypotheses. A high-level plan $z$ is a natural language + +![](images/72d92391158c4484b5555e5c92e4871e00876c805e54f04b5613ee9cb590e113.jpg) + +![](images/8b0c6c20e0b3765e35d369dbe71036c9619ed239ed3c74989df2a192503035f5.jpg) + +![](images/209628ab6f975b3ddb2eb0abe58598dfb3af322c47b3244731e9c77c75e29d2c.jpg) + +![](images/244c486407e549ca42ee08b64a9d91239c05397999921b34473be02c13e34d4b.jpg) + +![](images/da14ea506e146bcd2d249836094522c07cb80cf35e73609e131429f31d49babb.jpg) +Figure 2: Results for all models. Average reward per episode (with normalized steps for variable length episodes) for each environment and scenario. 5 seeds are generating for each model, with errorbars reflecting the SEM across those 5 episodes. + +description of HM's overall strategy, goal, or intention, conditioned on the best hypothesis $h^*$ and memory of past events: + +$$ +z = \operatorname {L L M} \left(\mathcal {M}, h ^ {*}\right) \tag {3} +$$ + +By conditioning the high-level plans on the hypotheses, HM can adapt its strategy based on its understanding of the other agents' latent states. + +Subgoal Module Finally, the Subgoal module selects a sequence of subgoals. Let $\mathbf{g} = g_1, g_2, \ldots, g_k$ be a sequence of subgoals, where each subgoal $g_i$ is an action or short sequence of actions that the agent needs to take to achieve the high-level plan $z$ : + +$$ +\mathbf {g} = \operatorname {L L M} (\mathcal {O}, \mathcal {M}, z) \tag {4} +$$ + +The sequence is generated by conditioning the LLM on the high-level plan, observations, and memory, and prompt to achieve the high-level plans. The LLM outputs a sequence of specified subgoal function calls, which are then parsed and mapped to the corresponding actions in the environment by a hardcoded Action Planner (see Appendix). + +# 4 EXPERIMENTS + +Here we investigate the following to analyze the generalizability and scalability of our method: + +Q1. How does Hypothetical Minds perform compared to LLM agent and RL baselines in embodied competitive zero-sum environments? +Q2. How does Hypothetical Minds perform compared to LLM agent and RL baselines in a collaborative domain that requires adaptation to a partner's role and competence? +Q3. How does Hypothetical Minds perform compared to LLM agent and RL baselines in a mixed-motive setting? +Q4. Does the Hypothetical Minds agent scale effectively to environments with larger populations of agents? +Q5. How do the different components of the Hypothetical Minds agent and the Theory of Mind module contribute to its overall performance? + +We directly test our LLM-based agent on the evaluation scenarios in four Melting Pot environments (Figure 2). The key evaluation method is to test agents against different bots with various policies. + +![](images/76c2881a1f7383788824691965b78e84a6abf34706382953cf0a8547aa042af3.jpg) +Figure 3: HM's reward per number of interactions before or after a hypothesis meets the validation threshold and is used for high-level strategy selection in RWS. Vertical green line indicates the average reward at the point where a hypothesis is validated, and positive and negative numbers on the x-axis indicate how many interactions before or after this point. Shaded region represents the range where the good hypothesis is typically first generated with a $95\%$ confidence interval. + +Across environments, this consists of 30 distinct evaluation scenarios. Crucially, our agent has no knowledge about which strategies they may be playing in the prompts given. Strategies have to be ascertained online within an episode via in-context learning. + +# Baselines + +ReAct synergizes reasoning and acting in language models, allowing them to generate both reasoning traces and task-specific actions in an interleaved manner (Yao et al., 2023). Reflexion includes three main components: an Actor module that generates actions and text, anEvaluator that scores these actions, and a Self-Reflection module that uses the evaluations to provide constructive feedback stored for subsequent use (Shinn et al., 2024). PlanReAct To provide a hierarchical baseline to test against our hierarchical model, we include the PlanReAct architecture introduced in (Liu et al., 2023b). This structure allows the agent to plan before interacting with the environment. PPO is a model-free RL baseline (Schulman et al., 2017) and we train agents in a population of models with the same parameters. OPRE is a hierarchical MARL method where agents learn high-level options as strategic responses to other agents' behaviors (Vezhnevets et al., 2020). The high-level controller selects options based on observations of other agents, and the low-level controller executes actions conditioned on these options. We include the OPRE results from the Melting Pot 2.0 paper (Agapiou et al., 2022) as a baseline to compare against a hierarchical MARL approach that, like our model, aims to adapt dynamically to other agents' strategies. + +Prompts and architectures are shared across baselines to provide a fair comparison and natural ablations of our model. The Subgoal module provides a baseline actor shared between LLM baselines, and the only difference between PlanReAct and Hypothetical Minds is that high-level planning is mediated by the Theory of Mind module, including hypothesis generation, evaluation, and refinement. + +# 4.1 HOW DOES HYPOTHETICAL MINDS PERFORM IN COMPETITIVE ENVIRONMENTS? + +Running With Scissors in the Matrix Repeated (RWS) is a zero-sum competitive environment with two players moving around a map and collecting yellow, purple, or blue resources that correspond to rock, paper, and scissors respectively. Zapping your opponent causes an interaction, with one agent getting positive reward and the other agent getting an opposite negative reward according to the inventories of resources picked up by each player, mirroring the rock, paper, scissors matrix game. + +RWS presents nine distinct evaluation scenarios, which range in complexity. These include three straightforward strategies where opponents consistently play rock, paper, or scissors. The remaining scenarios introduce more dynamic and adaptive strategies (see Appendix for details and full list). Therefore in order to succeed on the scenarios, an agent needs to correctly infer the strategy and exploit it. Against the simple policies, the agent should play the same type of inventory every round rather than playing randomly or anticipating a change in its opponent's policy. In contrast, success + +against the adaptive strategies demands not only the anticipation of the opponent's next move based on personal previous plays but also selecting the most advantageous counter. + +Figure 2 and Appendix Table 1 demonstrate how Hypothetical Minds model consistently achieves large magnitude rewards and performs reliably better than the baselines on every single scenario. Hypothetical Minds performs the best on the static strategies, scenarios 0, 6, 7, 8 representing fixed policies that play for the same inventory on every interaction (6: rock, 7: paper, 8: scissors, 0: random sample from 6-8). Therefore it is able to exploit the static strategy reliably once it correctly infers it. The agent is also able to consistently return positive rewards against the difficult scenario 1, the adaptive bot that plays the best response to your last round. In contrast, baselines are failing to achieve consistent positive rewards. OPRE, a method designed specifically for a earlier version of this task, gets rewards near zero for every scenario. PlanReAct is the only other model to achieve positive rewards on the difficult best response bot, illustrating the usefulness of a hierarchical structure for this evaluation in particular. Reflexion performs second best overall, underscoring the value of evaluative reflection for this environment. + +Figure 3 showcases HM's dynamics, depicting the agent's reward per interaction before and after hypothesis validation. Upon validation, the agent consistently achieves high positive returns, while rewards are near zero or negative during the information-gathering phase. The upward trajectory in reward after generating a good hypothesis and the significant increase just before the validation threshold demonstrate the agent's ability to exploit accurate hypotheses effectively. + +# 4.2 HOW DOES HYPOTHETICAL MINDS PERFORM IN COLLABORATIVE ENVIRONMENTS? + +In the Collaborative Cooking: Asymmetric environment, two players on distinct sides of a divided kitchen must collaborate to efficiently cook tomato soup. The layout provides distinct advantages to each side—one side is closer to the goal delivery but farther from the tomato dispenser, and vice versa for the other side. To maximize rewards, the two players should specialize based on their proximity to resources: one handles tomato dispensing and delivery, and the other manages dish retrieval and soup delivery. Evaluation scenarios challenge the focal agent to demonstrate dual forms of adaptation: adjusting to the specialized role dictated by their side of the kitchen and to the varying competence of their partner, from skilled and specialized to entirely unresponsive. + +Again, Hypothetical Minds achieves higher rewards than the baselines on every scenario (Figure 2). Interestingly, HM performs significantly better than the baselines on the scenarios where there is a functional partner (Appendix Table 1). This suggests that if there is value in a partner, HM can take advantage of this and adapt its behavior accordingly, highlighting the model's usefulness for complex, dynamic environments where cooperative interaction is crucial. The LLM baselines perform relatively well with the negligent partner, where success hinges on repeatedly executing an intuitive sequence of actions — filling and delivering pots — without the need to take into account the actions of another mind. For instance, baseline LLM agents struggled when encountering a pot already at capacity while attempting to add tomatoes. PPO showed the opposite relative weakness, performing moderately with the skilled partner but has a dramatic lack of generalization to the unhelpful partner scenario, as it is used to role specialization from self play. OPRE performs poorly on every scenario. + +# 4.3 HOW DOES HYPOTHETICAL MINDS PERFORM IN MIXED-MOTIVE ENVIRONMENTS? + +In the Prisoner's Dilemma in the Matrix Repeated (PD) environment, agents navigate a similar grid world to RWS and collect resources corresponding to cooperation or defection in the iterated prisoner's dilemma game. The payoff matrix incentivizes mutual defection in a single interaction, but the highest total welfare is achieved through mutual cooperation across an episode. + +Hypothetical Minds achieves the highest reward among LLM agents and in 5/10 scenarios (Figure 2, Appendix Table 1). This highlights its ability to perceive the background agent's strategy and adapt accordingly. HM outperforms the LLM baselines relatively more with dynamic partners. With tit-for-tat for example (scenarios 5 and 6), Hypothetical Minds achieves the highest score among all models, by engaging in more consistent cooperation while demonstrating some forgiveness to avoid cycles of alternating defection, a pattern that plagues LLM baselines. In scenarios 8 and 9, Hypothetical Minds showcases a capacity for "corrective punishment." By defecting against these partners that initially defect, it persuades them to switch to conditional cooperation. The agent then shifts to a forgiving cooperation strategy to maintain a mutually beneficial equilibrium. + +![](images/9b873b6e5096c23fd6965c3c170edbfe252bc24645cb9fa81a72a3dc68bb94d1.jpg) +Figure 4: Comparing different versions of HM. Errorbars reflect SEM across 5 episodes. + +However, OPRE achieves the highest rewards overall on Prisoner's Dilemma. Fixed heuristic policies such as always defecting, playing tit-for-tat, etc. can achieve high rewards without needing to correctly infer the policy it is playing against. One explanation is that advanced RL methods like OPRE collect resources more efficiently than Hypothetical Minds in Prisoner's Dilemma, due to the limited spatial reasoning abilities of ungrounded LLMs like GPT4. One limitation of HM is that the agent frequently travels across the environment to pick up resources that were closer to its original location. On the other hand, HM demonstrates good reasoning about the strategies it is playing against, and good hypotheses are frequently found and validated. This illustrates the tradeoffs between these two methods. LLM agents provide better abstract reasoning about things like other agent's goals right out of the box due to their extensive training data, but lack the low-level control necessary to maximize performance in a dense reward embodied environment (which RL excels at). + +# 4.4 HOW DOES HYPOTHETICAL MINDS SCALE TO ENVIRONMENTS WITH LARGER POPULATIONS OF AGENTS? + +Running With Scissors in the Matrix Arena (RWS Arena) is an eight-player extension of RWS, where the agent controls one player against a population of 7 strategies. This adds additional complexity to the decision-making process and tests the scalability of models, as agents now must infer the strategies of separate agents and maintain this information in memory. Hypothetical Minds is set up for this by maintaining separate hypothesis evaluation streams for every agent. Additionally, in order to maximize reward, agents should only interact with opponents that it knows it can beat with its current inventory. Models are therefore tasked with integrating uncertainty and seeking out opponents for which they have high confidence about their strategy. + +Hypothetical Minds achieves higher rewards than the baselines in RWS Arena (Figure 2) and is the best model on 6/8 scenarios (Appendix Table 1). HM performs particularly well on homogeneous populations of rock, paper, or scissors (scenarios 5-7). Scenarios 2-4 consist of heterogeneous populations where 2/3rds of the population are one pure strategy and the remaining 1/3rd represents the pure strategy that would beat the best response to the majority strategy (e.g., scenario 2 is 2/3 rock and 1/3 scissors). HM performs the best on 2 out of 3 of these difficult scenarios, and performance for scenario 4 is dragged down by one highly negative episode in which the agent was exploited by the minority strategy. In contrast, all baseline models struggle to achieve rewards of more than 10 on average in nearly every scenario. This highlights the difficulty of the environment, for which proper coordination between high-level plans, the embodiment, and memory is crucial for success. These results also suggest that Hypothetical Minds scales well to population-based environments in which you need to either handle distinct agents differently or make population-level inferences. + +# 4.5 ABLATIONS + +Our ablation studies focused on three key aspects: (1) comparing performance across different base LLMs, (2) analyzing the components of the ToM module, and (3) analyzing the sensitivity of the ToM module's hyperparameters. + +First, we compared GPT-4, GPT-3.5, and Llama-3-70B-Instruct across environments (Figure 5). GPT-4 significantly outperformed the other LLMs. Llama-3 performed moderately on RWS Repeated and Collaborative Cooking, placing between GPT-4 and GPT-3.5, but fell below GPT-3.5 on Prisoner's Dilemma. Due to context length limits, we could not evaluate Llama-3 on RWS Arena. + +Second, we conducted a detailed ablation analysis of the ToM module using RWS Repeated as our test environment. We evaluated five variants: 1. Vanilla Mind Prompting (VMP): A simplified version using a single API call for all ToM steps, without hypothesis evaluation or refinement. 2. Modular Mind Prompting (MMP): Removes hypothesis evaluation and refinement but queries the LLM separately for each reasoning step (ie. hypothesis generation and planning the next strategy are separate). 3. Modular Mind Prompting + Hypothesis Evaluation (MMP + HE): This version introduces hypothesis evaluation in comparison to the previous model. 4. Hypothesis Evaluation and Refinement w/o Mind Prompting (HE + HR): Focuses only on hypothesis evaluation and refinement, removing ToM-specific prompting. 5. Full Hypothetical Minds: The complete model combining MMP + HE with hypothesis refinement. + +Results show MMP consistently outperformed VMP (Figure 4, Figure 8). Adding hypothesis evaluation $(\mathrm{MMP} + \mathrm{HE})$ and refinement (full HM) improved performance, with both variants achieving positive returns above 10 across all scenarios. The full model showed particular strength against the challenging best response bot (SC 1). This demonstrates that valuation and refinement may be most beneficial for complex strategies that are difficult to generate or reason about from scratch. + +While GPT-4 could sometimes identify correct hypotheses through reasoning alone, it did so inconsistently, highlighting the value of systematic hypothesis evaluation. The $\mathrm{HE} + \mathrm{HR}$ variant excelled with adaptive opponents but struggled against fixed strategies, suggesting that explicit theory of mind modeling is crucial for recognizing static opponent behaviors (Rakoczy, 2022). Additionally, removing ToM prompting led to verbose, less focused hypotheses (see Figure 9). + +Third, we examined key hyperparameters in the ToM module. The 'top_k' parameter controlling how many top hypotheses to evaluate (default=5) trades off computational costs. Performance improves most dramatically when maintaining any hypotheses beyond just the last generated one ('top_k = 0' is equivalent to the MMP model), particularly for challenging scenarios like scenario 1 (Figure 11, Figure 12). This reflects a categorical difference when the best hypothesis is kept around, giving the agent some memory of past guesses, while poor hypotheses naturally fall out of the top 'k'. Increasing 'top_k' beyond 3 shows diminishing returns for RWS Repeated and may become detrimental past 5. The relationship between 'top_k' and computational cost is plotted in Figure 13 and Figure 14. Once top_k > 0, most cost variance stems from other factors, and higher costs ( $>$ 10 per episode) actually correlate with decreased performance. This occurs primarily because hypothesis validation reduces subsequent LLM calls, leading to both lower costs and better performance. Tests with Llama3 showed performance is relatively robust to learning rate $\alpha$ (which weights recent predictions) and the validation threshold (Figure 15, Figure 16). While smaller learning rates performed better, the model achieved above-chance performance across all parameter values tested. This robustness makes sense: a good hypothesis will eventually be validated across a reasonable range of these parameters, leading to high rewards for the remainder of the episode. + +# 5 CONCLUSION + +We have presented Hypothetical Minds, a model that demonstrates strong performance across diverse multi-agent environments through its novel approach to theory of mind modeling and hypothesis evaluation. Our work has several limitations that suggest promising directions for future research. The current implementation requires human intervention to establish scaffolding and prompting for the agent. Additionally, knowledge of game rules and mechanics must be explicitly encoded in the prompts rather than learned from the environment. An important avenue for future research is developing methods for agents to learn these concepts and appropriate types of scaffolding autonomously from environmental feedback. This could enable more general-purpose agents that can flexibly adapt to novel multi-agent scenarios without manual configuration. + +The success of our approach in structured game environments suggests broader applications to real-world multi-agent systems where understanding and adapting to people is crucial. Future work should investigate how the principles of the ToM module demonstrated here could extend to more complex social interactions such as adaptive tutoring or personalizing chat bot responses to users with hidden preferences. Such advances would represent important progress toward autonomous agents that can effectively navigate diverse social tasks. + +# AUTHOR CONTRIBUTIONS + +L.C. conceptualized and designed the Hypothetical Minds framework, developed the core codebase, conducted experiments, analyzed results, and wrote the manuscript. V.X. contributed to the framework design, codebase, and implementation. A.B. assisted with experiments. D.Y. and N.H. supervised the research, provided guidance on the project direction, and secured funding. All authors reviewed and provided feedback on the manuscript. + +# ACKNOWLEDGMENTS + +We thank members of the Yamins and Haber labs at Stanford University for their valuable feedback and suggestions throughout the development of this work. This work was supported by the following awards: To D.L.K.Y.: Simons Foundation grant 543061, National Science Foundation CAREER grant 1844724, National Science Foundation Grant NCS-FR 2123963, Office of Naval Research grant S5122, ONR MURI 00010802, ONR MURI S5847, and ONR MURI 1141386 - 493027. + +# REFERENCES + +John P Agapiou, Alexander Sasha Vezhnevets, Edgar A Duñez-Guzmán, Jayd Matyas, Yiran Mao, Peter Sunehag, Raphael Köster, Udari Madhushani, Kavya Kopparapu, Ramona Comanescu, et al. Melting pot 2.0. arXiv preprint arXiv:2211.13746, 2022. +Janet Wilde Astington and Jodie A Baird. Why language matters for theory of mind. Oxford University Press, 2005. +Chris L Baker, Rebecca Saxe, and Joshua B Tenenbaum. Action understanding as inverse planning. Cognition, 113(3):329-349, 2009. +Anthony Brohan, Noah Brown, Justice Carbajal, Yevgen Chebotar, Xi Chen, Krzysztof Choromanski, Tianli Ding, Danny Driess, Avinava Dubey, Chelsea Finn, et al. Rt-2: Vision-language-action models transfer web knowledge to robotic control. arXiv preprint arXiv:2307.15818, 2023a. +Anthony Brohan, Yevgen Chebotar, Chelsea Finn, Karol Hausman, Alexander Herzog, Daniel Ho, Julian Ibarz, Alex Irpan, Eric Jang, Ryan Julian, et al. Do as i can, not as i say: Grounding language in robotic affordances. In Conference on Robot Learning, pp. 287-318. PMLR, 2023b. +Nathaniel D Daw and Philippe N Tobler. Value learning through reinforcement: the basics of dopamine and reinforcement learning. In Neuroeconomics, pp. 283-298. Elsevier, 2014. +Jill G de Villiers. The interface of language and theory of mind. *Lingua*, 117(11):1858–1878, 2007. +Jill G de Villiers. The role (s) of language in theory of mind. In *The neural basis of mentalizing*, pp. 423-448. Springer, 2021. +Kanishk Gandhi, Jan-Philipp Franken, Tobias Gerstenberg, and Noah Goodman. Understanding social reasoning in language models with language models. Advances in Neural Information Processing Systems, 36, 2024. +Noah D Goodman and Michael C Frank. Pragmatic language interpretation as probabilistic inference. Trends in cognitive sciences, 20(11):818-829, 2016. +Wenlong Huang, Fei Xia, Ted Xiao, Harris Chan, Jacky Liang, Pete Florence, Andy Zeng, Jonathan Thompson, Igor Mordatch, Yevgen Chebotar, et al. Inner monologue: Embodied reasoning through planning with language models. arXiv preprint arXiv:2207.05608, 2022. +Dom Huh and Prasant Mohapatra. Representation learning for efficient deep multi-agent reinforcement learning. arXiv preprint arXiv:2406.02890, 2024. +Michal Kosinski. Evaluating large language models in theory of mind tasks. arXiv e-prints, pp. arXiv-2302, 2023. +Wenhao Li, Dan Qiao, Baoxiang Wang, Xiangfeng Wang, Bo Jin, and Hongyuan Zha. Semantically aligned task decomposition in multi-agent reinforcement learning. arXiv preprint arXiv:2305.10865, 2023. + +Ryan Liu, Howard Yen, Raja Marjieh, Thomas L Griffiths, and Ranjay Krishna. Improving interpersonal communication by simulating audiences with language models. arXiv preprint arXiv:2311.00687, 2023a. +Zhiwei Liu, Weiran Yao, Jianguo Zhang, Le Xue, Shelby Heinecke, Rithesh Murthy, Yihao Feng, Zeyuan Chen, Juan Carlos Niebles, Devansh Arpit, et al. Bolaa: Benchmarking and orchestrating llm-augmented autonomous agents. arXiv preprint arXiv:2308.05960, 2023b. +Ryan Lowe, Yi I Wu, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. Multiagent actor-critic for mixed cooperative-competitive environments. Advances in neural information processing systems, 30, 2017. +Joon Sung Park, Joseph O'Brien, Carrie Jun Cai, Meredith Ringel Morris, Percy Liang, and Michael S Bernstein. Generative agents: Interactive simulacra of human behavior. In Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology, pp. 1-22, 2023. +Yujia Qin, Shihao Liang, Yining Ye, Kunlun Zhu, Lan Yan, Yaxi Lu, Yankai Lin, Xin Cong, Xiangru Tang, Bill Qian, et al. Toollm: Facilitating large language models to master 16000+ real-world apis. arXiv preprint arXiv:2307.16789, 2023. +Linlu Qiu, Liwei Jiang, Ximing Lu, Melanie Sclar, Valentina Pyatkin, Chandra Bhagavatula, Bailin Wang, Yoon Kim, Yejin Choi, Nouha Dziri, et al. Phenomenal yet puzzling: Testing inductive reasoning capabilities of language models with hypothesis refinement. arXiv preprint arXiv:2310.08559, 2023. +Neil Rabinowitz, Frank Perbet, Francis Song, Chiyuan Zhang, SM Ali Eslami, and Matthew Botvinick. Machine theory of mind. In International conference on machine learning, pp. 4218-4227. PMLR, 2018. +Hannes Rakoczy. Foundations of theory of mind and its development in early childhood. Nature Reviews Psychology, 1(4):223-235, 2022. +Krishan Rana, Jesse Haviland, Sourav Garg, Jad Abou-Chakra, Ian Reid, and Niko Suenderhauf. Sayplan: Grounding large language models using 3d scene graphs for scalable task planning. arXiv preprint arXiv:2307.06135, 2023. +Robert A Rescorla. A theory of pavlovian conditioning: Variations in the effectiveness of reinforcement and non-reinforcement. Classical conditioning, Current research and theory, 2:64-69, 1972. +Timo Schick, Jane Dwivedi-Yu, Roberto Dessi, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. Toolformer: Language models can teach themselves to use tools. Advances in Neural Information Processing Systems, 36, 2024. +John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. +Melanie Sclar, Graham Neubig, and Yonatan Bisk. Symmetric machine theory of mind. In International Conference on Machine Learning, pp. 19450-19466. PMLR, 2022. +Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. Hugging-gpt: Solving ai tasks with chatgpt and its friends in hugging face. Advances in Neural Information Processing Systems, 36:38154-38180, 2023. +Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflection: Language agents with verbal reinforcement learning. Advances in Neural Information Processing Systems, 36, 2024. +Theodore R Sumers, Shunyu Yao, Karthik Narasimhan, and Thomas L Griffiths. Cognitive architectures for language agents. arXiv preprint arXiv:2309.02427, 2023. +Alexander Vezhnevets, Yuhuai Wu, Maria Eckstein, Rémi Leblond, and Joel Z Leibo. Options as responses: Grounding behavioural hierarchies in multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 9733-9742. PMLR, 2020. + +Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar. Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305.16291, 2023a. +Lei Wang, Chen Ma, Xueyang Feng, Zeyu Zhang, Hao Yang, Jingsen Zhang, Zhiyuan Chen, Jiakai Tang, Xu Chen, Yankai Lin, et al. A survey on large language model based autonomous agents. Frontiers of Computer Science, 18(6):186345, 2024. +Ruocheng Wang, Eric Zelikman, Gabriel Poesia, Yewen Pu, Nick Haber, and Noah D Goodman. Hypothesis search: Inductive reasoning with language models. arXiv preprint arXiv:2309.05660, 2023b. +Yuanfei Wang, Fangwei Zhong, Jing Xu, and Yizhou Wang. Tom2c: Target-oriented multi-agent communication and cooperation with theory of mind. arXiv preprint arXiv:2111.09189, 2021. +Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35:24824-24837, 2022. +Annie Wong, Thomas Bäck, Anna V Kononova, and Aske Plaat. Deep multiagent reinforcement learning: Challenges and directions. Artificial Intelligence Review, 56(6):5023-5056, 2023. +Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. React: Synergizing reasoning and acting in language models. In International Conference on Learning Representations (ICLR), 2023. +Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Tom Griffiths, Yuan Cao, and Karthik Narasimhan. Tree of thoughts: Deliberate problem solving with large language models. Advances in Neural Information Processing Systems, 36, 2024. +Chao Yu, Akash Velu, Eugene Vinitsky, Jiaxuan Gao, Yu Wang, Alexandre Bayen, and Yi Wu. The surprising effectiveness of ppo in cooperative multi-agent games. Advances in Neural Information Processing Systems, 35:24611-24624, 2022a. +Xiaopeng Yu, Jiechuan Jiang, Wanpeng Zhang, Haobin Jiang, and Zongqing Lu. Model-based opponent modeling. Advances in Neural Information Processing Systems, 35:28208-28221, 2022b. +Eric Zelikman, Jesse Mu, Noah D Goodman, and Yuhuai Tony Wu. Star: Self-taught reasoner bootstrapping reasoning with reasoning. 2022. +Ceyao Zhang, Kaijie Yang, Siyi Hu, Zihao Wang, Guanghe Li, Yihang Sun, Cheng Zhang, Zhaowei Zhang, Anji Liu, Song-Chun Zhu, et al. Proagent: Building proactive cooperative ai with large language models. arXiv preprint arXiv:2308.11339, 2023a. +Hongxin Zhang, Weihua Du, Jiaming Shan, Qinhong Zhou, Yilun Du, Joshua B Tenenbaum, Tian-min Shu, and Chuang Gan. Building cooperative embodied agents modularly with large language models. arXiv preprint arXiv:2307.02485, 2023b. +Zhuosheng Zhang, Yao Yao, Aston Zhang, Xiangru Tang, Xinbei Ma, Zhiwei He, Yiming Wang, Mark Gerstein, Rui Wang, Gongshen Liu, et al. Igniting language intelligence: The hitchhiker's guide from chain-of-thought reasoning to language agents. arXiv preprint arXiv:2311.11797, 2023c. + +A APPENDIX + +
ScenarioAgent Type
HM (ours)ReflexionReActPlanReActPPOOPRE
Running With +Scissors Repeated
0: Mix of all 350.8 ± 8.621.0 ± 10.2-1.0 ± 3.95.5 ± 3.6-2.9 ± 1.80.0 ± 0.0
1: Best Response23.2 ± 4.7-3.5 ± 3.5-2.3 ± 4.221.1 ± 5.00.5 ± 1.6-0.1 ± 0.0
2: 0 ∪ 154.6 ± 4.329.3 ± 12.517.1 ± 7.216.6 ± 6.1-1.1 ± 2.00.0 ± 0.0
3: Flip After 240.6 ± 11.130.9 ± 5.412.8 ± 4.713.2 ± 6.40.8 ± 0.50.0 ± 0.0
4: Flip After 148.5 ± 6.31.9 ± 4.2-1.5 ± 6.19.0 ± 5.1-2.4 ± 1.80.0 ± 0.0
5: Gullible12.9 ± 5.18.2 ± 3.22.5 ± 1.97.2 ± 3.40.1 ± 0.60.1 ± 0.0
6: Rock50.5 ± 4.417.9 ± 9.514.3 ± 8.615.6 ± 4.31.2 ± 2.00.2 ± 0.0
7: Paper59.6 ± 4.013.2 ± 6.82.7 ± 2.313.0 ± 4.4-0.1 ± 1.00.1 ± 0.0
8: Scissors63.8 ± 5.131.0 ± 6.529.0 ± 4.314.4 ± 3.3-4.2 ± 1.4-0.3 ± 0.0
Running With +Scissors Arena
0: Mix of all 313.3 ± 6.91.1 ± 3.63.5 ± 3.2-8.0 ± 4.1-0.5 ± 1.50.1 ± 0.2
1: Gullible-2.6 ± 3.4-1.8 ± 2.3-5.6 ± 4.00.9 ± 3.6-0.4 ± 1.0-0.6 ± 0.2
2: Rock + Flip After 216.2 ± 3.9-1.7 ± 2.2-4.4 ± 2.02.1 ± 3.2-1.0 ± 1.10.5 ± 0.4
3: Paper + Flip After 211.6 ± 4.51.6 ± 2.2-4.2 ± 3.60.9 ± 3.61.3 ± 1.40.3 ± 0.3
4: Scissors + Flip After 2-2.6 ± 5.710.6 ± 2.2-1.2 ± 3.3-2.4 ± 3.1-2.1 ± 1.00.2 ± 0.3
5: Rock21.8 ± 3.01.4 ± 2.0-4.3 ± 3.1-7.1 ± 2.01.7 ± 0.80.5 ± 0.4
6: Paper24.9 ± 2.5-1.1 ± 1.4-10.7 ± 2.5-4.0 ± 3.1-2.4 ± 1.00.4 ± 0.5
7: Scissors32.1 ± 1.811.8 ± 4.511.6 ± 2.0-0.2 ± 2.60.9 ± 0.90.7 ± 0.3
Collaborative Cooking +Asymmetric
0: Skilled Partner628.3 ± 35.1292.6 ± 38.2225.4 ± 60.0402.9 ± 70.1244.0 ± 76.121.5 ± 15.0
1: Semi-skilled Partner498.8 ± 78.2402.9 ± 65.0254.2 ± 39.1455.6 ± 55.786.0 ± 28.936.6 ± 28.0
2: Unhelpful Partner426.8 ± 42.5398.1 ± 33.6383.7 ± 21.4292.6 ± 36.70.0 ± 0.062.0 ± 62.0
Prisoner's Dilemma in the Matrix
0: 1 ∪ 240.6 ± 12.944.5 ± 13.257.9 ± 13.037.0 ± 15.320.7 ± 5.767.2 ± 1.2
1: Cooperator78.7 ± 2.487.2 ± 1.777.3 ± 1.078.8 ± 2.240.0 ± 5.4102.5 ± 1.0
2: Defector21.9 ± 0.522.1 ± 0.824.0 ± 0.322.5 ± 0.59.1 ± 2.034.5 ± 0.9
3: Grim Reciprocator31.6 ± 4.728.8 ± 0.429.2 ± 1.325.2 ± 0.413.0 ± 1.136.3 ± 1.0
4: Grim Reciprocator (2 strikes)27.8 ± 1.229.3 ± 1.730.7 ± 1.728.0 ± 1.216.5 ± 1.438.1 ± 1.2
5: Tit-for-tat52.5 ± 1.133.9 ± 0.735.8 ± 0.742.2 ± 2.115.4 ± 2.137.4 ± 0.5
6: Noisy tit-for-tat46.7 ± 2.240.3 ± 2.441.9 ± 2.742.0 ± 1.317.3 ± 2.747.8 ± 0.6
7: Cooperates then defects20.9 ± 0.525.1 ± 1.028.4 ± 0.724.9 ± 0.68.8 ± 0.938.3 ± 0.9
8: Defector that turns tit-for-tat42.1 ± 1.531.0 ± 1.430.1 ± 1.436.8 ± 0.98.1 ± 2.038.7 ± 0.6
9: Defector that turns to noisy tit-for-tat45.3 ± 1.834.7 ± 1.736.6 ± 1.640.6 ± 1.115.1 ± 2.546.7 ± 0.9
+ +Table 1: Average reward and SEM for different agents across substrates and scenarios. Note that the variance in scenarios that are a union of two scenarios may be related to which scenarios were sampled. + +![](images/5efc61d5431462a60843f786df86e804b1bdd3a8328497b5dba1f6c736ef889c.jpg) +Figure 5: Comparing base LLM models. 3 seeds are generated per LLM. + +![](images/a4cf12069864ed73275e2284a173c5f7ed5f0c04dd505804490bce64d511d8f7.jpg) + +1. 'Opponent_next_inventory': Based on the previous interactions and the guess about the opponent's policy/strategy, it seems that the opponent is likely to adapt their strategy to counter my strong plays. In the last interaction, I played a strong scissors strategy, and the opponent played a strong paper strategy. Given this pattern and the guess that the opponent favors rock when I play scissors, it is likely that the opponent's next inventory will be a strong rock strategy, inventory={'rock/yellow': 5, 'paper/purple': 1, 'scissors/blue': 1}. +2. 'My_next_inventory': To counter the opponent's likely strong rock strategy, I should adopt a strong paper strategy. This means my next inventory should be inventory={'rock/yellow': 1, 'paper/purple': 5, 'scissors/blue': 1}, which will give me an advantage if the opponent indeed plays a strong rock strategy. + +![](images/85da4bcf0e2f6f0e34bdc673e2fd579550846ad990c6da145e8592b0de6fe35b.jpg) +Figure 6: Example of GPT4-based agent finding a good hypothesis and employing good reasoning to select its next target inventory. +Figure 7: Example of a successful evolution of a hypothesis for $\mathrm{MMP} + \mathrm{HE} + \mathrm{HR}$ playing a Best Response bot. It shows the process of how the LLM-based agent generated a good hypothesis about the opponent's strategy, which was eventually validated. + +![](images/b81217791ba806ce1deecbdd07e51ce1e021cd576c9067693d212b0fbad646f0.jpg) +Comparing Model Versions for all Scenarios +Figure 8: Average reward per episode on all evaluation scenarios for each version of the ToM module using the full version. Errorbars reflect SEM across 5 episodes. Reward is normalized per 1200 timesteps to reduce variance with variable length episodes. +Figure 9: Example of a failure mode for $\mathrm{HE} + \mathrm{HR}$ playing rock bot. Generated strategies make little sense given the interaction history and requested format. + +# Example generated strategy for $\mathrm{HE} + \mathrm{HR}$ playing rock bot + +Given the interaction history and the current state of the game, it seems that a strategy that adapts to the opponent's recent choices while maintaining an element of unpredictability could be effective. The opponent's strategy is not entirely clear from the interaction history, but there are patterns of losses and wins that can be used to inform our strategy. + +```txt +Here's a high-level strategy for player.0: 1. Observe the opponent's recent strategy: Look at the last few interactions to determine if the opponent is favoring a particular resource. If a pattern is detected, prepare to counter it. 2. Adapt based on interaction history: If we win an interaction, introduce a slight randomness to our next choice to avoid being predictable. If we lose, counter the opponent's last winning resource. In the case of a tie, either maintain the current resource or switch based on the observed pattern of the opponent. 3. Efficient resource collection: Focus on collecting resources that align with our strategy while avoiding unnecessary collection of other resources. This will help in building a strong inventory for the next duel. 4. Strategic duel initiation: Initiate duels when we have a strong inventory that counters the opponent's likely choice. Use memory and observation to infer the opponent's strategy and position. 5. Avoid unnecessary resource collection: Once we have enough of a particular resource to play a strong strategy, avoid collecting more of that resource and instead focus on positioning for a duel or collecting a different resource if our strategy requires it. 6. Maintain flexibility: Be ready to adapt our strategy based on new information from the opponent's actions and the outcomes of interactions. Now, let's summarize this strategy in a Python dictionary format: `python { my_strategy': 'Adaptive Strategy with Randomness and Countering', 'observerecent-opponent_strategy': True, 'adapt_based_oninteraction_history': True, 'introduce_randomness_post_win': True, 'efficientResource.collection': True, 'strategic_duel_initiation': True, 'avoid_unnecessaryResource.collection': True, 'maintain_flexibility': True, 'interaction GUIDelines': {'if_win_next': 'introduce slight randomness to avoid predictability', 'iflosing_next': 'counter opponent's last winning resource', 'iftie_next': 'maintain or switch based on observed opponent pattern' } +``` + +# Example of a successful embodied exploration at the beginning of an episode + +First subgoals: Subgoal Plan: Since I am currently at (21, 10) with an orientation facing North and my high-level strategy is to collect 5 yellow resources to play a pure rock strategy, I need to find and move towards the nearest yellow box locations. However, there are no observable yellow box locations in my immediate vicinity. Therefore, my first subgoal is to explore the environment to find yellow boxes. I should move towards the center of the map where I am more likely to find resources and encounter the other player for a potential duel. + +Given that I am at the edge of the map, I should move left (West) towards the center. I will move to (20, 10), then to (19, 10), and continue in this direction until I find yellow boxes or reach a more central location on the map. If I encounter yellow boxes along the way, I will adjust my path to collect them. Once I have collected 5 yellow boxes, I will look for the opponent to initiate a duel. Action Plan: ```python +{ + action計劃: [move_to((21, 10), (20, 10)), move_to((20, 10), (19, 10)), move_to((19, 10), (18, 10)), move_to((18, 10), (17, 10)), move_to((17, 10), (16, 10))] +} ` + +# B HYPERPARAMETERS AND COMPUTATIONAL COSTS + +
HyperparameterValue
Alpha (α)0.3
Intrinsic reward c1.0
Threshold for Hypothesis Value (Vthr)0.7
Top k Hypotheses Considered (k)5
+ +Table 2: Default Hyperparameters of the Hypothetical Minds model + +![](images/ff8e2e3a9176652f817ee591f9c6439a90ffe3c35968da7a20526341964a7e11.jpg) +Figure 10: Example of a subgoal module exploring the environment at the beginning of an episode to build up a cognitive map of where resources are located. +Figure 11: Average reward per episode on Running With Scissors Repeated (all scenarios) for four values of top_k. Top_k reflects the number of top hypotheses to continue evaluating (default=5). Errorbars reflect SEM across 45 episodes. Reward is normalized per 1200 timesteps to reduce variance with variable length episodes. + +![](images/ed5e215078a9bd4061c7c0f692f2fca9c898e35ac03673171448de1902361b08.jpg) +Figure 12: Average reward per scenario on Running With Scissors Repeated for four values of top_k. Top_k reflects the number of top hypotheses to continue evaluating (default=5). Errorbars reflect SEM across 5 episodes per scenario. Reward is normalized per 1200 timesteps to reduce variance with variable length episodes. + +![](images/89acb4ea6d1a0b437227ee25a24dd60ba59b6181cbfceda02db02a511a7d19c5.jpg) +Figure 13: Scatter plot showing the relationship between computational cost and reward for different top-k parameter values in the hypothesis generation process. Each point represents an episode, with color indicating the top-k value used. Reward and cost is normalized per 1200 timesteps to reduce variance with variable length episodes. + +![](images/61b145922686bce19efa65c830eb612f7f46cc4a9d405e6bcfbce4ed69966cfd.jpg) +Figure 14: Comparison of computational costs across different top-k values in three metrics. Left: Total monetary cost in dollars. Middle: Number of input tokens consumed. Right: Number of output tokens generated. All metrics are normalized per episode length (1200 steps). Errorbars reflect SEM across 45 episodes. + +![](images/9b54f4160e97fa57882aafab8025c7464c613bebc63f5d21a615628d5d6482c5.jpg) + +![](images/00249727bffd9552d1acc1999950ce2145ac3033e1d29d1c242fca98212354f2.jpg) + +![](images/3d497ace99aad10e25d510f7de9dcd06e423a1f660218f2eff7b38fb4f3378cb.jpg) +Figure 15: Average reward per episode on Running With Scissors Repeated (all scenarios) for each four values of the learning rate alpha $\alpha$ . Alpha reflects how much to weigh recent interactions when evaluating the prediction accuracy of the hypotheses, with higher values weighing recent interactions more heavily (default=0.3). Errorbars reflect SEM across 10 episodes in two representative scenarios. Reward is normalized per 1200 timesteps to reduce variance with variable length episodes. + +![](images/f383b495a87da90b2873f421181c089449d71c572bbf45703173e7a7ef52577c.jpg) +Figure 16: Average reward per episode on Running With Scissors Repeated (all scenarios) for each five values of the value threshold for hypothesis validation. V_thr reflects how confident we want to be before validating a hypothesis as correct such that we do not generate or evaluate more hypotheses until that value falls under the threshold (default=0.7). Errorbars reflect SEM across 10 episodes in two representative scenarios. Reward is normalized per 1200 timesteps to reduce variance with variable length episodes. + +
HyperparameterValue
Alpha (α)0.3
Counterfactual reward c3.0
Threshold for Hypothesis Value (Vthr)3.0
Top k Hypotheses Considered (k)5
+ +Table 3: Hyperparameters of the HE + HR model + +
HyperparameterGPT-4GPT-3.5Llama3
Model”gpt-4-1106-preview””gpt-3.5-turbo-1106””Meta-Llama-3-70B-Instruct”
Max tokens400020002000
Temperature0.10.20.2
Top p1.01.01.0
n1110
+ +# B.1 EXPERIMENTS COMPUTE RESOURCES + +In Table 5, we show the cost of running an episode with 1000 steps. For Llama3 experiments which required 4 GPUs, we ran our experiments on three compute nodes with A40s or L40s. + +Table 4: Hyperparameters of Various Models + +
Money ($)Time (mins)
HM-GPT41045
Reflexion842
ReAct614
PlanReAct421
HM-GPT3.5124
HM-Llama3-58
+ +Table 5: Experiment costs for a single episode of RWS Repeated. Rounded to nearest integer. + +# C ENVIRONMENTS + +# C.1 RUNNING WITH SCISSORS REPEATED + +Specifically, here we evaluate our model on the Running With Scissors in the matrix: Repeated environment (RWS) in the Melting Pot multi-agent decision-making benchmark (Agapiou et al., 2022). This is a zero-sum competitive environment with two players moving around a map and collecting yellow, purple, or blue resources that correspond to rock, paper, and scissors respectively. In addition to movement, the agents have an action to fire an "interaction" beam which initiates a duel with the other player when that player is within range of the beam. An interaction results in one agent getting positive reward and the other agent getting an opposite negative reward according to the inventories of resources picked up by each player. Specifically a player will collect an inventory, which is only observable by that player: + +$$ +\rho = (\rho_ {y e l l o w}, \rho_ {p u r p l e}, \rho_ {b l u e}). +$$ + +Reward is determined by matrix multiplication operations mirroring the rock, paper, scissors matrix game: + +$$ +r _ {\text {r o w}} = \mathbf {v} _ {\text {r o w}} ^ {T} A _ {\text {r o w}} \mathbf {v} _ {\text {c o l}}, \quad r _ {\text {c o l}} = - r _ {\text {r o w}} +$$ + +where $v_{i} = \frac{\rho_{i}}{\sum_{j = 1}^{K}\rho_{j}}$ and + +$$ +A _ {\mathrm {r o w}} = \left[ \begin{array}{c c c} 0 & - 1 0 & + 1 0 \\ + 1 0 & 0 & - 1 0 \\ - 1 0 & + 1 0 & 0 \end{array} \right]. +$$ + +The partially-observable input in Melting Pot consists of a 5x5 window around the agent such that it can see three grids in front of itself and one behind it, and two on each side. + +# C.1.1 SCENARIOS + +Description of scenarios for each substrate are reproduced directly from (Agapiou et al., 2022): + +SC0: Versus mixed strategy opponent. Here the focal agent must defeat an opponent that was trained to play a pure strategy: either rock, paper, or scissors. However, the specific opponent is sampled at test time so it could be any of those. All opponents commit strongly to their choice, aiming to collect at least three resources before interacting. To defeat them, the focal agent should scout out which pure strategy its opponent is playing and then collect the resources to implement its counter strategy. Since this is a one-shot interaction, success requires the focal agent to pay close attention to which resources are missing since they provide a clue to which strategy their opponent is implementing. +SC1: Versus opponent who plays the best response to what the focal player did in the last round. Here the focal agent must defeat an opponent who may change their strategy with each interaction. The opponent will always select the best response to what the focal player selected in the previous interaction. For instance, if the focal player plays rock in one interaction then its opponent will play paper in the next interaction. On the first interaction of each episode it chooses one of the three pure strategies at random. The opponent always commits strongly to its choice, aiming to collect at least five resources before interacting. To win the focal player can trick its opponent into choosing a specific strategy and countering it. This requires changing strategy from interaction to interaction, cycling around the three options. +SC2: Versus opponent who sometimes plays a pure strategy but sometimes plays the best response to what the focal player did in the last round. Focal player must defeat an opponent sampled from the union of the background populations used in SC 0 and SC 1. The probability of sampling a pure opponent is $3/4$ while the probability of sampling a best response opponent is $1/4$ . +SC3: Versus mixture of opponents who often flip to other strategies after two interactions. Focal player must defeat an opponent that may initially play any pure strategy and, with probability 1/3, may flip after the second interaction to the best response to the best response to + +its initial strategy. For example if it starts out playing rock then the best response to that would be paper, so after the second interaction it would switch to playing the best response to paper i.e. scissors. It only weakly commits to its strategy for the first two interactions. That is, it aims to collect only one resource before interacting. After two interactions, at the point when it changes strategy, it also starts committing more strongly to its choice, aiming to collect five resources before each interaction. With probability 2/3, the opponent instead plays a pure strategy throughout the entire episode. In half of the pure opponent episodes the bot fully commits to its pure strategy, aiming to collect five resources before interacting, while the other half of the time it commits less strongly, aiming to collect only one resource before interacting. Note that opponents may be weakly committed to their strategy for the first two interactions regardless of whether they will ultimately flip strategy or not so it's not possible for the focal agent to observe weak commitment early on as a cue to predict whether or not their opponent will later flip strategies. + +SC4: Versus mixture of opponents who either flip to another strategy after one interaction and keep it forever or continue to change, always best responding to what the focal player just did. Two kinds of opponents are possible. Both change their strategy after the first interaction. With probability 3/4 the opponent will be a bot that flips to a different strategy after the first interaction and then follows it till the end of the episode. It always flips to the best response to the best response to its initial strategy (so if it initially plays rock then it will flip to scissors). With probability 1/4 the other kind of opponent is sampled. This opponent is identical to the one in SC 1. Both kinds of opponents always fully commit to their choice, aiming to collect at least five resources before interacting so its not possible to observe the opponent's commitment level to predict which kind they are. To win the focal player must figure out which kind of opponent it is playing against and either best respond by selecting the same choice in all interactions after the first if paired with the first kind of opponent, or apply the cyclic strategy described as the solution to SC 1 if paired with the second kind of opponent. +SC5: Versus gullible opponent. Here the focal agent must defeat an opposing agent that was trained to best respond to agents playing pure strategies. The opponent should attempt to scout out what strategy the focal agent is playing so it can pick the appropriate counter. To defeat it, the focal agent should feint toward one resource and then collect the counter to its counter. So for example, if the focal agent successfully feinted that it would pick rock, inducing its opponent to pick paper, the focal agent should then collect and play scissors. This opponent is fairly weak. +SC6: Versus pure rock opponent. Opponent always plays rock, and commits to it strongly, aiming to collect five resources before interacting. The focal player gets a high score when it picks paper and commits strongly to that choice. +SC7: Versus pure paper opponent. Same as SC 6 but opponent plays paper so focal player should play scissors. +SC8: Versus pure scissors opponent. Same as SC 6 but opponent plays scissors so focal player should play rock." + +It should be noted that scenario 5 includes a gullible opponent, that attempts to scout out what strategy you are playing and pick the appropriate counter. From first principles, to beat this opponent an agent should feint towards one resource to fool the opponent and then select the counter to its counter. Since our ToM module selects strategies on a higher-level of abstraction than the embodiment, it was not specifically designed to beat this opponent. Integrating high-level strategy information with relevant embodied information is the subject of future research. However, in practice the gullible bot does not effectively scout out our agent, and it frequently plays the same strategy, which is exploited by our agent, leading to positive rewards on this scenario on average for all model versions. + +# C.2 RUNNING WITH SCISSORS ARENA + +We also evaluate our model on Running With Scissors in the matrix: Arena environment in the Melting Pot multi-agent decision-making benchmark (Agapiou et al., 2022). This environment has the same dynamics as Running With Scissors in the matrix: Repeated with the main exception being that + +their are 8 players in this substrate playing on a larger 25 by 24 matrix with a 11 by 11 observability window, skewed towards viewing more in front of the agent. All scenarios under this agent represent one focal resident (agent) playing against 7 others with varying fixed and dynamic policies, attempting to maximize reward decided by the payoff matrix equivalent to the one in Running with Scissors Repeated. + +# C.2.1 SCENARIOS + +SC0: Versus a background population containing bots implementing all three pure strategies. Here one focal player joins seven from the background population. The background population contains bots who implement all three pure strategies: rock, paper, and scissors. They may either commit to their strategy moderately (aiming to collect three resources before interacting) or more strongly (aiming to collect five). The task for the focal agent is to watch its opponents, see what strategy one of them is implementing, and act accordingly. +SC1: Versus gullible bots. Here one focal player joins seven from the background population. The background population consists entirely of weak bots who were trained to best respond to agents playing pure strategies. They are weak opponents. +SC2: Versus mixture of opponents who play rock and some who flip to scissors after two interactions Here one focal player joins seven from the background population. The focal player should pay attention to what each prospective partner has collected since 2/3 of them play rock while 1/3 play scissors after the first two interactions. Choosing paper to best respond to rock is a bad choice if accidentally paired with an opponent playing scissors. +SC3: Versus mixture of opponents who play paper and some who flip to rock after two interactions. Like SC2 but with bots playing paper and bots switching from paper to rock. +SC4: Versus mixture of opponents who play scissors and some who flip to paper after two interactions. Like SC 2 but with bots playing scissors and bots switching from scissors to paper. +SC5: Visiting a population of pure paper bots. Here one focal player joins seven from the background population. All seven background bots play paper so the focal player can get a high score by playing scissors. +SC6: Visiting a population of pure rock bots Here one focal player joins seven from the background population. All seven background bots play rock so the focal player can get a high score by playing paper. +SC7: Visiting a population of pure scissors bots. Here one focal player joins seven from the background population. All seven background bots play scissors so the focal player can get a high score by playing rock. + +# C.3 PRISONERS DILEMMA REPEATED + +The Prisoners Dilemma in the Matrix Repeated environment is a mixed-motive one where two individuals collect resources that represent 'defect' (red) or 'cooperate' (green) and compare inventories in an encounter, analogous to the Running With Scissors substrates. Consequences of the inventory comparison are congruent with the classic Prisoner's Dilemma matrix game, exposing tension between reward for the group and reward for the individual. Reward is delivered after an interaction weighted by the proportion of items in each agent's inventory, as described above for Running With Scissors. The payoff matrix for the interaction is + +$$ +A _ {\mathrm {r o w}} = A _ {\mathrm {c o l}} ^ {T} = \left[ \begin{array}{c c} 3 & 0 \\ 5 & 1 \end{array} \right] +$$ + +# C.3.1 SCENARIOS + +SC0: Partner may play either cooperate or defect The optimal strategy is simply to unconditionally defect. However, given that the focal doesn't know the strategy of the background player, a good strategy is more subtle. A reasonable strategy is to be a grim reciprocator cooperator, which would cooperate with the cooperator, and defect to the defector. Alternatively the focal player might try to ascertain whether the background player is exploitable. + +Doing so, however, carries a risk, for if the background player were to be a Grim reciprocator (like in other scenarios), this would cause them to defect for the rest of the episode. + +SC1: Partner typically plays cooperate. The optimal strategy is simply to unconditionally defect. The same considerations about uncertainty of the background player's strategy from Scenario 0 apply here. +SC2: Partner typically plays defect The optimal strategy is simply to unconditionally defect. However, because the focal player doesn't a priori know the strategy of the background player, they must first try to find out their strategy. This can be done by looking at which resources they collect or by paying attention to the results of the first few interactions. Once the focal has identified its background partner is defecting then it may have confidence that it should defect as well. The focal player should also consider the possibility that the background bot is corrigible, i.e. that it could be persuade to switch from defection to cooperation. This is not the case here but the background populations used in SC 8 and SC are corrigible. +SC3: Partner is a hair-trigger grim reciprocator, i.e. one who initially cooperates but, if defected on once, will retaliate by defecting forever after. The optimal strategy is simply to cooperate. Grim reciprocator background players are non-exploitable, and there is no way to know how they will react to a defection ahead of time. Because of this uncertainty, testing for exploitability can lead to poor performance of the focal player. Conditional cooperators who cooperate first but retaliate if defected on should achieve a high score. +SC4: Partner is a two-strikes grim reciprocator, i.e. one who initially cooperates, but if defected on twice, will retaliate by defecting forever after The optimal strategy is simply to cooperate. Grim reciprocator background players are non-exploitable, and there is no way to know how they will react to a defection ahead of time. Because of this uncertainty, testing for exploitability can lead to poor performance of the focal player. In principle, it would be possible to defect once against the background player leading to higher reward. But since it is not possible to know the background player is a two-strikes grim reciprocator, and testing it against a hairtrigger grim reciprocator leads to defection, in practice is better simply to cooperate. Conditional cooperators who cooperate first but retaliate if defected on should achieve a high score. +SC5: Partner is a tit-for-tat conditional cooperator The optimal strategy is simply to cooperate. Defecting against a tit-for-tat agent, even occasionally, might lead to miscoordinated interactions where one player cooperates and the other defects, in an alternating way. Forgiveness is one way to break out of such cycles of recrimination. Conditional cooperators who cooperate first but retaliate if defected on should also be forgiving to ensure they do well in this scenario. +SC6: Partner is a tit-for-tat conditional cooperator who occasionally plays defect instead of cooperate. Like the previous scenario, except the tit-for-tat background player occasionally will defect instead of cooperate. This is known as trembling hand in game theory. A strict tit-for-tat focal player would occasionally fall into miscoordinated interactions with the background player resulting in alternating cooperation and defection. As in SC5, focal conditional cooperators must also be forgiving to ensure they do well in this scenario. Forgiveness is even more important here since the background player will defect relatively frequently itself but will still implement tit-for-tat retaliation when defected on itself. +SC7: Partner plays cooperate for a while then switches to defect Similar considerations to the previous scenarios. A good strategy is a grim reciprocator, or tit-for-tat for the focal player. Unconditional cooperation would be exploited by the background player. +SC8: Partner tries to take advantage of the focal player by playing defect, but if punished, partner then switches to tit-for-tat conditional cooperation Related to Scenario 2, the optimal strategy is for the focal player to persuade the background player to stop defecting by punishing it through defecting itself. Once persuaded, the background player implements a conditional cooperation (tit-fortat) strategy. So it is safe to start cooperating with them once you have verified that they are themselves consistently cooperating. +SC9: Partner tries to take advantage of the focal player by playing defect, but if punished, partner then switches to noisy tit-for-tat conditional cooperation Like the previous scenario, except + +the focal player must implement a more generous form of conditional cooperation after persuading the background player to switch from defection. + +# C.4 COLLABORATIVE COOKING ASYMMETRIC + +In the Collaborative Cooking Asymmetric substrate, players need to collaborate to follow recipes. The environment described in (Agapiou et al., 2022) follows the regular pseudoweward scheme, which is turned off by default. The asymmetric environment is a version of the Collaborative Cooking with an asymmetric advantages map. This is to test whether players can choose high-level strategies that play to their strengths. + +# C.4.1 SCENARIOS + +SC0: Collaborate with a skilled chef Here the background player implements a particular policy that can be very effective when its partner does its part. The two players are on two distinct and disconnected sides of the map. On one side the goal delivery location is close to cooking pots and the tomato dispenser is far away whereas on the other side the goal delivery location is far from the cooking pots but the tomato dispenser is close. The players should collaborate, each specializing in the part of the task that it is most efficient for them to do on the side of the map where they spawned. The background player implements this kind of policy, which depends on the actions of its partner to complete the task. The background player was trained with the V-MPO algorithm. + +SC1: Collaborate with a semi-skilled apprentice chef This scenario is similar to SC 0 but the background player is not as well trained. In fact the background population used here is the same as in SC0 but from an earlier point in training. The importance of evaluating cooperation with bots of varying skill levels, and different points in training. + +SC2: Succeed despite an unhelpful partner In this scenario the background player never moves or helps in any way. On this map it is less efficient to implement all steps of the recipe alone versus to work together with a partner. But it is still possible for either player to perform all the steps on their own. The task is to realize that the background player won't do their part of the joint policy so the focal agent had better do everything itself. + +# D METHODS + +# D.1 TEXTUAL MAP + +Pixel images of the global state are preprocessed into a text-based state representation. The images are divided into 8x8 patches, each corresponding to a cell within the Melting Pot grid that entities can occupy. Each patch may represent one of four types: an agent, a resource, a wall, or a blank space. The patches are labeled by comparing them to manually labeled reference patches of each type of entity, including the numerous possible body orientations and hat colors an agent can embody in each environment. Automating the process with computer vision is a candidate for future work. The global state can then be fully represented in text by coordinates in a Height x Width grid and the entity label at each coordinate. Egocentric states are then created from this according to the partially-observable 5x5 box around an agent (dependent on its orientation). We tried several representations of feeding this textual map to GPT, and in practice the best representation consists of printing each entity type with a list of all the coordinates where that entity type is present. For example "Player Position: {'player_0-S': [(21, 4)]}, Observable Yellow Box Locations: [(13, 10), (14, 11)]}, Observable Blue Box Locations: [], Observable Purple Box Locations: [(13, 11), (15, 11)]" encodes the player position and orientation (south) along with the observable box locations. The player's current inventory is also included in the textual state representation, as it is in the default state representation for Running With Scissors and Prisoner's Dilemma. + +# D.2 MEMORY + +The memory system consists of two parts. The first data structure appends the observed states in the previous step to lists of each entity type in a tuple with the step it was observed. For example: 'yellow_box': [(13, 3), 'Step: 1087'), ((13, 4), 'Step: 1087'), ((7, 3), 'Step: 1091')]. The LLM is + +prompted that its memory can be outdated and therefore should take the step it was last observed into account. + +The second data structure in the memory system contains a list of the agent's inventories and rewards from the interactions that occurred so far. This specific information, distinct from the previously observed states, is relayed to the ToM module. + +# D.3 THEORY OF MIND MODULE + +The Theory of Mind Module is queried periodically after discrete events. For the * in the Matrix substrates, this occurred after an interaction. For collaborative cooking, this occurred after a dish was delivered. + +The ToM module consisted of a multi-step process, as depicted in Figure 1 for the * in the Matrix substrates: + +1. Record the observed behavior from the other agent's trajectory $\phi(\tau)$ . Here this refers to whether they played rock, paper, or scissors, the argmax of the inventory (or cooperate/defect in Prisoner's Dilemma). Since the opponent's inventory is never observed, we have to estimate it given the inventory Hypothetical Minds played and the reward it received. Thus, we ask the LLM to estimate the opponent's inventory given this information, and note the output as the empirical opponent's inventory. +2. Evaluate Hypotheses about opponent's strategy. In the previous interaction, the top k hypotheses are used to generate predictions about the opponent's next inventory $\phi(\tau)$ . These argmax of the inventory predictions are compared to the argmax of the empirical opponent's inventory (did they play rock, paper, or scissors). As described in the main text, Hypotheses that led to correct predictions get a positive intrinsic reward and negative otherwise. If a hypothesis is validated, meeting $V_{\mathrm{thr}}$ , then step 3 is skipped and this hypothesis is used for step 4 until the hypothesis falls below the threshold (meaning its not longer making good predictions) +3. Generate new and refine old hypotheses. The LLM is tasked with generating a hypothesis about the other agent's strategy given the entire interaction history (see prompt below for more details). The prompt also includes the top $\mathrm{k}$ hypotheses generated so far if the hypotheses have a value above 0 (meaning at least one correct prediction) such that the LLM can refine previously generated hypotheses. +4. Guess opponent's next goal. The LLM is prompted to guess the opponent's next inventory given a hypothesis and the interaction history. If no hypothesis has yet surpassed $V_{\mathrm{thr}}$ , then guesses are made for the top $k$ hypotheses and the last generated hypothesis. The prediction from the last generated hypothesis would be used to select a counter inventory in the next step. Moreover, all the predictions will be used for step 2 (hypothesis evaluation) after the next interaction. If a hypothesis crosses $V_{\mathrm{thr}}$ , then only it will be used in this step. +5. Select goal to counter opponent. The LLM is prompted to select a counter inventory given the prediction about the opponent's next inventory. Since this step involves straightforward reasoning given the opponent's predicted inventory, it is done simultaneously in the API/LLM call with the previous step. Therefore, the LLM is specifically tasked with outputting both the predicted opponent's next inventory $\phi(\tau)$ and its own goal/target inventory $z$ in a single API/LLM call. + +In RWS Arena, step 4 is done separately than step 5. The LLM is first prompted to guess the next inventory for the opponent they just played. Then in a subsequent step, it is asked again to select which opponents to seek out, and to guess what inventory they will play (this could be a different opponent than the one interacted with in the last round). Therefore, the ToM module can evaluate the hypotheses for each opponent based on the quality of the predictions they make for that particular opponent, and this process is separable from selecting the target inventory in the next interaction (see prompts). + +A similar process occurs for Collaborative Cooking Asymmetric. Step 1 is hardcoded and not LLM dependent; the other agent's actions/behavior $\phi (\tau)$ are labeled by custom code given the observations (abstracting away the problem of action recognition from textual observations). These actions + +include "Teammate picked up a dish", "Teammate put down a dish", "Teammate picked up cooked soup in dish", "Teammate delivered cooked soup", "Teammate picked up a tomato", or nothing. In step 4, the LLM is prompted to guess the teammate's next behavior $\phi(\hat{\tau})$ in natural language. Another LLM instance is used in step 2 to assess whether the prediction was correct or not, prompting the LLM to output True or False, and giving each hypothesis the appropriate intrinsic reward. Step 5 is completed in a separate API call for Collaborative Cooking, and the LLM is prompted: "what strategy do you want to take next and why? Teammate's observed strategy: ". Think step by step about how to adapt to their behavior and maximize all resources and efficiency accordingly." + +# D.4 SUBGOAL MODULE + +The subgoal module is responsible for generating efficient subgoal plans for the agent. Given the high-level strategy and the current state of the game, the module decomposes the strategy into a sequence of subgoals in the form of action function calls to efficiently implement the strategy. The subgoal module uses the LLM to generate these plans as a sequence of action function calls (usually 3-6). The prompt includes the current step of the game, the high-level strategy/target inventory previously decided upon, details about the current observations (including player position, orientation, inventory, observable resource locations, other agent locations), valid movement locations, memory, and instructions about the action functions. + +Action functions for the * in the Matrix substrates: + +- move_to(src_coord, target_coord): Efficiently move agent from source coordinate to target coordinate. +- fire_at(target_coord): Stay around specified coordinate and fire interaction when opponent is spotted to initiate duel. + +Action functions for Collaborative Cooking Asymmetric: + +- move_to(src_coord, target_coord): Efficiently move agent from source coordinate to target coordinate. Only move to valid move_to locations where counters or objects are not present. +- interact(target_coord): Move to and interact with the entity at the target coordinate, such as picking up ingredients or delivering dishes of cooked soup. To place an object on a counter to free your hands, use interact(counter_coord). +- wait(target_coord): Wait for the pot at target_coord to finish cooking. Check the progress of the pots and only use valid locations where pots are present. + +# D.5 ACTION PLANNER + +The action planner turns the sequence of subgoals specified by the subgoal module into a sequence of atomic actions compatible with the Melting Pot environment. These actions include step forward, backward, left, or right, turn left or right, fire zapping beam, and noop. For the move_to (source_coordinates, target_coordinates) function, the $\mathbf{A}^*$ algorithm finds the most efficient path given a set of obstacles. Walls are always considered obstacles, and other resources are conditionally added as obstacles. If a path can be found without picking up another resource, the action planner will return it. However, in many cases the language model picks a target coordinate where other resources cannot be avoided. The action planner will use a priority system in this case, privileging paths where only resources of the same type as the target coordinate will be picked up. The fire_at function returns a sequence of actions to turn towards the opponent and zap them when the agent is within the extent of the zapping beam's range. If the opponent is not in view, then the fire_at function turns the agent continually clockwise until the other agent is found. + +# D.6 SELF-REFLECTION - COLLABORATIVE COOKING + +For Collaborative Cooking Asymmetric, an evaluator and self-reflection mechanism was added as in the Reflexion baseline (Shinn et al., 2024). This was added such that if the agent was making action plans that did not change the state of the world, for example trying to pick up a tomato while holding a dish, these action plans were not repeated with the same state information. By first reflecting on + +whether the previous action plan was successful, the agent was able to make less mistakes over the course of the episode. This additional cognitive module for self-reflection could in principle also be added for the other substrates, but was not necessary for good performance on the * in the matrix games because the state transitions were simpler for LLMs to understand. + +# E BASELINES + +# E.1 REACT + +The ReAct (Yao et al., 2023) agent combines reasoning traces with task-specific actions in an interleaved manner. This approach allows the agent to generate both reasoning steps and actions within the same language model framework. In our context, the reasoning consists of chain of thought reasoning preceding a subgoal plan in the specified format of utilizing action functions. The agent is prompted to think about the other agents' strategies and come up with a subgoal plan accordingly. Thus, ReAct is functionally an ablation of Hypothetical Minds such that there is only a subgoal module and not a theory of mind module. Three example responses are shown as few-shot prompts, consistent with the ReAct framework. + +# E.2 REFLEXION + +Reflexion adds evaluation and self-reflection to the ReAct agent backbone serving as the Actor module. After a subgoal plan is completed, the LLM is queried to evaluate the outcomes of that plan. Outcomes are represented as the reward during the plan, and salient state information pre and post plan. This state information includes the position and the inventory of the agent for the * in the matrix games. For Collaborative Cooking Asymmetric, the given state information included position, what the agent is holding, and the state of the two pots. + +# E.3 PLANREACT + +We include the PlanReAct architecture introduced in (Liu et al., 2023b) as a hierarchical baseline. This model first generates a high-level plan in language and then feeds this plan to a subgoal module that outputs a subgoal plan based on the high-level plan. Thus, the only difference between PlanReAct and Hypothetical Minds is that high-level planning is mediated by the multiple processing steps of the theory of mind module, including hypothesis generation, evaluation, and refinement. + +# E.4 PPO + +We train RL agents in a population of PPO agents (Schulman et al., 2017) on each substrate. The weights are randomly initialized for each agent in the population and weights are not shared. Therefore the agents are not playing against identical copies of themselves and see a greater diversity during training than traditional self-play. Models were trained in PyTorch using the Ray Rlib pipeline and this starter code https://github.com/rstrivedi/Melting-Pot-Contest-2023. Optimal parameters were searched over and the final models were trained for 1e8 steps. + +# E.5 OPRE + +We include the Options as REsponses model (OPRE) introduced in the first version of the Running With Scissors environment (Vezhnevets et al., 2020). OPRE is a hierarchical MARL method where agents learn high-level options as strategic responses to other agents' behaviors. The high-level controller selects options based on observations of other agents, and the low-level controller executes actions conditioned on these options. As this was included as a baseline in the Melting Pot 2.0 paper, we reuse the results reported in that paper (Agapiou et al., 2022). + +# F ABLATION DETAILS + +The Hypothesis Evaluation + Hypothesis Refinement model had a different evaluation procedure than the other models. Rather than computing values based on predicting the opponent's inventory, + +here we use extrinsic reward and counterfactual reward. If a hypothesis is used online for goal selection, then the rewards received in the next interaction can be directly used for evaluating it. For the other considered hypotheses, we simulate counterfactual reward by 1. asking GPT to generate a target inventory given the hypothesis/strategy and the given situation and 2. after the next interaction we ask GPT again to reason about what the reward would have been if it played the inventory from 1. GPT is asked to output, positive, negative, or neutral, which we convert to reward with the $c$ parameter. + +# G PROMPTS + +All prompts can be seen in our code. The most representative prompts are also reproduced below. + +# G.1 RUNNING WITH SCISSORS: ARENA PROMPTS + +# RWS Arena System Message + +You are Agent 0 in the eight player 'running-with-scissors' Melting Pot multiagent reinforcement learning environment that is a $25 \times 24$ (x by y) grid with resources to collect and walls to navigate around. 8 Players can move around the map and collect resources of 3 discrete types corresponding to rock, paper, and scissors strategies - Yellow box = rock - Purple box = paper - Blue box = scissors. Rock/yellow beats scissors/blue, paper/purple beats rock/yellow, and scissors/blue beats paper/purple. + +In addition to movement, the agents have an action to fire an "interaction" beam which initiates a duel with one player getting positive reward and the other agent getting an opposite negative reward according to their inventories. + +All players carry an inventory with the count of resources picked up since last respawn and for each respawn start with an inventory of 1 resource each. This inventory is visible in the state with the key 'inventory'. + +To play a pure strategy strongly, pick up at least 5 resources or more of the color and then fire the interaction beam at another player. To commit less strongly to a strategy, pick up around 3 resources of the color and then fire the interaction beam at another player. + +Usually you will only want to pick up one type of resource before an interaction, in order to gain the most information about the other players' strategies and to not waste time collecting other resources. + +You also want to maximize the number of interactions so after you pick up 4-6 resources, you should seek out a duel to reset your inventory and gain more information about the other players' strategies. + +Your opponents will also almost always only pick up one type of resource before an interaction. + +For example, player0_inventory = [7, 1, 1] (Yellow, Purple, Blue) is a good inventory that will lead to an informative duel, whereas player0_inventory = [2, 2, 2] (Yellow, Purple, Blue) will not be informative. + +Your reward is the result of a matrix multiplication involving your inventory in a vector format, and your opponent's inventory vector, and a payoff matrix similar to rock paper scissors. + +r_t = transpose(your_inventory) * A_payoff * opponent_inventory where A_payoff = np.array([[0, -10, 10], [10, 0, -10], [-10, 10, 0]]) + +The reward usually ranges from (5, -5) depending on the inventories of both players (the min is -10 and max 10, but it is rare to get these magnitudes). Typically $+/-3-5$ is a high magnitude, and a reward near 0 suggests both players played a similar inventory. + +State Description: This environment is partially-observable, you can observe an 11x11 grid around your agent depending on your position and orientation (you can see more in front of you than behind). + +Previously seen states will be represented in memory, but note that these states could potentially be outdated. For example, the other agent could collect a resource that you previously saw. + +Given the partially-observable nature of the environment, you will need to explore the environment appropriately and select goals based on the information you've gathered. + +Also pay attention to your opponents' positions when you see them in order to duel with them and gain information about their strategy. + +To find a specific player, you can first move towards the last known location of the player and then move randomly around the map. + +Hanging around the center of the map and waiting for a player to come to you is not a good strategy for this environment. + +After you gather information about your opponents' strategies, seek out opponents whose strategy you know and can exploit and play a counter-strategy. + +# G.1.1 HYPOTHETICAL MINDS + +# Subgoal Module Message + +# Current State Description: + +- Global Map Size: {map_size} grid (Walls are located at the boundaries of the map and in other places that are invalid for move_to). + +- Valid Locations for move-to: {movableLocations} + +- Player Position: {player-position} + +- Player Orientation: {player-orientation} + +- Player Inventory (yellow, purple, blue): {player_inventory} + +- Egocentric Observations Size: 11x11 grid around your agent. You currently can observe the following based on your position and orientation: + +- Observable Yellow Box Locations (format: $(x, y)$ , distance from current location): {yellowLocations.with_distance} + +- Observable Blue Box Locations: {blueLocations.with_distance} + +- Observable Purple Box Locations: {purpleLocations.with_distance} + +- Observable Opponent Locations: {opponentLocations} + +- Previously seen states from memory (format: $(x, y)$ , step last observed, distance from current location)): {self/memory_states} + +# Execution Outcomes: + +{execution_outcomes} + +Error for extracting and executing actions from the response: + +{get_action_from_response Errors} + +# Rewards: + +{rewards_str} + +# Strategy Request: + +You are at step $\{\mathrm{step}\}$ of the game. + +You have decided to execute a high-level strategy/target inventory in a previous response given what you predicted your opponent will do. + +Select subgoals in order to achieve the strategy, including first achieving a target my_next_inventory: {self.hls_next_inventories}. + +Once you achieve the target inventory, STOP picking up resources and immediately seek out a duel with an opponent close to you that you can exploit based on your hypothesis about their strategy and your current inventory. + +So once you've picked up about 5-7 resources in total, seek out a duel to receive rewards, get more information about strategies, and reset your inventory. + +Here are your hypotheses about each player's strategy: + +{self.opponent_hypotheses} + +If you've generated a hypothesis about a player's strategy, you can use this to inform your strategy about whether to interact with them or not. Each strategy is paired with a value on how well it explains the data observed so far, starting at 0. + +A hypothesis is validated when its value is greater than: {self.good_hypothesis_thr}. + +Your task is to devise efficient action plans for player {self(agent_id}, reason through what the next subgoals should be given the state information. Your response should be broken up into two parts: + +1. Subgoal Plan - based on the current state and the high-level strategy you previously specified above, decompose this strategy into a sequence of subgoals and actions to efficiently implement this strategy. Think step by step about this. This could be fairly long. + +2. Action Plan - output this sequence of actions in the following Python dictionary format, parsable by astliteral.eval() starting with: + +{{ 'action_plan': ['move_to((11, 7), (9, 5))', 'move_to((9, 5), (13, 5))'] }} + +Example response 1, 2, and 3 are formatted similarly, detailing other strategies and actions. + +# ToM Module User Message 1 + +An interaction with another player has occurred at step {step}, {self.interaction_history[self.lastplayed_id][-1]}. + +# What was my opponent's likely inventory in the last round given the inventory I played and the reward received? + +Think step by step about this. First think about what resource you had the most of in your inventory, and then think about which resource would beat that if you received a negative reward of -1 or worse or which resource would lose to yours if you received a positive reward of 1 or more. + +If you received a small magnitude reward near 0 and in between $(-1, 1)$ , then your opponent may have played a similar inventory to you. Then depending on the magnitude of the reward and the number of resources you played, you can infer the opponent's inventory and whether they played that strategy strongly (5+ of that resource) or weakly (3 of that resource). + +An inventory of {'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 1} is not possible because you need at least 2 resources of a type to play a duel. + +Here are some example interactions to help you reason about how the reward function works: + +'your_inventory': {'rock/yellow': 3, 'paper/purple': 1, 'scissors/blue': 1}, 'rewards': -2.285, 'possible_opponent_inventory': {'rock/yellow': 1, 'paper/purple': 5, 'scissors/blue': 1} +'your_inventory': {'rock/yellow': 5, 'paper/purple': 1, 'scissors/blue': 1}, 'rewards': 3.571, 'possible_opponent_inventory': {'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 6} +'your_inventory': {'rock/yellow': 1, 'paper/purple': 4, 'scissors/blue': 1}, 'rewards': 2.0, 'possible_opponent_inventory': {'rock/yellow': 3, 'paper/purple': 1, 'scissors/blue': 1} + +In the 2nd part of your response, output the predicted opponent's inventory in following Python dictionary format, parsable by ast.literal.eval() starting with: 'possible_opponent_inventory': {'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 5} Example output: + +Given that I last played a strong paper strategy with an inventory of {'rock/yellow': 1, 'paper/purple': 5, 'scissors/blue': 1} and received a reward of -3.428, I believe my opponent played a strong scissors strategy. + +The reward suggests that my paper was beaten by their scissors, which means their inventory likely had a higher count of blue/scissors resources. + +A possible inventory for them could be {'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 5} or a similar distribution favoring scissors. + +# ToM Module User Message 2 + +Total Rewards: {rewards_str} + +# Strategy Request: + +An interaction with another player has occurred at step {step}, {selfinteraction_history[self.lastplayed_id][-1]}. + +The total interaction history with this opponent is: {selfinteraction_history[self.last Played_id]}. + +# If self-improvement is a focus: + +Here are your previous hypotheses about the algorithm this opponent is playing: {self.top_hypotheses[self.last Played_id]}. + +What is your opponent's likely policy given the inventories and the reward function? Think step by step about this given the interaction history. + +If your previous hypotheses are useful, you can iterate and refine them to get a better explanation of the data observed so far. + +If a hypothesis already explains the data very well, then repeat the hypothesis in this response. + +They may be playing the same pure policy every time, a complex strategy to counter you, or anything in between. + +They are not necessarily a smart agent that adapts to your strategy, you are just playing an algorithm. + +Are you getting high positive or negative reward when playing the same type of inventory? For example, getting high positive reward every time you play many paper resources. If so, this opponent may be playing a pure strategy and you can exploit this by playing the counter strategy. + +Once you have output a hypothesis about this opponent's strategy with step by step reasoning, you can use the hypothesis to inform your strategy. + +In the 2nd part of your response, summarize your hypothesis in a concise message following Python dictionary format, + +parsable by ast.literal.eval() starting with: 'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 5 + +{'OpponentStrategy': 'I think my opponent is always playing a pure scissors strategy and collecting around 5 blue resources.'} + +# Otherwise: + +What is this opponent's likely policy given the inventories and the reward + +function? Think step by step about this given the interaction history. + +They may be playing the same pure policy every time, a complex strategy to + +counter you, or anything in between. + +They are not necessarily a smart agent that adapts to your strategy. + +Are you getting high positive or negative reward when playing the same type of inventory? For example, getting high positive reward every time you play many + +paper resources. If so, this opponent may be playing a pure strategy and you + +can exploit this by playing the counter strategy. + +Once you have output a hypothesis about this opponent's strategy with step by step reasoning, you can use hypothesis to inform your strategy. + +In the 2nd part of your response, summarize your hypothesis in a concise message following Python dictionary format, parsable by ast.literal.eval() starting with: {'Opponent_strategy': 'I think my opponent is always playing a pure scissors strategy a collecting around 5 blue resources.'} + +You will be prompted again shortly to select subgoals and action plans to execute this strategy that achieves the target inventory, so do not include that in your response yet right now. + +# ToM Module User Message 3 + +```txt +An interaction with self.lastplayed_id has occurred at step {step}, The total interaction history with {self.lastplayed_id{ is: You previously made the following guess about this player's strategy: Think step by step and predict what this opponent will play the next time you interact with them. Given the above mentioned guess about the opponent's policy/strategy, and the last inventory you played (if their strategy is adaptive, it may not be), what is their likely inventory in the next round. In the 2nd part of your response, output the predicted opponent's next inventory in following Python dictionary format, parsable by `ast.literal.eval()` starting with `\"python. Example response 1: 'Opponent_next_inventory': Given that my opponent is playing a rock policy, I believe their next inventory will be inventory={'rock/yellow': 5, 'paper/purple': 1, 'scissors/blue': 1}. `\"python{ predicted_opponent_next_inventory': {'rock/yellow': 5, 'paper/purple': 1, 'scissors/blue': 1}``Example response 2: 'Opponent_next_inventory': Since my guess is that this player is playing a scissors policy, I predict that their next inventory will be{'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 5}. `\"python{ 'predicted_opponent_next_inventory': {'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 5}``Example response 3: 'Opponent_next_inventory': Since my opponent is following a paper strategy, I predict their upcoming inventory will be inventory={'rock/yellow': 1, 'paper/purple': 5, 'scissors/blue': 1}. `\"python{ 'predicted_opponent_next_inventory': {'rock/yellow': 1, 'paper/purple': 5, 'scissors/blue': 1} +``` + +# ToM Module User Message 4 + +An interaction with self.last Played_id has occurred at step {step}, The total interaction history with self.last Played_id is: The total interaction history overall is: . You previously made the following guesses about all the other players' strategies: possible_opponent_strategy. High-level strategy Request: Provide the next high-level strategy for your player self(agent_id. This response should include step by step reasoning in parts 1-3 about which strategy to select based on the entire interaction history in the following format: 1. 'Opponents_toSeekout': Given the hypotheses about your opponent's strategies and their values, which players should you seek out to duel with next and why? If possible, select opponents you have a good hypothesis about so you can exploit it and maximize your reward. Try to select multiple players if possible as one player might be hard to find or isRespawning. Are you noticing any patterns across the population as a whole? 2. 'Opponent_next_inventory': Given the above mentioned guess about the opponent's policy/strategy what is their likely inventory in the next round. 3. My_next_inventory': Given the opponent's likely inventory in the next round, what should your next inventory be to counter this? 4. In the 4th part of your response, output the opponent to seekout, the predicted opponent's next inventory, and your next inventory in following Python dictionary format, parsable by 'astliteral.eval() starting withpython. Example response 1: 1. 'Opponent_toSeekout': Given that I am fairly certain that player_1 and player_5 is playing a rock policy, I believe I should seek out either player_1 or player_5 to duel with next. 2. 'Opponent_next_inventory': Given that these opponents are playing a rock policy, I believe their next inventory will be something like inventory={'rock/yellow': 5, 'paper/purple': 1, 'scissors/blue': 1}. 3. My_next_inventory': Given that these players are playing a rock policy, I believe my next inventory should be a paper policy inventory={'rock/yellow': 1, 'paper/purple': 5, 'scissors/blue': 1}. 'python { 'opponents_toSeekout': ['player_1', 'player_5'], predicted_opponent_next_inventory': {'rock/yellow': 5, 'paper/purple': 1, 'scissors/blue': 1} 'my_next_inventory': Considering all the interactions, player_2, player_3, and player_5 seem to heavily favor the scissors/blue strategy with consistent picks. Engaging either of these players could offer a high reward opportunity. 2. 'Opponent_next_inventory': Based on the observed behavior of player_2, player_3, and player_5, it is likely they will continue with a strong scissors/blue strategy, potentially having an inventory of{'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 5}. 3. My_next_inventory': To effectively counter the scissors/blue strategy, my optimal approach would be to adopt a rock/yellow strategy. An inventory geared towards this would be{'rock/yellow': 5, 'paper/purple': 1, 'scissors/blue': 1}. 'python { 'opponents_toSeekout': ['player_2', 'player_3', 'player_5'], 'predicted-opponent_next_inventory': {'rock/yellow': 1, 'paper/purple': 1, 'scissors/blue': 1} + +# G.2 RUNNING WITH SCISSORS: REPEATED + +The prompts for Running with Scissors Repeated remain very similar as Running with Scissors: Arena with the modification of the prompts being in a 2 player setting. + +# G.3 PRISONER'S DILEMMA: REPEATED + +# System Message + +You are Agent {self(agent_id} in the two player 'prisoner_dilemma_in_the_matrix' Melting Pot multiagent reinforcement learning environment that is an $23 \times 15$ (x by y) grid with resources to collect and walls to navigate around. Your goal is to maximize reward. Players can move around the map and collect resources of 2 discrete types corresponding to cooperate and defect strategies - Green box = cooperate - Red box = defect. You and another agent will collect resources and compare inventories in an encounter in repeated rounds. In addition to movement, the agents have an action to fire an "interaction" beam which initiates a duel to compare inventories and distribute rewards. All players carry an inventory with the count of resources picked up since last respawn and for each respawn start with an inventory of 1 resource each. This inventory is visible in the state with the key 'inventory'. Here is how the payoff matrix in the generic prisoner dilemma works: + +- If both players cooperate, they both receive a reward of around 3, +- If one player cooperates and the other defects, the defector receives a reward of around 5 and the cooperator receives a reward of around 0, +- If both players defect, they both receive a reward of around 1. + +The nuance of 'prisoner-dilemma.in_the_matrix...repeated' is that the rewards are using the payoff rules of the classic prisoner dilemma, but the interaction is repeated and the rewards are distributed based on the inventory of resources collected by each player. + +- If both agents cooperate, the one with more cooperate resources will receive a reward lower than the one with less cooperate resources, +- If one agent cooperates and the other defects, the more defect resources the defector has, the higher the reward for the defector, +- If both agents defect, the one with more defect resources will receive a higher reward than the one with less defect resources. + +Your goal before each interaction is to try and infer what the other player will play and how their strategy over time is affected by your plays. You will only want to pick up one type of resource before an interaction. For example, the inventories {'cooperate/green': 1, 'defect/red': 1} and {'cooperate/green': 3, 'defect/red': 3} will both result in the same reward, so don't waste time collecting more than you need. Player 1 will also always only pick up one type of resource before an interaction. To play a strategy strongly, pick up at least 6 resources or more of only one color and then fire the interaction beam at the other player. To commit less strongly to a strategy, pick up around 2 resources of only one color and then fire the interaction beam at the other player. State Description: This environment is partially-observable, you can observe a 5x5 grid around your agent depending on your position and orientation (you can see more in front of you than behind). Previously seen states will be represented in memory, but note that these states could potentially be outdated. For example, the other agent could collect a resource that you previously saw. Given the partially-observable nature of the environment, you will need to explore the environment appropriately and select goals based on the information you've gathered. Also pay attention to Player 1's position when you see it in order to duel with them and gain information about their strategy. Your goal is to maximize reward attained over an entire episode, so keep in mind the long-term consequences of your actions. Look at events in a gestalt manner. + +# G.4 COLLABORATIVE COOKING PROMPTS + +# System Message for Collaborative Cooking Asymmetric + +You are Player {self(agent_id} in the Collaborative Cooking Asymmetric environment, the goal is to cook and deliver tomato soup dishes with a partner. The environment consists of a kitchen with a tomato dispenser, pots, delivery locations, and dish dispensers. Each agent (of 2) has access to specific parts of the kitchen and can perform actions like picking up ingredients, putting soup in a dish, and delivering cooked soup dishes. There is an impassable barrier in the middle of the kitchen that separates the agents' sides at $x = 4$ , where the pots are located. The goal is to work together with the other agent to efficiently cook and serve as many dishes of tomato soup as possible to maximize the collective reward. However, communication is not possible, so you must infer your partner's strategy from their actions and adapt accordingly to coordinate tasks. To cook tomato soup, 1. put 3 tomatoes in a pot, 2. pick up a dish when it is finished cooking, 3. put the cooked soup in a dish, and 4. deliver it to the delivery location. Your team receives a reward of 20 for each successfully delivered dish. Only interact with objects on your side of the kitchen. You can only hold one tomato at once. You cannot pick up a tomato from the tomato dispenser with another item like a dish in your hand. You need to pick up a dish before you pick up cooked soup from a pot. The environment is partially observable, and you can only see a 5x5 grid around your agent. You will be prompted at different points to provide high-level strategies and lower-level action plans to achieve them. Use these three functions for lower-level action plans: + +- move_to(src_coord, target_coord): Efficiently move agent from source coordinate to target coordinate. Only move to valid move_to locations where counters or objects are not present. Use sparingly. +- interact(target_coord): Move to and interact with the entity at the target coordinate, such as picking up ingredients or delivering dishes of cooked soup. To place an object down on a counter to free your hands, use interact(counter_coord). Mostly use this function. +- wait(target_coord): Wait for the pot at target_coord to finish cooking. Check the progress of the pots and only use valid locations where pots are present. You probably only want to use this when both pots are full to maximize efficiency. + +Most of the time you will just want to use the interact function because it both moves to and interacts with objects, therefore all the cooking steps can be completed with the interact function. To put down an item to pick something else up, interact with a counter to free your hands. Do not put down items on the floor or the delivery location. + +# G.4.1 HYPOTHETICAL MINDS + +# High Level Strategy Message (in ToM Module of HM) for Collaborative Cooking Asymmetric + +# Strategy Request: + +You are at step $\{\mathrm{step}\}$ of the game. + +Provide a strategy for agent $\{\mathrm{self}.{agent\_id}\}$ + +Your response should outline a high-level strategy - what strategy do you want to take next and why? + +Teammate's observed strategy: {self.teammate_strategy} + +Think step by step about how to adapt to their behavior and maximize all resources and efficiency accordingly. + +This response will be shown to you in the future in order for you to select lower-level actions to implement this strategy. + +Example response: + +High-level strategy: I want to focus on cooking tomato soup dishes. + +You will be prompted again shortly to select subgoals and action plans to execute this strategy, so do not include that in your response yet. + +# Subgoal Module Message + +# Strategy Request: + +```txt +You are at step {step} of the game. +Your task is to devise efficient action plans for agent +{self(agent_id}, reason through what the next subgoals should be given the state information. +Your previously specified high-level strategy is: +{self.my_strategy} +Your response should be broken up into two parts: +``` + +```txt +1. Subgoal Plan - Based on the current state and the high-level strategy you previously specified, decompose this strategy into a sequence of subgoals and actions to efficiently implement this strategy. For every subgoal, think step by step about the best action function and parameter to use for that function. This could be fairly long. +``` + +```python +2. Action Plan - Output this sequence of actions in the following Python dictionary format, parsable by ast.literal.eval() starting with: {{ 'action_plan': ['interact((5, 1))'] }} +``` + +```txt +Example response 1: Subgoal Plan: Given the current state and my high-level strategy to focus on cooking tomato soup dishes, I should: Move to the tomato dispenser and pick up a tomato. +``` + +```twig +{{ 'action_plan': ['interact((5, 1))'] }} +Example response 2: +Subgoal Plan: Given the current state and my high-level strategy to focus on delivering tomato soup dishes, I should: +Move to the dish dispenser and pick up a dish, then plate the cooked soup. +``` + +```txt +{{ 'action_plan': ['interact((3, 4))', 'interact((4, 2))'] }} +``` + +```txt +Example response 3: Subgoal Plan: Next I should move to the delivery location and deliver the cooked soup. +``` + +```twig +{{ 'action_plan': ['interact((3, 1))'] }} +``` + +# Evaluate Action Outcomes/Self-Reflection + +# User Message Preamble: + +# If subgoal failed: + +You are an action plan evaluator. + +The last subgoal included an interact action that failed. + +Your task is to look at the subgoal the agent took, the state of the environment before and after the subgoal, + +and evaluate why the subgoal was unsuccessful and provide feedback about what the agent should do next time. + +We will next plan an entire new action plan, so suggest specific action plans and action functions to use next when applicable. + +# If subgoal succeeded: + +You are an action plan evaluator. + +Your task is to look at the action plan the agent took, the state of the environment before the plan and the state of the environment after the plan, + +and evaluate whether the action plan was successful, and if not, provide feedback about what failed and what the agent should do next time. + +Take into account that your teammate could have influenced the outcome of the subgoal in some circumstances. + +Suggest specific action plans and action functions to use next when applicable. + +# Infer Teammate Strategy Message + +# User Message: + +Based on the observed actions of your teammate (player_1), what do you think their strategy is? + +Are they specializing in any specific activity or subtask? + +Teammate's observed actions: {self.teammate ACTIONS} + +Here are your previous hypotheses about the strategy your partner is playing: {self.top_hypotheses}. + +Think step by step and provide an analysis of their strategy, any specialization you infer from their behavior, and their competence. + +Then analyze how you can adapt your strategy to maximize efficiency and coordination with your teammate. + +Remember communication is not allowed. + +# Predict Teammate Behavior Message + +```twig +A dish has been delivered at step {step}. +You previously guessed that your teammate's (player.1) policy is: +{possible TEAMmateStrategy} +Based on the proposed hypothesis about your teammate (player.1), +what do you think they will do next? +Output a concise label about your teammate's next behavior in the +following Python dictionary format, parsable by ast.literalize() starting with: +python +{{ 'predicted_next_behavior': 'placing tomatoes into pot $(4,2)$ }} +``` + +# Evaluate Predicted Behavior + +```txt +A dish has been delivered at step {step}. +You previously guessed that your teammate's (player_1) would perform this behavior in this round: {predicted_next_behavior} +Here is the observed behavior of your teammate (player_1) in this round: {latest TEAMMATE ACTIONS} +Did your prediction match the observed behavior? Concisely output True or False in the below Python dictionary format, parsable by ast.literal_eval() starting with: {{ 'evaluate_predicted_behavior': True }} +``` \ No newline at end of file diff --git a/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/images.zip b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6e1c3cea9352e807a0c14fe1af4f7c0ee8afc941 --- /dev/null +++ b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2dfd62059621b8295ff8f9d281cb2ce2716c56cea73fb73ed6e2aba03b51465d +size 863414 diff --git a/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/layout.json b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..740b74bb1a4460228020b7bf5173ebf039b1b32e --- /dev/null +++ b/ICLR/2025/Hypothetical Minds_ Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:446271cb426fa94014b4529366c07ecd2db2227d14fd9cbf269c9e1e99e8c1e2 +size 907328 diff --git a/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_content_list.json b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5fe93ce4ea6d37abd918bff847154d892f866180 --- /dev/null +++ b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:870625593d6b1ac0eabf7bef33ca017560da76eebe7981db75f78831a0d8c3a9 +size 125921 diff --git a/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_model.json b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..75be0d6150c537e596f2e8751d98d00910c8f9ec --- /dev/null +++ b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39b1d51c38288df7694b567602c7531a5075444eb040b068c8e807f645158680 +size 151611 diff --git a/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_origin.pdf b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d502f6e79c49436ab0b8c9673e4024ff148d58b2 --- /dev/null +++ b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/83ee51e9-885a-4be5-b24f-535464df8c7f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c42dabc2ba54affb50695de798c04721a75c4a54d9b791eddd8307d5de4917a +size 1778264 diff --git a/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/full.md b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e7f8870d0dca14714e969d86715e235b6fbd245d --- /dev/null +++ b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/full.md @@ -0,0 +1,476 @@ +# I CAN HEAR YOU: SELECTIVE ROBUST TRAINING FOR DEEPFAKE AUDIO DETECTION + +Zirui Zhang $^{1}$ , Wei Hao $^{1}$ , Aroon Sankoh $^{2}$ , William Lin $^{3}$ , Emanuel Mendiola Ortiz $^{4}$ , Junfeng Yang $^{1}$ , Chengzhi Mao $^{5}$ + +1Columbia University, 2Washington University in St. Louis, +$^{3}$ New York University, $^{4}$ Pennsylvania State University, $^{5}$ Rutgers University + +{zz3093, wh2473} @columbia.edu, a.j.sankoh@wustl.edu, wl2612@nyu.edu, emo5318@psu.edu, junfeng@cs.columbia.edu, cm1838@rutgers.edu + +# ABSTRACT + +Recent advances in AI-generated voices have intensified the challenge of detecting deepfake audio, posing further risks for the spread of scams and disinformation. To tackle this issue, we establish a large scale public voice dataset DeepFakeVox-HQ, comprising 1.3 million samples, including 270,000 high-quality deepfake samples from 14 diverse sources. Despite previously reported high accuracy, existing deepfake voice detectors struggle with our diversely collected dataset, and their detection success rates drop even further under realistic corruptions and adversarial attacks. We conduct a holistic investigation into factors that enhance model robustness and show that incorporating a diversified set of voice augmentations is beneficial. Moreover, we find that the best detection models often rely on high-frequency features, which are imperceptible to humans and can be easily manipulated by an attacker. To address this, we propose the F-SAT: Frequency-Selective Adversarial Training method focusing on high-frequency components. Empirical results demonstrate that our training dataset boosts baseline model performance (without robust training) by $33\%$ , and our robust training further improves accuracy by $7.7\%$ on clean samples and by $29.3\%$ on corrupted and attacked samples, over the state-of-the-art RawNet3 model. + +# 1 INTRODUCTION + +AI-generated voices have become increasingly realistic due to larger datasets and enhanced model capacities (Ju et al., 2024; Neekhara et al., 2024), and they have been used in many important applications (Calahorra-Candao & Martinde Hoyos, 2024). However, the success of AI-synthesized human voices poses significant security risks, including deepfake voice fraud and scams (Tak et al., 2021; Sun et al., 2023; Yang et al., 2024). A recent CNN report reveals a fraud in Hong Kong where a finance worker sent $25 million to scammers after a video call with a deepfake 'chief financial + +![](images/d9251910f827548230f56a3e81a507fd8e1c9c82d4b8dda8b0953dd78053027e.jpg) +Figure 1: The distribution of deepfake samples over predicted scores using the state-of-the-art detector (Jung et al., 2022) trained on the In-the-Wild dataset (Müller et al., 2022), with a decision boundary at 0.5. Tests on original, corrupted, attacked, and real-world deepfake audio reveal significant shifts in prediction scores, highlighting that training solely on current public datasets without robust training methods leads to poor performance. + +officer'. The voice was created by an AI model, highlighting the risk of such technology. + +Due to the importance of this problem, a number of work has investigated detecting AI-generated audio. Despite previously reported high detection accuracy on public datasets (Todisco et al., 2019; + +![](images/a30bdf02ac16692065ff12bacc72cf68f77bd6dd5abb9e79ae5c9fed30ba10b7.jpg) +Figure 2: We apply a high-pass filter to audio samples to remove low-frequency components. The x-axis represents the center frequency of the filter applied. Notably, there is a marked decline for RawNet3 Model in detection performance for real audio starting at $4000\mathrm{Hz}$ and for fake audio at $6000\mathrm{Hz}$ , suggesting that existing audio models often rely on high frequency signals for prediction. + +Frank & Schonherr, 2021), existing deepfake voice detectors perform poorly under real-world conditions (Xu et al., 2020; Müller et al., 2022; Radford et al., 2023). This is because the established benchmarks are often trivial, small, outdated, and homogeneous. Consequently, models trained and validated solely on these datasets fail to generalize to more diverse and challenging real-world deepfake samples. Moreover, deep learning models for audio are particularly vulnerable to adversarial attacks (Szegedy et al., 2013) (Zhang et al., 2019), where an attacker can subtly alter audio inputs in ways that are imperceptible to humans but mislead models into incorrect classifications. Figure 1 illustrates a dramatic shift in the models' prediction scores when exposed to these factors, underscoring the need for more robust training methodologies. + +To address the above limitations, we first created the largest deepfake audio dataset to date, DeepFakeVox-HQ, including 270,000 high-quality deepfake samples from 14 diverse and distinct origins. We show that simply training on our collected dataset can produce new state-of-the-art models. + +Moreover, we find that even the state-of-the-art AI-voice detection model (RawNet3) often depend on high-frequency features to make decisions (see Figure 2), which are imperceptible to humans. On the other hand, the low frequency signals can be heard by humans but are not relied on by the model to make predictions. As a result, natural corruptions in high frequency or attackers can easily manipulate the model by changing the high frequency signals, reducing the detection's robustness. + +In an initial study, we observed that standard adversarial training on raw waveforms not only fails to bolster robustness but also diminishes performance on unattacked data. To address these shortcomings, we propose Frequency-Selective Adversarial Training (F-SAT), which focuses on high-frequency components. Since our adversarial training is targeted, we can mitigate specific vulnerabilities without touching the true features at lower frequencies, thus enhancing the model's resilience to corruptions and attacks while maintaining high accuracy on clean data. + +Visualizations and empirical experiments demonstrate that using only our training dataset, we can produce state-of-the-art models, achieving a $33\%$ improvement on the out-of-distribution portion of our test set, which includes 1,000 deepfake samples from the top five AI voice synthesis companies and 600 samples from social media. Additionally, by incorporating random audio augmentations, our model achieves the highest accuracy across 24 different types of corruptions. Furthermore, after applying F-SAT, our model further achieves a $30.4\%$ improvement against adversarial attacks in the frequency domain and an $18.3\%$ improvement against unseen attacks targeting raw waveform data in the time domain. + +# 2 RELATED WORK + +AI-synthesized human voice: AI voice synthesis generally falls into two categories: text-to-speech (TTS) and voice conversion (VC). TTS systems convert written text into spoken audio using a desired voice. This process typically involves three main components: a text analysis module that transforms text into linguistic features, an acoustic model that converts these features into a mel + +
Dataset#Real Utt#Fake UttLanguageConditionsYear#Fake SourceFake Type
ASVspoof1912k109kEnglishClean201917TTS, VC
ASVspoof2122k589kEnglishClean, Noisy2021UNKTTS, VC
WavFake14k90kEnglish, JapaneseClean20217TTS
ADD202261k251kChineseClean2022UNKTTS, VC
In-The-Wild20k12kEnglishClean, Noisy202219TTS
LibriSeVoc13k79kEnglishClean20236TTS
Our Train690k640kEnglishClean, Noisy202440TTS, VC
Our Test3k3kEnglishClean, Noisy202415TTS, VC
+ +Table 1: Comparison of Deepfake Audio Datasets + +spectrogram, and a vocoder. Some of the leading TTS models include StyleTTS (Li et al., 2024), VoiceCraft (Peng et al., 2024), XTTS (Casanova et al., 2024), and Tortoise-TTS (Betker, 2023), and are known for their ability to produce high-quality audio that closely mimics real human speech. + +VC models, in contrast, take an audio sample from one person and transform it to sound like another person for the same speech content. Recent VC approaches primarily operate within the mel-spectrum domain (Ju et al., 2024; Shen et al., 2023; Popov et al., 2021), using deep neural networks to shift the mel-spectrograms from the source to the target voice. + +Detection Method: AI deepfake detection models based on deep learning can be grouped into two main categories: those processing raw audio end-to-end and those analyzing spectrum. The first category includes models like RawNet2, which employs Sinc-Layers (Ravanelli & Bengio, 2018) to extract features directly from waveforms, and RawGAT-ST, which utilizes spectral and temporal sub-graphs (Tak et al., 2021). RawNet3 (Jung et al., 2022), which begins by using parameterized filterbanks (Zeghidour et al., 2018) to extract a time-frequency representation from the raw waveform and then is followed by three backbone blocks with residual connections, a structural approach that sets it apart from ECAPA-TDNN (Desplanques et al., 2020). These models process the audio data in its raw form to capture nuanced details directly impacting model performance. + +The second category of AI deepfake detection models involves transforming raw audio into spectrograms for analysis. This process utilizes extracted features such as Mel Frequency Cepstral Coefficients (MFCCs) (Sahidullah & Saha, 2012), Constant Q Cepstral Coefficients (CQCCs) (Todisco et al., 2017), bit-rate (Borzi et al., 2022). The analysis of these features is conducted using traditional machine learning methods like Gaussian Mixture Models (GMMs) (Todisco et al., 2019) or advanced neural networks such as Bidirectional Long Short-Term Memory (Bi-LSTM) (Akdeniz & Becerikli, 2021), ResNet (Alzantot et al., 2019), and Transformers (Zhang et al., 2021). These methods enable deeper and more intricate pattern recognition, enhancing the model's ability to identify and classify deepfake audio accurately. + +Adversarial Attack: Neural networks are highly vulnerable to nearly imperceptible perturbations, known as adversarial attacks (Szegedy et al., 2013). Although initial studies focused on image models, speech tasks are similarly susceptible. Notably, adversarial attacks generated on spectrograms can deceive 2D CNN models and, when converted back to waveforms, can also effectively fool 1D CNN models (Koerich et al., 2020). + +Adversarial training, initially developed for image processing systems (Madry et al., 2017; Mao et al., 2019), has been increasingly adapted to the audio domain (Chen et al., 2023), particularly to enhance the robustness of applications such as Automatic Speech Recognition (ASR) and speaker verification systems. Another defense method, smoothing, based on additive noise masking, has demonstrated great improvements in model robustness for these tasks (Olivier et al., 2021; Cohen et al., 2019). Additionally, a defensive strategy that employs diffusion models to counter adversarial audio attacks (Wu et al., 2023) effectively smoothes out perturbations and prevents attackers from altering audio signals without significantly compromising signal quality. + +While these techniques enhance robustness, they hurt the detection on unattacked audio, highlighting a trade-off between robustness and accuracy (Zhang et al., 2019; Tsipras et al., 2018). This compromise is particularly critical in scenarios that demand high accuracy and user satisfaction. Furthermore, the generalizability of adversarially trained models to new and unseen attacks remains limited (Rajaratnam et al., 2018), raising questions about their effectiveness in rapidly evolving threat environments. + +# 3 DEEPFAKEVOX-HQ + +# 3.1 TRAINING DATASET + +In this section, we introduce a new training dataset and a rigorous test set. In contrast to prior dataset, our dataset is large, diversified, realistic, and up-to-date, as shown in Table 1. Prior detectors show poor generalization capabilities in realistic settings, as shown in Figure 8. Both our training and testing datasets integrate the latest advancements in AI voice synthesis technologies. Additionally, the testing dataset includes several new models not covered in the training dataset, specifically designed to test the generalization ability of our detection systems. + +High quality deepfake samples: The limitations of existing public datasets, which often lack high-quality deepfake samples, can potentially impair model performance. To address this, we have investigated more than 30 recent advancements in Text-to-Speech (TTS) and Voice Conversion (VC) models developed in the past few years. Our training dataset now includes deepfake audio samples generated using the top seven TTS models: MetaVoice-1B (Liu et al., 2021), StyleTTS-v2 (Li et al., 2024), VoiceCraft (Peng et al., 2024), WhisperSpeech (Radford et al., 2023), VokanTTS, XTTS-v2 (Casanova et al., 2024), and Elevenlabs. We use four datasets—VCTK (Yamagishi, 2012), LibriSpeech (Panayotov et al., 2015), In-The-Wilds (Müller et al., 2022), and AudioSet (Gemmke et al., 2017)—to generate deepfake audio. These datasets include both clean, high-quality and noisy, low-quality real audio, ensuring that the deepfake audio produced is highly diverse and accurately reflects real-world conditions. + +Reference data: For both fake and real audio, having only high-quality samples is insufficient. A broader diversity of samples is essential for the training dataset. Thus, for real audio, we utilize portions from six public audio datasets: VCTK, LibriSpeech, AudioSet, ASRspoof2019 (Todisco et al., 2019), Voxceleb1 (Nagrani et al., 2017), and ASRspoof2021 (Liu et al., 2023), with half consisting of clean audio and the other half of noisy audio. For fake audio, we include two low-quality fake audio datasets: WaveFake (Frank & Schonherr, 2021) and ASRspoof2019 to further enhance the diversity of the training material. + +# 3.2 TESTING DATASET + +Our test dataset comprises approximately 6,000 samples, with an equal balance between real and fake audio. All data used is legally permissible, as detailed in Section A.1, where we discuss the sources and usage policies in further detail. + +Real audio samples are sourced from recent celebrity speeches and conversational videos. For the fake audio, we not only utilize samples created using the seven latest TTS models but have also expanded our dataset to include contributions from eight of the most advanced AI voice synthesis models or commercial software currently available, namely CosyVoice (Du et al., 2024), resemble, Speechify, LOVO AI, Artist, and Lipsynthesis. Additionally, this set includes fake audio directly collected from social media platforms like YouTube and X, further enriching the dataset with a diverse range of real-world scenarios. This comprehensive composition is strategically designed to rigorously test the generalization capabilities of our model. + +Insight: Figure 8 shows that training with previous public datasets yields lower accuracy on ours. Additionally, removing high-quality deepfake samples from our training set significantly also reduces accuracy, highlighting their importance." + +# 4 METHOD + +In this section, we present our selective adversarial training approach, F-SAT. We also present a taxonomy of the most common corruptions and attacks in audio processing, which can be used for robust evaluation in realistic settings. Additionally, we discuss the implementation of Rand-Augmentation for audio to further enhance the robustness of our detection system. + +![](images/b94ea5ea1beaa6b7197f72b89957cc351670925ebe698f336f5d887c96fccc1b.jpg) +Figure 3: F-SAT Pipeline + +# 4.1 F-SAT: FREQUENCY-SELECTIVE ADVERSARIAL TRAINING + +Let $\mathbf{x}$ be a waveform input audio, and $\mathbf{y}$ be its ground-truth category label. To perform classification, neural networks commonly learn to predict the category $\hat{\mathbf{y}} = \mathcal{F}_{\theta}(\mathbf{x})$ by optimizing the cross-entropy $H(\hat{\mathbf{y}},\mathbf{y})$ between the predictions and the ground truth. We use RawNet3 (Jung et al., 2022) that can process waveform audio input. The network parameters $\theta$ are estimated by minimizing the expected value of the objective: + +$$ +\mathcal {L} _ {c} (\mathbf {x}, \mathbf {y}) = H (F _ {\theta} (\mathbf {x}), \mathbf {y}), +$$ + +Time domain Attack: Adversarial attacks on audio can be directly added to the waveform. Let the additive perturbations be $\delta$ . For attacks in the time domain, we directly add $\delta$ to the waveform $\mathbf{x}$ . Due to the huge amount of freedom of the attack vector $\delta$ , the added attack vectors are often high frequency. We formulate this attack as: $\mathbf{x}' = \mathbf{x} + \delta$ . + +Frequency Domain Attack: Attacks can also be applied in the frequency domain, accessed through a reversible Fourier transformation of the waveform. We transform the waveform $\mathbf{x}$ to the frequency domain $\mathbf{X}$ using the Short-Time Fourier Transform (STFT). The attack modifies $\mathbf{X}$ by adding $\delta$ , yielding $\mathbf{X}' = \bar{\mathbf{X}} + \delta$ . The Inverse Short-Time Fourier Transform (ISTFT) then reverts $\mathbf{X}'$ back to the time domain, creating the manipulated audio waveform $\mathbf{x}'$ . + +Frequency-Selective Attack: Compared to time-domain attacks, frequency-domain attacks provide an inductive bias that enables the crafting of more controlled perturbations, such as those within a restricted bandwidth. Building on this, we introduce a Frequency-Selective Attack that targets specific frequency ranges within the magnitude component of a waveform. We define this attack as + +$$ +\mathbf {x} ^ {\prime} = s \left(\mathbf {x}, \boldsymbol {\delta}, f _ {l}, f _ {u}\right) +$$ + +where $f_{l}$ and $f_{u}$ represent the lower and upper frequency boundaries of the range where the attack is to be applied. The procedure can be described as follows: + +Starting with STFT result $\mathbf{X}$ , we first compute its magnitude component $\mathbf{X}_{\rho}$ and phase component $\mathbf{X}_{\phi}$ . To map the frequency range to the index range of the STFT spectrum, we calculate the lower and upper boundary indices $r_{l}$ and $r_{u}$ of the FFT spectrum using formulas: + +$$ +r _ {l} = \left\lfloor \frac {f _ {l} \times n _ {\mathrm {f f t}}}{s r} \right\rfloor , \quad r _ {u} = \left\lceil \frac {f _ {u} \times n _ {\mathrm {f f t}}}{s r} \right\rceil , +$$ + +where $n_{\mathrm{fft}}$ is the number of FFT points, and $sr$ is the sampling rate of the original signal $\mathbf{x}$ . We then define a mask function $M$ using a diagonal matrix $\mathbf{D}$ such that + +$$ +\mathbf {D} _ {k k} = \left\{ \begin{array}{l l} 1 & \text {i f} r _ {l} \leq k \leq r _ {u} \\ 0 & \text {o t h e r w i s e} \end{array} \right. +$$ + +This matrix $\mathbf{D}$ selectively targets the desired frequency components within the specified range $[r_l, r_u]$ for perturbation. The selective perturbation is then defined as: + +$$ +\boldsymbol {\delta} _ {s} = M (\boldsymbol {\delta}, r _ {l}, r _ {u}) = \mathbf {D} \cdot \boldsymbol {\delta}. +$$ + +By adding this perturbation $\delta_{s}$ to the magnitude component of the spectrogram, the perturbed spectrogram can be represented as: + +$$ +\mathbf {X} ^ {\prime} = \left(\mathbf {X} _ {\rho} + \boldsymbol {\delta} _ {\mathbf {s}}\right) \cdot e ^ {j \mathbf {X} _ {\phi}} = \left(\mathbf {X} _ {\rho} + \mathbf {D} \cdot \boldsymbol {\delta}\right) \cdot e ^ {j \mathbf {X} _ {\phi}} +$$ + +Finally, we employ the ISTFT to convert the attacked spectrogram $\mathbf{X}'$ back into the time-domain signal $\mathbf{x}'$ , thus generating the attacked audio waveform $\mathbf{x}'$ . + +Moreover, attackers design these worst-case perturbations to disrupt a trained network $\mathcal{F}_{\theta}$ , aiming to maximize misclassifications by optimizing the objective: + +$$ +\mathbf {x} ^ {\prime} = \arg \max _ {\mathbf {x} ^ {\prime}} \mathcal {L} _ {c} (\mathbf {x} ^ {\prime}, \mathbf {y}), \quad \mathrm {s . t .} \quad \| \mathbf {x} ^ {\prime} - \mathbf {x} \| _ {q} < \epsilon , +$$ + +where the perturbation $\delta = \mathbf{x}' - \mathbf{x}$ is constrained by the $q$ norm to be less than $\epsilon$ , ensuring minimal deviation. + +F-SAT: Based on the Frequency-Selective Attack, we propose F-SAT, an adversarial training method which optimizes perturbations in the frequency domain by targeting the magnitude component within specific frequency ranges. + +$$ +\mathbf {x} _ {n + 1} ^ {\prime} = \Pi_ {\mathbf {x} + S} \left(x _ {n} ^ {\prime} + \alpha \cdot M \Big (\mathrm {s g n} \big (\nabla_ {\mathbf {x} ^ {\prime}} \mathcal {L} (s (\mathbf {x}, \pmb {\delta}, f _ {l}, f _ {u}), y) \big), f _ {u}, f _ {l} \Big)\right), +$$ + +where $\Pi_{\mathbf{x} + S}$ represents the projection onto the allowable perturbation set $S$ , defined by the condition $\| \mathbf{x}' - \mathbf{x}\|_p \leq \epsilon$ . The parameter $\alpha$ denotes the step size of the update, and $\nabla_{\mathbf{x}'}\mathcal{L}$ is the gradient of the loss function with respect to the perturbed input $\mathbf{x}'$ . + +As illustrated in Figure 3, after $K$ iterations (where $n \geq K$ ), we feed the most perturbed sample back into the detection model and calculate the cross-entropy loss between it and the ground truth label: + +$$ +\mathcal {L} _ {\text {r o b u s t}} \left(\mathbf {x} ^ {\prime}, \mathbf {y}\right) = H \left(F _ {\theta} \left(\mathbf {x} ^ {\prime}\right), \mathbf {y}\right), +$$ + +Additionally, to maintain a balance between accuracy on original and attacked samples, we train the model using both the original and perturbed samples. We introduce a parameter $\gamma$ to control the trade-off between clean loss and robust loss. The clean loss is defined as: + +$$ +\mathcal {L} _ {\text {c l e a n}} (\mathbf {x}, \mathbf {y}) = H (F _ {\theta} (\mathbf {x}), \mathbf {y}), +$$ + +The total loss $\mathcal{L}_{total}$ is then computed as a weighted sum of clean and robust losses. + +$$ +\mathcal {L} _ {\text {t o t a l}} = \mathcal {L} _ {\text {c l e a n}} + \boldsymbol {\gamma} \cdot \mathcal {L} _ {\text {r o b u s t}} +$$ + +Since time domain attacks are often high frequency, by focusing the adversarial training on the high frequency, our approach not only enhances model robustness against frequency-targeted attacks, but also improves defenses against time-domain attacks. + +# 4.2 RANDAUGMENT FOR AUDIO + +Realistic Corruptions for Deepfake Audio Generation: As shown in Figure 9, we present a taxonomy for analyzing the robustness of deepfake audio detection systems that incorporate the most common corruptions and attacks. Corruptions in audio result from unintentional modifications during recording, processing, or transmission, impacting noise levels and frequency responses. Adversarial attacks, in contrast, are intentional manipulations aimed at deceiving detection systems through subtle changes across various attack methodologies. + +RandAugment: Experiments show that the best detection model, RawNet3, experiences a great drop in accuracy when faced with audio corruptions. Inspired by the image-based RandAugment (Cubuk et al., 2020), which improves model robustness, we adapted this method for audio. We selectively apply $\mathcal{N}$ transformations from the available options, each assigned a uniform probability. An additional probability $p$ determines whether each transformation is applied at a given instance, to balance the accuracy between original and corrupted samples. The magnitude of each transformation is controlled within predefined boundaries, with the intensity randomly sampled from this range. + +# 5 EXPERIMENTS + +We first compare our approach to existing state-of-the-art methods across three benchmarks and demonstrate improved accuracy. We then assess its robustness against corruption and adversarial attacks. We finally conduct ablation study on enhancements to the detection system's robustness. + +![](images/b9f7d06a9cdb8857f3c455ccc6f628641e753d559100a6e88645d2c278a64333.jpg) +Figure 4: Detailed results across different AI-voice synthesis models on our test set. Fake audio is categorized into sources included and not included in training. Models evaluated include RawNet2, RawNet3, and Ours. Our method outperforms all others across all different sources. + +# 5.1 DATASET + +DeepFakeVox-HQ (test) Our custom test dataset incorporates 14 of the latest and highest quality TTS and VC models to generate fake audio. It also includes fake audio samples directly collected from social media platforms such as YouTube and X, providing a diverse set of real-world scenarios. For the experiments described in this paper, we specifically utilize seven fake sources not present in the training set. However, we also include samples from seven other fake sources used during training to facilitate future research. + +ASVspoof2019 (Todisco et al., 2019) derived from the VCTK base corpus, which includes speech data captured from 107 speakers. It contains three major forms of spoofing attacks, namely synthetic, converted, and replayed speech. + +# 5.2 BASELINE + +RawNet2 (Tak et al., 2021) employs Sinc-Layers (Ravanelli & Bengio, 2018) to directly extract features from audio waveforms. These layers function as band-pass filters that enhance the detection of spoofed audio content. + +RawGAT-ST (Tak et al., 2021) utilizes spectral and temporal sub-graphs integrated with a graph pooling strategy, effectively processing complex auditory environments. + +TE-ResNet (Zhang et al., 2021) processes synthetic speech detection by first extracting MFCC from input speech. These coefficients are used as features for a CNN that extracts spatial features, followed by a Transformer that analyzes these to detect characteristics of synthetic speech effectively. + +RawNet3 (Jung et al., 2022) begins by using parameterized filterbanks to extract a time-frequency representation from the raw waveform. This is followed by three backbone blocks with residual connections, a structural approach that deviates from ECAPA-TDNN (Desplanques et al., 2020). + +# 5.3 MAIN RESULT + +Results on Original Data: We trained all models on DeepFakeVox-HQ and tested them across two benchmarks: our test set and ASVspoof2019, as shown in Table 2. Our method achieved state-of-the-art results across both benchmarks. Compared with RawNet3, our method shows improvements of $7.8\%$ F1 score on DeepFakeVox-HQ (test), $1.1\%$ F1 score on ASVspoof2019. + +Among all baseline models, Rawnet3 performs the best. Therefore, for subsequent evaluations involving corruption and attacks, we will apply robust training methods to Rawnet3 and conduct comparisons. + +Figure 4 outlines results across various AI-voice synthesis models on our test set. For the fake sources are included in the training, all models demonstrated high accuracy. However, for unforeseen source, our method significantly outperformed others, particularly those from real-world social media platforms like YouTube and Lipsync, by up to $50\%$ points, highlighting its superior generalization capabilities on out-of-distribution data. + +Result on Corrupted data: Figure 5a shows detailed results for various corruptions. Our methods are depicted in the green region with F-SAT, and in the red region without F-SAT. They outperform all other baseline methods across 24 types of corruptions, with an average absolute increase of $15.3\%$ + +
ApproachDeepFakeVox-HQASVsproof2019
Real AccFake AccF1Real AccFake AccF1
TE-ResNet0.8590.4330.6290.8940.9730.933
RawGAT-ST0.9260.6980.8100.9430.9510.947
RawNet20.9460.5780.7540.9300.9850.957
RawNet30.9610.7590.8610.9700.9080.939
Ours0.9750.9640.9740.9500.9820.966
+ +Table 2: Comparative performance of our method and baseline models on DeepFakeVox-HQ and ASVspoof2019 test sets, our method outperforms prior approaches. (We ensured our deepfake test set does not overlap with the training set.) + +![](images/e75ce16c5923602664173c7fb4210a4422c4c85b2bfe0203348d19b5a2eaccca.jpg) +(a) Performance across various corruptions + +![](images/73bb71a1655926c05512262ff4a8d3407272ddf5b08b16af503a287dad8e0537.jpg) +(b) Performance across different types of attacks +Figure 5: Comparative results showcasing the accuracy of our method against various types of corruptions and attacks. Our method outperforms the baseline across nearly all tested conditions. + +points. However, as we can observe, aliasing has the most negative impact on accuracy. During aliasing, audio is intentionally downsampled and then resampled back, which not only removes high-frequency features but also introduces distortions characteristic of aliasing. In addition, low-pass filters, time stretching, and noise also significantly impact performance more than others. + +# 5.4 RESULTS ON ATTACKED DATA + +To assess our model's robustness against adversarial attacks, we employ the Projected Gradient Descent (PGD) attack, a well-established method in adversarial training. We compare our F-SAT with conventional adversarial training and smoothing defense methods. + +Attack Settings for Evaluation and Perceptibility Assessment: In the main paper, we evaluate the $l_{\infty}$ -PGD attack on the time domain ( $\epsilon = 1 \times 10^{-4}$ , $\alpha = 4 \times 10^{-5}$ , iter = 2) and on the magnitude component of the frequency domain ( $\epsilon = 1 \times 10^{-3}$ , $\alpha = 4 \times 10^{-4}$ , iter = 2). For the frequency domain, we progressively expand the attacked frequency range to include 6-8 kHz, 4-8 kHz, 2-8 kHz, and 0-8 kHz. The average attack result is calculated across these ranges. More comprehensive attack analyses are provided in Appendix A2. To ensure the imperceptibility of the attacks in both domains, we evaluate the Signal-to-Noise Ratio (SNR) of the attacks compared to the original audio. The SNR values are 58.4 dB for the time domain attack and 68.7 dB for the frequency domain attack, indicating that the attacks remain imperceptible. + +Compared with other defense method: We compare our Method F-SAT with other defense methods—MAD smoothing (Olivier et al., 2021), Gaussian smoothing (Cohen et al., 2019), and standard adversarial training (Mkadry et al., 2017)—on the RawNet3 model against various adversarial attacks in both time and frequency domains. As shown in Figure 5b, F-SAT outperforms all other methods. + +![](images/e6d4c1aa21649fb235026cfc79d8913a89f2c2362e70d0ab045e186575b1529d.jpg) +(a) Impact of Different Attack Types + +![](images/3b4c8729e676959ab9d956e694ebbf93f2f0d3783a7ad72b38effabf59f2dab2.jpg) +(b) Frequency Range for Attack $(\epsilon = 0.01)$ +Figure 6: Exploring Model Vulnerabilities: (a) shows accuracy under under various attack types; (b) details how attacks targeting magnitude in various frequency domains affect accuracy. We show attacks based on magnitude in the frequency domain are highly effective at degrading model performance, with those targeting higher frequency ranges having a greater impact. + +# 5.5 ABLATION STUDY AND ANALYSIS + +Choice of attack type for F-SAT: As discussed in Section 4.2, there are three types of adversarial attacks on audio: time domain, frequency domain on magnitude, and frequency domain on phase. All of these can be employed for adversarial training. However, our focus on targeting the magnitude component in attacks is explained in Figure 6a. Through our evaluation, we found that attacks based on magnitude in the frequency domain are particularly effective at degrading model performance. This is due to the fact that changes in magnitude directly affect the amplitude of audio signals, crucial for maintaining core acoustic features. Such changes alter the sound intensity across frequencies, complicating the model's task of distinguishing key characteristics between real and fake audio. Conversely, phase attacks have minimal impact on the model's predictions, as phase alterations primarily influence spatial audio perception and do not significantly affect feature detection. + +We further validate our conclusions experimentally, as shown in Table 3. Our findings indicate that F-SAT excels in adversarial training against attacks on both time and frequency domains. Surprisingly, incorporating adversarial training focused on the time domain appears to diminish overall accuracy on original data and does not effectively enhance robustness against attacks in either domain. Direct attacks in the time domain may disrupt most features critical for differentiating between real and fake audio, potentially overburdening the model during training. + +Additionally, the introduction of RandAug to the RawNet3 baseline model significantly enhances accuracy on corrupted data, suggesting that the model benefits from exposure to varied conditions during training. + +
ApproachOriginCorruptionAttack(Time)Attack(Frequency)
Real AccFake AccF1Real AccFake AccF1Real AccFake AccF1Real AccFake AccF1
RawNet30.9610.7590.8610.9470.5560.7200.9790.0350.1340.8040.0830.202
+RandAug0.9760.9470.9680.8990.8260.8600.7470.6610.6930.6300.5730.613
+RandAug+AT(Time)0.9470.8250.8910.8810.7720.8180.8710.1240.2110.6650.1520.207
+RandAug+ F-SAT0.9750.9640.9740.9480.8300.8850.9020.8800.9100.9330.9150.924
+ +Table 3: Ablation study evaluating the impact of our RandAug and F-SAT, comparing their effects against time-domain adversarial training (AT) and phase-based adversarial training. RandAug enhances robustness to corruptions, while F-SAT improves robustness to adversarial attacks. + +Impact of frequency range for F-SAT: The importance of high-frequency components is underscored in Figure 6b, which shows the model's performance under gradient-based adversarial attacks across different frequency ranges. Attacks targeting higher frequencies notably degrade deepfake detection more than lower frequencies, underscoring the vulnerability of high-frequency features. By focusing attacks on high-frequency regions, we preserve low-frequency integrity, simplifying the model's task of distinguishing deepfake audio features. This approach maintains high accuracy on unattacked data and improves adversarial robustness. + +Further analysis on selecting the optimal frequency range for F-SAT is presented in Table 4. Adversarial training within the $4\mathrm{k}$ to $8\mathrm{k}$ frequency range yields the best performance. We observe that increasing the attack frequency range decreases accuracy on original data due to the distortion of more critical features, adding complexity to the model's learning process. + +Moreover, we observe that narrowing the frequency range of F-SAT increases the accuracy for attacked fake data while decreasing it for attacked real data. This supports the findings shown in + +
ApproachOriginalAttack (Time)Attack (Frequency)
Real AccFake AccF1Real AccFake AccF1Real AccFake AccF1
F-SAT (0-8kHz)0.9770.8180.8980.9780.7950.8770.9700.7510.862
F-SAT (2-8kHz)0.9830.8960.9400.9760.7360.8310.9790.7540.836
F-SAT (4-8kHz)0.9750.9640.9740.9020.8800.9100.9330.9150.924
F-SAT (6-8kHz)0.9710.9740.9520.9120.8500.8790.9230.8960.907
+ +Table 4: The results of frequency range selections for F-SAT. 4-8k is the most effective range. + +Figure 2, which highlights a significant gap between the frequency domains where real and fake audio features predominantly exist. Fake audio features are concentrated in higher frequency ranges compared to real audio. In most real-world applications, criminals aim to make fake audio sound real enough to deceive detectors for committing fraud. Therefore, focusing adversarial training on high frequencies effectively enhances the robustness of fake audio. + +![](images/5062de2cd4b1aba886094e102f43bf6c64f1eddf851a84c36b8b307a22a29835.jpg) +(a) Impact of Attack Magnitude $\epsilon$ on Detection Accuracy + +![](images/974d21db75f064134f215988c712dcccbbc0564e7c8c90e15490f7d26781366d.jpg) +(b) Impact of ratio $\gamma$ between robust and clean loss $(L_{\text{robust}} / L_{\text{clean}})$ on Detection Accuracy +Figure 7: Exploration of hyperparameters to control attacks, balancing accuracy and robustness. (We train Rawnet3 + RandAug + F-SAT on $10\%$ of DeepFakeVoc-HQ) + +Balance Between Clean and Attacked Data: Figure 7a demonstrates that F-SAT achieves optimal performance with an attack magnitude of $\epsilon = 0.01$ , maintaining high accuracy on both attacked and clean data. Figure 7b reveals that a ratio of 0.1 between robust and clean loss, $(L_{robust} / L_{clean})$ , results in the highest overall accuracy. The results show that excessive focus on attacked data does not consistently boost robustness and may decrease clean data accuracy. Similarly, an undue emphasis on clean data does not reliably enhance accuracy and can weaken robustness. Thus, striking a balance between clean and attacked samples is critical for optimal model performance. + +Additional Analysis of the F-SAT: The fundamental rationale for our algorithm lies in the dual nature of high-frequency features: while they are crucial for identifying deepfake audio, they are also susceptible to adversarial attacks. In contrast, low-frequency features, though more robust, do not provide sufficient information on their own to train an effective detector. Therefore, simply using a lowpass filter to eliminate all high-frequency features is not a feasible strategy; instead, a powerful and resilient detector must retain and protect these high-frequency features. + +Additionally, our F-SAT approach specifically targets the magnitude component of audio signals while preserving the phase. This focused strategy significantly bolsters the effectiveness of our method. To substantiate this approach, we conducted frequency-selective adversarial training on the high-frequency phase component, which led to a substantial decline in accuracy on unattacked data. This outcome suggests that the model may overfit to artifacts introduced by phase perturbations, thereby diminishing its generalization capacity. + +# 6 CONCLUSION + +In our study, we introduce a dataset DeepFakeVoc-HQ that addresses diversity and quality issues in prior datasets, and provide a taxonomy to explore common audio corruptions and attacks. We find that leading AI voice detection models depend on vulnerable high-frequency features. This discovery leads us to develop F-SAT, a targeted adversarial training method that focuses on high-frequency components while while preserving the integrity of low-frequency features. Our approach effectively maintains accuracy on unattacked data and enhances robustness against various attacks. These results pioneer robust training for detecting fake audio for the first time, opening up a new direction for identifying such threats. + +# ACKNOWLEDGMENTS + +This work was supported in part by multiple Google Cyber NYC awards, Columbia SEAS/EVPR Stimulus award, and Columbia SEAS-KFAI Generative AI and Public Discourse Research award. + +# REFERENCES + +Fulya Akdeniz and Yacsar Becerikli. Detection of copy-move forgery in audio signal with mel frequency and delta-mel frequency kephrum coefficients. In 2021 Innovations in Intelligent Systems and Applications Conference (ASYU), pp. 1-6. IEEE, 2021. +Moustafa Alzantot, Ziqi Wang, and Mani B Srivastava. Deep residual neural networks for audio spoofing detection. arXiv preprint arXiv:1907.00501, 2019. +James Betker. Better speech synthesis through scaling. arXiv preprint arXiv:2305.07243, 2023. +Stefano Borzi, Oliver Giudice, Filippo Stanco, and Dario Allegra. Is synthetic voice detection research going into the right direction? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 71-80, 2022. +Guillermo Calahorra-Candao and María José Martín-de Hoyos. The effect of anthropomorphism of virtual voice assistants on perceived safety as an antecedent to voice shopping. Computers in Human Behavior, 153:108124, 2024. +Edresson Casanova, Kelly Davis, Eren Gölgé, Görkem Göknar, Iulian Gulea, Logan Hart, Aya Aljafari, Joshua Meyer, Reuben Morais, Samuel Olayemi, et al. Xtts: a massively multilingual zero-shot text-to-speech model. arXiv preprint arXiv:2406.04904, 2024. +Guangke Chen, Zhe Zhao, Fu Song, Sen Chen, Lingling Fan, Feng Wang, and Jiashui Wang. Towards understanding and mitigating audio adversarial examples for speaker recognition. IEEE Transactions on Dependable and Secure Computing, 20(5):3970-3987, 2023. doi: 10.1109/TDSC.2022.3220673. +Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. Certified adversarial robustness via randomized smoothing. In international conference on machine learning, pp. 1310-1320. PMLR, 2019. +Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops, pp. 702-703, 2020. +Brecht Desplanques, Jenthe Thienpondt, and Kris Demuynck. Ecapa-tdnn: Emphasized channel attention, propagation and aggregation in tdnn based speaker verification. arXiv preprint arXiv:2005.07143, 2020. +Zhihao Du, Qian Chen, Shiliang Zhang, Kai Hu, Heng Lu, Yexin Yang, Hangrui Hu, Siqi Zheng, Yue Gu, Ziyang Ma, et al. Cosyvoice: A scalable multilingual zero-shot text-to-speech synthesizer based on supervised semantic tokens. arXiv preprint arXiv:2407.05407, 2024. +Joel Frank and Lea Schonherr. Wavefake: A data set to facilitate audio deepfake detection. arXiv preprint arXiv:2111.02813, 2021. +Jort F Gemmeke, Daniel PW Ellis, Dylan Freedman, Aren Jansen, Wade Lawrence, R Channing Moore, Manoj Plakal, and Marvin Ritter. Audio set: An ontology and human-labeled dataset for audio events. In 2017 IEEE international conference on acoustics, speech and signal processing (ICASSP), pp. 776-780. IEEE, 2017. +Zeqian Ju, Yuancheng Wang, Kai Shen, Xu Tan, Detai Xin, Dongchao Yang, Yanqing Liu, Yichong Leng, Kaitao Song, Siliang Tang, et al. Naturalspeech 3: Zero-shot speech synthesis with factorized codec and diffusion models. arXiv preprint arXiv:2403.03100, 2024. +Jee-weon Jung, You Jin Kim, Hee-Soo Heo, Bong-Jin Lee, Youngki Kwon, and Joon Son Chung. Pushing the limits of raw waveform speaker recognition. arXiv preprint arXiv:2203.08488, 2022. + +Karl Michel Koerich, Mohammad Esmailpour, Sajjad Abdoli, Alceu de S Britto, and Alessandro L Koerich. Cross-representation transferability of adversarial attacks: From spectrograms to audio waveforms. In 2020 International Joint Conference on Neural Networks (IJCNN), pp. 1-7. IEEE, 2020. +Yinghao Aaron Li, Cong Han, Vinay Raghavan, Gavin Mischler, and Nima Mesgarani. Styletts 2: Towards human-level text-to-speech through style diffusion and adversarial training with large speech language models. Advances in Neural Information Processing Systems, 36, 2024. +Songxiang Liu, Dan Su, and Dong Yu. Meta-voice: Fast few-shot style transfer for expressive voice cloning using meta learning. arXiv preprint arXiv:2111.07218, 2021. +Xuechen Liu, Xin Wang, Md Sahidullah, Jose Patino, Héctor Delgado, Tomi Kinnunen, Massimiliano Todisco, Junichi Yamagishi, Nicholas Evans, Andreas Nautsch, et al. Asvspoof 2021: Towards spoofed and deepfake speech detection in the wild. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 31:2507-2522, 2023. +Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. +Aleksander Mkadry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. stat, 1050(9), 2017. +Chengzhi Mao, Ziyuan Zhong, Junfeng Yang, Carl Vondrick, and Baishakhi Ray. Metric learning for adversarial robustness. Advances in neural information processing systems, 32, 2019. +Nicolas M Müller, Pavel Czempin, Franziska Dieckmann, Adam Froghyar, and Konstantin Bötttinger. Does audio deepfake detection generalize? arXiv preprint arXiv:2203.16263, 2022. +Arsha Nagrani, Joon Son Chung, and Andrew Zisserman. Voxceleb: a large-scale speaker identification dataset. arXiv preprint arXiv:1706.08612, 2017. +Paarth Neekhara, Shehzeen Hussain, Subhankar Ghosh, Jason Li, Rafael Valle, Rohan Badlani, and Boris Ginsburg. Improving robustness of llm-based speech synthesis by learning monotonic alignment. arXiv preprint arXiv:2406.17957, 2024. +Raphael Olivier, Bhiksha Raj, and Muhammad Shah. High-frequency adversarial defense for speech and audio. In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 2995-2999. IEEE, 2021. +Vassil Panayotov, Guoguo Chen, Daniel Povey, and Sanjeev Khudanpur. Librispeech: an asr corpus based on public domain audio books. In 2015 IEEE international conference on acoustics, speech and signal processing (ICASSP), pp. 5206-5210. IEEE, 2015. +Puyuan Peng, Po-Yao Huang, Daniel Li, Abdelrahman Mohamed, and David Harwath. Voicecraft: Zero-shot speech editing and text-to-speech in the wild. arXiv preprint arXiv:2403.16973, 2024. +Vadim Popov, Ivan Vovk, Vladimir Gogoryan, Tasnima Sadekova, Mikhail Kudinov, and Jiansheng Wei. Diffusion-based voice conversion with fast maximum likelihood sampling scheme. arXiv preprint arXiv:2109.13821, 2021. +Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine McLeavey, and Ilya Sutskever. Robust speech recognition via large-scale weak supervision. In International conference on machine learning, pp. 28492-28518. PMLR, 2023. +Krishan Rajaratnam, Kunal Shah, and Jugal Kalita. Isolated and ensemble audio preprocessing methods for detecting adversarial examples against automatic speech recognition. arXiv preprint arXiv:1809.04397, 2018. +Mirco Ravanelli and Yoshua Bengio. Speaker recognition from raw waveform with sincnet. In 2018 IEEE spoken language technology workshop (SLT), pp. 1021-1028. IEEE, 2018. + +Chandan KA Reddy, Vishak Gopal, and Ross Cutler. Dnsmos: A non-intrusive perceptual objective speech quality metric to evaluate noise suppressors. In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6493-6497. IEEE, 2021. +Md Sahidullah and Goutam Saha. Design, analysis and experimental evaluation of block based transformation in mfcc computation for speaker recognition. Speech communication, 54(4):543-565, 2012. +Kai Shen, Zeqian Ju, Xu Tan, Yanqing Liu, Yichong Leng, Lei He, Tao Qin, Sheng Zhao, and Jiang Bian. Naturalspeech 2: Latent diffusion models are natural and zero-shot speech and singing synthesizers. arXiv preprint arXiv:2304.09116, 2023. +Chengzhe Sun, Shan Jia, Shuwei Hou, and Siwei Lyu. AI-synthesized voice detection using neural vocoder artifacts. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 904-912, 2023. +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013. +Hemlata Tak, Jose Patino, Massimiliano Todisco, Andreas Nautsch, Nicholas Evans, and Anthony Larcher. End-to-end anti-spoofing with rawnet2. In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6369-6373. IEEE, 2021. +Massimiliano Todisco, Héctor Delgado, and Nicholas Evans. Constant q cepstral coefficients: A spoofing countermeasure for automatic speaker verification. Computer Speech & Language, 45: 516-535, 2017. +Massimiliano Todisco, Xin Wang, Ville Vestman, Md Sahidullah, Héctor Delgado, Andreas Nautsch, Junichi Yamagishi, Nicholas Evans, Tomi Kinnunen, and Kong Aik Lee. Asvsproof 2019: Future horizons in spoofed and fake audio detection. arXiv preprint arXiv:1904.05441, 2019. +Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. arXiv preprint arXiv:1805.12152, 2018. +Shutong Wu, Jiongxiao Wang, Wei Ping, Weili Nie, and Chaowei Xiao. Defending against adversarial audio via diffusion model. arXiv preprint arXiv:2303.01507, 2023. +Ruilin Xu, Rundi Wu, Yuko Ishiwaka, Carl Vondrick, and Changxi Zheng. Listening to sounds of silence for speech denoising. Advances in Neural Information Processing Systems, 33:9633-9648, 2020. +Junichi Yamagishi. English multi-speaker corpus for cstr voice cloning toolkit. URL http://homepages.inf.ed.ac.uk/jyamagis/page3/page58/page58.html, 2012. +Yujie Yang, Haochen Qin, Hang Zhou, Chengcheng Wang, Tianyu Guo, Kai Han, and Yunhe Wang. A robust audio deepfake detection system via multi-view feature. In ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 13131-13135. IEEE, 2024. +Neil Zeghidour, Nicolas Usunier, Iasonas Kokkinos, Thomas Schaiz, Gabriel Synnaeve, and Emmanuel Dupoux. Learning filterbanks from raw speech for phone recognition. In 2018 IEEE international conference on acoustics, speech and signal Processing (ICASSP), pp. 5509-5513. IEEE, 2018. +Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. Theoretically principled trade-off between robustness and accuracy. In International conference on machine learning, pp. 7472-7482. PMLR, 2019. +Zhenyu Zhang, Xiaowei Yi, and Xianfeng Zhao. Fake speech detection using residual network with transformer encoder. In Proceedings of the 2021 ACM workshop on information hiding and multimedia security, pp. 13-22, 2021. + +# A APPENDIX + +# A.1 LEGAL PERMISSIONS FOR BENCHMARK DATASET + +Our benchmark dataset is sourced from three main platforms: YouTube, commercial software, and open-source projects from GitHub. For both commercial software and open-source projects, we have reviewed their respective policies and confirmed that they permit the sharing of generated data for non-commercial use. + +To address concerns regarding YouTube's terms of service and ethical considerations, we will not directly distribute any content sourced from YouTube. Instead, we will provide only metadata (video ID, start time, and end time), ensuring that researchers can access the content through YouTube's official interface in compliance with the platform's policies. + +# A.2 COMPARISON OF DATASETS + +![](images/0d7874a8f212410e01a83fc89de0c3a232ed34d8389eb8f45745576128962fc0.jpg) +Figure 8: Performance of the RawNet3 baseline model on various datasets. 'Ours (train, w/o new)' represents our training dataset after removing all high-quality deepfake samples. + +# A.3 EXPLANATION OF SOME TYPES OF CORRUPTIONS + +Air Absorption: Air absorption refers to the phenomenon where high-frequency sound waves are more strongly attenuated by air molecules. As sound travels through the air, it loses energy, particularly at higher frequencies, due to air viscosity and thermal conduction. + +Room Simulator: A room simulator is a digital tool that emulates the acoustics of different rooms or spaces. It includes parameters such as room size, wall materials, and shape, which affect how sound reflects and diffuses. + +Peaking: Peaking refers to adjusting a specific range of frequencies around a central frequency. It is commonly used in parametric equalizers. + +Ailiasing: Aliasing occurs when high-frequency components are sampled below the Nyquist rate, causing them to appear as lower frequencies. This can be represented using the Nyquist theorem: + +$$ +f _ {\text {s a m p l e}} > 2 \cdot f _ {\max }, +$$ + +where $f_{\mathrm{sample}}$ is the sampling frequency, and $f_{\mathrm{max}}$ is the maximum frequency of the signal. When this condition is violated, the signal is folded back into the lower frequencies, creating aliasing artifacts. + +Bit-Crush: Bit-crushing reduces the bit depth of an audio signal, causing quantization errors. + +Tanh Distortion: Tanh distortion is a form of soft clipping achieved using the hyperbolic tangent function. The output $y$ is given by: + +$$ +y = \tanh (k x), +$$ + +where $x$ is the input signal, and $k$ controls the amount of distortion. As $k$ increases, the function approximates a hard clipping effect. + +![](images/20800cbb591fd19714ac518c6e3fbcae8d2301d2ec1b98c2bda01690edc91041.jpg) +Figure 9: Overview of various corruption types and adversarial attack strategies affecting audio robustness. The diagram categorizes different forms of corruptions (e.g., noise, filtering, distortion) and adversarial attacks (e.g., white-box, black-box) based on their methods, objectives, and scope of perturbation. This framework outlines the challenges in ensuring the robustness of audio systems against both environmental corruption and intentional adversarial manipulation. +Figure 10: Python code for RandAugment for audio + +Gain Transition: Gain transition refers to smoothly adjusting the amplitude over time. + +Seven-Band Parametric EQ: A seven-band parametric EQ provides independent control over seven frequency bands. Each band can be adjusted using three parameters: center frequency $(f_0)$ , gain $(G)$ , and bandwidth $(Q)$ . The overall transfer function is a combination of individual band filters: + +$$ +H (f) = \prod_ {i = 1} ^ {7} H _ {i} (f), +$$ + +where $H_{i}(f)$ represents the frequency response of the $i$ -th band. + +Time Mask: Time masking involves temporarily silencing or removing a segment of audio. + +# A.4 RANDAUGMENT FOR AUDIO + +```python +audio_transforms = [ + 'background_noise', 'color_noise', 'short_noise', 'gaussian_noise', 'air_ABSorption', 'room_simulator', 'band_pass', 'band_stop', 'high_pass', 'low_pass', 'high_shelf', 'low_shelf', 'peaking', 'aliasing', 'bit_crush', 'clip', 'tanh_distortion', 'gain_transition', 'seven_band-parametric_EQ', 'pitchhift', 'time_mask', 'time_stretch' ] +] +def rand_augmentation.audio(sample, N, p): + ''' Apply random augmentations to an audio sample. +Args: + sample: An audio sample N: Number of augmentations to apply p: Probability of applying each augmentation +Returns: + An augmented audio sample +''' +operations = np.random.choice.audio_transforms, N) +return operations(sample) if random.random() < p else sample +``` + +Details of RandAugment for Audio are shown in Figure 10. In our experiments, we set $N = 1$ and $p = 0.9$ . + +# A.5 ROBUSTNESS TO COMPRESSION + +To evaluate the robustness of our detection model to compression, we tested two lossy formats: MP3 and AAC. The evaluation utilized RawNet3 combined with RandAug and F-SAT. As shown in the table 5, both MP3 and AAC compression had minimal impact on detection accuracy. + +
FormatRealFakeAvg
Origin (90% wav + 10% mp3)97.5%96.4%97.0%
MP397.5%95.6%96.6%
ACC96.9%96.6%96.8%
+ +Table 5: Detection Results for Compressed Audio Formats + +# A.6 COMPREHENSIVE ANALYSIS OF ALL ATTACK TYPES + +Table 6 presents the detailed adversarial attack results for RawNet3 and our method under various conditions. It includes both white-box and black-box approaches and examines the impacts of attacks in both the time and frequency domains, detailing the different attack hyperparameters used. + +
DomainItersRestartSourceRawNet3RawNet3+RandAugRawNet3+RandAug+F-SAT
Real AccFake AccReal AccFake AccReal AccFake Acc
No Attack---96.1%75.9%97.6%94.7%97.5%96.4%
Time21A97.9%3.50%74.7%66.1%90.2%88.0%
51A90.6%2.10%34.4%42.4%66.7%80.9%
52A90.2%1.70%33.2%39.4%65.4%80.3%
21A'98.9%8.10%79.8%69.0%92.9%89.2%
51A'92.1%2.90%43.7%52.4%74.4%84.0%
52A'91.6%3.20%42.1%50.3%73.2%83.1%
21B100.0%17.3%98.7%91.7%98.7%96.4%
51B100.0%16.0%98.9%92.1%98.7%96.3%
52B100.0%16.2%98.9%92.1%98.7%96.3%
Frequency (0-8k Hz)21A65.0%5.7%38.5%42.9%87.0%86.3%
51A23.8%2.9%7.5%14.9%63.8%69.4%
52A23.0%2.7%7.3%15.2%63.7%69.2%
21A'77.3%14.9%50.6%55.1%90.2%88.1%
51A'31.6%4.92%14.9%27.6%72.7%74.6%
52A'23.8%2.4%7.8%16.0%63.8%66.4%
21B99.8%34.60%98.9%85.98%98.7%96.8%
51B99.8%29.5%98.9%85.3%98.7%96.8%
52B100.0%31.9%98.9%84.9%98.7%96.7%
Frequency (2-8k Hz)21A74.3%6.8%50.4%49.3%93.1%89.5%
51A34.0%4.29%12.9%22.9%83.5%82.6%
52A33.0%4.44%12.7%21.4%83.0%82.1%
21A'84.0%16.5%59.7%63.5%94.0%89.8%
51A'43.8%7.00%23.5%35.2%87.5%85.1%
52A'33.5%4.0%12.9%21.3%82.9%80.3%
21B99.8%33.3%98.9%84.2%98.6%97.0%
51B100.0%28.4%98.4%84.7%98.7%95.9%
52B99.8%31.0%99.1%84.2%98.6%96.0%
Frequency (4-8k Hz)21A87.2%8.5%72.9%61.3%96.7%94.6%
51A54.9%7.78%35.4%36.3%96.2%93.4%
52A54.4%6.83%35.1%36.3%95.7%93.2%
21A'91.4%18.3%80.0%71.9%97.1%95.6%
51A'64.9%10.5%47.3%50.6%96.5%94.5%
52A'54.6%7.1%36.0%36.3%96.0%93.4%
21B99.7%34.4%99.0%88.0%98.0%96.3%
51B99.7%29.2%99.0%87.5%98.0%96.3%
52B99.7%32.5%99.2%87.8%98.0%96.3%
Frequency (6-8k Hz)21A95.2%12.3%90.1%76.7%96.5%95.6%
51A83.8%16.0%70.6%65.6%95.7%95.3%
52A83.7%15.7%70.5%65.0%95.9%94.9%
21A'95.7%21.9%92.7%80.4%96.7%95.9%
51A'86.8%16.8%78.4%70.4%96.0%95.9%
52A'83.2%15.9%70.5%63.4%95.9%95.8%
21B99.7%38.3%98.9%89.1%97.0%96.4%
51B99.7%32.2%98.9%88.5%97.1%96.4%
52B99.7%36.8%99.0%88.5%97.3%96.4%
+ +Table 6: Adversarial Attack Results on RawNet3 and Its Variants under Various Conditions. For the attack scenarios, we include both white-box and black-box approaches: $A$ represents tests with the same model and identical weights, while $A'$ indicates the same model but with different weights, and $B$ denotes tests on a completely different model. For attacks in the time domain, we use $\epsilon = 10^{-4}$ and $\alpha = 4 \cdot 10^{-5}$ . For attacks in the frequency domain, the parameters are $\epsilon = 10^{-3}$ and $\alpha = 4 \cdot 10^{-4}$ . + +A.7 DATASET DETAILS + +
Fake SourceTotal Duration (Hours)Audio CountMean Duration (Seconds)
VCTK14.112.0k4.2
Librispeech (Train)961.1281.2k12.3
In-The-Wilds14.69.3k5.7
ASRspoof2019 (LA)11.912.5k3.4
Voxceleb1340.4148.6k8.2
Audioset (Narration)50.112.2k14.8
+ +Table 7: Summary of fake audio sources data + +
Fake SourceTotal Duration (Hours)Audio CountMean Duration (Seconds)
Metavoice189.161.7k11.0
StyleTTS-v2186.661.6k10.9
XTTS-v2175.561.8k10.2
VoiceCraft119.959.4k7.3
Whisperspeech155.261.9k9.0
Vokan-TTS161.761.6k9.4
Elevenlabs3.33.2k3.7
ASRspoof2019 (LA)97.8109.0k3.2
Wavefake (English)198.7117.9k6.1
+ +Table 8: Summary of fake audio sources data + +
ModelVCTK Speaker_id: p244In-the-Wild Speaker: Alan Watts
Ovrl MOSSig MOSBak MOSP808 MOSOvrl MOSSig MOSBak MOSP808 MOS
Real refer3.263.564.043.613.023.403.743.57
metavoice3.293.584.053.633.153.523.883.55
StyleTTS v23.283.564.083.873.283.574.063.83
XTTS v23.133.414.003.783.113.413.983.70
VoiceCraft3.163.513.943.613.013.343.803.43
Whisperspeech3.283.564.073.823.153.443.993.59
Vokan-TTS3.233.554.013.712.943.393.663.60
+ +Table 9: MOS Scores for Various TTS Models + +Table 7 presents the real audio data we utilized from previously published datasets. For generating deepfake audio for the training set, we employ models such as XTTS v2, StyleTTS v2, Metavoice, Whisperspeech, Vokan-TTS, VoiceCraft, and Elevenlabs. Additionally, for the test set, we use Cosyvoice, PlayHT 2.0, Resemble, LOVO AI, and Lipsynthesis to create deepfake voices. We introduce post-processing augmentations to generate noisy deepfakes. Four real datasets—VCTK (12.0k), Librispeech-clean-100 (28.5k), Audioset (narration) (12.2k), and In-The-Wild (real parts: 9.3k)—are utilized to generate deepfake voices for the training set. Details of our generated deepfake audio and references to previous public deepfake audio datasets are presented in Table 8. Additionally, we employed DNSMOS (Reddy et al., 2021) to quantitatively measure the synthetic speech quality across these models, using a scale from 1 to 5, where higher values indicate better quality. As demonstrated in Table 9, Metavoice and StyleTTS outperform other AI voice synthesis models. + +# A.8 F-SAT'S TRAINING EFFICIENCY + +F-SAT's training efficiency is influenced by hyperparameters such as attack iterations and restart counts, which identify the worst-case perturbation. Drawing on insights from "Fast Is Better Than Free: Revisiting Adversarial Training," we optimized these parameters by setting restarts to one and attack iterations to one or two, while employing a larger attack magnitude to enhance robustness. Training time is shown in the Table 10. Although F-SAT requires longer training times, it improves accuracy by an average of $9\%$ on original data and $43\%$ on attacked data compared to Standard Adversarial Training. We should not compromise accuracy merely to accelerate training + +
Descriptionw/o Adversarial TrainingStandard Adversarial TrainingF-SAT
Training Duration (Days)24.58
Number of Epochs151515
Hardware UsedA100 GPUA100 GPUA100 GPU
+ +Table 10: Training time comparison + +# A.8.1 TRAINING HYPERPARAMETER + +Here are the Training hyperparameter of F-SAT for Table 3: + +# Training Hyperparameters + +- Learning Rate (lr): $1 \times 10^{-5}$ +- Epochs: 15 +- Batch Size (bs): 16 +- Optimizer: adam +- Augmentation Number (aug_num): 1 or 2 +- Augmentation Probability (aug-prob): 0.9 + +# LR Scheduler (Warmup Cosine) + +Warm-up Epochs: 1 +- Warm-up LR: $1 \times 10^{-6}$ +- Minimum LR: $1 \times 10^{-7}$ + +# Attack Hyperparameters + +Attack Type: $l_{\infty}$ +- Epsilon: 0.005, Alpha: 0.002 +- Gamma (control ratio of clean loss and robust loss): 0.1 +Attack Iterations: 2 +- Restarts: 1 +Frequency Range: 4-8k Hz + +# Mixup Hyperparameters + +- Mixup Alpha: 0.5 \ No newline at end of file diff --git a/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/images.zip b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8f7586aa353a9d664c430ca1ae1ecac5e69bbde3 --- /dev/null +++ b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bc2babf5f8702e03279a6aa52470eefe07ea48d29a16da7493e76fd8bca9954 +size 1002044 diff --git a/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/layout.json b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3827363e75e817021ca8eb8027db0b9c88ba0cd7 --- /dev/null +++ b/ICLR/2025/I Can Hear You_ Selective Robust Training for Deepfake Audio Detection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c73cbb7b21f38bdc74b8075bac28b659173ada9be19338fbda5918c30d2fb0bc +size 575228 diff --git a/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_content_list.json b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4f253b4c399eb47333e65939b271809cb473f45b --- /dev/null +++ b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1359563799bcd550c3368f6993227973728a86cd4c069475a1a6a32acacb7cb9 +size 191342 diff --git a/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_model.json b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dc66f5db37ae814674b55cfb659be931a8120633 --- /dev/null +++ b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e49c17c63f0397fa6cdbccd80239f3a3467e439d543a4cb765cd40f52fbeb3da +size 226432 diff --git a/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_origin.pdf b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fd3910b663fe7ac2746d9ab63023940201d15d09 --- /dev/null +++ b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/89955ae5-46c8-49c5-a214-4cfec0432c97_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:327289a21257e01ebc8c6671e1652dbaf1ccf19430b37cb32fa0c23087c2a32f +size 9125413 diff --git a/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/full.md b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8228892380d50842878ab417f6847616b44b0209 --- /dev/null +++ b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/full.md @@ -0,0 +1,1014 @@ +# I-CON: A UNIFYING FRAMEWORK FOR REPRESENTATION LEARNING + +Shaden Alshammari1 John Hershey2 Axel Feldmann1 William T. Freeman1,2 Mark Hamilton1,3 +1MIT 2Google 3Microsoft + +https://aka.ms/i-con + +![](images/b39b43e42b3f9fe38c6de3d9e22b4181b728c271bd7b491097d79be803e762db.jpg) +Figure 1: A "periodic" table of representation learning methods unified by the I-Con framework. By choosing different types of conditional probability distributions over neighbors, I-Con generalizes over 23 commonly used representation learning methods. + +# ABSTRACT + +As the field of representation learning grows, there has been a proliferation of different loss functions to solve different classes of problems. We introduce a single information-theoretic equation that generalizes a large collection of modern loss functions in machine learning. In particular, we introduce a framework that shows that several broad classes of machine learning methods are precisely minimizing an integrated KL divergence between two conditional distributions: the supervisory and learned representations. This viewpoint exposes a hidden information geometry underlying clustering, spectral methods, dimensionality reduction, contrastive learning, and supervised learning. This framework enables the development of new loss functions by combining successful techniques from across the literature. We not only present a wide array of proofs, connecting over 23 different approaches, but we also leverage these theoretical results to create state-of-the-art unsupervised image classifiers that achieve a $+8\%$ improvement over the prior state-of-the-art on unsupervised classification on ImageNet-1K. We also demonstrate that I-Con can be used to derive principled debiasing methods which improve contrastive representation learners. + +# 1 INTRODUCTION + +Over the past decade the field of representation learning has flourished, with new techniques, architectures, and loss functions emerging daily. These advances have powered state-of-the-art models in vision, language, and multimodal learning, often with minimal human supervision. Yet as the field + +expands, the diversity of loss functions makes it increasingly difficult to understand how different methods relate, and which objectives are best suited for a given task. + +In this work, we introduce a general mathematical framework that unifies a wide range of representation learning techniques spanning supervised, unsupervised, and self-supervised approaches under a single information-theoretic objective. Our framework, Information Contrastive Learning (I-Con), reveals that many seemingly disparate methods including clustering, spectral graph theory, contrastive learning, dimensionality reduction, and supervised classification are all special cases of the same underlying loss function. + +While prior work has identified isolated connections between subsets of representation learning methods, typically linking only two or three techniques at a time (Sobal et al., 2025; Hu et al., 2023; Yang et al., 2022; Böhm et al., 2023; Balestriero & LeCun, 2022), I-Con is the first framework to unify over 23 distinct methods under a single objective. This unified perspective not only clarifies the structure of existing techniques but also provides a strong foundation for transferring ideas and improvements across traditionally separate domains. + +Using I-Con, we derive new unsupervised loss functions that significantly outperform previous methods on standard image classification benchmarks. Our key contributions are: + +- We introduce $I$ -Con, a single information-theoretic loss that generalizes several major classes of representation learning. +- We prove 15 theorems showing how diverse algorithms emerge as special cases of I-Con. +- We use I-Con to design a debiasing strategy that improves unsupervised ImageNet-1K accuracy by $+8\%$ , with additional gains of $+3\%$ on CIFAR-100 and $+2\%$ on STL-10 in linear probing. + +# 2 RELATED WORK + +Representation learning spans a wide range of methods for extracting structure from complex data. We review approaches that I-Con builds upon and generalizes. For comprehensive surveys, see (Le-Khac et al., 2020; Bengio et al., 2013; Weng, 2021). + +Feature Learning aims to derive informative low-dimensional embeddings using supervisory signals such as pairwise similarities, nearest neighbors, augmentations, class labels, or reconstruction losses. Classical methods like PCA (Pearson, 1901) and MDS (Kruskal, 1964) preserve global structure, while UMAP (McInnes et al., 2018) and t-SNE (Hinton & Roweis, 2002; Van der Maaten & Hinton, 2008) focus on local topology by minimizing divergences between joint distributions. I-Con adopts a similar divergence-minimization view. + +Contrastive learning approaches such as SimCLR (Chen et al., 2020a), CMC (Tian et al., 2020), CLIP (Radford et al., 2021), and MoCo v3 (Chen* et al., 2021) use positive and negative pairs, often built via augmentations or aligned modalities. I-Con generalizes these losses within a unified KL-based framework, highlighting subtle distinctions between them. Supervised classifiers (e.g., ImageNet models (Krizhevsky et al., 2017)) also yield effective features, which I-Con recovers by treating class labels as discrete contrastive points, bridging supervised and unsupervised learning. + +Clustering methods uncover discrete structure through distance metrics, graph partitions, or contrastive supervision. Algorithms like k-Means (Macqueen, 1967), EM (Dempster et al., 1977), and spectral clustering (Shi & Malik, 2000) are foundational. Recent methods, including IIC (Ji et al., 2019), Contrastive Clustering (Li et al., 2021), and SCAN (Gansbeke et al., 2020), leverage invariance and neighborhood structure. Teacher-student models such as TEMI (Adaloglou et al., 2023) and EMA-based architectures (Chen et al., 2020b) enhance clustering further. I-Con encompasses these by aligning a clustering-induced joint distribution with a target distribution derived from similarity, structure, or contrastive signals. + +Unifying Representation Learning has been explored through connections between contrastive learning and t-SNE (Hu et al., 2023; Böhm et al., 2023), equivalences between contrastive and cross-entropy losses (Yang et al., 2022), and relations between spectral and contrastive methods (Balestriero & LeCun, 2022; Sobal et al., 2025). Other efforts, like Bayesian grammar models (Grosse et al., 2012), offer probabilistic perspectives. Tschannen et al. (Tschannen et al., 2019) emphasized estimator and architecture design in mutual information frameworks but stopped short of broader unification. + +![](images/1d80ef86a61c3a85a7a47dae00bbc25dd43a6da7219bb811b043dd2fe1d5169b.jpg) + +![](images/c1343dd93a3b4c4de6ef19b0fd1fce192a07b8e4b3e5671aa876e4ba128a64c6.jpg) +(a) High-level I-Con architecture. +(b) Illustrative examples of distribution families for $p_{\theta}$ or $q_{\phi}$ . +Figure 2: Overview of the I-Con framework. (a) Alignment of learned and supervisory distributions. (b) Common distribution families in I-Con's formulation. + +While prior work links subsets of these methods, I-Con, to our knowledge, is the first to unify supervised, contrastive, clustering, and dimensionality reduction objectives under a single loss. This perspective clarifies their shared structure and opens paths to new learning principles. + +# 3 METHODS + +The I-Con framework unifies multiple representation learning methods under a single loss function: minimizing the average KL divergence between two conditional "neighborhood distributions" that define transition probabilities between data points. This information-theoretic objective generalizes techniques from clustering, contrastive learning, dimensionality reduction, spectral graph theory, and supervised learning. By varying the construction of the supervisory distribution and the learned distribution, I-Con encompasses a broad class of existing and novel methods. We introduce I-Con and demonstrate its ability to unify techniques from diverse areas and orchestrate the transfer of ideas across different domains, leading to a state-of-the-art unsupervised image classification method. + +# 3.1 INFORMATION CONTRASTIVE LEARNING + +Let $i, j \in \mathcal{X}$ be elements of a dataset $\mathcal{X}$ , with a probabilistic neighborhood function $p(j|i)$ defining a transition probability. To ensure valid probability distributions, $p(j|i) \geq 0$ and $\int_{j \in \mathcal{X}} p(j|i) = 1$ . We parameterize this distribution by $\theta \in \Theta$ , to create a learnable function $p_{\theta}(j|i)$ . Similarly, we define another distribution $q_{\phi}(j|i)$ parameterized by $\phi \in \Phi$ . The core I-Con loss function is then: + +$$ +\mathcal {L} (\theta , \phi) = \int_ {i \in \mathcal {X}} D _ {\mathrm {K L}} \left(p _ {\theta} (\cdot | i) | | q _ {\phi} (\cdot | i)\right) = \int_ {i \in \mathcal {X}} \int_ {j \in \mathcal {X}} p _ {\theta} (j | i) \log \frac {p _ {\theta} (j | i)}{q _ {\phi} (j | i)}. \tag {1} +$$ + +In practice, $p$ is typically a fixed "supervisory" distribution, while $q_{\phi}$ is learned by comparing deep network representations, prototypes, or clusters. Figure 2a illustrates this alignment process. The optimization aligns $q_{\phi}$ with $p$ , minimizing their KL divergence. Although most existing methods optimize only $q_{\phi}$ , I-Con also allows learning both $p_{\theta}$ and $q_{\phi}$ , although one must take care to prevent trivial solutions. + +# 3.2 UNIFYING REPRESENTATION LEARNING ALGORITHMS WITH I-CON + +Despite the incredible simplicity of Equation 1, this equation is rich enough to generalize several existing methods in the literature simply by choosing parameterized neighborhood distributions $p_{\theta}$ and $q_{\phi}$ as shown in Figure 1. We categorize common choices for $p_{\theta}$ and $q_{\phi}$ in Figure 2a. + +Table 1 summarizes some key choices which recreate popular methods from contrastive learning (SimCLR, MOCOV3, SupCon, CMC, CLIP, VICReg), dimensionality reduction (SNE, t-SNE, PCA), clustering (K-Means, Spectral, DCD, PMI), and supervised learning (Cross-Entropy and Harmonic Loss). Due to limited space, we defer proofs of each of these theorems to the supplemental material. We also note that Table 1 is not exhaustive, and we encourage the community to explore whether other learning frameworks implicitly minimize Equation 1 for some choice of $p$ and $q$ . + +# 3.2.1 EXAMPLE: SNE, SIMCLR, AND K-MEANS + +While I-Con unifies a broad range of methods, we illustrate how different choices of $p$ and $q$ recover well-known techniques such as SNE, SimCLR, and K-Means. Full details are in the appendix. + +SNE as "neighbors remain neighbors." Stochastic Neighbor Embedding (SNE) is a classic example. Given $x \in \mathbb{R}^{d \times n}$ with $n$ points in $d$ dimensions, SNE learns a low-dimensional representation $\phi \in \mathbb{R}^{m \times n}$ , typically $m \ll d$ . To preserve local structure, $p(j \mid i)$ is defined by placing a Gaussian around each high-dimensional point $x_i$ , and $q_{\phi}(j \mid i)$ by placing a Gaussian around $\phi_i$ . Minimizing the average KL divergence between these distributions ensures that points close in the original space remain close in the embedded space. + +SimCLR as "augmentations of the same image are neighbors." Contrastive learning methods like SimCLR and SupCon instead use class labels. Here, $p(j \mid i) = 1$ if $j$ is an augmentation of $i$ (and 0 otherwise). In the embedding space, $q_{\phi}(j \mid i)$ is defined via a Gaussian-like distribution based on cosine similarity. Minimizing their KL divergence encourages images from the same scene to cluster together. + +K-Means as "points that are close are members of the same clusters." Clustering-based approaches like K-Means and DCD follow a similar recipe. The distribution $p(j \mid i)$ is again Gaussian-based in the original space, while $q_{\phi}(j \mid i)$ reflects whether points are assigned to the same cluster in the learned representation. Minimizing KL divergence aligns these cluster assignments with the actual neighborhood structure in the data. Methods like K-Means include an entropy penalty to enforce hard probabilistic assignments, as shown in Theorem 13, whereas methods like DCD do not include it. + +![](images/5b42517ee51d4652022dd14d969d7a8d9de8afb68c3ff48c9059e92776697752.jpg) +(a) SNE (dimensionality reduction) + +![](images/076e62f964e23b8975157d991d42c628b4fb789a99f5e26700ae04fcf4c8ac59.jpg) + +![](images/acdca5f1cbd7a45d770a872f335da78832d41fc81393ae41916fce90e736cd42.jpg) +(b) SimCLR (contrastive learning) +(c) K-Means (clustering) +Figure 3: Examples of methods as special cases of I-Con via different choices of $p$ and $q$ , with corresponding code-style configurations. + +# 3.3 CREATING NEW REPRESENTATION LEARNERS WITH I-CON + +The I-Con framework unifies various approaches to representation learning under a single mathematical formulation and, crucially, facilitates the transfer of techniques among different domains. + +
MethodChoice of pθ(j|i)Choice of qφ(j|i)
(A) Dimensionality Reduction
SNE(Hinton & Roweis, 2002)Theorem 1Gaussian over data points, xiGaussian over learned low-dimensional points, φi exp(-||φi-φj||2)/∑k≠i exp(-||φi-φk||2)
t-SNE(Van der Maaten & Hinton, 2008)Corollary 1exp(-||xi-xj||2/2σi2)/∑k≠i exp(-||xi-xk||2/2σi2)Cauchy distribution over φi (1+||φi-φj||2)-1/∑k≠i (1+||φi-φk||2)-1
PCA(Pearson, 1901)Theorem 21[i=j]Wide Gaussian on linear projection features, fφ(xi) lim exp(-||fφ(xi)-fφ(xj)||2/2σ2) σ→∞ ∑k≠i exp(-||fφ(xi)-fφ(xk)||2/2σ2)
(B) Contrastive Learning
InfoNCE Loss(Bachman et al., 2019)Theorem 31/Z Π{i and j are a positive pair}Gaussian on deep normalized features exp(fφ(xi)·fφ(xj)) / ∑k≠i exp(fφ(xi)·fφ(xk))
Triplet Loss(Schroff et al., 2015)Theorem 5Gaussian on deep features (1 neg. sample, σ→0) exp(-||fφ(xi)-fφ(xj)||2/2σ2) / ∑k≠i exp(-||fφ(xi)-fφ(xk)||2/2σ2) k∈{i+, i-}
t-SimCLR, t-SimCNE(Hu et al., 2023; Böhm et al., 2023)Corollary 2Student-T on deep features (1+||φi-φj||2/ν)-(ν+1)/2/∑k≠i (1+||φi-φk||2/ν)-(ν+1)/2
VICReg*without covariance term(Bardes et al., 2021)Theorem 4Wide Gaussian on learned features exp(-||fφ(xi)-fφ(xj)||2/2σ2) lim σ→∞ ∑k≠i exp(-||fφ(xi)-fφ(xk)||2/2σ2)
SupCon(Khosla et al., 2020)Theorem 61/Z Π{i and j have same class}Gaussian on deep normalized features exp(fφ(xi)·fφ(xj)) / ∑k≠i exp(fφ(xi)·fφ(xk))
X-Sample(Sobal et al., 2025)Theorem 7Gaussian on corresponding embeddings exp(gθ(xi)·gθ(xj)) / ∑k≠i exp(gθ(xi)·θ(xk))
LGSimCLR(El Banani et al., 2023)1/Z Π{i is among xj's k nearest neighbors}
CMC & CLIP(Tian et al., 2020)Theorem 81/Z Π{i,j pos. pairs, Vi≠Vj}exp(fφ(xi)·fφ(xj)) / ∑k∈Vj exp(fφ(xi)·fφ(xk))
(C) Supervised Learning
Supervised Cross Entropy(Good, 1963)Theorem 9Indicator over classesexp(fφ(xi)·φj)/∑k∈C exp(fφ(xi)·φk)
Harmonic Loss(Baek et al., 2025)Theorem 101[i belongs to class j]Student-T on deep features and class prototypes lim σ→0 ∑k∈C (σ2+||fφ(xi)-φj||2)-n
Masked Lang. Modeling(Devlin et al., 2019)Theorem 111/Z # [Context i precedes token j]exp(fφ(xi)·φj)/∑k∈C exp(fφ(xi)·φk)
(D) Clustering
Probabilistic k-Means(Macqueen, 1967)Theorem 13Intra-cluster uniform probabilityGaussians on datapoints exp(-||xi-xj||2/2σi2)/∑k≠i exp(-||xi-xk||2/2σi2)
Spectral Clustering(Ng et al., 2001)Corollary 4∑c=1m p(fθ(xi) and fθ(xj) in c)/E[size of cluster c]Gaussians on spectral embeddings exp(-||xi-xj||2/2σi2)/∑k≠i exp(-||xi-xk||2/2σi2)
Normalized Cuts(Shi & Malik, 2000)Theorem 14Intra-cluster uniform probability weighted by degree p(fθ(xi) and fθ(xj) in c) · dj/∑c=1E[degree of cluster c]Gaussians on graph weights exp(wij/dj)/∑k exp(wik/dk)
PMI Clustering(Adaloglou et al., 2023)Theorem 151/k Π{j is k-NN of i}Intra-Cluster Uniform Probability ∑c=1m p(fθ(xi) and fθ(xj) in c)/E[size of cluster c]
Debiased InfoNCE Clustering(ours)Debiased Graph through Uniform Distribution and Neighbor Propagation∑c=1m (1-α)p(fθ(xi) and fθ(xj) in c)/∑c=1N E[size of cluster c] + α/N
+ +Table 1: I-Con unifies representation learners under different choices of ${p}_{\theta }\left( {j \mid i}\right)$ and ${q}_{\phi }\left( {j \mid i}\right)$ . +Proofs of the propositions in this table can be found in the supplement. + +![](images/fe4d39f1aa8356318f88c0fa3050de60459c709d906b04f6cff4881dbf66cd83.jpg) +(a) Continuous distance-based distributions control neighborhood width via hyperparameters. + +![](images/2431ec72ece302e5b5b58716cf8dd1ed4cb2266cd0c5a5351524245db022a14a.jpg) + +![](images/8a0c952e72306fae6243ace2f682a26a642030200b0cc0e54c257b141455bf7c.jpg) + +![](images/b4bdde395fc037afc583295311c9af135989615ddd81e6d7a9b6df7f4ea3751f.jpg) + +![](images/907bd8abe8bb93aaa300773c69304b05f8519b30dafb1c9cb02bd1602b8ce271.jpg) +(b) Graph-based distributions expand neighborhoods through structural strategies. + +![](images/518253dc455c9cb76cb2fe59ad6dd297a85f9bbb72f470a9d3a14146b3ff71e5.jpg) +Expanding Neighborhood with Neighbor Propagation +Figure 4: Neighborhood adaptation in continuous and discrete settings. (a) Distance-based distributions modulate neighborhood "width" via parameters such as $\sigma$ . (b) Graph-based approaches modify the connectivity directly, often via random walks or added edges, thereby broadening each node's neighborhood. + +For instance, a trick from contrastive learning can be applied to clustering—or vice versa. In this paper, we demonstrate how surveying modern representation methods enables the development of clustering and unsupervised classification algorithms that surpass previous performance levels. Specifically, we integrate insights from spectral clustering, t-SNE, and debiased contrastive learning (Chuang et al., 2020) to build a state-of-the-art unsupervised image classification pipeline. + +# 3.3.1 DEBASING + +Debiased Contrastive Learning (DCL) addresses the mismatch caused by random negative sampling in contrastive learning, especially when the number of classes is small. Randomly chosen negatives can turn out to be positives, introducing spurious repulsive forces between similar examples. Chuang et al. (2020) rectify this by subtracting out such false repulsion terms and boosting attractive forces, substantially improving representation quality. However, their method modifies the softmax itself, implying that $q_{j|i}$ is no longer a genuine probability distribution and making it more difficult to extend the approach to clustering or supervised tasks. + +Our view, grounded in the I-Con framework, suggests a simpler and more general alternative: rather than adjusting the learned distribution $q_{j|i}$ , we incorporate additional "uncertainty" directly into the supervisory distribution $p(j|i)$ . This preserves $q_{j|i}$ as a valid distribution and keeps the method applicable to tasks beyond contrastive learning. + +# 3.3.2 DEBIASING THROUGH A UNIFORM DISTRIBUTION + +Our first example adopts a simple uniform mixture: + +$$ +\tilde {p} (j | i) = (1 - \alpha) p (j | i) + \frac {\alpha}{N}, +$$ + +where $N$ is the local neighborhood size, and $\alpha$ specifies the degree of mixing. This approach assigns a small probability mass $\frac{\alpha}{N}$ to each "negative" sample, thereby mitigating overconfident allocations. In supervised contexts, this is analogous to label smoothing (Szegedy et al., 2016). In contrast, Chuang et al. (2020) adjust the softmax function itself while retaining one-hot labels. + +Another way to view this method is through the lens of heavier-tailed or broader distributions. By adding a uniform component, we mirror the idea in t-SNE's Student- $t$ distribution (Van der Maaten & Hinton, 2008), which allocates greater mass to distant points. In both cases, expanding the distribution reduces the chance of overfitting to a narrowly defined set of neighbors. + +![](images/1115831c2490af03af8a09fbb2ef0268bc5be6782c4b356a7c6d621cdf72308a.jpg) +Figure 5: Left: Debiasing cluster learning improves performance on ImageNet-1K across batch sizes. Center: Distribution of maximum predicted probabilities for the biased model ( $\alpha = 0$ ) showing poor calibration, with overconfident predictions. Right: Distribution of maximum predicted probabilities for the debiased model ( $\alpha = 0.4$ ), demonstrating improved probability calibration. Debiased training alleviates optimization stiffness by reducing the prevalence of saturated logits, mitigating vanishing gradient issues, and fostering more robust and well-calibrated learning dynamics. + +![](images/285e234500645a4383bd412f47d222a5cf43001076d5730caf8b2d9d1544d8c1.jpg) + +![](images/398193595930426d0d4914db4db8c98ca30b417cb8d56ed3744dfdc2131b7b0e.jpg) + +Empirical results in Tables 3, Figures 5, and 6 show that this lightweight modification consistently improves performance across various tasks and batch sizes. It also "relaxes" overconfident distributions, much like label smoothing in supervised cross entropy, thereby guarding against vanishing gradients. + +# 3.3.3 DEBIASING THROUGH NEIGHBOR PROPAGATION + +A second strategy applies graph-based expansions. As shown in Table 1, replacing k-Means' Gaussian neighborhoods with degree-weighted $k$ -nearest neighbors recovers spectral clustering, which is known for robust, high-quality solutions. Building on this idea, we train contrastive learners with KNN-based neighborhood definitions. Given the nearest-neighbor graph, we can further expand it by taking longer walks, analogous to Word-Graph2Vec or tsNET (Li et al., 2023; Kruiger et al., 2017), a process we term neighbor propagation. + +Formally, let $P$ be the conditional distribution matrix whose entries $P_{ij} = p(x_j \mid x_i)$ define the probability of selecting $x_j$ as a neighbor of $x_i$ . Interpreting $P$ as the adjacency matrix of the training data, we can smooth it by summing powers of $P$ up to length $k$ : + +$$ +\tilde {P} \propto P + P ^ {2} + \dots + P ^ {k}. +$$ + +We can further simplify this by taking a uniform distribution over all points reachable within $k$ steps, denoted by: + +$$ +\tilde {P} _ {U} \propto I [ P + P ^ {2} + \dots + P ^ {k} > 0 ], +$$ + +where $I[\cdot]$ is the indicator function. This walk-based smoothing broadens the effective neighborhood, allowing the model to learn from a denser supervisory signal. + +Tables 3 and 4 confirm that adopting such a propagation-based approach yields significant improvements in unsupervised image classification, underscoring the effectiveness of neighborhood expansion as a debiasing strategy. + +# 4 EXPERIMENTS + +In this section, we demonstrate that the I-Con framework offers testable hypotheses and practical insights into self-supervised and unsupervised learning. Rather than aiming only for state-of-the-art performance, our goal is to show how I-Con can enhance existing unsupervised learning methods + +by leveraging a unified information-theoretic approach. Through this framework, we also highlight the potential for cross-pollination between techniques in varied machine learning domains, such as clustering, contrastive learning, and dimensionality reduction. This transfer of techniques, enabled by I-Con, can significantly improve existing methodologies and open new avenues for exploration. + +We focus our experiments on clustering because it is relatively understudied compared to contrastive learning, and there are a variety of techniques that can now be adapted to this task. By connecting established methods such as k-Means, SimCLR, and t-SNE within the I-Con framework, we uncover a wide range of possibilities for improving clustering methods. We validate these theoretical insights experimentally, demonstrating the practical impact of I-Con. + +We evaluate the I-Con framework using the ImageNet-1K dataset (Deng et al., 2009), which consists of 1,000 classes and over one million high-resolution images. This dataset is considered one of the most challenging benchmarks for unsupervised image classification due to its scale and complexity. To ensure a fair comparison with prior works, we strictly adhere to the experimental protocol introduced by (Adaloglou et al., 2023). The primary metric for evaluating clustering performance is Hungarian accuracy, which measures the quality of cluster assignments by finding the optimal alignment between predicted clusters and ground truth labels via the Hungarian algorithm (Ji et al., 2019). This approach provides a robust measure of clustering performance in an unsupervised context, where direct label supervision is absent during training. + +For feature extraction, we utilize the DiNO pre-trained Vision Transformer (ViT) models in three variants: ViT-S/14, ViT-B/14, and ViT-L/14 (Caron et al., 2021). These models are chosen to ensure comparability with previous work and to explore how the I-Con framework performs across varying model capacities. The experimental setup, including training protocols, optimization strategies, and data augmentations, mirrors those used in TEMI to ensure consistency in methodology. + +The training process involved optimizing a linear classifier on top of the features extracted by the DiNO models. Each model was trained for 30 epochs, using ADAM (Kingma & Ba, 2017) with a batch size of 4096 and an initial learning rate of 1e-3. We decayed the learning rate by a factor of 0.5 every 10 epochs to allow for stable convergence. We do not apply additional normalization to the feature vectors. During training, we applied a variety of data augmentation techniques, including random re-scaling, cropping, color jittering, and Gaussian blurring, to create robust feature representations. Furthermore, to enhance the clustering performance, we pre-computed global nearest neighbors for each image in the dataset using cosine similarity. This allowed us to sample two augmentations and two nearest neighbors for each image in every training batch, thus incorporating both local and global information into the learned representations. We refer to our derived approach as "InfoNCE Clustering" in Table 2. In particular, we use a supervisory neighborhood comprised of augmentations, KNNs $(k = 3)$ , and KNN walks of length 1. We use the "shared cluster likelihood by cluster" neighborhood from k-Means (See table 1 for a more detailed Equation) as our learned neighborhood function to drive cluster learning. + +# 4.1 BASELINES + +We compare our method against several state-of-the-art clustering methods, including TEMI, SCAN, IIC, and Contrastive Clustering. These methods rely on augmentations and learned representations, but often require additional regularization terms or loss adjustments, such as controlling cluster size or reducing the weight of affinity losses. In contrast, our I-Con-based loss function is self-balancing and does not require such manual tuning, making it a cleaner, more theoretically grounded approach. This allows us to achieve higher accuracy and more stable convergence across three different-sized backbones. + +# 4.2 RESULTS + +Table 2 compared the Hungarian accuracy of Debiased InfoNCE Clustering across different DiNO variants (ViT-S/14, ViT-B/14, ViT-L/14) and several other modern clustering methods. The I-Con framework consistently outperforms the prior state-of-the-art method across all model sizes. Specifically, for the DiNO ViT-B/14 and ViT-L/14 models, debiased InfoNCE clustering achieves significant performance gains of $+4.5\%$ and $+7.8\%$ in Hungarian accuracy compared to TEMI, the prior state-of-the-art ImageNet clusterer. We attribute these improvements to two main factors: + +
MethodDiNO ViT-S/14DiNO ViT-B/14DiNO ViT-L/14
k-Means51.8452.2653.36
Contrastive Clustering47.3555.6459.84
SCAN49.2055.6060.15
TEMI56.8458.62-
Debiased InfoNCE Clustering (Ours)57.8 ± 0.2664.75 ± 0.1867.52 ± 0.28
+ +Self-Balancing Loss: Unlike TEMI or SCAN, which require hand-tuned regularizations (e.g., balancing cluster sizes or managing the weight of affinity losses), I-Con's loss function automatically balances these factors without additional regularization hyper-parameter tuning as we are using the exact same clustering kernel used by k-Means. This theoretical underpinning leads to more robust and accurate clusters. + +Cross-Domain Insights: I-Con leverages insights from contrastive learning to refine clustering by looking at pairs of images based on their embeddings, treating augmentations and neighbors similarly. This approach, originally successful in contrastive learning, translates well into clustering and leads to improved performance on noisy high-dimensional image data. + +# 4.3 ABLATIONS + +We conduct several ablation studies to experimentally justify the architectural improvements that emerged from analyzing contrastive clustering through the I-Con framework. These ablations focus on two key areas: the effect of incorporating debiasing into the target and embedding spaces and the impact of neighbor propagation strategies. + +Table 2: Comparison of methods on ImageNet-1K clustering with respect to Hungarian Accuracy. Debiased InfoNCE Clustering significantly outperforms the prior state-of-the-art TEMI. Note that TEMI does not report results for ViT-L. + +
MethodDiNO ViT-S/14DiNO ViT-B/14DiNO ViT-L/14
Baseline55.5163.0365.70
+ Debiasing57.27±0.0763.72 ± 0.0966.87 ± 0.07
+ KNN Propagation58.45 ± 0.2364.87 ± 0.1967.25 ± 0.21
+ EMA57.8 ± 0.2664.75 ± 0.1867.52 ± 0.28
+ +Table 3: Ablation study of new techniques discovered through the I-Con framework. We compare ImageNet-1K clustering accuracy across different sized backbones. + +
MethodDiNO ViT-S/14DiNO ViT-B/14DiNO ViT-L/14
Baseline55.5163.0365.72
+ KNNs56.4364.2665.70
+ 1-walks on KNN58.0964.2965.97
+ 2-walks on KNN57.8464.2767.26
+ 3-walks on KNN57.8264.1567.02
+ +Table 4: Ablation Study on Neighbor Propagation. Adding both KNNs and walks of length 1 or 2 on the KNN graph achieves the best performance. + +We perform experiments with different levels of debiasing in the target distribution, denoted by the parameter $\alpha$ , and test configurations where debiasing is applied to the target side, both sides (target and learned representations), or none. As seen in Figure 6, adding debiasing improves performance, with the optimal value typically around $\alpha = 0.6$ to $\alpha = 0.8$ , particularly when applied to both sides of the learning process. This method is similar to how debiasing work in contrastive learning by assuming that each negative sample has a non-zero probability $(\alpha / N)$ of being incorrect. Figure 5 shows how changing the value of $\alpha$ improves performance across different batch sizes. + +![](images/0793e0fe975321f3d7b346e4376667be4c330478827e654f799698c6bb80d600.jpg) +Figure 6: Effects of increasing the debias weight $\alpha$ on the supervisory neighborhood (blue line) and both the learned and supervisory neighborhood (red line). Adding some amount of debiasing helps in all cases, with a double debiasing yielding the largest improvements. + +In a second set of experiments, shown in Table 4, we examine the impact of neighbor propagation strategies. We evaluate clustering performance when local and global neighbors are included in the contrastive loss computation. Neighbor propagation, especially at small scales ( $s = 1$ and $s = 2$ ), significantly boosts performance across all model sizes, showing the importance of capturing local structure in the embedding space. Larger neighbor propagation values (e.g., $s = 3$ ) offer diminishing returns, suggesting that over-propagating neighbors may dilute the information from the nearest, most relevant points. Note that only DiNO-L/14 showed preference for large step size, and this is likely due to its higher k-nearest neighbor ability, so the augmented links are correct. + +Our ablation studies highlight that small adjustments in the debiasing parameter and neighbor propagation can lead to notable improvements that achieve a state-of-the-art result with a simple loss function. Additionally, sensitivity to $\alpha$ and propagation size varies across models, with larger models generally benefiting more from increased propagation but requiring fine-tuning of $\alpha$ for optimal performance. We recommend using $\alpha \approx 0.6$ to $\alpha \approx 0.8$ and limiting neighbor propagation to small values for a balance between performance and computational efficiency. + +# 5 CONCLUSION + +In summary, we have developed I-Con: a single information-theoretic equation that unifies a broad class of machine learning methods. We provide over 15 theorems that prove this assertion for many of the most popular loss functions used in clustering, spectral graph theory, supervised and unsupervised contrastive learning, dimensionality reduction, and supervised classification and regression. We not only theoretically unify these algorithms but show that our connections can help us discover new state-of-the-art methods, and apply improvements discovered for a particular method to any other method in the class. We illustrate this by creating a new method for unsupervised image classification that achieves a $+8\%$ improvement over prior art. We believe that the results presented in this work represent just a fraction of the methods that are potentially unfit-able with I-Con, and we hope the community can use this viewpoint to improve collaboration and analysis across algorithms and machine learning disciplines. + +Acknowledgments This research was partially sponsored by the Department of the Air Force Artificial Intelligence Accelerator and was conducted under Cooperative Agreement Number FA8750-19-2-1000, as well as NSF CIF 1955864 (Occlusion and Directional Resolution in Computational Imaging). We also acknowledge support from Quanta Computer. Additionally, we would like thank Phillip Isola, Andrew Zisserman, Yair Weiss, Justin Kay, and Shivam Duggal for valuable discussions and feedback. + +# BIBLIOGRAPHY + +Nikolas Adaloglou, Felix Michels, Hamza Kalisch, and Markus Kollmann. Exploring the limits of deep image clustering using pretrained models. arXiv preprint arXiv:2303.17896, 2023. +Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. Advances in neural information processing systems, 32, 2019. +David D Baek, Ziming Liu, Riya Tyagi, and Max Tegmark. Harmonic loss trains interpretable ai models. arXiv preprint arXiv:2502.01628, 2025. +Randall Balestriero and Yann LeCun. Contrastive and non-contrastive self-supervised learning recovery global and local spectral embedding methods. Advances in Neural Information Processing Systems, 35:26671-26685, 2022. +Adrien Bardes, Jean Ponce, and Yann LeCun. Vicreg: Variance-invariance-covariance regularization for self-supervised learning. arXiv preprint arXiv:2105.04906, 2021. +Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798-1828, 2013. +David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American statistical Association, 112(518):859-877, 2017. +Jan Niklas Böhm, Philipp Berens, and Dmitry Kobak. Unsupervised visualization of image datasets using contrastive learning. International Conference on Learning Representations, 2023. +Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers, 2021. URL https://arxiv.org/abs/2104.14294. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020a. +Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020b. +Xinlei Chen*, Saining Xie*, and Kaiming He. An empirical study of training self-supervised vision transformers. arXiv preprint arXiv:2104.02057, 2021. +Ching-Yao Chuang, Joshua Robinson, Lin Yen-Chen, Antonio Torralba, and Stefanie Jegelka. Debiased contrastive learning, 2020. URL https://arxiv.org/abs/2007.00224. +Keenan Crane, Clarisse Weischedel, and Max Wardetzky. Geodesics in heat: A new approach to computing distance based on heat flow. ACM Transactions on Graphics (TOG), 32(5):1-11, 2013. +Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the royal statistical society: series B (methodological), 39(1): 1-22, 1977. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding, 2019. URL https://arxiv.org/abs/1810.04805. +Mohamed El Banani, Karan Desai, and Justin Johnson. Learning visual representations via language-guided sampling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 19208-19220, 2023. + +Wouter Van Gansbeke, Simon Vandenhende, Stamatios Georgoulis, Marc Proesmans, and Luc Van Gool. Scan: Learning to classify images without labels, 2020. URL https://arxiv.org/abs/2005.12320. +Irving J Good. Maximum entropy for hypothesis formulation, especially for multidimensional contingency tables. The Annals of Mathematical Statistics, pp. 911-934, 1963. +Roger Grosse, Ruslan R Salakhutdinov, William T Freeman, and Joshua B Tenenbaum. Exploiting compositionality to explore a large space of model structures. arXiv preprint arXiv:1210.4856, 2012. +Geoffrey E Hinton and Sam Roweis. Stochastic neighbor embedding. Advances in neural information processing systems, 15, 2002. +Tianyang Hu, Zhili Liu, Fengwei Zhou, Wenjia Wang, and Weiran Huang. Your contrastive learning is secretly doing stochastic neighbor embedding. In International Conference on Learning Representations, 2023. +Xu Ji, Joao F Henriques, and Andrea Vedaldi. Invariant information clustering for unsupervised image classification and segmentation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9865-9874, 2019. +Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. Advances in neural information processing systems, 33:18661-18673, 2020. +Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2017. URL https://arxiv.org/abs/1412.6980. +Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84-90, 2017. +Johannes F Kruiger, Paulo E Rauber, Rafael Messias Martins, Andreas Kerren, Stephen Kobourov, and Alexandru C Telea. Graph layouts by t-sne. In Computer graphics forum, volume 36, pp. 283-294. Wiley Online Library, 2017. +Joseph B Kruskal. Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. Psychometrika, 29(1):1-27, 1964. +Phuc H Le-Khac, Graham Healy, and Alan F Smeaton. Contrastive representation learning: A framework and review. *IEEE Access*, 8:193907–193934, 2020. +Wenting Li, Jiahong Xue, Xi Zhang, Huacan Chen, Zeyu Chen, Feijuan Huang, and Yuanzhe Cai. Word-graph2vec: An efficient word embedding approach on word co-occurrence graph using random walk technique, 2023. URL https://arxiv.org/abs/2301.04312. +Yunfan Li, Peng Hu, Zitao Liu, Dezhong Peng, Joey Tianyi Zhou, and Xi Peng. Contrastive clustering. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pp. 8547-8555, 2021. +J Macqueen. Some methods for classification and analysis of multivariate observations. In Proceedings of 5-th Berkeley Symposium on Mathematical Statistics and Probability/University of California Press, 1967. +Leland McInnes, John Healy, and James Melville. Umap: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.03426, 2018. +Andrew Ng, Michael Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. Advances in neural information processing systems, 14, 2001. +Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. +Karl Pearson. Liii. on lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin philosophical magazine and journal of science, 2(11):559-572, 1901. + +Ben Poole, Sherjil Ozair, Aaron Van Den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In International Conference on Machine Learning, pp. 5171-5180. PMLR, 2019. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision, 2021. URL https://arxiv.org/abs/2103.00020. +Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 815-823, 2015. +Jianbo Shi and Jitendra Malik. Normalized cuts and image segmentation. IEEE Transactions on pattern analysis and machine intelligence, 22(8):888-905, 2000. +Vlad Sobal, Mark Ibrahim, Randall Balestriero, Vivien Cabannes, Diane Bouchacourt, Pietro Astolfi, Kyunghyun Cho, and Yann LeCun. X-sample contrastive loss: Improving contrastive learning with sample similarity graphs. International Conference on Learning Representations, 2025. +Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818-2826, 2016. +Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XI 16, pp. 776-794. Springer, 2020. +Michael Tschannen, Josip Djolonga, Paul K Rubenstein, Sylvain Gelly, and Mario Lucic. On mutual information maximization for representation learning. arXiv preprint arXiv:1907.13625, 2019. +Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. +Lilian Weng. Contrastive representation learning. _lilianweng.github.io_, May 2021. URL https://lilianweng.github.io/posts/2021-05-31-contrastive/. +Jianwei Yang, Chunyuan Li, Pengchuan Zhang, Bin Xiao, Ce Liu, Lu Yuan, and Jianfeng Gao. Unified contrastive learning in image-text-label space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 19163-19173, 2022. + +# APPENDIX + +A Additional Experiments on Debiasing Feature Learning 15 +B Proofs for Unifying Dimensionality Reduction Methods 17 +C Proofs for Unifying Feature Learning Methods 19 +D Proofs for Unifying Clustering Methods 24 +E I-Con as a Variational Method 27 +F Why do we need to unify representation learners? 28 +G How to choose neighborhood distributions for your problem 29 +H Comparing I-Con, MLE, and the KL Divergence 30 +I On I-Con's Hyperparameters 30 + +# A ADDITIONAL EXPERIMENTS ON DEBIASING FEATURE LEARNING + +The following experiments aim to test the effect of our debiasing approach in feature learning. We followed the experimental setup introduced by Hu et al. (Hu et al., 2023). The architecture consisted of a ResNet-34 backbone paired with a two-layer multilayer perceptron (MLP) feature extractor. The MLP included a hidden layer with 512 units and an output layer with 64 units, without batch normalization. + +CIFAR-10 & CIFAR-100. The models were trained on the CIFAR-10 dataset for 1000 epochs using the AdamW optimizer with the following hyperparameters: $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ , a learning rate of $1 \times 10^{-3}$ , a batch size of 1024, and a weight decay of $1 \times 10^{-5}$ . The learned kernel was either Gaussian or Student's t-distribution with degrees of freedom $d_{f} = 2$ . + +For evaluation, we used two methods: (1) linear probing on the 512-dimensional embeddings from the MLP's hidden layer, and (2) $k$ -nearest neighbors ( $k = 3$ ) classification based on the same embeddings for CIFAR-10 (in-distribution) and CIFAR-100 (out-of-distribution). + +STL-10 & Oxford-IIIT Pet. With a similar setup, the models were trained contrastively on STL-10 (in distribution) without labels using the same hyperparameters as in the CIFAR experiments. For evaluation, we performed (1) linear probing for the STL-10 classification task and Oxford-IIIT Pet binary classification, and (2) $k$ -nearest neighbors classification based on the same embeddings for STL-10 and Oxford-IIIT Pet with $k = 10$ . + +
MethodCIFAR10 (in distribution)CIFAR100 (out of distribution)
Linear ProbingKNNLinear ProbingKNN
qφis a Gaussian Distribution
SimCLR (Chen et al., 2020a)77.7980.0231.8240.27
DCL (Chuang et al., 2020)78.3283.1132.4442.10
Our Debiasing α = 0.279.5084.0732.5343.19
Our Debiasing α = 0.479.0785.0632.5343.29
Our Debiasing α = 0.679.3285.9030.6729.79
qφis a Student's t-distribution
t-SimCLR(Hu et al., 2023)90.9788.1438.9630.75
DCL (Chuang et al., 2020)DivergesDivergesDivergesDiverges
Our Debiasing α = 0.291.3188.3441.6232.88
Our Debiasing α = 0.492.7088.5041.9834.26
Our Debiasing α = 0.692.8688.9238.9232.51
+ +Table 5: Contrastive feature learning evaluation results for CIFAR10 and CIFAR100 datasets with various debasing $\alpha$ factors. Adding some amount of debasing helps raising accuracy in both linear probing and KNN classification. + +
MethodSTL-10 (in distribution)Oxford-IIIT Pet (out of distribution)
Linear ProbingKNNLogistic RegressionKNN
SimCLR (Chen et al., 2020a)77.7174.9274.8071.48
DCL (Chuang et al., 2020)78.3275.0374.4170.22
qφis a Student's t-distribution
t-SimCLR(Hu et al., 2023)85.1183.0583.4081.41
Our Debiasing α = 0.285.9483.1584.1181.15
Our Debiasing α = 0.486.1384.1484.0784.13
Our Debiasing α = 0.687.1883.5884.5183.04
+ +Table 6: Contrastive feature learning evaluation results for STL10 (in distribution) and Oxford-IIIT Pet (out of distribution) with various debasing $\alpha$ factors. Similar to the other experiments, our debasing helps raising accuracy in both linear probing and KNN classification. + +![](images/b763a8f5c6c2ae28aad25e63d09e2dbf566c76ae3c6add190d84e643d50dc9e4.jpg) +(a) STL-10 embeddings for SimCLR & DCL + +![](images/5bd55879e2715532d4a849d1858c61424fe2e220f1bfa7a1afcb5aa6cccdced8.jpg) + +![](images/931aecaba1ccc5ff023827cb96ed1363df1969cbd2d0a40f704112f580fce606.jpg) + +![](images/d0b6b5e2c767f6a58c97b37fc219f47fa507d8b8b3d039aa91bc151b0663096c.jpg) + +![](images/ceaa6c90e0f32e38bba0d477ac5a4ab3334cd27bf1d55e11a328c6aa10ed2650.jpg) +(c) CIFAR10 embeddings for models trained on with Gaussian distribution $q_{\phi}$ + +![](images/e28f80d50fc1b3e3a6f3adf11f3100a36f74aedbf05f25272b24ee5152fc335d.jpg) +(b) CIFAR-10 embeddings for SimCLR & DCL + +![](images/62a2fbe3f5583bb8cc034c4c3793dddbcaa9efed81909d617df4ca10c37c8709.jpg) + +![](images/9cb82b55e11ebb1cd136e61bf54eb823a0e20818274ac570d8df28ef24436d85.jpg) +(d) CIFAR10 features for models trained with Student's t-distribution $q_{\phi}$ + +![](images/986c604dd0b49285b2e6fee0dc5c9c02491d21717b675a87964f680ff6f79495.jpg) + +![](images/a2ab0e3da780172e616aab6307043491fd15b29114aef7797cf6d60f23e8a865.jpg) + +![](images/a37a9f64f8cb4990a773e0a1cf99a7aa0a00ffa55d74ab6abb2344498b3f5fe1.jpg) +(e) STL-10 features for models trained with Student's t-distribution $q_{\phi}$ + +![](images/7ce29b1dd090e90fb686f98c942add9375cd7d796124c29ff9c429e18e30c3ce.jpg) +Figure 7: t-SNE visualizations of learned embeddings on CIFAR10 and STL10 datasets. (a) and (b) display embeddings from the DCL (Chuang et al., 2020) method before and after applying debiasing, showing a tendency to heavily cluster data points, which may hinder out-of-distribution generalization (Hu et al., 2023). (c) and (d) show embeddings with Student's t-distribution, where the debiasing factor $\alpha$ enhances clustering and separation, resulting in improved data representation. + +![](images/4977cabf410c446fd3e59fc49c25aa85d67e762632589defc694ec37b1d467ee.jpg) + +![](images/9b367da7588ce2e5cfd1e6b6ce11f31e0f583e3997f3fadf220436c104053783.jpg) + +# B PROOFS FOR UNIFYING DIMENSIONALITY REDUCTION METHODS + +We begin by defining the setup for dimensionality reduction methods in the context of I-Con. Let $x_{i} \in \mathbb{R}^{d}$ represent high-dimensional data points, and $\phi_i \in \mathbb{R}^m$ represent their corresponding low-dimensional embeddings, where $m \ll d$ . The goal of dimensionality reduction methods, such as Stochastic Neighbor Embedding (SNE) and t-Distributed Stochastic Neighbor Embedding (t-SNE), is to learn these embeddings such that neighborhood structures in the high-dimensional space are preserved in the low-dimensional space. In this context, the low-dimensional embeddings $\phi_{i}$ can be interpreted as the outputs of a mapping function $f_{\theta}(x_{i})$ , where $f_{\theta}$ is essentially an embedding matrix or look-up table. The I-Con framework is well-suited to express this relationship through a KL divergence loss between two neighborhood distributions: one in the high-dimensional space and one in the low-dimensional space. + +Theorem 1. Stochastic Neighbor Embedding (SNE) (Hinton & Roweis, 2002) is an instance of the I-Con framework. + +Proof. This is one of the most straightforward proofs in this paper, essentially based on the definition of SNE. The target distribution (supervised part), described by the neighborhood distribution in the high-dimensional space, is given by: + +$$ +p _ {\theta} (j | i) = \frac {\exp \left(- \| x _ {i} - x _ {j} \| ^ {2} / 2 \sigma_ {i} ^ {2}\right)}{\sum_ {k \neq i} \exp \left(- \| x _ {i} - x _ {k} \| ^ {2} / 2 \sigma_ {i} ^ {2}\right)}, +$$ + +while the learned low-dimensional neighborhood distribution is: + +$$ +q _ {\phi} (j | i) = \frac {\exp \left(- \| \phi_ {i} - \phi_ {j} \| ^ {2}\right)}{\sum_ {k \neq i} \exp \left(- \| \phi_ {i} - \phi_ {k} \| ^ {2}\right)}. +$$ + +The objective is to minimize the KL divergence between these distributions: + +$$ +\mathcal {L} = \sum_ {i} D _ {\mathrm {K L}} \left(p _ {\theta} (\cdot | i) \| q _ {\phi} (\cdot | i)\right) = \sum_ {i} \sum_ {j} p _ {\theta} (j | i) \log \frac {p _ {\theta} (j | i)}{q _ {\phi} (j | i)}. +$$ + +The embeddings $\theta_{i}$ are learned implicitly by minimizing $\mathcal{L}$ . The mapper is an embedding matrix, as SNE is a non-parametric optimization. Therefore, SNE is a special case of the I-Con framework, where $p_{\theta}(j|i)$ and $q_{\phi}(j|i)$ represent the neighborhood probabilities in the high- and low-dimensional spaces, respectively. + +Corollary 1 (t-SNE (Van der Maaten & Hinton, 2008)). t-SNE is an instance of the I-Con framework. + +Proof. The proof is similar to the one for SNE. While the high-dimensional target distribution $p_{\theta}(j|i)$ remains unchanged, t-SNE modifies the low-dimensional distribution to a Student's t-distribution with one degree of freedom (Cauchy distribution): + +$$ +q _ {\phi} (j | i) = \frac {(1 + \| \phi_ {i} - \phi_ {j} \| ^ {2}) ^ {- 1}}{\sum_ {k \neq i} (1 + \| \phi_ {i} - \phi_ {k} \| ^ {2}) ^ {- 1}}. +$$ + +The objective remains to minimize the KL divergence. Therefore, t-SNE is an instance of the I-Con framework. + +Proposition 1. Let $X \coloneqq \{x_{i}\}_{i = 1}^{n}$ , then the following cohesion variance loss + +$$ +\mathcal {L} _ {\text {c o h e s i o n - v a r}} = \frac {1}{n} \sum_ {i j} w _ {i j} \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} - 2 \operatorname {V a r} (X) +$$ + +is an instance of $I - \text{Con}$ in the special case $w_{ij} = p(j|i)$ and $q_{\phi}$ is Gaussian as with a large width as $\sigma \to \infty$ . + +Proof. By using AM-GM inequality, we have + +$$ +\frac {1}{n} \sum_ {k = 1} ^ {n} e ^ {- z _ {k}} \geq \left(\Pi_ {k = 1} ^ {n} e ^ {- z _ {k}}\right) ^ {\frac {1}{n}} \Rightarrow \frac {1}{n} \sum_ {k = 1} ^ {n} e ^ {- z _ {k}} \geq \left(e ^ {- \sum_ {k = 1} ^ {n} z _ {k}}\right) ^ {\frac {1}{n}} +$$ + +which implies that + +$$ +\log \sum_ {k = 1} ^ {n} e ^ {- z _ {k}} - \log n \geq \log \left(e ^ {- \sum_ {k = 1} ^ {n} z _ {k}}\right) ^ {\frac {1}{n}} \Rightarrow \log \sum_ {k = 1} ^ {n} e ^ {- z _ {k}} \geq - \frac {1}{n} \sum_ {k = 1} ^ {n} z _ {k} + \log (n) +$$ + +Alternatively, this can be written as + +$$ +- \log \sum_ {k = 1} ^ {n} e ^ {- z _ {k}} \leq \frac {1}{n} \sum_ {k = 1} ^ {n} z _ {k} - \log (n) +$$ + +Now assume that we have a Gaussian Kernel $q_{\phi}$ + +$$ +q _ {\phi} (j | i) = \frac {\exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} / \sigma^ {2}\right)}{\sum_ {k \neq i} \exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2} / \sigma^ {2}\right)}, +$$ + +Therefore, given the inequality of exp-sum that we showed above, we have + +$$ +\begin{array}{l} \log q _ {\phi} (j | i) = - \frac {\| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2}}{\sigma^ {2}} - \log \sum_ {k \neq i} \exp \left(- \frac {\| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}}{\sigma^ {2}}\right) \\ \leq - \frac {1}{\sigma^ {2}} \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} + \frac {1}{n \sigma^ {2}} \sum_ {k \neq i} \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2} - \log (n) \\ = - \frac {1}{\sigma^ {2}} \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} + \frac {1}{n} \sum_ {k \neq i} \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}\right) - \log (n) \\ \end{array} +$$ + +Therefore, the cross entropy $H(p_{\theta}, q_{\phi})$ , is bounded by + +$$ +\begin{array}{l} H \left(p _ {\theta}, q _ {\phi}\right) = - \frac {1}{n} \sum_ {i} \sum_ {j} p (j | i) \log q _ {\phi} (j | i) \\ \leq \frac {1}{n} \sum_ {i} \sum_ {j} p (j | i) \left(\frac {1}{\sigma^ {2}} (- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} + \frac {1}{n} \sum_ {k \neq i} \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}) - \log (n)\right) \\ = \frac {1}{\sigma^ {2}} \left(\frac {1}{n} \sum_ {i j} p (j | i) \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} - \frac {1}{n ^ {2}} \sum_ {i j k} p (j | i) \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}\right) - \log (n) \\ = \frac {1}{\sigma^ {2}} \left(\frac {1}{n} \sum_ {i j} p (j | i) \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} - 2 \operatorname {V a r} (X)\right) + \log (n) \\ = \frac {1}{\sigma^ {2}} \left(\frac {1}{n} \sum_ {i j} p (j | i) \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} - 2 \operatorname {V a r} (X)\right) + \log (n) \\ = \frac {1}{\sigma^ {2}} \mathcal {L} _ {\text {c o h e s i o n - v a r}} + \log (n) \\ \end{array} +$$ + +On the other hand, the L.H.S. can be upper bounded by using second order bound $e^{-z} \leq 1 - z + z^2 / 2$ , which implies that + +$$ +- \log \sum_ {k = 1} ^ {n} e ^ {- z _ {k}} \geq \log (1 - \frac {1}{n} \sum_ {k = 1} ^ {n} z _ {k} + \frac {1}{n} \sum_ {k = 1} ^ {n} z _ {k} ^ {2}) - \log (n) +$$ + +On the other hand, $\log (1 + u)\geq u - u^2 /2$ , therefore, + +$$ +- \log \sum_ {k = 1} ^ {n} e ^ {- z _ {k}} \geq (1 - \frac {1}{n} \sum_ {k = 1} ^ {n} z _ {k} + \frac {1}{n} \sum_ {k = 1} ^ {n} z _ {k} ^ {2}) - \frac {1}{2} (1 - \frac {1}{n} \sum_ {k = 1} ^ {n} z _ {k} + \frac {1}{n} \sum_ {k = 1} ^ {n} z _ {k} ^ {2}) ^ {2} - \log (n) +$$ + +Therefore, in the limit $\sigma \to \infty$ , the bounds become tighter and the I-Con loss approaches the cohesion variance loss. + +Theorem 2. Principal Component Analysis (PCA) is an asymptotic instance of the I-Con. + +Proof. By using Proposition 1. When $p_{j|i} = \mathbf{1}[i = j]$ , we have the following expression for $\mathcal{L}$ + +$$ +\begin{array}{l} \mathcal {L} = \frac {1}{n} \sum_ {i j} p _ {j | i} \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} - 2 \operatorname {V a r} (X) \\ = \frac {1}{n} \sum_ {i} \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {i}) \| ^ {2} - 2 \operatorname {V a r} (X) \\ = - 2 \operatorname {V a r} (X) \\ \end{array} +$$ + +Therefore, minimizing $\mathcal{L}$ is equivalent to maximizing the variance which is the equivalent of the PCA objective. Intuitively, the KL divergence is asking $-\| f_{\phi}(x_i) - f_{\phi}(x_j)\|^2 = 0$ to be the maximum in comparison to $-\| f_{\phi}(x_i) - f_{\phi}(x_j)\|^2$ to match the supervisory indicator function, which implies the minimization of the sum of $-\| f_{\phi}(x_i) - f_{\phi}(x_j)\|^2$ , which is maximizing the variance. If we restrict $f_{\phi}$ to be a linear projection map, then minimizing $\mathcal{L}$ would be equivalent to PCA. + +# C PROOFS FOR UNIFYING FEATURE LEARNING METHODS + +We now extend the I-Con framework to feature learning methods commonly used in contrastive learning. Let $x_{i} \in \mathbb{R}^{d}$ be the input data points, and $f_{\phi}(x_{i}) \in \mathbb{R}^{m}$ be their learned feature embedding. In contrastive learning, the goal is to learn these embeddings such that similar data points (positive pairs) are close in the embedding space, while dissimilar points (negative pairs) are far apart. This setup can be expressed using a neighborhood distribution in the original space, where "neighbors" are defined not by proximity in Euclidean space, but by predefined relationships such as data augmentations or class membership. The learned embeddings $f_{\phi}(x_{i})$ define a new distribution over neighbors, typically using a Gaussian kernel in the learned feature space. We show that InfoNCE is a natural instance of the I-Con framework, and many other methods, such as SupCon, CMC, and Cross Entropy, follow from this. + +Theorem 3 (InfoNCE (Bachman et al., 2019)). InfoNCE is an instance of the I-Con framework. + +Proof. InfoNCE aims to maximize the similarity between positive pairs while minimizing it for negative pairs in the learned feature space. In the I-Con framework, this can be interpreted as minimizing the divergence between two distributions: the neighborhood distribution in the original space and the learned distribution in the embedding space. + +The neighborhood distribution $p_{\theta}(j|i)$ is uniform over the positive pairs, defined as: + +$$ +p _ {\theta} (j | i) = \left\{ \begin{array}{l l} \frac {1}{k} & \text {i f x _ {j} i s a m o n g t h e k p o s i t i v e v i e w s o f x _ {i} ,} \\ 0 & \text {o t h e r w i s e .} \end{array} \right. +$$ + +where $k$ is the number of positive pairs for $x_{i}$ . + +The learned distribution $q_{\phi}(j|i)$ is based on the similarities between the embeddings $f_{\phi}(x_i)$ and $f_{\phi}(x_j)$ , constrained to unit norm $(\| f_{\phi}(x_i)\| = 1)$ . Using a temperature-scaled Gaussian kernel, this distribution is given by: + +$$ +q _ {\phi} (j | i) = \frac {\exp {(f _ {\phi} (x _ {i}) \cdot f _ {\phi} (x _ {j}) / \tau)}}{\sum_ {k \neq i} \exp {(f _ {\phi} (x _ {i}) \cdot f _ {\phi} (x _ {k}) / \tau)}}, +$$ + +where $\tau$ is the temperature parameter controlling the sharpness of the distribution. Since $\| f_{\phi}(x_i)\| = 1$ , the Euclidean distance between $f_{\phi}(x_i)$ and $f_{\phi}(x_j)$ is $2 - 2(f_{\phi}(x_i)\cdot f_{\phi}(x_j))$ . + +The InfoNCE loss can be written in its standard form: + +$$ +\mathcal {L} _ {\mathrm {I n f o N C E}} = - \sum_ {i} \log \frac {\exp \left(f _ {\phi} (x _ {i}) \cdot f _ {\phi} (x _ {i} ^ {+}) / \tau\right)}{\sum_ {k} \exp \left(f _ {\phi} (x _ {i}) \cdot f _ {\phi} (x _ {k}) / \tau\right)}, +$$ + +where $j^+$ is the index of a positive pair for $i$ . Alternatively, in terms of cross-entropy, the loss becomes: + +$$ +\mathcal {L} _ {\text {I n f o N C E}} \propto \sum_ {i} \sum_ {j} p _ {\theta} (j | i) \log q _ {\phi} (j | i) = H (p _ {\theta}, q _ {\phi}), +$$ + +where $H(p_{\theta}, q_{\phi})$ denotes the cross-entropy between the two distributions. Since $p_{\theta}(j|i)$ is fixed, minimizing the cross-entropy $H(p_{\theta}, q_{\phi})$ is equivalent to minimizing the KL divergence $D_{\mathrm{KL}}(p_{\theta} \| q_{\phi})$ . By aligning the learned distribution $q_{\phi}(j|i)$ with the target distribution $p_{\theta}(j|i)$ , InfoNCE operates within the I-Con framework, where the neighborhood structure in the original space is preserved in the embedding space. Thus, InfoNCE is a direct instance of I-Con, optimizing the same divergence-based objective. + +Corollary 2. t-SimCLR and t-SimCNE (Hu et al., 2023; Böhm et al., 2023) are instances of the I-Con framework. + +Given the proof of Theorem 3, we can see that t-SimCLR is equivariant by having the same $p_{\theta}$ but $q_{\phi}$ would change from a Gaussian distribution over cosine similarity to a Student-T distribution over a Euclidean distance. + +$$ +q _ {\phi} (j | i) = \frac {\left(\| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} / \tau\right) ^ {- 1}}{\sum_ {k \neq i} \left(\| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2} / \tau\right) ^ {- 1}}, +$$ + +Theorem 4. VICReg Bardes et al. (2021) without a covariance term is an instance of the I-Con framework. + +Given Proposition 1, we know that any loss in the cohesion variance form is an instance of $I$ -Con: + +$$ +\mathcal {L} = \frac {1}{n} \sum_ {i j} p _ {j | i} \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2} - 2 \mathrm {V a r} (X) +$$ + +If we choose $p_{j|i}$ to be an indicator over positive pairs, $i$ and $i^{+}$ , we obtain + +$$ +\mathcal {L} = \frac {1}{n} \sum_ {i} | | f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {i +}) | | ^ {2} - 2 \mathrm {V a r} (X) +$$ + +which is the VICReg loss without the covariance term and with an invariance-to-variance term ratio of 1:2. Observe that VICReg does not have negative pairs because it applies an equal repulsion force to all points. This is equivalent to taking $\sigma \rightarrow \infty$ in the conditional Gaussian distribution over the embeddings. + +Theorem 5 (Triplet Loss (Schroff et al., 2015)). Triplet Loss can be viewed as an instance of the I-Con framework with the following distributions $p_{\theta}(j|i)$ and $q_{\phi}(j|i)$ : + +$$ +p _ {\theta} (j | i) = \left\{ \begin{array}{l l} \frac {1}{k} & \text {i f x _ {j} i s a m o n g t h e k p o s i t i v e v i e w s o f x _ {i}}, \\ 0 & \text {o t h e r w i s e}, \end{array} \right. +$$ + +$$ +q _ {\phi} (j | i) = \frac {\exp \left(- \frac {\| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2}}{\sigma^ {2}}\right)}{\sum_ {k \neq i} \exp \left(- \frac {\| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}}{\sigma^ {2}}\right)}, +$$ + +particularly in the special case where only two neighbors are considered: one positive view and one negative view. + +Proof. The idea of this proof was first presented at (Khosla et al., 2020) using Taylor Approximation; however, in this proof we present a stronger bounds for this result. For simplicity, we set $\sigma = 1$ (the general bounds for other $\sigma$ values are provided at the end of the proof). + +$$ +\mathcal {L} = - \frac {1}{N} \sum_ {i} \sum_ {j} q _ {\phi} (j | i) \log \frac {\exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2}\right)}{\sum_ {k \neq i} \exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}\right)}. +$$ + +In the special case where each anchor $x_{i}$ has exactly one positive $x_{i}^{+}$ and one negative $x_{i}^{-}$ example, the denominator simplifies to: + +$$ +\sum_ {k \neq i} \exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}\right) = \exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {i} ^ {+}) \| ^ {2}\right) + \exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {i} ^ {-}) \| ^ {2}\right). +$$ + +Let $d_i^+ = \| f_\phi(x_i) - f_\phi(x_i^+)\|^2$ and $d_i^- = \| f_\phi(x_i) - f_\phi(x_i^-)\|^2$ . Substituting these into the loss function, we obtain: + +$$ +\begin{array}{l} \mathcal {L} = - \frac {1}{N} \sum_ {i} \log \frac {\exp \left(- d _ {i} ^ {+}\right)}{\exp \left(- d _ {i} ^ {+}\right) + \exp \left(- d _ {i} ^ {-}\right)} \\ = - \frac {1}{N} \sum_ {i} \log \left(\frac {1}{1 + \exp \left(d _ {i} ^ {-} - d _ {i} ^ {+}\right)}\right) \\ = \frac {1}{N} \sum_ {i} \log \left(1 + \exp \left(d _ {i} ^ {+} - d _ {i} ^ {-}\right)\right). \\ \end{array} +$$ + +Recognizing that the expression inside the logarithm is the softplus function, we can leverage its well-known bounds: + +$$ +\max (z, 0) \leq \log (1 + \exp (z)) \leq \max (z, 0) + \log (2). +$$ + +By letting $z = d_i^+ -d_i^-$ , we substitute into the bounds to obtain: + +$$ +\frac {1}{N} \sum_ {i} \max \left(d _ {i} ^ {+} - d _ {i} ^ {-}, 0\right) \leq \mathcal {L} \leq \frac {1}{N} \sum_ {i} \max \left(d _ {i} ^ {+} - d _ {i} ^ {-}, 0\right) + \log (2), +$$ + +where the left-hand side is the Triplet loss $\mathcal{L}_{\mathrm{Triplet}} = \frac{1}{N}\sum_{i}\max (d_{i}^{+} - d_{i}^{-},0)$ . Therefore, we obtain the following bounds: + +$$ +\mathcal {L} - \log (2) \leq \mathcal {L} _ {\text {T r i p l e t}} \leq \mathcal {L}. +$$ + +For a general $\sigma$ , the inequality bounds are as follows: + +$$ +\mathcal {L} _ {\sigma} - \sigma^ {2} \log (2) \leq \mathcal {L} _ {\text {T r i p l e t}} \leq \mathcal {L} _ {\sigma}, +$$ + +where + +$$ +\mathcal {L} _ {\sigma} = - \frac {\sigma^ {2}}{N} \sum_ {i} \sum_ {j} q _ {\phi} (j | i) \log \frac {\exp \left(- \frac {\| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2}}{\sigma^ {2}}\right)}{\sum_ {k \neq i} \exp \left(- \frac {\| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}}{\sigma^ {2}}\right)}. +$$ + +As $\sigma$ approaches 0, $\mathcal{L}_{\mathrm{Triplet}}$ approaches $\mathcal{L}_{\sigma}$ . + +Theorem 6. The Supervised Contrastive Loss (Khosla et al., 2020) is an instance of the I-Con framework. + +Proof. This follows directly from Theorem 3. Define the supervisory and target distributions as: + +$$ +q _ {\phi} (j \mid i) = \frac {\exp \left(f _ {\phi} (x _ {i}) \cdot f _ {\phi} (x _ {j}) / \tau\right)}{\sum_ {k \neq i} \exp \left(f _ {\phi} (x _ {i}) \cdot f _ {\phi} (x _ {k}) / \tau\right)}, +$$ + +$$ +p _ {\theta} (j \mid i) = \frac {1}{K _ {i} - 1} \mathbf {1} [ i \text {a n d} j \text {s h a r e t h e s a m e l a b e l} ], +$$ + +where $f_{\phi}$ is the mapping to deep feature space and $K_{i}$ is the number of samples in the class of $i$ . Substituting these definitions into the I-Con framework recovers the Supervised Contrastive Loss. + +□ + +Theorem 7. The $X$ -Sample Contrastive Learning Loss (Sobal et al., 2025) is an instance of the I-Con framework. + +Proof. Consier the following $p$ distribution over corresponding features (e.g. caption embeddings for images): + +$$ +\frac {\exp \left(g _ {\theta} (x _ {i}) \cdot g _ {\theta} (x _ {j})\right)}{\sum_ {k \neq i} \exp \left(g _ {\theta} (x _ {i}) \cdot_ {\theta} (x _ {k})\right)} +$$ + +where $g$ could be either a parametric or a non-parametric mapper to the corresponding embeddings $g_{\theta}(x_i)$ . On the other hand, similar to most feature learning methods, the learned distribution is a Gaussian over learned embeddings with cosine distance + +$$ +q _ {\phi} (j \mid i) = \frac {\exp \big (f _ {\phi} (x _ {i}) \cdot f _ {\phi} (x _ {j}) \big)}{\sum_ {k \neq i} \exp \big (f _ {\phi} (x _ {i}) \cdot f _ {\phi} (x _ {k}) \big)} +$$ + +where $f_{\phi}$ is the mapping to deep feature space. + +![](images/0ea365c3612b4d4ab6b55f3ce71ee69163d572473bba8ec0f0bf2bdb20a4e19c.jpg) + +Theorem 8. Contrastive Multiview Coding (CMC) and CLIP are instances of the I-Con framework. + +Proof. Since we have already established that InfoNCE is an instance of the I-Con framework, this corollary follows naturally. The key difference in Contrastive Multiview Coding (CMC) and CLIP is that they optimize alignment across different modalities. The target probability distribution $p_{\theta}(j|i)$ can be expressed as: + +$$ +p _ {\theta} (j | i) = \frac {1}{Z} \mathbb {1} [ i \text {a n d} j \text {a r e p o s i t i v e p a i r s a n d} V _ {i} \neq V _ {j} ], +$$ + +where $V_{i}$ and $V_{j}$ represent the modality sets of $x_{i}$ and $x_{j}$ , respectively. Here, $p_{\theta}(j|i)$ assigns uniform probability over positive pairs drawn from different modalities. + +The learned distribution $q_{\phi}(j|i)$ , in this case, is based on a Gaussian similarity between deep features, but conditioned on points from the opposite modality set. Thus, the learned distribution is defined as: + +$$ +q _ {\phi} (j | i) = \frac {\exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {j}) \| ^ {2}\right)}{\sum_ {k \in V _ {j}} \exp \left(- \| f _ {\phi} (x _ {i}) - f _ {\phi} (x _ {k}) \| ^ {2}\right)}. +$$ + +This formulation shows that CMC and CLIP follow the same principles as InfoNCE but apply them in a multiview setting, fitting seamlessly within the I-Con framework by minimizing the divergence between the target and learned distributions across different modalities. + +Theorem 9. Cross-Entropy classification is an instance of the I-Con framework. + +Proof. Cross-Entropy can be viewed as a special case of the CMC loss, where one "view" corresponds to the data point features and the other to the class logits. The affinity between a data point and a class is based on whether the point belongs to that class. This interpretation has been explored in prior work, where Cross-Entropy was shown to be related to the CLIP loss (Yang et al., 2022). $\square$ + +Theorem 10. Harmonic Loss for classification is an instance of the I-Con framework. + +Proof. This is the equivalent of moving from a Gaussian distribution for $q(j|i)$ in Cross-Entropy to a Student-T distribution analogs to moving from SNE to t-SNE. More specifically, let $V$ be the set of data points, $C$ the set of class prototypes, $\phi_i$ be the learned class prototype for class $i$ , and $n$ be the harmonic loss degree. + +Consider the following $p$ , which is a data-label indicator + +$$ +p (j | i) = \mathbb {1} [ i \text {b e l o n g s t o c l a s s} j ] +$$ + +and the following $q$ , which is a Student-T distribution with $2n - 1$ degrees for freedom. + +$$ +\lim _ {\sigma \rightarrow 0} \frac {\left(1 + \| f _ {\phi} (x _ {i}) - \phi_ {j} \| ^ {2} / ((2 n - 1) \sigma^ {2})\right) ^ {- n}}{\sum_ {k \in C} \left(1 + \| f _ {\phi} (x _ {i}) - \phi_ {k} \| ^ {2} / ((2 n - 1) \sigma^ {2})\right) ^ {- n}} +$$ + +It can be rewritten as + +$$ +\lim _ {\sigma \rightarrow 0} \frac {((2 n - 1) \sigma^ {2}) + \| f _ {\phi} (x _ {i}) - \phi_ {j} \| ^ {2}) ^ {- n}}{\sum_ {k \in C} ((2 n - 1) \sigma^ {2}) + \| f _ {\phi} (x _ {i}) - \phi_ {k} \| ^ {2} /) ^ {- n}} +$$ + +As $\sigma \to \infty$ , the loss function approaches + +$$ +\mathcal {L} = \sum_ {i \in C} \frac {(\| f _ {\phi} (x _ {i}) - \phi_ {j} \| ^ {2}) ^ {- n}}{\sum_ {k \in C} (\| f _ {\phi} (x _ {i}) - \phi_ {k} \| ^ {2} /) ^ {- n}} +$$ + +which's the Harmonic Loss for classification as introduced by 10 + +![](images/b759de54d38c16f0795ceec5b88eab5c3c26480a869dec07dc7fcd050cb9946a.jpg) + +Theorem 11. Masked Language Modeling (MLM) (Devlin et al., 2019) loss is an instance of the I-Con framework. + +Proof. In Masked Language Modeling, the objective is to predict a masked token $j$ given its surrounding context $x_{i}$ . This setup fits naturally within the I-Con framework by defining appropriate target and learned distributions. + +The target distribution $p_{\theta}(j|i)$ is the empirical distribution over contexts $i$ and tokens $j$ , defined as: + +$$ +p _ {\theta} (j \mid i) = \frac {1}{Z} \# [ \text {C o n t e x t} i \text {p r e c e d e s t o k e n} j ], +$$ + +where $\#$ [Context $i$ precedes token $j$ ] counts the number of times token $j$ follows context $x_{i}$ in the training corpus and $Z$ is a normalization constant ensuring that $\sum_{j}p_{\theta}(j|i) = 1$ . + +The learned distribution $q_{\phi}(j|i)$ is modeled using the neural network's output logits for token predictions. It is defined as a softmax over the dot product between the context embedding $f_{\phi}(x_i)$ and the token embeddings $\phi_j$ : + +$$ +q _ {\phi} (j | i) = \frac {\exp \left(f _ {\phi} \left(x _ {i}\right) \cdot \phi_ {j}\right)}{\sum_ {k \in \mathcal {V}} \exp \left(f _ {\phi} \left(x _ {i}\right) \cdot \phi_ {k}\right)}, +$$ + +where $f_{\phi}(x_i)$ is the embedding of the context $x_i$ produced by the model, $\phi_j$ is the embedding of token $j$ , and $\mathcal{V}$ is the vocabulary of all possible tokens. + +The MLM loss aims to minimize the cross-entropy between the target distribution $p_{\theta}(j|i)$ and the learned distribution $q_{\phi}(j|i)$ : + +$$ +\mathcal {L} _ {\mathrm {M L M}} = - \sum_ {i} \sum_ {j} p _ {\theta} (j | i) \log q _ {\phi} (j | i) = H (p _ {\theta}, q _ {\phi}). +$$ + +Since in practice, for each context $x_{i}$ , only the true masked token $j_{i}^{*}$ is considered, the target distribution simplifies to: + +$$ +p _ {\theta} (j | i) = \delta_ {j, j _ {i} ^ {*}}, +$$ + +where $\delta_{j,j_i^*}$ is the Kronecker delta function, equal to 1 if $j = j_{i}^{*}$ and 0 otherwise. + +Substituting this into the loss function, the MLM loss becomes: + +$$ +\mathcal {L} _ {\mathrm {M L M}} = - \sum_ {i} \log q _ {\phi} \left(j _ {i} ^ {*} \mid x _ {i}\right). +$$ + +![](images/20ef0eb6b5529f4c9f70ebe5039d1d61b04adce8caf28a90720f10be1a40b6a1.jpg) + +# D PROOFS FOR UNIFYING CLUSTERING METHODS + +The connections between clustering and the I-Con framework are more intricate compared to the dimensionality reduction methods discussed earlier. To establish these links, we first introduce a probabilistic formulation of K-means and demonstrate its equivalence to the classical K-means algorithm, showing that it is a zero-gap relaxation. Building upon this, we reveal how probabilistic K-means can be viewed as an instance of I-Con, leading to a novel clustering kernel. Finally, we show that several clustering methods implicitly approximate and optimize for this kernel. + +Definition 1 (Classical K-means). Let $x_1, x_2, \ldots, x_N \in \mathbb{R}^n$ denote the data points, and $\mu_1, \mu_2, \ldots, \mu_m \in \mathbb{R}^n$ be the cluster centers. + +The objective of classical $K$ -means is to minimize the following loss function: + +$$ +\mathcal {L} _ {k \text {- M e a n s}} = \sum_ {i = 1} ^ {N} \sum_ {c = 1} ^ {m} \mathbb {1} (c ^ {(i)} = c) \| x _ {i} - \mu_ {c} \| ^ {2}, +$$ + +where $c^{(i)}$ represents the cluster assignment for data point $x_{i}$ , and is defined as: + +$$ +c ^ {(i)} = \arg \min _ {c} \left\| x _ {i} - \mu_ {c} \right\| ^ {2}. +$$ + +# PROBABILISTIC K-MEANS RELAXATION + +In probabilistic K-means, the cluster assignments are relaxed by assuming that each data point $x_{i}$ belongs to a cluster $c$ with probability $\phi_{ic}$ . In other words, $\phi_{i}$ represents the cluster assignments vector for $x_{i}$ + +Proposition 2. The relaxed loss function for probabilistic $K$ -means is given by: + +$$ +\mathcal {L} _ {\text {P r o b - k - M e a n s}} = \sum_ {i = 1} ^ {N} \sum_ {c = 1} ^ {m} \phi_ {i c} \| x _ {i} - \mu_ {c} \| ^ {2}, +$$ + +and is equivalent to the original $K$ -means objective $\mathcal{L}_{k-Means}$ . The optimal assignment probabilities $\phi_{ic}$ are deterministic, assigning probability 1 to the closest cluster and 0 to others. + +Proof. For each data point $x_{i}$ , the term $\sum_{c = 1}^{m}\phi_{ic}\| x_{i} - \mu_{c}\|^{2}$ is minimized when the assignment probabilities $\phi_{ic}$ are deterministic, i.e., + +$$ +\phi_ {i c} = \left\{ \begin{array}{l l} 1 & \text {i f} c = \arg \min _ {j} \| x _ {i} - \mu_ {j} \| ^ {2}, \\ 0 & \text {o t h e r w i s e}. \end{array} \right. +$$ + +With these deterministic probabilities, $\mathcal{L}_{\mathrm{Prob - k - Means}}$ simplifies to the classical K-means objective, confirming that the relaxation introduces no gap. + +# CONTRASTIVE FORMULATION OF PROBABILISTIC K-MEANS + +Definition 2. Let $\{x_i\}_{i=1}^N$ be a set of data points. Define the conditional probability $q_{\phi}(j|i)$ as: + +$$ +q _ {\phi} (j | i) = \sum_ {c = 1} ^ {m} \frac {\phi_ {i c} \phi_ {j c}}{\sum_ {k = 1} ^ {N} \phi_ {k c}}, +$$ + +where $\phi_{i}$ is the soft-cluster assignments for $x_{i}$ . + +Given $q_{\phi}(j|i)$ , we can reformulate probabilistic K-means as a contrastive loss: + +Theorem 12. Let $\{x_i\}_{i=1}^N \in \mathbb{R}^n$ and $\{\phi_{ic}\}_{i=1}^N$ be the corresponding assignment probabilities. Define the objective function $\mathcal{L}$ as: + +$$ +\mathcal {L} = - \sum_ {i, j} \left(x _ {i} \cdot x _ {j}\right) q _ {\phi} (j | i). +$$ + +Minimizing $\mathcal{L}$ with respect to the assignment probabilities $\{\phi_{ic}\}$ yields optimal cluster assignments equivalent to those obtained by $K$ -means. + +Proof. The relaxed probabilistic K-means objective $\mathcal{L}_{\mathrm{Prob - k - Means}}$ is: + +$$ +\mathcal {L} _ {\text {P r o b - k - M e a n s}} = \sum_ {i = 1} ^ {N} \sum_ {c = 1} ^ {m} \phi_ {i c} \| x _ {i} - \mu_ {c} \| ^ {2}. +$$ + +Expanding this, we obtain: + +$$ +\mathcal {L} _ {\text {P r o b - k - M e a n s}} = \sum_ {c = 1} ^ {m} \left(\sum_ {i = 1} ^ {N} \phi_ {i c}\right) \| \mu_ {c} \| ^ {2} - 2 \sum_ {c = 1} ^ {m} \left(\sum_ {i = 1} ^ {N} \phi_ {i c} x _ {i}\right) \cdot \mu_ {c} + \sum_ {i = 1} ^ {N} \| x _ {i} \| ^ {2}. +$$ + +The cluster centers $\mu_c$ that minimize this loss are given by: + +$$ +\mu_ {c} = \frac {\sum_ {i = 1} ^ {N} \phi_ {i c} x _ {i}}{\sum_ {i = 1} ^ {N} \phi_ {i c}}. +$$ + +Substituting $\mu_{c}$ back into the loss function, we get: + +$$ +\mathcal {L} = - \sum_ {i, j} \left(x _ {i} \cdot x _ {j}\right) q _ {\phi} (j | i), +$$ + +which proves that minimizing this contrastive formulation leads to the same clustering assignments as classical K-means. + +Corollary 3. The alternative loss function: + +$$ +\mathcal {L} = - \sum_ {i, j} \| x _ {i} - x _ {j} \| ^ {2} q _ {\phi} (j | i), +$$ + +yields the same optimal clustering assignments when minimized with respect to $\{\phi_{ic}\}$ . + +Proof. Expanding the squared norm in the loss function gives: + +$$ +\mathcal {L} = - \sum_ {i, j} \left(\| x _ {i} \| ^ {2} - 2 x _ {i} \cdot x _ {j} + \| x _ {j} \| ^ {2}\right) q _ {\phi} (j | i). +$$ + +The terms involving $\| x_{i}\|^{2}$ and $\| x_{j}\|^{2}$ simplify since $\sum_{j}q_{\phi}(j|i) = 1$ , reducing the loss to: + +$$ +\mathcal {L} = 2 \left(- \sum_ {i, j} x _ {i} \cdot x _ {j} q _ {\phi} (j | i)\right), +$$ + +which is equivalent to the objective in the previous theorem. + +![](images/d51506639b2770f7f62792ebf462a26696c05721e337c0d4c7c97c2c233d6e39.jpg) + +# PROBABILISTIC K-MEANS AS AN I-CON METHOD + +In the I-Con framework, the target and learned distributions represent affinities between data points based on specific measures. For instance, in SNE, these measures are Euclidean distances in high- and low-dimensional spaces, while in SupCon, the distances reflect whether data points belong to the same class. Similarly, we can define a measure of neighborhood probabilities in the context of clustering, where two points are considered neighbors if they belong to the same cluster. The probability of selecting $x_{j}$ as $x_{i}$ 's neighbor is the probability that a point, chosen uniformly at random from $x_{i}$ 's cluster, is $x_{j}$ . More explicitly, let $q_{\phi}(j|i)$ represent the probability that $x_{j}$ is selected uniformly at random from $x_{i}$ 's cluster: + +$$ +q _ {\phi} (j | i) = \sum_ {c = 1} ^ {m} \frac {\phi_ {i c} \phi_ {j c}}{\sum_ {k = 1} ^ {N} \phi_ {k c}}. +$$ + +Theorem 13 (K-means as an instance of I-Con). Given data points $\{x_{i}\}_{i = 1}^{N}$ , define the neighborhood probabilities $p_{\theta}(j|i)$ and $q_{\phi}(j|i)$ as: + +$$ +p _ {\theta} (j | i) = \frac {\exp \left(- \| x _ {i} - x _ {j} \| ^ {2} / 2 \sigma^ {2}\right)}{\sum_ {k} \exp \left(- \| x _ {i} - x _ {k} \| ^ {2} / 2 \sigma^ {2}\right)}, q _ {\phi} (j | i) = \sum_ {c = 1} ^ {m} \frac {\phi_ {i c} \phi_ {j c}}{\sum_ {k = 1} ^ {N} \phi_ {k c}}. +$$ + +Let the loss function $\mathcal{L}_{c-SNE}$ be the sum of KL divergences between the distributions $q_{\phi}(j|i)$ and $p_{\theta}(j|i)$ : + +$$ +\mathcal {L} _ {c - S N E} = \sum_ {i} D _ {K L} \left(q _ {\phi} (\cdot | i) \| p _ {\theta} (\cdot | i)\right). +$$ + +Then, + +$$ +\mathcal {L} _ {c - S N E} = \frac {1}{2 \sigma^ {2}} \mathcal {L} _ {P r o b - k - M e a n s} - \sum_ {i} H (q _ {\phi} (\cdot | i)), +$$ + +where $H(q_{\phi}(\cdot |i))$ is the entropy of $q_{\phi}(\cdot |i)$ + +Proof. For simplicity, assume that $2\sigma^2 = 1$ . Denote $\sum_{k}\exp \left(-\| x_{i} - x_{k}\|^{2}\right)$ by $Z_{i}$ . Then we have: + +$$ +\log p _ {\theta} (j | i) = - \left\| x _ {i} - x _ {j} \right\| ^ {2} - \log Z _ {i}. +$$ + +Let $\mathcal{L}_i$ be defined as $-\sum_{j}\| x_{i} - x_{j}\|^{2}q_{\phi}(j|i)$ . Using the equation above, $\mathcal{L}_i$ can be rewritten as: + +$$ +\begin{array}{l} \mathcal {L} _ {i} = - \sum_ {j} \| x _ {i} - x _ {j} \| ^ {2} q _ {\phi} (j | i) (2) \\ = \sum_ {j} \left(\log \left(p _ {\theta} (j \mid i)\right) + \log \left(Z _ {i}\right)\right) q _ {\phi} (j \mid i) (3) \\ = \sum_ {j} q _ {\phi} (j | i) \log \left(p _ {\theta} (j | i)\right) + \sum_ {j} q _ {\phi} (j | i) \log \left(Z _ {i}\right) (4) \\ = \sum_ {j} q _ {\phi} (j | i) \log \left(p _ {\theta} (j | i)\right) + \log \left(Z _ {i}\right) (5) \\ = H \left(q _ {\phi} (\cdot | i), p _ {\theta} (\cdot | i)\right) + \log \left(Z _ {i}\right) (6) \\ = D _ {\mathrm {K L}} \left(q _ {\phi} (\cdot | i) \| p _ {\theta} (\cdot | i)\right) + H \left(q _ {\phi} (\cdot | i)\right) + \log \left(Z _ {i}\right). (7) \\ \end{array} +$$ + +Therefore, $\mathcal{L}_{\mathrm{Prob - KMeans}}$ , as defined in Corollary 3, can be rewritten as: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {P r o b - K M e a n s}} = - \sum_ {i} \sum_ {j} \| x _ {i} - x _ {j} \| ^ {2} q _ {\phi} (j | i) = \sum_ {i} \mathcal {L} _ {i} (8) \\ = \sum_ {i} D _ {\mathrm {K L}} \left(q _ {\phi} (\cdot | i) \| p _ {\theta} (\cdot | i)\right) + H \left(q _ {\phi} (\cdot | i)\right) + \log \left(Z _ {i}\right) (9) \\ = \mathcal {L} _ {\mathrm {c - S N E}} + \sum_ {i} H \left(q _ {\phi} (\cdot | i)\right) + \text {c o n s t a n t}. (10) \\ \end{array} +$$ + +Therefore, + +$$ +\mathcal {L} _ {\mathrm {c - S N E}} = \mathcal {L} _ {\text {P r o b - K M e a n s}} - \sum_ {i} H \left(q _ {\phi} (\cdot | i)\right). +$$ + +If we allow $\sigma$ to take any value, the entropy penalty will be weighted accordingly: + +$$ +\mathcal {L} _ {\mathrm {c - S N E}} = \frac {1}{2 \sigma^ {2}} \mathcal {L} _ {\text {P r o b - K M e a n s}} - \sum_ {i} H \left(q _ {\phi} (\cdot | i)\right). +$$ + +Note that the relation above is up to an additive constant. This implies that minimizing the contrastive probabilistic K-means loss with entropy regularization minimizes the sum of KL divergences between $q_{\phi}(\cdot |i)$ and $p_{\theta}(\cdot |i)$ . + +Corollary 4. Spectral Clustering is an instance of the I-Con framework. + +Proof. From Theorem 13, we know that K-Means clustering can be formulated as an instance of the I-Con framework, where the clustering assignments depend on the inner products of the data points. + +Spectral Clustering extends this idea by first embedding the data into a lower-dimensional space using the top $k$ eigenvectors of the normalized Laplacian derived from the affinity matrix $A$ . The affinity matrix $A$ is constructed using a similarity measure (e.g., an RBF kernel) and encodes the probabilities of assignments between data points. Given this transformation, spectral clustering is an instance of I-Con on the projected embeddings. + +Theorem 14. Normalized Cuts (Shi & Malik, 2000) is an instance of I-Con. + +Proof. The proof for this follows naturally from our work on K-Means analysis. The loss function for normalized cuts is defined as: + +$$ +\mathcal {L} _ {\text {N o r m C u t s}} = \sum_ {c = 1} ^ {m} \frac {\operatorname {c u t} \left(A _ {c} , \bar {A} _ {c}\right)}{\operatorname {v o l} \left(A _ {c}\right)}, +$$ + +where $A_{c}$ is a subset of the data corresponding to cluster $c$ , $\overline{A}_c$ is its complement, and $\operatorname{cut}(A_c,\overline{A}_c)$ represents the sum of edge weights between $A_{c}$ and $\overline{A}_{c}$ , while $\mathrm{vol}(A_c)$ is the total volume of cluster $A_{c}$ , i.e., the sum of edge weights within $A_{c}$ . + +Similar to K-Means, by reformulating this in a contrastive style with soft-assignments, the learned distribution can be expressed using the probabilistic cluster assignments $\phi_{ic} = p(c|x_i)$ as: + +$$ +q _ {\phi} (j | i) = \sum_ {c = 1} ^ {m} \frac {\phi_ {i c} \phi_ {j c} d _ {j}}{\sum_ {k = 1} ^ {N} \phi_ {k c} d _ {k}}, +$$ + +where $d_{j}$ is the degree of node $x_{j}$ , and the volume and cut terms can be viewed as weighted sums over the soft-assignments of data points to clusters. + +This reformulation shows that normalized cuts can be written in a manner consistent with the I-Con framework, where the target distribution $p_{\theta}(j|i)$ and the learned distribution $q_{\phi}(j|i)$ represent affinity relationships based on graph structure and cluster assignments. + +Thus, normalized cuts is an instance of I-Con, where the loss function optimizes the neighborhood structure based on the cut and volume of clusters in a manner similar to K-Means and its probabilistic relaxations. + +Theorem 15. Mutual Information Clustering is an instance of I-Con. + +Proof. Given the connection established between SimCLR, K-Means, and the I-Con framework, this result follows naturally. Specifically, the target distribution $p_{\theta}(j|i)$ (the supervised part) is a uniform distribution over observed positive pairs: + +$$ +p _ {\theta} (j | i) = \left\{ \begin{array}{l l} \frac {1}{k} & \text {i f x _ {j} i s a m o n g t h e k p o s i t i v e v i e w s o f x _ {i}}, \\ 0 & \text {o t h e r w i s e}. \end{array} \right. +$$ + +On the other hand, the learned embeddings $\phi_{i}$ represent the probabilistic assignments of $x_{i}$ into clusters. Therefore, similar to the analysis of the K-Means connection, the learned distribution is modeled as: + +$$ +q _ {\phi} (j | i) = \sum_ {c = 1} ^ {m} \frac {\phi_ {i c} \phi_ {j c}}{\sum_ {k = 1} ^ {N} \phi_ {k c}}. +$$ + +This shows that Mutual Information Clustering can be viewed as a method within the I-Con framework, where the learned distribution $q_{\phi}(j|i)$ aligns with the target distribution $p_{\theta}(j|i)$ , completing the proof. + +# E I-CON AS A VARIATIONAL METHOD + +Variational bounds for mutual information are widely explored and have been connected to loss functions such as InfoNCE, where minimizing InfoNCE maximizes the mutual information lower bound (Oord et al., 2018; Poole et al., 2019). The proof usually starts by rewriting the mutual information: + +$$ +I (X; Y) = \mathbb {E} _ {p (x, y)} \left[ \log \frac {q (x | y)}{p (x)} \right] + \mathbb {E} _ {p (y)} \left[ D _ {\mathrm {K L}} \left(p (x | y) \| q (x | y)\right) \right] +$$ + +This expression is typically used to derive a lower bound for $I(X;Y)$ . The proof usually begins by assuming that $p$ is uniform over discrete data points $\mathcal{X} = \{x_{i}\}_{i = 1}^{N}$ (i.e., we use uniform sampling + +for data points). By using the fact that $p(x_{i}) = \frac{1}{N}$ , we can write $p(x,y) = \frac{1}{N} p(x|y)$ . Therefore, the mutual information lower bound becomes + +$$ +\begin{array}{l} I (X; Y) \geq \mathbb {E} _ {p (x, y)} [ \log q (x | y) ] - \mathbb {E} _ {p (x, y)} [ \log p (x) ] \\ = \mathbb {E} _ {p (x, y)} [ \log q (x | y) ] + \log (N) \\ = \frac {1}{N} \sum_ {x, y \in \mathcal {X} \times \mathcal {X}} p (x | y) \log q (x | y) + \log (N) \\ = \frac {1}{N} \sum_ {y \in \mathcal {X}} \sum_ {x \in \mathcal {X}} p (x | y) \log q (x | y) + \log (N) \\ = - H (p (x | y), q (x | y)) + \log (N) \\ \end{array} +$$ + +Therefore, maximizing the cross-entropy between the two distributions maximizes the mutual information between samples. + +On the hand, Variational Bayesian (VB) methods are fundamental in approximating intractable posterior distributions $p(z \mid x)$ with tractable variational distributions $q_{\phi}(z)$ . This approximation is achieved by minimizing the Kullback-Leibler (KL) divergence between the variational distribution and the true posterior: + +$$ +\operatorname {K L} \left(q _ {\phi} (z) \| p (z \mid x)\right) = \mathbb {E} _ {q _ {\phi} (z)} \left[ \log \frac {q _ {\phi} (z)}{p (z \mid x)} \right]. \tag {11} +$$ + +The optimization objective, known as the Evidence Lower Bound (ELBO), is given by: + +$$ +\operatorname {E L B O} = \mathbb {E} _ {q _ {\phi} (z)} [ \log p (x, z) ] - \mathbb {E} _ {q _ {\phi} (z)} [ \log q _ {\phi} (z) ]. \tag {12} +$$ + +Maximizing the ELBO is equivalent to minimizing the KL divergence, thereby ensuring that $q_{\phi}(z)$ closely approximates $p(z \mid x)$ (Blei et al., 2017). + +VB can be framed within the I-Con framework by making specific mappings between the variables and distributions. Let $i$ correspond to the data point $x$ , and $j$ correspond to the latent variable $z$ . We can set the supervisory distribution $p_{\theta}(z \mid x)$ to be the true posterior $p(z \mid x)$ . This allows us to define the learned distribution $q_{\phi}(z \mid x)$ to be independent of $x$ , i.e., $q_{\phi}(z \mid x) = q_{\phi}(z)$ . + +Under these settings, the I-Con loss simplifies to: + +$$ +\mathcal {L} (\phi) = \int_ {x \in \mathcal {X}} \operatorname {K L} (p (z \mid x) \| q _ {\phi} (z)) d x = \mathbb {E} _ {p (x)} [ \operatorname {K L} (p (z \mid x) \| q _ {\phi} (z)) ]. \tag {13} +$$ + +# INTERPRETATION + +- Global Approximation: In VB, $q_{\phi}(z)$ serves as a global approximation to the posterior $p(z \mid x)$ across all data points $x$ . Similarly, in I-Con, when $q_{\phi}(j \mid i) = q_{\phi}(j)$ , the learned distribution provides a uniform approximation across all $i$ . +- Variational Alignment: Both frameworks employ variational techniques to align a tractable distribution $q_{\phi}$ with an intractable or supervisory distribution $p$ . This alignment ensures that the learned representations capture essential information from the target distribution. +- Framework Generalization: I-Con generalizes VB by allowing $q_{\phi}(j \mid i)$ to depend on $i$ , enabling more flexible and data-specific alignments. VB is recovered as a special case where the learned distribution is uniform across all data points. + +# F WHY DO WE NEED TO UNIFY REPRESENTATION LEARNERS? + +I-con not only provides a deeper understanding of these methods but also opens up the possibility of creating new methods by mixing and matching components. We explicitly use this property to discover new improvements to both clustering and representation learners. In short, I-Con acts like a periodic table of machine learning losses. With this periodic table we can more clearly see the implicit assumptions of each method by breaking down modern ML losses into more simple components: pairwise conditional distributions $p$ and $q$ . + +One particular example of how this opens new possibilities is with our generalized debiasing operation. Through our experiments we show adding a slight constant linkage between datapoints improves both stability and performance across clustering and feature learning. Unlike prior art, which only applies to specific feature learners, our debiasers can improve clusterers, feature learners, spectral graph methods, and dimensionality reducers. + +Finally it allows us to discover novel theoretical connections by compositionally exploring the space, and considering limiting conditions. We use I-Con to help derive a novel theoretical equivalences between K-Means and contrastive learning, and between MDS, PCA, and SNE. Transferring ideas between methods is standard in research, but in our view it becomes much simpler to do this if you know methods are equivalent. Previously, it might not be clear how exactly to translate an insight like changing Gaussian distributions to Cauchy distributions in the upgrade from SNE to T-SNE has any effect on clustering or representation learning. In I-Con it becomes clear to see that similarly softening clustering and representation learning distributions can improve performance and debias representations. + +# G HOW TO CHOOSE NEIGHBORHOOD DISTRIBUTIONS FOR YOUR PROBLEM + +# PARAMETERIZATION OF LEARNING SIGNAL + +- Parametric: (Learn a network to transform a data points to representations). Use a parametric method to quickly represent new datapoints without retraining. Use a parametric method if there is enough "features" in the underlying data to properly learn a representation. Use this option with datasets with sparse supervisory signal in order to share learning signal through network parameters. +- Nonparametric: (Learn one representation per data point). Use a nonparametric method if datapoints are abstract and don't contain natural features that are useful for mapping. Use this option to better optimize the loss of each individual datapoint. Do not use this in sparse supervisory signal regimes (Like augmentation based contrastive learning), as there are not enough links to resolve each individual embedding. + +# CHOICE OF SUPERVISORY SIGNAL + +- Gaussians on distances in the input space: though this is a common choice and underlies methods like k-means, with enough data it is almost always better to use k-neighbor distributions as they better capture local topology of data. This is the same intuition that is used to justify spectral clustering over k-means. +- K-neighbor graphs distributions: If your data can be naturally put into a graph instead of just considering Gaussians on the input space we suggest it. This allows the algorithm to adapt local neighborhoods to the data, as opposed to considering all points neighborhoods equally shaped and sized. This better aligns with the manifold hypothesis. +- Contrastive augmentations: When possible, add contrastive augmentations to your graph - this will improve performance in cases where quantities of interest (like an image class) are guaranteed to be shared between augmentations. +- General kernel smoothing techniques: Use random walks to improve the optimization quality. It connects more points together and in some cases mirrors geodesic distance on the manifold (Crane et al., 2013). +- Debiasing: Use this if you think negative pairs actually have a small chance of aligning positively. For a small number of classes this parameter scales like the inverse of the number of classes. You can also use this to improve stability of the optimization. + +# CHOICE OF REPRESENTATION: + +Any conditional distribution on representations can be used, so consider what kind of structure you want to learn, tree, vector, cluster, etc. And choose the distribution to be simple and meaningful for that representation. + +- Discrete: Use discrete cluster-based representations if interpretability and discrete structure are important +- Continuous Vector: Use a vector representation if generic downstream performance is a concern as this is a bit easier to optimize than discrete variants. + +# H COMPARING I-CON, MLE, AND THE KL DIVERGENCE + +There are many connections between KL divergence and maximum likelihood estimation. We highlight the differences between a standard MLE approach and I-Con. In short, although I-Con has a maximum likelihood interpretation, its specific functional form allows it to unify both unsupervised and supervised methods in a way that elucidates the key structures that are important for deriving new representation learning losses. This is in contrast to the commonly known connection between MLE and KL divergence minimization, which does not focus on pairwise connections between datapoints and does not provide as much insight for representation learners. To see this we note that the conventional connection between MLE and KL minimization is as follows: + +$$ +\theta_ {\mathrm {M L E}} = \arg \min _ {\theta} D _ {\mathrm {K L}} (\hat {P} | | Q _ {\theta}), +$$ + +where the empirical distribution, $\hat{P}$ , is defined as: + +$$ +\hat {P} (x) = \frac {1}{N} \sum_ {i = 1} ^ {N} \delta (x - x _ {i}), +$$ + +where $\delta (x - x_{i})$ is the Dirac delta function. The classical KL minimization fits a parameterized model family to an empirical distribution. In contrast the I-Con equation: + +$$ +\mathcal {L} (\theta , \phi) = \int_ {i \in \mathcal {X}} D _ {\mathrm {K L}} (p _ {\theta} (\cdot | i) | | q _ {\phi} (\cdot | i)) +$$ + +Operates on conditional distributions and captures an "average" KL divergence instead of a single KL divergence. Secondly, I-Con explicitly involves a computation over neighboring datapoints which does not appear in the aforementioned equation. This decomposition of methods into their actions on their neighborhoods makes many methods simpler to understand, and makes modifications of these methods easier to transfer between domains. It also makes it possible to apply this theory to unsupervised problems where empirical supervisory data does not exist. Furthermore some methods, like DINO, do not share the exact functional form of I-Con, and suffer from various difficulties like collapse which need to be handled with specific regularizers. This shows that I-Con is not just a catchall reformulation of MLE, but is capturing a specific functional form shared by several popular learners. + +# I ON I-CON'S HYPERPARAMETERS + +One important way that I-Con removes hyperparameters from existing works is that it does not rely on things like entropy penalties, activation normalization, activation sharpening, or EMA stabilization to avoid collapse. The loss is self-balancing in this regard as any way that it can improve the learned distribution to better match the target distribution is "fair game". This allows one to generalize certain aspects of existing losses like InfoNCE. In I-Con info NCE looks like fixed-width Gaussian kernels mediating similarity between representation vectors. In I-Con it's trivial to generalize these Gaussians to have adaptive and learned covariances for example. This allows the network to select its own level of certainty in representation learning. If you did this naively, you would need to ensure the loss function doesn't cheat by making everything less certain. + +Nevertheless I-Con defines a space of methods depending on the choice of $p$ and $q$ . The choice of these two distributions becomes the main source of hyperparameters we explore. In particular our experiments change the structure of the supervisory signal (often $p$ ). For example, in a clustering experiment changing $p$ from "Gaussians with respect to distance" to "graph adjacency" transforms + +K-Means into Spectral clustering. It's important to note that K-means has benefits over Spectral clustering in certain circumstances and vice-versa, and there's not necessarily a singular "right" choice for p in every problem. Like many things in ML, the different supervisory distributions provide different inductive biases and should be chosen thoughtfully. We find that this design space makes it easier to build better performing supervisory signals for specific important problems like unsupervised image classification on ImageNet and others. \ No newline at end of file diff --git a/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/images.zip b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e030a2dfacd6492c775e1c6824399dff794c8692 --- /dev/null +++ b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e98256223975340fec56e4c726f798688de41b8cefffada9c9aa1b633d336a06 +size 1872612 diff --git a/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/layout.json b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6a2f078727a5be9a639dbef0ce70999a542aab25 --- /dev/null +++ b/ICLR/2025/I-Con_ A Unifying Framework for Representation Learning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd5f8065e2dfde26a0d3d2e80a757744ea9fc9066e4149de89ac61e6b7f3c9e0 +size 1077747 diff --git a/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_content_list.json b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5fa97d67e1baec97235771495efc318f6a5f7310 --- /dev/null +++ b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc1298218963c2e95a749ba80567439844a326206dca2f7b4b3fc8cd2b1ffe52 +size 76701 diff --git a/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_model.json b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..eeaaff83af7218b5dab32143abdff2d31c997d83 --- /dev/null +++ b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d19cc187a4af7511b02f1a36e136f07ee6496f25297c5e251074cd0969f23f9c +size 94691 diff --git a/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_origin.pdf b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6fc2c7dce9142f563a1c3ff0a12a5f6d6e5f6e84 --- /dev/null +++ b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/1998549f-2de4-4db9-b654-8b370ebde49c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a0adaadbf78a245a770ea7098139804fe8d637d24a2466580844aba7573da81 +size 10126467 diff --git a/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/full.md b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1287984e0f015fc039cd1a19021565fdd33a4183 --- /dev/null +++ b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/full.md @@ -0,0 +1,294 @@ +# I2VCONTROL-CAMERA: PRECISE VIDEO CAMERA CONTROL WITH ADJUSTABLE MOTION STRENGTH + +Wanquan Feng $^{1}$ Jiawei Liu $^{1}$ Pengqi Tu $^{1}$ Tianhao Qi $^{1,2}$ Mingzhen Sun $^{1,3}$ Tianxiang Ma $^{1}$ Songtao Zhao $^{1}$ Siyu Zhou $^{1}$ Qian He $^{1}$ $^{1}$ ByteDance China $^{2}$ University of Science and Technology of China (USTC) $^{3}$ Institute of Automation, Chinese Academy of Sciences (CASIA) + +# ABSTRACT + +Video generation technologies are developing rapidly and have broad potential applications. Among these technologies, camera control is crucial for generating professional-quality videos that accurately meet user expectations. However, existing camera control methods still suffer from several limitations, including control precision and the neglect of the control for subject motion dynamics. In this work, we propose I2VControl-Camera, a novel camera control method that significantly enhances controllability while providing adjustability over the strength of subject motion. To improve control precision, we employ point trajectory in the camera coordinate system instead of only extrinsic matrix information as our control signal. To accurately control and adjust the strength of subject motion, we explicitly model the higher-order components of the video trajectory expansion, not merely the linear terms, and design an operator that effectively represents the motion strength. We use an adapter architecture that is independent of the base model structure. Experiments on static and dynamic scenes show that our framework outperforms previous methods both quantitatively and qualitatively. Project page: https://wanquanf.github.io/I2VControlCamera. + +# 1 INTRODUCTION + +Video generation technologies are explored to synthesize dynamic and coherent visual content, conditioned on various modalities including text (Blattmann et al., 2023c; Wang et al., 2024a; Gupta et al., 2023) and images (Blattmann et al., 2023b; Feng et al., 2024). Video generation has broad application potential across various fields, such as entertainment, social media, and film production. Motion controllability is crucial for ensuring that generated videos accurately meet user expectations, with camera control being one of the most important aspects. Camera control is the process of adjusting the position, angle, and motion of a camera, resulting in changes to the composition, perspective, and dynamic effects of a video. This technique is essential for generating professional-quality videos, as it influences the attention of viewers and enhances the expressiveness of scenes. + +Although precise camera control is crucial for producing high-quality videos, existing methods still face challenges. The first challenge pertains to the precision and stability of control. The lack of precision would result in an inaccurate reflection of the user control intention, significantly degrading user satisfaction. The second challenge is ensuring the natural dynamics of the subjects themselves, independent of camera movements. Similar to the challenges in multi-view (Mildenhall et al., 2020; Kerbl et al., 2023) and 3D geometric algorithms (Wang et al., 2021), where static scenes are much easier to handle than dynamic ones (Pumarola et al., 2020; Cai et al., 2022), generating plausible dynamics in videos proves to be more complex than managing static elements. + +WhileAnimateDiff (Guo et al., 2024b) utilizes LoRA (Hu et al., 2022) strategy for controlling camera movements, the motion-LoRAs are confined to a limited set of fixed movement modes, lacking flexibility, and it only allows for coarse control, thus failing to provide precise scale adjustments. A direct and intuitive approach allowing for arbitrary camera movements is embedding the camera pose matrix, as in MotionCtrl (Wang et al., 2023). However, this method results in sparse input signals that heavily rely on the training set distribution, which leads to poor generalization capability. Consequently, it may inadequately respond to less common camera parameters within the training + +![](images/4332abf12226facfc4e2ebd42f70dede9d7e004ae285aebe1e44a58fe8b56968.jpg) +Figure 1: We propose I2VControl-Camera, a novel camera control method for image-to-video generation, offering high control precision and adjustable motion strength. + +dataset, and thus hinders precise control over the motion's amplitude. Although CameraCtrl (He et al., 2024) attempts to mitigate this sparsity issue by employing Plücker embeddings (Sitzmann et al., 2021), this parameterization lacks information of the input image, and it actually does not offer any additional information compared to the camera matrix used in MotionCtrl. Another natural strategy is novel view synthesis, which uses 3D implicit representations that can be rendered from arbitrary views, such as Cat3D (Gao* et al., 2024). Unfortunately, this strategy cannot support subject motion well, thus undermining the core goal of creating dynamic video content. + +In this paper, we propose I2VControl-Camera, a camera control method (some examples shown in Fig. 1) to surmount these prevalent issues in image-to-video generation, enhancing the control precision and adding control over the dynamic strength of subject motion in video output. To ensure control precision and stability, we use point trajectories in the camera coordinate system as our control signals, instead of extrinsic matrix. From the point trajectory function, we extract the linear term to serve as a proxy for camera control, ensuring high precision, stability and user friendliness. To control the motion strength, we further represent object motions with higher-order terms in the trajectory function and explicitly model the degree of dynamics. Specifically, we employ the derivative of the high-order terms to compute the motion speed of each point and integrate them in the image domain to obtain the entire motion strength as the control input of the network. This approach allows us to accurately gauge and adjust the amplitude of subject motion dynamics. + +We construct training data from regular RGB videos registering 3D tracking information and motion mask for them. Our approach features an adapter architecture that remains agnostic to the underlying base model structure. Experimentally, we conduct experiments in both static and dynamic scenes. For static scenes, we can set the motion strength to zero, resulting in significantly higher precision than previous methods. In dynamic scenes, we can configure a higher motion strength, which allows for both high control precision and vivid subject motion. Our approach outperforms previous methods both quantitatively and qualitatively. In summary, our contributions include: + +- We explicitly model decoupled motion representations: 3D rigid point trajectories and motion strength for camera and subject motion controls. +- We propose a data pipeline to construct training control signals from RGB videos. +- For both static and dynamic scenes, our method outperforms previous methods both quantitatively and qualitatively. + +# 2 RELATED WORK + +# 2.1 TEXT TO VIDEO SYNTHESIS + +Text-to-video generation requires models to synthesize realistic videos based on given textual descriptions. Recent progress in diffusion models has boosted the quality of T2V generation to an + +unprecedented degree, achieving both impressive visual quality and surprising text-video consistency (Brooks et al., 2024; Blattmann et al., 2023b). Image Video (Ho et al., 2022) cascaded multiple video generation and super-resolution diffusion models to generate long and high-resolution videos from textual descriptions. Make-A-Video (Singer et al., 2022) extended a diffusion-based T2I model to T2V in a spatiotemporal factorized manner. Based on the successful experiences of image generation methods, several works (Wang et al., 2024a; Girdhar et al., 2023; Mei & Patel, 2023) performed T2V by first generating images from texts and then synthesizing videos based on images. EMU VIDEO (Girdhar et al., 2023) introduced adjusted noise schedules and a multi-stage training strategy for high-quality video generation. To reduce the computational complexity of video generation, other works (Blattmann et al., 2023c; He et al., 2022; Yu et al., 2023; Gupta et al., 2023) explored different designs of video auto-encoders, which can map a high-dimensional video into a low-dimensional latent space. LVDM (He et al., 2022) compressed videos from both the spatial and temporal dimensions, obtaining a low-dimensional 3D latent for each video. In addition, Lumiere (Bar-Tal et al., 2024) and Latte (Ma et al., 2024) explored different 3D model structures. Recently, Sora (Brooks et al., 2024) showed the power of DiT (Peebles & Xie, 2022) in T2V task. + +# 2.2 IMAGE TO VIDEO SYNTHESIS + +Image-to-video task aims to generate videos with a static image as the condition. One classic strategy is integrating CLIP embeddings of the static image into DPMs. For instance, VideoCrafter1 (Chen et al., 2023a) and I2V-Adapter (Guo et al., 2024a) utilized a dual cross-attention layer, similar to the IP-Adapter (Ye et al., 2023), to fuse these embeddings effectively. However, due to the notorious issue of CLIP image encoders losing fine-grained details, subsequent works (Hu, 2024; Wei et al., 2024) have proposed using more expressive image encoders to capture finer image features. In addition, another strategy is to expand the input channels of DPMs to concatenate noisy frames and the static image. Notable works in this category include SEINE (Chen et al., 2023b), PixelDance (Zeng et al., 2024),AnimateAnything (Dai et al., 2023), and PIA (Zhang et al., 2024), which have demonstrated superior results by enhancing the input channels to integrate image information more effectively. Finally, methods such as DynamiCrafter (Xing et al., 2023), I2VGen-XL (Zhang et al., 2023), and SVD (Blattmann et al., 2023a) combined channel concatenation and attention mechanisms to simultaneously inject image features, aiming to achieve consistency in both global semantics and fine-grained details. This dual approach ensured that the generated videos maintained a high level of fidelity to the original static images while introducing realistic and coherent motion. + +# 2.3VIDEOCAMERACONTROL + +While methods aiming to control video foundation models continue to emerge, relatively few works explore how to manipulate camera motions in generated videos. AnimateDiff (Guo et al., 2024b) employed temporal motion LoRA (Hu et al., 2022) trained on video datasets with similar camera motions, where one single trained LoRA can control a specific type of camera motion. MotionCtrl (Wang et al., 2023) proposed to employ an adaptor structure to encode the extrinsic matrix of each frame into the temporal attention layers. Further, CamereCtrl (He et al., 2024) utilized the Plücker embedding to improve the controllability. Camrol (Hou et al., 2024) proposed a simple training-free method to directly render static point cloud to multiview frames and construct the final output video in a video-to-video manner. CamCo (Xu et al., 2024) integrated an epipolar attention module in each attention block that enforces epipolar constraints to the feature maps, which keeps 3D-consistent well but causes small motion dynamic. In our work, we propose a method that can enhance the precision of camera control and add the control over subject motion strength. + +# 3 METHOD + +# 3.1VIDEO REPRESENTATION AND NOTATIONS + +In this section, we introduce the video representation and notation used in this paper. First, we stipulate that the coordinates of all points we study are in the camera coordinate system. Although both the camera and the captured scene may move, we transfer all dynamics to the camera coordinate system, as in Fig. 2. Intuitively, the entire 3D world can be divided into the static part and the dynamic part, where the static part corresponds to a linear motion in the camera coordinate system. + +![](images/625cfeae4a823e2791a231ba0dcc27f60da81ac1c49151380b4e6c0b30d0249f.jpg) +Figure 2: We lift the input image from 2D to 3D as a RGBD point cloud. When the camera moves, the 3D points can be considered as moving in the camera coordinate system. Then we project them onto 2D according to current camera pose to obtain the 2D point trajectory. + +Consider a dynamic sequence $\mathcal{F}(\mathbf{p},\lambda)$ + +$$ +\mathcal {F} (\mathbf {p}, \lambda): \mathbb {R} ^ {3} \times [ 0, \Lambda ] \rightarrow \mathbb {R} ^ {3}, \text {s . t .} \mathcal {F} (\mathbf {p}, 0) = \mathbf {p} \tag {1} +$$ + +where $\lambda \in [0, \Lambda]$ represents a time moment during the video, and $\mathbf{p} \in \mathbb{R}^3$ denotes a point of the entire 3D world. Notice that we specifically enforce $\mathcal{F}(\mathbf{p}, 0) = \mathbf{p}$ , to ensure that $\mathcal{F}$ accurately defines the 3D motion trajectory originating from the first frame. Considering the physical properties of the macroscopic world, it is reasonable to consider $\mathcal{F}$ as a smooth mapping function. Naturally, we can assert that for any given $\lambda \in [0, \Lambda]$ , there exist unique $\mathbf{R}_{\lambda} \in \mathbb{R}^{3 \times 3}$ and $\mathbf{t}_{\lambda} \in \mathbb{R}^3$ such that: + +$$ +\mathcal {F} (\mathbf {p}, \lambda) = \mathbf {R} _ {\lambda} \cdot \mathcal {F} (\mathbf {p}, 0) + \mathbf {t} _ {\lambda} + o (\mathbf {p}), \tag {2} +$$ + +where $o(\mathbf{p})$ denotes an infinitesimal of higher order than $\mathbf{p}$ . To simply prove it, we only need to perform a Maclaurin expansion of $\mathcal{F}(\mathbf{p},\lambda)$ and $\mathcal{F}(\mathbf{p},0)$ at $\mathbf{p} = \mathbf{0}$ : + +$$ +\mathcal {F} (\mathbf {p}, \lambda) = \mathcal {F} (\mathbf {0}, \lambda) + \mathbf {J} _ {\mathcal {F}} (\mathbf {0}, \lambda) \cdot \mathbf {p} + o (\mathbf {p}), \tag {3} +$$ + +$$ +\mathcal {F} (\mathbf {p}, 0) = \mathcal {F} (\mathbf {0}, 0) + \mathbf {J} _ {\mathcal {F}} (\mathbf {0}, 0) \cdot \mathbf {p} + o (\mathbf {p}), \tag {4} +$$ + +where $\mathbf{J}_{\mathcal{F}}$ denotes the Jacobian matrix, representing the gradient for vector-valued functions. Subtracting the two equations and performing a simple calculation yields: + +$$ +\mathcal {F} (\mathbf {p}, \lambda) = \left(\mathbf {I} + \mathbf {J} _ {\mathcal {F}} (\mathbf {0}, \lambda) - \mathbf {J} _ {\mathcal {F}} (\mathbf {0}, 0)\right) \cdot \mathcal {F} (\mathbf {p}, 0) + \mathcal {F} (\mathbf {0}, \lambda) + o (\mathbf {p}). \tag {5} +$$ + +Evidently, we can define: + +$$ +\mathbf {R} _ {\lambda} \triangleq \mathbf {I} + \mathbf {J} _ {\mathcal {F}} (\mathbf {0}, \lambda) - \mathbf {J} _ {\mathcal {F}} (\mathbf {0}, 0), \mathbf {t} _ {\lambda} \triangleq \mathcal {F} (\mathbf {0}, \lambda), \tag {6} +$$ + +Subsequently, we further denote: + +$$ +\mathcal {G} (\mathbf {p}, \lambda) \triangleq \mathcal {F} (\mathbf {p}, \lambda) - \left(\mathbf {R} _ {\lambda} \cdot \mathcal {F} (\mathbf {p}, 0) + \mathbf {t} _ {\lambda}\right) = o (\mathbf {p}), \tag {7} +$$ + +which actually represents the extent of nonlinearity, being a higher-order infinitesimal with respect to $\mathbf{p}$ than the linear term. Up to now, we have introduced the variables $(\mathbf{R}_{\lambda},\mathbf{t}_{\lambda},\mathcal{G}(\mathbf{p},\lambda))$ to facilitate our forthcoming discussion on video camera control. + +# 3.2 CONTROL SIGNAL CONSTRUCTION + +While the most intuitive method is to directly employ $\mathbf{R}_{\lambda}$ and $\mathbf{t}_{\lambda}$ as the control signals, we aim to overcome the previously mentioned challenges of controllability and subject motion. Denote the region of 3D points captured by the first frame as $\Omega \subseteq \mathbb{R}^3$ . We compute the linear translation for $\Omega$ and project it to 2D, which defines a point trajectory on the camera plane: + +$$ +\mathbf {T} _ {\lambda} = \Pi \left(\mathbf {R} _ {\lambda} \cdot \boldsymbol {\Omega} + \mathbf {t} _ {\lambda}\right), \lambda \in [ 0, \Lambda ] \tag {8} +$$ + +where $\Pi$ is the projection operation. Compared to $\mathbf{R}_{\lambda}$ and $\mathbf{t}_{\lambda}$ , $\mathbf{T}_{\lambda}$ offers a denser representation, thereby providing enhanced controllability and stability. + +However, at the same time, this could further inhibit the motion of the nonlinear parts, which is undesirable. To address this issue, we proceed to model the motion of the nonlinear parts (dynamic regions in the world system) as well. Considering that we have already defined the variable $\mathcal{G}(\mathbf{p},\lambda)$ to measure the extent of nonlinearity, we employ its first-order derivative with respect to time $\lambda$ to quantify the degree of motion dynamics at time moment $\lambda$ . In our generative tasks, we cannot control + +the motion of every individual point, so we instead resort to a secondary strategy. We integrate the $L_{2}$ norm of the first-order derivative (physically represents the motion speed of the point, as shown in Fig.3) across the entire domain $\Omega$ , to characterize an overall measure of motion strength: + +$$ +m _ {\lambda} = \frac {1}{| \Omega |} \int_ {\Omega} \| \frac {\partial \mathcal {G} (\mathbf {p} , \lambda)}{\partial \lambda} \| _ {2} d \mathbf {p} = \frac {1}{| \Omega |} \int_ {\Omega} \sqrt {\left(\frac {\partial \mathcal {G} (\mathbf {p} , \lambda)}{\partial \lambda}\right) ^ {T} \cdot \left(\frac {\partial \mathcal {G} (\mathbf {p} , \lambda)}{\partial \lambda}\right)} d \mathbf {p} \tag {9} +$$ + +Up to this point, we have fully defined the inputs of our camera control framework, $(\mathbf{T}_{\lambda},m_{\lambda})$ , where the former enhances controllability and stability, and the latter effectively represents the extent of motion dynamics, thus fulfilling the original intent of our designed method. + +In addition, we discuss some properties for the control signals. As discussed in Sec. 3.1, $\Omega$ can be divided into a static part and a dynamic part, which we can denote as $\Omega_S$ and $\Omega_D$ respectively. Notably, $\Omega_S$ corresponds to the linear motion within the camera system. In fact, we have: + +$$ +\mathcal {F} (\mathbf {p}, \lambda) \equiv \mathbf {R} _ {\lambda} \cdot \mathcal {F} (\mathbf {p}, 0) + \mathbf {t} _ {\lambda}, \forall \mathbf {p} \in \Omega_ {S}. \tag {10} +$$ + +In other words, $\mathcal{G}(\mathbf{p},\lambda)\equiv 0$ on $\Omega_S$ . According to Eq. 10, if we can obtain the partition $\Omega = \Omega_{S}\sqcup \Omega_{D}$ , we can calculate $(\mathbf{T}_{\lambda},m_{\lambda})$ by simply linear fitting the point trajectory function $\mathcal{F}(\mathbf{p},\lambda)$ . + +![](images/cf81ba871241a44234792226beca16b8d465a8407da8d11e1f62788b3910a4b0.jpg) +Figure 3: Illustration of motion strength (speed value). + +# 3.3 DATA PIPELINE + +In Sec. 3.2, we theoretically analyzed how to derive the input signal $(\mathbf{T}_{\lambda},m_{\lambda})$ for camera control. In this section, we show how to compute them for the real-world video data $\mathbf{V}_{gt}$ . For the real-world video, the timesteps is a discrete sequence $\lambda \in [0,T]\cap \mathbb{Z}$ , where $\lambda$ represents the timestep index. The region captured by the first frame can be organized on $H\times W$ pixels, denoted as $\Omega = \{\mathbf{p}_{ij}\}_{i,j = 1}^{H,W}$ . Further, we divide the whole point set $\{\mathbf{p}_{ij}\}_{i,j = 1}^{H,W}$ into the static part and the dynamic part: + +$$ +\Omega = \left\{\mathbf {p} _ {i j} \right\} _ {i, j = 1} ^ {H, W} = \Omega_ {S} \sqcup \Omega_ {D}, \tag {11} +$$ + +where $\Omega_S$ denotes the static part, and $\Omega_D$ denotes the dynamic part. Different from the theoretical analysis discussed in above sections, there are several major gaps between real-world RGB video data and the continuous trajectory function: + +- Lack of 3D Information: Real-world video data only contains 2D pixels without 3D information. +- Lack of Temporal Correspondence: The raw video data does not explicitly involve the information about the temporal movement of dense points as described by the continuous trajectory function. +- Lack of dynamic/static partition: In real-world video data, discerning which regions are dynamic and which are static remains ambiguous, especially when the camera itself is also mobile. This introduces a coupling between the movement of objects and the motion of the camera. + +To address the first issue, we employ metric depth estimation method, Unidepth (Piccinelli et al., 2024), to bridge the gap between 2D and 3D data representation. For the second issue, we utilize a tracking method, SpatialTracker (Xiao et al., 2024), to establish pixel correspondence between consecutive frames, so that we can obtain the discrete trajectory (still denoted as $\mathcal{F}(\mathbf{p},\lambda)$ for ease of reading). For the third issue, we need to extract $\Omega_S,\Omega_D\subseteq \Omega$ from $\Omega$ . A key insight lies in Eq. 10, which means the trajectory on $\Omega_S$ can be linearly fitted well. We solve this problem in a iterative manner, as described in Alg. 1. + +Iteratively, we fit the trajectory and extract the well-fitted region as the updated static region $\Omega_S$ , while the remaining part is the dynamic part $\Omega_D$ . Once we obtain the result $\Omega_S$ and $\Omega_D$ , like in each iteration, we can final compute $(\mathbf{R}_{\lambda},\mathbf{t}_{\lambda})$ by addressing a nonlinear least squares problem using the L-BFGS (Liu & Nocedal, 1989) algorithm: + +$$ +\left(\mathbf {R} _ {\lambda}, \mathbf {t} _ {\lambda}\right) = \underset {\mathbf {R}, \mathbf {t}} {\arg \min } \| \Pi \left(\mathcal {F} \left(\Omega_ {S}, \lambda\right)\right) - \Pi \left(\mathbf {R} \cdot \Omega_ {S} + \mathbf {t}\right) \| ^ {2}. \tag {12} +$$ + +Then, $\mathbf{T}_{\lambda}$ can be calculated according to Eq. 8. + +Data: Whole region $\Omega$ , point trajectory $\mathcal{F}(\mathbf{p},\lambda)$ , tolerable error $\epsilon$ , acceptable ratio $\alpha$ maximum iterations $N_{\mathrm{max}}$ +Result: The static region $\Omega_S$ and the dynamic region $\Omega_D$ +initialization: $n\gets 0,\Omega_S\gets \Omega ,\Omega_D\gets \emptyset$ +while $n < N_{max}$ do for each $\lambda \in [0,T]$ do Solve with L-BFGS: $(\mathbf{R}_{\lambda},\mathbf{t}_{\lambda}) = \underset {\mathbf{R},\mathbf{t}}{\arg \min}\| \Pi (\mathcal{F}(\Omega_S,\lambda)) - \Pi (\mathbf{R}\cdot \Omega_S + \mathbf{t})\| ^2;$ end Compute: $\epsilon_{max} = \max_{\mathbf{p}\in \Omega_S}\sum_{\lambda = 0}^{T}\| \Pi (\mathcal{F}(\mathbf{p},\lambda)) - \Pi (\mathbf{R}_{\lambda}\cdot \mathbf{p} + \mathbf{t}_{\lambda})\| ^2;$ if $\epsilon_{max} < \epsilon$ then stop (solution found); else $\begin{array}{r}\Omega_S\leftarrow \{\mathbf{p}\in \Omega \mid \sum_{\lambda = 0}^T\| \Pi (\mathcal{F}(\mathbf{p},\lambda)) - \Pi (\mathbf{R}_{\lambda}\cdot \mathbf{p} + \mathbf{t}_{\lambda})\| ^2 < \alpha \cdot (\epsilon_{max} + \epsilon)\} ;\\ \textit{if}\Omega_S = \Omega \textit{then}\\ \textit{stop(solution found);}\\ \textit{end}\\ \textit{end}\\ \Omega_D = \Omega \setminus \Omega_S;\\ n\gets n + 1;\\ \end{array}$ end Algorithm 1: Static and dynamic region extraction based on trajectory analysis + +For the motion strength, we employ the difference between adjacent frames to replace the first-order derivative of $\mathcal{G}(\mathbf{p},\lambda)$ . Specifically, we calculate: + +$$ +m _ {\lambda} = \left\{ \begin{array}{l l} 0 & \text {i f} \lambda = 0, \\ \frac {1}{H W} \sum_ {i, j = 1} ^ {H, W} \| \mathcal {G} (\mathbf {p}, \lambda) - \mathcal {G} (\mathbf {p}, \lambda - 1) \| _ {2} & \text {i f} \lambda > 0. \end{array} \right. \tag {13} +$$ + +Thus, we can calculate the required control signals $(\mathbf{T}_{\lambda},m_{\lambda})$ from any raw RGB video, which allows us to train the model with a vast array of easy-acquired RGB video data. + +# 3.4 NETWORK, TRAINING AND INFERENCE + +To ensure our method remains compatible with rapidly evolving base models, we have implemented an adaptive structure. Our network design is illustrated in Fig. 4. Starting from the original control signal, our adapter network generates a control feature that can be integrated into any diffusion process, thereby allowing adaptation to various video generation base frameworks. + +Considering that $\mathbf{T}_{\lambda}$ is a 4-dim tensor with shape $(T,2,H,W)$ and $m_{\lambda}$ is a 2-dim tensor with shape $(T,1)$ , we use a tiling method to expand $m_{\lambda}$ to the same shape as $\mathbf{T}_{\lambda}$ , and then concatenate them along the channel dimension to finally obtain a $(T,3,H,W)$ -shaped tensor as the input of the network. As shown in Fig. 4 (layers marked with flame are our adaptive layers), we first employ several convolutional layers to convert the input to the same size as the tokens used in the diffusion process. We then concatenate the features with the tokens before computing self-attention. After the self-attention computation, we restore the original shape by removing the additional parts added during concatenation, similar to Hu (2024). + +During the training phase, we merely incorporate the insertion of the control signal, while all other training strategies remain unchanged. We adopt the same loss function and the same scheduler, with the sole modification being the introduction of the control signal condition. During testing, we first employ Unidepth (Piccinelli et al., 2024) to lift the input image into a RGBD point cloud. When the user moves the camera, we convert it as the transformation of 3D points in the camera coordinate systemcan according to the camera poses. We finally project the transformed 3D points of each + +frame onto camera plane to compute the 2D trajectory, as shown in Fig. 2. Additionally, the user can provide a scalar value for the motion strength control. As a result, this conforms to the training paradigm and produces suitable camera movement effects. When the motion strength is set small, nearly static camera movements can be achieved, whereas a significant motion strength allows for more pronounced dynamics of the subject. + +# 4 EXPERIMENTS + +In this section, we show our experiments. Sec. 4.1 introduces our implementation details and experiment settings. Sec. 4.2 shows the results and some properties of our method. In Sec. 4.3, we compare our method with previous baseline methods. + +# 4.1 SETTINGS + +Implementation details. We employ a Image-to-Video version of Magicvideo-V2 (Wang et al., 2024b) as our base model, where we set the frame number as 24 and the resolution as $704 \times 448$ . We use 16 NVIDIA A100 GPUs to train them with a batch size 1 per GPU for $20K$ steps, taking about 36 hours. During training, we fix the parameters of the base model and only train our adapter part. + +![](images/bcf32f93dd38be9234570db60868f5747278b73bad34c8cc07936ac2d5bb641b.jpg) +Figure 4: The adaptive network structure. + +Datasets. Although previous methods trained on the RealEstate10K (Zhou et al., 2018) dataset for train + +ing, we do not choose it as our training set because the videos in this dataset are all nearly static scenes with very limited dynamic motion of objects, which is conflict with our goal of achieving controllable motion dynamics. Therefore, we collect a dataset of $30K$ video clips as our training set, which contains not only camera movements but also natural motion. For validation, we choose two testing sets. The first testing set comprises 500 random static scene clips from RealEstate10K, where each clip only extracts the initial frames according to the generated frame number. To enrich the testing set, we randomly substitute the camera movements in half of these clips with one of eight basic camera movements (as in MotionCtrl (Wang et al., 2023)): pan left, pan right, pan up, pan down, zoom in, zoom out, anticlockwise rotation, and clockwise rotation. The second testing set consists of 480 samples generated by text-to-image model that feature movable objects including humans and animals, each equipped one of the basic camera movements. + +Metrics. To comprehensively evaluate the quality of the results generated by our method and to facilitate a fair comparison with existing techniques, we employ the same metrics as in CameraCtrl (He et al., 2024): Rotational Error (RotErr), Translational Error (TransErr) and Fréchet Inception Distance (FID) (Seitzer, 2020). To compute FID, we randomly select 2000 video frames from WebVid (Bain et al., 2021). As for the calculation of RotErr and TransErr, we refer to the formula in CameraCtrl (He et al., 2024). Furthermore, as our method supports adjusting the motion dynamics, we design a metric to measure the motion dynamics in the generated videos, too. Specifically, we employ the open source RAFT (Teed & Deng, 2020) optical flow model to calculate a motion score, denoted as MSC. Specifically, we use optical flow to establish a correspondence relationship between any two adjacent frames, then perform 2D rigid alignment between adjacent frames (to appropriately remove the optical flow caused by camera movement), and compute the average of the $L_{2}$ alignment errors as the metric MSC. + +# 4.2 VISUALIZATION RESULTS + +In this section, we show the visualization results of our method, demonstrating both pixel-level controllability and the motion strength adjustment. Due to the format of the paper, the results shown below are all in frame-by-frame image format. Please see our project page for video results. + +![](images/7561f1936364223f9549dbed030026e224ae22d97ae6058a5083874302cd8a28.jpg) +Figure 5: Visualization of our pixel-level controllability. The figure presents two samples: the top one demonstrates a pan-left camera movement, while the bottom one shows the camera sliding to the right. For each sample, we show a preview (directly render the RGBD point cloud on to 2D plane according to the extrinsic matrix) and our generated result. We can see that the generated result can almost follow the control signal at the pixel level (can be seen in the green boxes) even when there exists movable object (the cat in the red box). + +# 4.2.1 Pixel-LEVEL CONTROLLABILITY + +We demonstrate comprehensive pixel-level user controllability in our approach, as illustrated in Fig. 5. Initially, we estimate the metric depth from the input image, and then directly manipulate the RGBD point cloud with control signals to render a preview image. This provides users with an immediate and intuitive visual feedback, labeled as "Preview" in the figure. Below the direct rendering results, we display the outputs generated by our framework. As observed, the camera pose in the generated results is largely consistent with the preview, indicating that our control system achieves precise pixel-level control. In the first sample, where we set the motion strength to 0, the fox remains static, and the entire image aligns perfectly with the preview. In the second sample, with the motion strength set to 600, the cat is able to walk on the floor. Despite the movement of cat, the camera positioning remains consistent with the preview across all static elements, such as the fireplace. These examples underscore the ability of our framework to maintain pixel-level alignment regardless of the motion strength. This high level of controllability ensures that users can interactively and effortlessly tailor their visual outputs with exceptional precision, epitomizing a truly user-friendly experience. + +# 4.2.2 MOTION STRENGTH ADJUSTMENT + +In Fig. 6, we illustrate the effects of varying motion strength values on the same input image with consistent camera movements. When the motion strength is 0, the image content appears almost stationary. Conversely, as the motion strength is increased, the main objects within the scenes begin to exhibit motion. For instance, in the first example, the camera performs a pan-right movement, shifting the entire scene to the left. At a motion strength of 0, the polar bear remains static, moving uniformly with the background. However, increasing the motion strength allows the bear to move independently, walking naturally and vividly across the frame, giving an impression of freedom and animation. In the second example, with the camera moving downward, the scene seems to ascend. With motion strength as 0, the astronaut stands still, anchored to the ground. Increasing the motion strength causes the astronaut to walk toward the camera, thereby enhancing the dynamic interaction and realism within the scene. The third example features the camera rotating counterclockwise, which results in the scene rotating clockwise. Here, a motion strength of 0 keeps the wolf stationary. Yet, upon intensifying the motion strength, the wolf begins to run, infusing the scene with action + +![](images/55c781a3418ec61d27d31fe88c5b23d64317a06005a9ffd1cad3d9e0e10025e9.jpg) +Figure 6: Results under different motion strength values. We test the same camera control signal with different motion strength value. When the motion strength is set as 0, the entire scene is nearly static even when there are movable objects in the figure (polar bear, astronaut, wolf); when the motion strength is large, the main objects move obviously. + +and enlivening the overall visualization. These demonstrations confirm the efficacy of our controlled motion strength system, showcasing its capability to customize dynamic behaviors in accordance with the desired camera movements and scene compositions. + +# 4.3 COMPARISONS + +In this section, we compare our results with previous baselines: MotionCtrl (Wang et al., 2023) and CameraCtrl (He et al., 2024). It is important to note that the original MotionCtrl and CameraCtrl differ significantly from our training configurations, including differences in the base model, training set, image resolution, and even the number of frames. Fortunately, they both employ an adapter architecture, allowing their designs to be adaptable to various base models. Therefore, to ensure a fair comparison, we choose to retrain MotionCtrl and CameraCtrl using the same experimental settings and base model (Magicvideo-V2) as ours. In the subsequent text of this section, whenever we refer to MotionCtrl and CameraCtrl, we are referring to the version that have been retrained by us. Considering that the motion-LoRA ofAnimateDiff only supports a limited number of fixed camera movement patterns, we excluded it from our comparison. + +# 4.3.1 COMPARISON ON REALESTATE10K DATASET + +We compare our method with MotionCtrl and CameraCtrl on the RealEstate10K dataset. Considering that data in this dataset are nearly all static scenes, we set our motion strength to 0. Quantitative comparisons are presented in Tab. 1. Our method significantly outperforms the previous methods in both RotErr and TransErr, consistent with the pixel-level precision control observed in Section 4.2.1. For a qualitative comparison, refer to the left sample in Fig. 7. While our results are largely consistent with the preview, the outputs from CameraCtrl and MotionCtrl exhibit noticeable deviations. The results from MotionCtrl has the right trend but with some extra zoom-in, while CameraCtrl, although correct in the direction of camera movement, applies excessive movement amplitude, resulting in a failure to align at the pixel level with the ground truth. It can be seen that our method is closest to the preview image, which is consistent with the conclusion of quantitative comparison, further confirming the superiority of our controllability. Our results also show the smallest values in terms of FID and MSC, indicating that our method not only produces the highest quality of generated images but also maintains the static nature in static scenes. + +# 4.3.2 COMPARISON ON DATASET OF MOVABLE OBJECTS. + +We also evaluate our method against MotionCtrl and CameraCtrl on the movable object dataset. Considering it contains movable objects, we experimented with several motion strength values: 0, 200, 400, 600. Quantitative comparisons are presented in Tab. 2. Our method performs best in both + +![](images/466326f2429e095165d9e463e09301ace9a41fe4fecc61cc68ea0247ba85eb44.jpg) +Figure 7: Qualitative comparison with previous methods. By comparing the preview with the generated results of different methods, we can see that our control precision is the best. + +Table 1: Comparison on the RealEstate10k dataset. + +
MethodsRotErr↓TransErr↓FID↓MSC↓
MotionCtrl2.6612.70164.6213.71
CameraCtrl1.2621.60156.6915.52
Ours-00.539.72155.0112.93
+ +Table 2: Comparison on the movable object dataset. + +
MethodsRotErr↓TransErr↓FID↓MSC ↓↑
MotionCtrl2.108.0898.5442.28
CameraCtrl1.5611.3299.5932.69
Ours-00.766.97100.3618.96
Ours-2001.037.5393.2838.23
Ours-4001.127.2391.9347.13
Ours-6001.188.1691.8647.70
+ +RotErr and TransErr. Although Ours-200, Ours-400 and Ours-600 perform slightly worse on these two metrics than Ours-0, they are still better than the comparison methods. Ours-600 achieves the best FID and thus the best image quality. The FID of Ours-0 is slightly higher than that of the other settings. A possible reason for this could be that the movable objects are forcibly held static, resulting in unnatural and insufficiently diverse frames, while diversity is crucial for FID. For MSC, our smallest value (Ours-0) is lower than the comparing methods, and our largest value (ours-600) is higher than the comparing methods, which proves our adjustable motion strength control ability again. Qualitative comparison is shown on the right sample in Fig. 7, where only our method is pixel-level aligned with the ground truth. + +# 5 CONCLUSION + +In this work, we introduced I2VControl-Camera, a precise camera control method designed to enhance the controllability of video generation while maintaining a robust range of subject motion. We successfully addressed the challenge of control stability by employing point trajectories in the camera coordinate system, rather than relying on extrinsic matrices. Additionally, our approach involved modeling higher-order components of video trajectory expansion, enabling the network to precisely perceive and adjust the amplitude of subject motion dynamics. Our method demonstrated superior performance over previous methods in both quantitative and qualitative assessments. Looking forward, possible future work includes extending our framework to include more control modalities, such as drag and motion brush controls. These enhancements will allow for even more detailed and varied manipulations of video content, enabling creators to achieve a wider range of visual effects and further personalize their video productions. + +# REFERENCES + +Max Bain, Arsha Nagrani, Gül Varol, and Andrew Zisserman. Frozen in time: A joint video and image encoder for end-to-end retrieval. In IEEE International Conference on Computer Vision, + +2021. +Omer Bar-Tal, Hila Chefer, Omer Tov, Charles Herrmann, Roni Paiss, Shiran Zada, Ariel Ephrat, Junhwa Hur, Yuanzhen Li, Tomer Michaeli, et al. Lumiere: A space-time diffusion model for video generation. arXiv preprint arXiv:2401.12945, 2024. +Andreas Blattmann, Tim Dockhorn, Sumith Kulal, Daniel Mendelevitch, Maciej Kilian, Dominik Lorenz, Yam Levi, Zion English, Vikram Voleti, Adam Letts, et al. Stable video diffusion: Scaling latent video diffusion models to large datasets. arXiv preprint arXiv:2311.15127, 2023a. +Andreas Blattmann, Tim Dockhorn, Sumith Kulal, Daniel Mendelevitch, Maciej Kilian, Dominik Lorenz, Yam Levi, Zion English, Vikram Voleti, Adam Letts, et al. Stable video diffusion: Scaling latent video diffusion models to large datasets. arXiv preprint arXiv:2311.15127, 2023b. +Andreas Blattmann, Robin Rombach, Huan Ling, Tim Dockhorn, Seung Wook Kim, Sanja Fidler, and Karsten Kreis. Align your latents: High-resolution video synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22563-22575, 2023c. +Tim Brooks, Bill Peebles, Connor Holmes, Will DePue, Yufei Guo, Li Jing, David Schnurr, Joe Taylor, Troy Luhman, Eric Luhman, Clarence Ng, Ricky Wang, and Aditya Ramesh. Video generation models as world simulators. 2024. URL https://openai.com/research/video-generation-models-as-world-simulators. +Hongrui Cai, Wanquan Feng, Xuetao Feng, Yan Wang, and Juyong Zhang. Neural surface reconstruction of dynamic scenes with monocular rgb-d camera. In Thirty-sixth Conference on Neural Information Processing Systems (NeurIPS), 2022. +Haoxin Chen, Menghan Xia, Yingqing He, Yong Zhang, Xiaodong Cun, Shaoshu Yang, Jinbo Xing, Yaofang Liu, Qifeng Chen, Xintao Wang, et al. Videocaster: Open diffusion models for high-quality video generation. arXiv preprint arXiv:2310.19512, 2023a. +Xinyuan Chen, Yaohui Wang, Lingjun Zhang, Shaobin Zhuang, Xin Ma, Jiashuo Yu, Yali Wang, Dahua Lin, Yu Qiao, and Ziwei Liu. Seine: Short-to-long video diffusion model for generative transition and prediction. In The Twelfth International Conference on Learning Representations, 2023b. +Zuozhuo Dai, Zhenghao Zhang, Yao Yao, Bingxue Qiu, Siyu Zhu, Long Qin, and Weizhi Wang. *Animateanything: Fine-grained open domain image animation with motion guidance.* arXiv eprints, pp. arXiv-2311, 2023. +Wanquan Feng, Tianhao Qi, Jiawei Liu, Mingzhen Sun, Pengqi Tu, Tianxiang Ma, Fei Dai, Songtao Zhao, Siyu Zhou, and Qian He. I2vcontrol: Disentangled and unified video motion synthesis control. arXiv preprint arXiv:2411.17765, 2024. +Ruiqi Gao*, Aleksander Holynski*, Philipp Henzler, Arthur Brussee, Ricardo Martin-Brualla, Pratul P. Srinivasan, Jonathan T. Barron, and Ben Poole*. Cat3d: Create anything in 3d with multi-view diffusion models. arXiv, 2024. +Rohit Girdhar, Mannat Singh, Andrew Brown, Quentin Duval, Samaneh Azadi, Sai Saketh Rambhatla, Akbar Shah, Xi Yin, Devi Parikh, and Ishan Misra. Emu video: Factorizing text-to-video generation by explicit image conditioning. arXiv preprint arXiv:2311.10709, 2023. +Xun Guo, Mingwu Zheng, Liang Hou, Yuan Gao, Yufan Deng, Pengfei Wan, Di Zhang, Yufan Liu, Weiming Hu, Zhengjun Zha, et al. 12v-adapter: A general image-to-video adapter for diffusion models. In ACM SIGGRAPH 2024 Conference Papers, pp. 1-12, 2024a. +Yuwei Guo, Ceyuan Yang, Anyi Rao, Zhengyang Liang, Yaohui Wang, Yu Qiao, Maneesh Agrawala, Dahua Lin, and Bo Dai. Animatediff: Animate your personalized text-to-image diffusion models without specific tuning. International Conference on Learning Representations, 2024b. + +Agrim Gupta, Lijun Yu, Kihyuk Sohn, Xiuye Gu, Meera Hahn, Li Fei-Fei, Irfan Essa, Lu Jiang, and José Lezama. Photorealistic video generation with diffusion models. arXiv preprint arXiv:2312.06662, 2023. +Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, and Ceyuan Yang. Cameractrol: Enabling camera control for text-to-video generation. arXiv preprint arXiv:2404.02101, 2024. +Yingqing He, Tianyu Yang, Yong Zhang, Ying Shan, and Qifeng Chen. Latent video diffusion models for high-fidelity long video generation. arXiv preprint arXiv:2211.13221, 2022. +Jonathan Ho, William Chan, Chitwan Sahara, Jay Whang, Ruiqi Gao, Alexey Gritsenko, Diederik P Kingma, Ben Poole, Mohammad Norouzi, David J Fleet, et al. Imagen video: High definition video generation with diffusion models. arXiv preprint arXiv:2210.02303, 2022. +Chen Hou, Guoqiang Wei, Yan Zeng, and Zhibo Chen. Training-free camera control for video generation. CoRR, abs/2406.10126, 2024. +Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=nZeVKeeFYf9. +Li Hu. Animate anyone: Consistent and controllable image-to-video synthesis for character animation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8153-8163, 2024. +Bernhard Kerbl, Georgios Kopanas, Thomas Leimkuhler, and George Drettakis. 3d gaussian splatting for real-time radiance field rendering. ACM Transactions on Graphics, 2023. +Dong C. Liu and Jorge Nocedal. On the limited memory BFGS method for large scale optimization. Math. Program., 1989. +Xin Ma, Yaohui Wang, Gengyun Jia, Xinyuan Chen, Ziwei Liu, Yuan-Fang Li, Cunjian Chen, and Yu Qiao. Latte: Latent diffusion transformer for video generation. arXiv preprint arXiv:2401.03048, 2024. +Kangfu Mei and Vishal Patel. Vidm: Video implicit diffusion models. In Proceedings of the AAAI conference on artificial intelligence, volume 37, pp. 9117-9125, 2023. +Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020. +William Peebles and Saining Xie. Scalable diffusion models with transformers. arXiv preprint arXiv:2212.09748, 2022. +Luigi Piccinelli, Yung-Hsu Yang, Christos Sakaridis, Mattia Segu, Siyuan Li, Luc Van Gool, and Fisher Yu. UniDepth: Universal monocular metric depth estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024. +Albert Pumarola, Enric Corona, Gerard Pons-Moll, and Francesc Moreno-Noguer. D-nerf: Neural radiance fields for dynamic scenes. arXiv preprint arXiv:2011.13961, 2020. +Maximilian Seitzer. pytorch-fid: FID Score for PyTorch. https://github.com/mseitzer/pytorch-fid, August 2020. Version 0.3.0. +Uriel Singer, Adam Polyak, Thomas Hayes, Xi Yin, Jie An, Songyang Zhang, Qiyuan Hu, Harry Yang, Oron Ashual, Oran Gafni, et al. Make-a-video: Text-to-video generation without text-video data. arXiv preprint arXiv:2209.14792, 2022. +Vincent Sitzmann, Semon Rezchikov, Bill Freeman, Josh Tenenbaum, and Frédo Durand. Light field networks: Neural scene representations with single-evaluation rendering. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, 2021. + +Zachary Teed and Jia Deng. RAFT: recurrent all-pairs field transforms for optical flow. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm (eds.), Computer Vision - ECCV 2020 - 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part II, 2020. +Peng Wang, Lingjie Liu, Yuan Liu, Christian Theobalt, Taku Komura, and Wenping Wang. Neus: Learning neural implicit surfaces by volume rendering for multi-view reconstruction. *NeurIPS*, 2021. +Weimin Wang, Jiawei Liu, Zhijie Lin, Jiangqiao Yan, Shuo Chen, Chetwin Low, Tuyen Hoang, Jie Wu, Jun Hao Liew, Hanshu Yan, et al. Magicvideo-v2: Multi-stage high-aesthetic video generation. arXiv preprint arXiv:2401.04468, 2024a. +Weimin Wang, Jiawei Liu, Zhijie Lin, Jiangqiao Yan, Shuo Chen, Chetwin Low, Tuyen Hoang, Jie Wu, Jun Hao Liew, Hanshu Yan, et al. Magicvideo-v2: Multi-stage high-aesthetic video generation. arXiv preprint arXiv:2401.04468, 2024b. +Zhouxia Wang, Ziyang Yuan, Xintao Wang, Tianshui Chen, Menghan Xia, Ping Luo, and Yin Shan. Motionctrl: A unified and flexible motion controller for video generation. 2023. +Yujie Wei, Shiwei Zhang, Zhiwu Qing, Hangjie Yuan, Zhiheng Liu, Yu Liu, Yingya Zhang, Jingren Zhou, and Hongming Shan. Dreamvideo: Composing your dream videos with customized subject and motion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6537-6549, 2024. +Yuxi Xiao, Qianqian Wang, Shangzhan Zhang, Nan Xue, Sida Peng, Yujun Shen, and Xiaowei Zhou. Spatialtracker: Tracking any 2d pixels in 3d space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024. +Jinbo Xing, Menghan Xia, Yong Zhang, Haoxin Chen, Xintao Wang, Tien-Tsin Wong, and Ying Shan. Dynamiccrafter: Animating open-domain images with video diffusion priors. arXiv preprint arXiv:2310.12190, 2023. +Dejia Xu, Weili Nie, Chao Liu, Sifei Liu, Jan Kautz, Zhangyang Wang, and Arash Vahdat. Camco: Camera-controllable 3d-consistent image-to-video generation. arXiv preprint arXiv:2406.02509, 2024. +Hu Ye, Jun Zhang, Sibo Liu, Xiao Han, and Wei Yang. Ip-adapter: Text compatible image prompt adapter for text-to-image diffusion models. arXiv preprint arXiv:2308.06721, 2023. +Sihyun Yu, Kihyuk Sohn, Subin Kim, and Jinwoo Shin. Video probabilistic diffusion models in projected latent space. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 18456-18466, 2023. +Yan Zeng, Guoqiang Wei, Jiani Zheng, Jiaxin Zou, Yang Wei, Yuchen Zhang, and Hang Li. Make pixels dance: High-dynamic video generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8850-8860, 2024. +Shiwei Zhang, Jiayu Wang, Yingya Zhang, Kang Zhao, Hangjie Yuan, Zhiwu Qin, Xiang Wang, Deli Zhao, and Jingren Zhou. I2vgen-xl: High-quality image-to-video synthesis via cascaded diffusion models. arXiv preprint arXiv:2311.04145, 2023. +Yiming Zhang, Zhening Xing, Yanhong Zeng, Youqing Fang, and Kai Chen. Pia: Your personalized image animator via plug-and-play modules in text-to-image models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7747-7756, 2024. +Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: learning view synthesis using multiplane images. ACM Trans. Graph., 2018. \ No newline at end of file diff --git a/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/images.zip b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..357504a7c006cd11be12f55573a8269de43f859b --- /dev/null +++ b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f747af1e6a49dce3cc16690cad631f6935d16be6bacb2aaf46ce48ade4632b27 +size 723663 diff --git a/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/layout.json b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f94f8c9e6715ea382793e466b252808657ea09d0 --- /dev/null +++ b/ICLR/2025/I2VControl-Camera_ Precise Video Camera Control with Adjustable Motion Strength/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08db294e0fd554c4ff04adb52010e10a79b39cdf8d65c259de20f6ea87b9c27f +size 379253 diff --git a/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_content_list.json b/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..09f156f57e9f78723b5971c4f55c91e56b20f6a7 --- /dev/null +++ b/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6a9270c979cfdc173266cfc8e5840c156e13e1229a3563785bba91a1004f3e0 +size 152596 diff --git a/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_model.json b/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_model.json new file mode 100644 index 0000000000000000000000000000000000000000..caffb7bbf4c10e6688e24fa48b501d577eca7535 --- /dev/null +++ b/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f21fe4bc0417fd6cb412ce6d03aa573d9cb09123814761cab3b4783f69673d1 +size 177973 diff --git a/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_origin.pdf b/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aec7cabca155d8f36c00566a7ca07d413f7b9e1f --- /dev/null +++ b/ICLR/2025/ICLR_ In-Context Learning of Representations/df420a29-3d43-4f6e-8394-392257c9ac14_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b786b0ccef7742821104aeb879e160548bc0a32cc92c0d7246667bb5fecec2e3 +size 4498141 diff --git a/ICLR/2025/ICLR_ In-Context Learning of Representations/full.md b/ICLR/2025/ICLR_ In-Context Learning of Representations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..265fff307403c43687b9262320a94a7d284ff66a --- /dev/null +++ b/ICLR/2025/ICLR_ In-Context Learning of Representations/full.md @@ -0,0 +1,635 @@ +# ICLR: IN-CONTEXT LEARNING OF REPRESENTATIONS + +Core Francisco Park $^{4,2,3}$ , Andrew Lee $^{4*}$ , Ekdeep Singh Lubana $^{1,3}$ , Yongyi Yang $^{1,3,5}$ , Maya Okawa $^{1,3}$ , Kento Nishi $^{1,4}$ , Martin Wattenberg $^{4}$ , & Hidenori Tanaka $^{1,3}$ + +1CBS-NTT Program in Physics of Intelligence, Harvard University +$^{2}$ Department of Physics, Harvard University +3Physics & Informatics Lab, NTT Research Inc. +4 SEAS, Harvard University +$^{5}$ CSE, University of Michigan, Ann Arbor + +# ABSTRACT + +Recent work has demonstrated that semantics specified by pretraining data influence how representations of different concepts are organized in a large language model (LLM). However, given the open-ended nature of LLMs, e.g., their ability to in-context learn, we can ask whether models alter these pretraining semantics to adopt alternative, context-specified ones. Specifically, if we provide in-context exemplars wherein a concept plays a different role than what the pretraining data suggests, do models reorganize their representations in accordance with these novel semantics? To answer this question, we take inspiration from the theory of conceptual role semantics and define a toy "graph tracing" task wherein the nodes of the graph are referenced via concepts seen during training (e.g., apple, bird, etc.) and the connectivity of the graph is defined via some predefined structure (e.g., a square grid). Given exemplars that indicate traces of random walks on the graph, we analyze intermediate representations of the model and find that as the amount of context is scaled, there is a sudden re-organization from pretrained semantic representations to in-context representations aligned with the graph structure. Further, we find that when reference concepts have correlations in their semantics (e.g., Monday, Tuesday, etc.), the context-specified graph structure is still present in the representations, but is unable to dominate the pretrained structure. To explain these results, we analogize our task to energy minimization for a predefined graph topology, providing evidence towards an implicit optimization process to infer context-specified semantics. Overall, our findings indicate scaling context-size can flexibly re-organize model representations, possibly unlocking novel capabilities. + +# 1 INTRODUCTION + +A growing line of work demonstrates that large language models (LLMs) organize representations of specific concepts in a manner that reflects their structure in pretraining data (Park et al., 2024c;d; Engels et al., 2024; Abdou et al., 2021; Patel & Pavlick, 2022; Anthropic AI, 2024; Gurnee & Tegmark, 2023; Vafa et al., 2024; Li et al., 2021; Pennington et al., 2014). More targeted experiments in synthetic domains have further corroborated these findings, showing how model representations are organized according to the data-generating process (Li et al., 2022; Jenner et al., 2024; Traylor et al., 2022; Liu et al., 2022b; Shai et al., 2024; Park et al., 2024b; Gopalani et al., 2024). However, when a model is deployed in open-ended environments, we can expect it to encounter novel semantics for a concept that it did not see during pretraining. For example, assume that we describe to an LLM that a new product called strawberry has been announced. Ideally, based on this context, the model would alter the representation for strawberry and reflect that we are not referring to the pretraining semantics (e.g., the fruit strawberry). Does this ideal solution transpire in LLMs? + +Motivated by the above, we evaluate whether when provided an in-context specification of a concept, an LLM alters its representations to reflect the context-specified semantics. Specifically, we propose + +![](images/9e9c94806de1f88cb1bab96fb1155be60a5707e2c7f87e99bf90c7276b2ad146.jpg) +(a) Words on a grid +(b) Data generation + +![](images/0bd6493581e7e26bf0c0ef90c473591daeabf93a84d0a53a46d63479886ad7f9.jpg) +Context length: 200 +Figure 1: Alteration of representations in accordance with context-specified semantics (grid structure). (a) We randomly arrange a set of concepts on a grid that does not reflect any correlational semantics between the tokens. (b) We then generate sequences of tokens following a random walk on the grid, inputting it as context to a Llama-3.1-8B model. (c) The model's mean token representations projected onto the top two principal components. As the number of in-context exemplars increases, there is a formation of representations mirroring the grid structure underlying the data-generating process. Representations are from the residual stream activation following layer 26. + +![](images/901ebfb07833683c1cea7a79249c2a7a288c396d25e69d63ca73d046a2843363.jpg) + +![](images/35d9419dd835cbca72c9ecf185fa77cfd5371c3d14abcde632bf7e63697b9131.jpg) +(c) Emergent grid representation in context +Context length: 400 +Context length: 1400 + +an in-context learning task that involves a simple "graph tracing" problem wherein the model is shown edges corresponding to a random traversal of a graph (see Fig. 1). The nodes of this graph are intentionally referenced via concepts the model is extremely likely to have seen during training (e.g., apple, bird, etc.), while its connectivity structure is defined using a predefined geometry that is ambivalent to correlations between concepts' semantics (e.g., a square grid). Based on the provided context, the model is expected to output a valid next node prediction, i.e., a node connected to the last presented one. As we show, increasing the amount of context leads to a sudden re-organization of representations in accordance with the graph's connectivity. This suggests LLMs can manipulate their representations in order to reflect concept semantics specified entirely in-context, inline with theories of inferential semantics from cognitive science (Harman, 1982; Block, 1998). We further characterize these results by analyzing the problem of Dirichlet energy minimization, showing that models indeed identify the structure of the underlying graph to achieve a non-trivial accuracy on our task. This suggests an implicit optimization process, as hypothesized by theoretical work on ICL in toy setups (e.g., in-context linear regression), can transpire in more naturalistic settings (Von Oswald et al., 2023a;b; Akyurek et al., 2023). Overall, our contributions can be summarized as follows. + +- Graph Navigation as a Simplistic Model of Novel Semantics. We introduce a toy graph navigation task that requires a model to interpret semantically meaningful concepts as referents for nodes in a structurally constrained graph. Inputting traces of random walks on this graph into an LLM, we analyze whether the model alters its intermediate representations for referent concepts to predict valid next nodes as defined by the underlying graph connectivity, hence inferring, inline with theories of semantics from cognitive science, novel semantics of a concept (Harman, 1982). +- Emergent In-Context Reorganization of Concept Representations. Our results show that as context-size is scaled, i.e., as we add more exemplars in context, there is a sudden re-organization of concept representations that reflects the graph's connectivity structure. Intriguingly, these results are similar to ones achieved in a similar setup with human subjects (Garvert et al., 2017; Whittington et al., 2020). Further, we show the context-specified graph structure emerges even when we use concepts that have correlations in their semantics (e.g., Mon, Tues, etc.), but, interestingly, is unable to dominate the pretrained structure. More broadly, we note that this sudden reorganization is reminiscent of emergent capabilities in LLMs when other relevant axes, e.g., compute or model size, are scaled (Wei et al., 2022; Srivastava et al., 2022; Lubana et al., 2024). +- An Energy Minimization Model of Semantics Inference. To provide a more quantitative account of our results, we compute the Dirichlet energy of model representations with respect to the ground-truth graph structure, and find the energy decreases as a function of context size. This offers a precise hypothesis for the mechanism employed by an LLM to re-organize representations according to the context-specified semantics of a concept. These results also serve as + +![](images/019d0a3cace717dd353182ae21862b10423d2e995f33dd12636998d050da9110.jpg) +(a) Words on a ring +(b) Data generation + +Randomly pick pairs of neighbors: (apple, banana), (orange, onion), (fig, carrot), (grape, lettuce), ... + +![](images/19daa7131ab45a7bd295aa3cbe22e43e392d32c6a7ef1f0e30f98fe707e33913.jpg) +(c) Emergent ring representation in context +Figure 2: Alteration of representations in accordance with context-specified semantics (ring structure). (a) We randomly place concepts on a ring structure unrelated to their semantics. (b) We then generate sequences of tokens by randomly sampling neighboring pairs from the ring which is used as the input context to a Llama-3.1-8B model. (c) The model's mean representation of tokens projected onto the top two principal components. As the number of in-context exemplars increases, there is a formation of representations mirroring the ring structure underlying the data-generating process. The representations are from the residual stream activations. + +evidence towards theories of in-context learning as implicit optimization in a more naturalistic setting (Von Oswald et al., 2023a;b; Akyurek et al., 2023). + +# 2 EXPERIMENTAL SETUP: IN-CONTEXT GRAPH TRACING + +We first define our setup for assessing the impact of context specification on how a model organizes its representations. In the main paper, we primarily focus on Llama3.1-8B (henceforth Llama3) (Dubey et al., 2024), accessed via NDIF/NNsight (Fiotto-Kaufman et al., 2024). We present results on other models—Llama3.2-1B / Llama3.1-8B-Instruct (Dubey et al., 2024) and Gemma-2-2B / Gemma-2-9B (Gemma Team, 2024)—in App. C.2. + +Task. Our proposed task, which we call in-context graph tracing, involves random walks on a predefined graph $\mathcal{G}$ . Specifically, inspired by prior work analyzing structured representations learned by sequence models, we experiment with three graphical structures: a square grid (Fig. 1 (a)), a ring (Fig. 2 (a)), and a hexagonal grid (Fig. 10). Results on hexagonal grid are deferred to appendix due to space constraints. To construct the square grid, we randomly arrange the set of tokens in a grid and add edges between horizontal and vertical neighbors. We then perform a random walk on the graph, emitting the visited tokens as a sequence (Fig. 1 (b)). For the ring, we add edges between neighboring nodes and simply sample random pairs of neighboring tokens on the graph (Fig. 2 (b)). Nodes in our graphs, denoted $\mathcal{T} = \{\tau_0,\tau_1,\dots ,\tau_n\}$ , are referenced via concepts that the model is extremely likely to have seen during pretraining. While any choice of concepts is plausible, we select random tokens that, unless mentioned otherwise, have no obvious semantic correlations with one another (e.g., apple, sand, math, etc.). However, these concepts have precise meanings associated with them in the training data, necessitating that to the extent the model relies on the provided context, the representations are morphed according to the in-context graph. We highlight that a visual analog of our task, wherein one uses images instead of text tokens to represent a concept, has been used to elicit very similar results with human subjects as the ones we report in this paper using LLMs (Garvert et al., 2017; Whittington et al., 2020; Mark et al., 2020; Brady et al., 2009). We also note that our proposed task is similar to ones studied in literature on in-context RL, wherein one provides exploration trajectories in-context to a model and expects it to understand the environment and its dynamics (a.k.a., a world model) (Lee et al., 2024b; Laskin et al., 2022). + +# 3 RESULTS + +# 3.1 VISUALIZING INTERNAL ACTIVATION USING PRINCIPAL COMPONENTS + +Since we are interested in uncovering context-specific representations, we input sequences from our data-generating process to the model and first compute the mean activations for each unique token $\tau \in \mathcal{T}$ . Namely, assume a given context $\mathcal{C} \coloneqq [c_0, \dots, c_{N-1}]$ , where $c_i \in \mathcal{T}$ , that originates from an underlying graph $\mathcal{G}$ . At each timestep, we look at a window of $N_w$ ( $=50$ ) preceding tokens (or all tokens if the context length is smaller than $N_w$ ), and collect all activations corresponding to each token $\tau \in \mathcal{T}$ at a given layer $\ell$ . We then compute the mean activations per token, denoted as $h_\tau^\ell \in \mathbb{R}^d$ . We further denote the stack of mean token representations as $H^\ell(\mathcal{T}) \in \mathbb{R}^{n \times d}$ . Finally, we run PCA on $H^\ell(\mathcal{T})$ , and use the first two principal components to visualize model activations (unless stated otherwise). We note that while PCA visualizations are known to suffer from pitfalls as a representation analysis method, we provide a thorough quantitative analysis in Sec. 4 to demonstrate that the model re-organizes concept representations according to the in-context graph structure, and prove in Sec. 5 that the structure of the graph is reflected in the PCA visualizations because of this re-organization of representations. We also provide further evidence on the faithfulness of PCA by conducting a preliminary causal analysis of the principal components, finding that intervening on concept representations' projections along these components affects the model's ability to accurately predict valid next node generations (App. C.4). + +Results. Figs. 1, 2 demonstrate the resulting visualizations for square grid and ring graphs, respectively (more examples are provided in the Appendix; see Fig. 9, 10). Strikingly, with enough exemplars, we find representations are in fact organized in accordance with the graph structure underlying the context. Interestingly, results can be skewed in the earlier layers towards semantic priors the model may have internalized during training; however, these priors are overridden as we go deeper in the model. For example, in the ring graph (see Fig. 2), concepts apple and orange are closer to each other in Layer 6 of the model, but become essentially antipodal around layer 26, as dictated by the graph; the antipodal nature is also more prominent as context length is increased. + +We also observe that despite developing a square-grid structure when sufficient context length is given (see Fig. 1), the structure is partially irregular; e.g., it is wider in the central regions, but narrowly arranged in the periphery. We find this to be an artifact of frequency with which a concept is seen in the context. Specifically, due to lack of periodic boundary conditions, concepts that are present in the inner $2 \times 2$ region of the grid are visited more frequently during a random walk on the graph, while the periphery of the graph has a lower visitation frequency. The representations reflect this, thus organizing in accordance with both structure and frequency of concepts in the context. + +Overall, the results above indicate that as we scale context size, models can re-organize semantically unrelated concepts to form task-specific representations, which we call in-context representations. Intriguingly, these results are broadly inline with theories of inferential semantics from cognitive science as well (Harman, 1982; Block, 1998). + +# 3.2 SEMANTIC PRIOR VS. IN-CONTEXT TASK REPRESENTATIONS + +Building on results from the previous section, we now investigate the impact of using semantically correlated concepts. Specifically, we build on the results from Engels et al. (2024), who show that representations for days of the week, i.e., {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}, organize in a circular geometry. We randomly permute the ordering of these concepts, arrange them on a 7-node ring graph similar to the previous section (see Fig. 3a), and evaluate whether the in-context representations can override the strong pretraining prior internalized by the model. + +Results. Fig. 3 (b, c) demonstrate the resulting visualizations. We find that when there is a conflict between the semantic prior and in-context task, we observe the original semantic ring in the first two principal components. However, the components right after in fact encode the context-specific structure: visualizing the third and fourth principal components shows the newly defined ring structure. This indicates that the context-specified structure is present in the representations, but does not dominate them. In Fig. 14, we report the model's accuracy on the in-context task, finding that the model overrides the semantic prior to perform well on our task when enough context is given. + +![](images/c7ac83a1eb93d79684da024bbaa05276925ecff8deefe737514b10d842b1ca03.jpg) +(a) + +![](images/68785be758f50773bd9c2ba6d6a67551c0981dab8cc49ffd48c461eb2adcc16c.jpg) +(b) +Figure 3: In-context representations form in higher principal components in the presence of semantic priors. (a) (Purple) Semantic links underlying days of the week. (Dashed blue) We define a non-semantic graph structure by linking non-neighboring days and generate tokens from this graph. (b) (Purple) The ring geometry formed by semantic links established during pre-training remains intact in the first two principal components. (c) (Dashed blue) The non-semantic structure provided in-context can be seen in the third and fourth principal components. Note that the star structure in the first two components (b), which match the ground truth graphical structure of our data generating process (a), becomes a ring in the next two principal components (c). The representations are from the residual stream activation following layer 21. + +![](images/c846892c12a07a638d8f42c85e9b94268ae2a90fd5458215203eb4569ef0ecb3.jpg) +(c) + +# 4 EFFECTS OF CONTEXT SCALING: EMERGENT RE-ORGANIZATION OF REPRESENTATIONS + +Our results in the previous section demonstrate models can re-organize concept representations in accordance with the context-specified semantics. We next aim to study how this behavior arises as context is scaled—is there a continuous, monotonic improvement towards the context-specified structure as context is added? If so, is there a trivial solution, e.g., regurgitation based on context that helps explain these results? To analyze these questions, we must first define a metric that helps us gauge how aligned the representations are with the structure of the graph that underlies the context. + +Dirichlet Energy. We measure the Dirichlet energy of our graph $\mathcal{G}$ 's structure by defining an energy function over the model representations. Specifically, for an undirected graph $\mathcal{G}$ with $n$ nodes, let $\pmb {A}\in \mathbb{R}^{n\times n}$ be its adjacency matrix, and $\pmb {x}\in \mathbb{R}^n$ be a signal vector that assigns a value $x_{i}$ to each node $i$ . Then the Dirichlet energy of the graph with respect to $\pmb{x}$ is defined as + +$$ +E _ {\mathcal {G}} (\boldsymbol {x}) = \sum_ {i, j} \boldsymbol {A} _ {i, j} \left(x _ {i} - x _ {j}\right) ^ {2}. \tag {1} +$$ + +For a multi-dimensional signal, the Dirichlet energy is defined as the summation of the energy over each dimension. Specifically, let $\mathbf{X} \in \mathbb{R}^{n \times d}$ be a matrix that assigns each node $i$ with a $d$ -dimensional vector $\mathbf{x}_i$ , then the Dirichlet energy of $\mathbf{X}$ is defined by + +$$ +E _ {\mathcal {G}} (\boldsymbol {X}) = \sum_ {k = 1} ^ {d} \sum_ {i, j} \boldsymbol {A} _ {i, j} \left(x _ {i, k} - x _ {j, k}\right) ^ {2} = \sum_ {i, j} \boldsymbol {A} _ {i, j} \| \boldsymbol {x} _ {i} - \boldsymbol {x} _ {j} \| ^ {2}. \tag {2} +$$ + +Overall, to empirically quantify the formation of geometric representations, we can measure the Dirichlet energy with respect to the graphs underlying our data generating processes (DGPs) and our mean token activations $h_{\tau}^{\ell}$ : + +$$ +E _ {\mathcal {G}} \left(\boldsymbol {H} ^ {\ell} (\mathcal {T})\right) = \sum_ {i, j} \boldsymbol {A} _ {i, j} \| \boldsymbol {h} _ {i} ^ {\ell} - \boldsymbol {h} _ {j} ^ {\ell} \| ^ {2}, \tag {3} +$$ + +where $H^{\ell}(\mathcal{T}) \in \mathbb{R}^{n \times d}$ is the stack of our mean token representations $h^\ell$ at layer $\ell$ and $i, j \in \mathcal{T}$ are tokens from our DGP at a certain context length. We note $H^{\ell}(\mathcal{T})$ is a function of context + +![](images/b1251e0be540dcc45f4d23b6059bf89b48e25b4f7c3a61ecc32f5f09600e1c3d.jpg) +Figure 4: A model continuously develops task representation as it learns to traverse novel graphs in-context. We plot the accuracy of graph traversal and the Dirichlet energy of the graph, computed from the model's internal representations, as functions of context length. We note that the Dirichlet energy never reaches a perfect zero—ruling out that the representations are learning a degenerate structure, as was also seen in the PCA visualizations in Sec. 3. (a) A 4x4 grid graph with 16 nodes. (b) A circular ring with 10 nodes. (c) A "honey-comb" hexagonal lattice, with 30 nodes. + +length as well, but we omit it in the notation for brevity. Intuitively, the measure above indicates whether neighboring tokens (nodes) in the ground truth graph have a small distance between their representations. Thus, as the model correctly infers the correct underlying structure, we expect to see a decrease in Dirichlet energy. We do note that, in practice, Dirichlet energy minimization has a trivial solution where all nodes are assigned the same representation. While we can be confident this trivial solution does not exist in our results, for else we would not see distinct node representations in PCA visualizations nor high accuracy for solving our tasks, we still provide an alternative analysis in App. C.3 where the representations are standardized (mean-centered and normalized by variance) to render this trivial solution infeasible. We find results are qualitatively similar with such standardized representations, but more noisy since standardization can induce sensitivity to noise. + +# 4.1 RESULTS: EMERGENT ORGANIZATION AND TASK ACCURACY IMPROVEMENTS + +We plot Llama3's accuracy at the in-context graph tracing task alongside the Dirichlet energy measure (for different layers) as a function of context. Specifically, we compute the "rule following accuracy", where we add up the model's output probability over all graph nodes which are valid neighbors. For instance, if the graph structure is apple-car-bird-water and the current state is car, we add up the predicted probabilities for apple and bird. This metric simply measures how well the model abides by the graph structure. + +Results are reported in Fig. 4. We see once a critical amount of context is seen by the model, accuracy starts to rapidly improve. We find this point in fact closely matches when Dirichlet Energy reaches its minimum value: energy is minimized shortly before the rapid increase in in-context task accuracy, suggesting that the structure of the data is correctly learned before the model can make valid predictions. This leads us to the claim that as the amount of context is scaled, there is an emergent re-organization of representations that allows the model to perform well on our in-context graph tracing task. We note these results also provide a more quantitative counterpart of our PCA visualization results before. + +Is there a Trivial Solution at play? A simple baseline that would exhibit an increase in performance with increasing context involves the model merely regurgitating a node's neighbors by copying them from its context. We call this the memorization solution. While such a solution would not explain the reorganization of representations, we use it as a baseline to show the model is likely engaging in a more intriguing mechanism. Since our accuracy metric measures rule following, this memorization solution will achieve value 1 if the node has been observed in the context and 0 otherwise. Following our data sampling process then, if we simply choose an initial node at random with replacement, we can express the probability of a node existing in a context of length $l$ as: + +$$ +p _ {\text {s e e n 1}} (\mathbf {x}) = 1 - \left(\frac {n - 1}{n}\right) ^ {l}, \tag {4} +$$ + +![](images/d304cefa5efe009a74b4f5357aed446eae3d14b3c91b57614e0c6c2f0e88724b.jpg) +Piecewise Linear Fit + +![](images/f0b857f1f95a21a1203f6fb2b13aa275fe415ffe9b462559fd972aa61e39a907.jpg) +Transition Point +Figure 5: A memorization solution cannot explain Llama's ICL graph tracing performance. We plot the rule-following accuracy from Llama-3.1-8B outputs and accuracies from a simple 1-shot and 2-shot memorization hypothesis. (a) A ring graph with 50 nodes. (b) A square grid graph with 25 nodes. In both cases, we find that the memorization solution cannot explain the accuracy ascent curve. Instead, we find a slow phase and a fast phase, which we fit with a piecewise linear fit. + +where $\mathbf{x}$ is the context and $n$ is the number of nodes available. Note that the current node itself does not matter as the sampling probability is uniform with replacement. We also evaluate another, similar baseline that assumes the same token much be encountered twice for the model to recognize it as an in-context exemplar. To define a closed-form expression for this solution, we have the probability that a node has appeared twice as follows: + +$$ +p _ {\text {s e e n 2}} (\mathbf {x}) = p _ {\text {s e e n 1}} (\mathbf {x}) - l \left(\frac {1}{n}\right) ^ {1} \left(\frac {n - 1}{n}\right) ^ {(l - 1)}. \tag {5} +$$ + +To evaluate whether the memorization solutions above explain our results, we plot their performance alongside the observed performance of Llama-3. Fig. 5 shows the result (a) on a ring graph with 50 nodes and (b) on a grid graph with 25 nodes. We find, in both cases, that neither the 1-shot nor the 2-shot memorization curve can explain the behavior of Llama. Instead, we observe that the accuracy has two phases, a first phase where the accuracy improves very slowly, and a second phase where the log-linear slope suddenly changes to a steeper ascent. We find that a piecewise linear fit can extract this transition point fairly well, which will be of interest in the next section. + +# 5 EXPLAINING EMERGENT RE-ORGANIZATION OF REPRESENTATIONS: THE ENERGY MINIMIZATION HYPOTHESIS + +Building on the results from previous section, we now put forward a hypothesis for why we are able to identify such structured representations from a model: we hypothesize the model internally runs an energy minimization process in search of the correct structural representation of the data (Yang et al., 2022), similar to claims of implicit optimization in in-context learning proposed by prior work in toy settings (Von Oswald et al., 2023a;b). More formally, we claim the following hypothesis. + +Hypothesis 5.1. Let $n$ be the number of tokens, $d$ be the dimensionality of the representations, and $H^{(\ell ,t)}(\mathcal{T})\in \mathbb{R}^{n\times d}$ be the stack of representations for each token learned by the model at layer $\ell$ and context length $t$ , then $E_{\mathcal{G}}\left(H^{(\ell ,t)}(\mathcal{T})\right)$ decays with context length $t$ . + +# 5.1 MINIMIZERS OF DIRICHLET ENERGY AND SPECTRAL EMBEDDINGS. + +We call the $k$ -th energy minimizer of $E_{\mathcal{G}}$ the optimal solution that minimizes $E_{\mathcal{G}}$ and is orthogonal to the first $k - 1$ energy minimizers. Formally, the energy minimizers $\left\{\boldsymbol{z}^{(k)}\right\}_{k = 1}^{n}$ are defined as the + +![](images/a6c48d8987f486202a8c3974b2561502d1a1381c8889c9f2ad4ff142067c55f6.jpg) +Figure 6: Spectral embedding of a ring graph. + +![](images/1503704e4e522ea288d4db269bb6574a51fffd865426bd831d5ad3a563aab36d.jpg) +Figure 7: Spectral embedding of a grid graph. + +solution to the following problem: + +$$ +\boldsymbol {z} ^ {(k)} = \arg \min _ {\boldsymbol {z} \in \mathbb {S} ^ {n - 1}} E _ {\mathcal {G}} (\boldsymbol {z}) \tag {6} +$$ + +$$ +\text {s . t .} \quad z \perp z ^ {(j)}, \forall j \leq k - 1, \tag {7} +$$ + +where $\mathbb{S}^{n - 1}$ is the unit sphere in $n$ dimensional Euclidean space. The energy minimizers are known to have the following properties (Spielman, 2019): + +1. $\pmb{z}^{(1)} = c\mathbf{1}$ for some constant $c \neq 0$ , which is a degenerated solution that assigns the same value to every node; and +2. If we use $\left(z_i^{(2)},z_i^{(3)}\right)$ as the coordinate of node $i$ , it will be a good planar embedding. We call them (2-dimensional) spectral embeddings. + +Spectral embeddings are often used to a draw graph on a plane and in many cases can preserve the structure of the graph (Tutte, 1963). In Figs. 6 and 7, we show the spectral embedding results for a ring graph and a grid graph respectively. Notice how such spectral embeddings are similar to the representations from our models in Fig. 1 and 2. As we show in Theorem B.1, this is in fact expected if our energy minimization hypothesis is true: if the representations $\pmb{H}$ from the model minimize the Dirichlet energy and are non-degenerated, then the first two principal components of PCA will exactly produce the spectral embeddings $z^{(2)}, z^{(3)}$ . Here we present an informal version of the theorem, and defer the full version and proof to the appendix. + +Theorem 5.1 (Informal Version of Theorem B.1). Let $\mathcal{G}$ be a graph and $\pmb{H} \in \mathbb{R}^{n \times d}$ (where $n \geq d \geq 3$ ) be a matrix that minimizes Dirichlet energy on $\mathcal{G}$ with non-degenerated singular values, then the first two principal components of $\pmb{H}$ will be $\pmb{z}^{(2)}$ and $\pmb{z}^{(3)}$ . + +See App. B for the formal version and proof of Theorem 5.1. See also Tab. 2 for an empirical validation of the theorem, wherein we show the principal components align very well with spectral embeddings of the graph. + +# 5.2 ENERGY MINIMIZATION AND GRAPH CONNECTIVITY + +Given the relationship between spectral embeddings (i.e., energy minimizers) and the principal components observed in our results (Figs. 1, 2), we claim that the model's inference of the underlying structure is akin to an implicit energy minimization. To further analyze the implication of this claim, we show that the moment at which we can visualize a graph using PCA is the moment at which the model has found a large connected component (i.e., the graph's structure). Specifically, consider an unconnected graph $\hat{\mathcal{G}}$ , i.e., $\hat{\mathcal{G}}$ has multiple connected components. Then, there are multiple degenerate solutions to the energy minimization problem, which will be found by PCA. Specifically, suppose $\hat{\mathcal{G}}$ has $q$ connected components, with $U_{i}$ denoting the set of nodes of the $i$ -th component. + +![](images/ef9666995064c382c589b4c8b8b503a7031a523fd919dc2f8ac44a6ba733aa63.jpg) +Figure 8: In-context emergence. We analyze the in-context accuracy curves as a function of context-size inputted to the model. The graph used in this experiment is an $m \times m$ grid, with a varying value for $m$ . (a) The rule following accuracy of a graph tracing task. The accuracy show a two phase ascent. We fit a piecewise linear function to the observed ascent to extract the transition point, which moves rightwards with increasing graph size. (b) Interestingly, the transition point scales as a power-law in $m$ , i.e., the number of nodes in the graph. + +![](images/1e952ffcabe9ce6f2cade3955bcb0c3336ea06d36c140b1a1c95aade458158e9.jpg) + +Then we can construct the first $q$ energy minimizers as follows: $\forall i\in [q]$ , let the $j$ -th value of $z^{(i)}$ be + +$$ +z _ {j} ^ {(i)} = \left\{ \begin{array}{l l} - \alpha_ {i} & j \in \bigcup_ {k = 1} ^ {i - 1} U _ {k} \\ 1 & \text {o t h e r w i s e ,} \end{array} \right. \tag {8} +$$ + +where $\alpha_{1} = 1$ and $\alpha_{i} = \frac{\sum_{k^{\prime} = i}^{q}\sum_{j\in U_{k^{\prime}}}z_{j^{\prime}}^{(i - 1)}}{\sum_{k = 1}^{i - 1}\sum_{j\in U_{k}}z_{j}^{(i - 1)}}$ for $i\in [q]\setminus \{1\}$ + +It is easy to check that each $z^{(i)}$ constructed above for $i \in [q]$ has 0 energy, and is thus a global minimizer of $E_{\hat{\mathcal{G}}}$ . Moreover, all $z^{(i),s}$ are orthogonal to each other and hence satisfy our definition of the first $q$ energy minimizers. It is important to notice that these $z^{(i),s}$ for $i \in [q]$ contain no information about the structure of the graph, other than identifying each connected component. Theorem B.1 tells us that the principal components of a non-degenerated (rank $s$ where $s > 1$ ) solution $H$ that minimizes the energy will be $z^{(2)} \cdots z^{(s+1)}$ . Thus, if the graph is unconnected, then the energy-minimizing representations will be dominated by information-less principal components, in which we should not expect any meaningful visualization. The acute reader may recall that the first minimizer $z^{(1)}$ is a trivial solution of the energy minimization that assigns the same value to every node. Conveniently, the above argument also implies that this is not a concern: PCA will rule out this degenerate solution as demonstrated in Theorem B.1. + +In-context emergence: A hypothesis. Our results in Fig. 5 showed an intriguing breakpoint that is reminiscent of a second-order phase transition (i.e., an undefined second derivative). As shown in Fig. 8, we in fact find this behavior is extremely robust across graphs of different sizes, and shows a power-law scaling trend with increasing graph size (see App. C.7 for several more results in this vein, including different graph topologies). Given the relationship offered between energy minimization and discovery of a connected component (graph structure) in our analysis above, a possible framework to explain these results may be the problem of bond-percolation on a graph (Newman, 2003; Hooyberghs et al., 2010): in bond-percolation, one starts with an unconnected graph and slowly fills edges to connect its nodes; as edges are filled, there is a second-order transition after which a large connected component emerges in the graph. The nature of the transition observed in our experiments (Fig. 8) and the theoretical connection between energy minimization and existence of a connected component provide some evidence towards the plausibility of this hypothesis. However, we believe the analogy is still loose, for our graph sizes are relatively small (likely causing significant finite-size effects) and the experiments need to corroborate any scaling theory of the transition point from percolation literature would require running graphs with at least 2 orders-of-magnitude difference in their sizes. However, the consistency of the hypothesis with our empirical results and analysis implies that investigating it further may be fruitful. + +# 6 RELATED WORK + +Model Representations. Researchers have recently discovered numerous structured representations in neural networks. Mikolov et al. (2013) suggests that concepts are linearly represented in activations, and Park et al. (2024d) more recently suggests this may be the case for contemporary language models. Numerous researchers have found concrete examples of linear representations for human-level concepts, including "truthfulness" (Burns et al., 2022; Li et al., 2023b; Marks & Tegmark, 2024), "refusal" (Arditi et al., 2024), toxicity (Lee et al., 2024a), sycophancy (Rimsky et al., 2024), and even "world models" (Li et al., 2022; Nanda et al., 2023). Park et al. (2024c) finds that hierarchical concepts are represented with a tree-like structure consisting of orthogonal vectors. A relevant line of work includes that of Todd et al. (2023) and Hendel et al. (2023). Both papers find that one can compute a vector from in-context exemplars that encode the task, such that adding such a vector during test time for a new input can correctly solve the task. Language models do not always form linear representations, however. Engels et al. (2024) find circular feature representations for periodic concepts, such as days of the week or months of the year, using a combination of sparse autoencoders and PCA. Csordás et al. (2024) finds that recurrent neural networks trained on token repetition can either learn an "onion"-like representation or a linear representation, depending on the model's width. Unlike such prior work, we find that task-specific representations with a desired structural pattern can be induced in-context. To our knowledge, our work offers the first such investigation of in-context representation learning. + +Scaling In-Context Learning Numerous works have demonstrated that in-context accuracy improves with more exemplars (Brown et al., 2020; Lu et al., 2022; Bigelow et al., 2023). With longer context lengths becoming available, researchers have begun to study the effect of many-shot prompting (as opposed to few-shot) (Agarwal et al., 2024; Anil et al., 2024; Li et al., 2023c). For instance, Agarwal et al. (2024) reports improved performance on ICL using hundreds to thousands of exemplars on a wide range of tasks. Similarly, Anil et al. (2024) demonstrate the ability to jail-break LLMs by scaling the number of exemplars. Unlike such work that evaluates model behavior, we study the effect of scaling context on the underlying representations, and provide a framework for predicting when discontinuous changes in behavior can be expected via mere context-scaling. + +Synthetic Data for Interpretability Recent works have demonstrated the value of interpretable, synthetic data generating processes for understanding Transformer's behavior, including in-context learning (Park et al., 2024a; Ramesh et al., 2023; Garg et al., 2023), language acquisition (Lubana et al., 2024; Qin et al., 2024; Allen-Zhu & Li, 2023b), fine-tuning (Jain et al., 2023; Lubana et al., 2023; Juneja et al., 2022), reasoning abilities (Prystawski et al., 2024; Khona et al., 2024; Wen et al., 2024; Liu et al., 2022a), and knowledge representations (Nishi et al., 2024; Allen-Zhu & Li, 2023a). While prior work typically pre-trains Transformers on synthetic data, we leverage synthetic data to study representation formation during in-context learning in pretrained large language models. + +# 7 DISCUSSION + +In this work, we show that LLMs can flexibly manipulate their representations from semantics internalized based on pretraining data to semantics defined entirely in-context. To arrive at these results, we propose a simple but rich task of graph tracing, wherein traces of random walks on a graph are shown to the model in-context. The graphs are instantiated using predefined structures (e.g., lattices) and concepts that are semantically interesting (e.g., to define nodes), but meaningless in the overall context of the problem. Interestingly, we find the ability to flexibly manipulate representations is in fact emergent with respect to context size—we propose a model based on energy minimization to hypothesize a mechanism for the underlying dynamics of this behavior. These results suggest context-scaling can unlock new capabilities, and, more broadly, this axis may have as of yet been underappreciated for improving a model. In fact, we note that, to our knowledge, our work is to first to investigate the formation of representations entirely in-context. Our study also naturally motivates future work towards formation of world representations Li et al. (2023a) and world models (Ha & Schmidhuber, 2018) in-context, which can have significant implications toward building general and open-ended systems, as well as forecasting its safety concerns. We also highlight the relation of our experimental setup to similar tasks studied in neuroscience literature Garvert et al. (2017); Mark et al. (2020; 2024), wherein humans are shown random walks of a graph of visual concepts; fMRI images of these subjects demonstrate the formation of a structured representation of the graph in the hippocampal-entorhinal cortex, similar to our results with LLMs. + +# ACKNOWLEDGMENTS + +We greatly thank the National Deep Inference Fabric (NDIF) pilot program (Fiotto-Kaufman et al., 2024), especially, Emma Bortz, Jaden Fiotto-Kaufman, Adam Belfki, David Bau, and the team who provided us with access to representations of Llama models, making this work possible. CFP and HT acknowledge the support of Aravinthan D.T. Samuel, Cecilia Garraffo and Douglas P. Finkbeiner. CFP, ESL, KN, MO, and HT are supported by the CBS-NTT Program in Physics of Intelligence. AL and MW acknowledges support from the Superalignment Fast Grant from OpenAI. MW also acknowledges support from Effective Ventures Foundation, Effektiv Spenden Schweiz, and the Open Philanthropy Project. Part of the computations in this paper were run on the FASRC cluster supported by the FAS Division of Science Research Computing Group at Harvard University. ESL thanks Eric Bigelow for crucial discussions that helped define several hypotheses pursued in this work, and the Harvard CoCoDev lab (especially Peng Qian) and Talia Konkle for feedback on an earlier version of the paper. CFP thanks Zochen Zhang, Eric Todd, Clement Dumas, and Shivam Raval for useful discussions. All authors thank David Bau and his lab for useful feedback on the paper's results. + +# AUTHOR CONTRIBUTIONS + +CFP, AL, ESL, and HT conceived the in-context graph traversal task, inspired by discussions and experiments with MO and KN in a related work on pretraining. CFP and AL co-led experiments, where CFP discovered the in-context learning of the ring-structured representation with input from HT, kicking off this study. AL suggested extending this to grid structures to CFP connecting it to world representations, and ESL proposed hexagonal configurations. ESL hypothesized in-context transitions with increased context and percolation mechanism. CFP conducted semantic overriding and percolation experiments, while AL performed accuracy-energy experiments and causal interventions, with CFP, AL, and ESL developing transition point detection methods and contributing to energy normalization. YY formulated the energy minimization theory and its proofs, collaborating with ESL to connect the framework to component existence and demonstrate PCA's optimality. MW provided alternative hypotheses for experimental robustness. CFP, AL, ESL, YY, and HT codeveloped an initial manuscript with feedback from MW, with ESL leading the final writing and project narrative development. CFP, AL, and HT created figures, while CFP and AL jointly developed the appendix. AL conducted substantial experiments to verify the main claims generalize to other models with CFP's support. HT supervised the project. + +# REFERENCES + +Mostafa Abdou, Artur Kulmizev, Daniel Hershcovich, Stella Frank, Ellie Pavlick, and Anders Søgaard. Can language models encode perceptual structure without grounding? a case study in color. arXiv preprint arXiv:2109.06129, 2021. +Rishabh Agarwal, Avi Singh, Lei M. Zhang, Bernd Bohnet, Luis Rosias, Stephanie Chan, Biao Zhang, Ankesh Anand, Zaheer Abbas, Azade Nova, John D. Co-Reyes, Eric Chu, Feryal Behbahani, Aleksandra Faust, and Hugo Larochelle. Many-shot in-context learning, 2024. URL https://arxiv.org/abs/2404.11018. +Ekin Akyurek, Dale Schuurmans, Jacob Andreas, Tengyu Ma, and Denny Zhou. What learning algorithm is in-context learning? investigations with linear models, 2023. URL https:// arxiv.org/abs/2211.15661. +Zeyuan Allen-Zhu and Yanzhi Li. Physics of language models: Part 3.1, knowledge storage and extraction. arXiv preprint arXiv:2309.14316, 2023a. +Zeyuan Allen-Zhu and Yanzhi Li. Physics of language models: Part 1, learning hierarchical language structures. ArXiv e-prints, abs/2305.13673, May, 2023b. +Cem Anil, Esin Durmus, Mrinank Sharma, Joe Benton, Sandipan Kundu, Joshua Batson, Nina Rimsky, Meg Tong, Jesse Mu, Daniel Ford, et al. Many-shot jailbreaking. *Anthropic*, April, 2024. +Anthropic AI. Scaling Monoseismicity: Extracting Interpretable Features from Claude 3 Sonnet, 2024. https://transformer-circuits.pub/2024/scaling-monoseismicity/index.html. +Andy Arditi, Oscar Obeso, Aaquib Syed, Daniel Paleka, Nina Panickssery, Wes Gurnee, and Neel Nanda. Refusal in language models is mediated by a single direction. arXiv preprint arXiv:2406.11717, 2024. +Eric J Bigelow, Ekdeep Singh Lubana, Robert P Dick, Hidenori Tanaka, and Tomer D Ullman. In-context learning dynamics with random binary sequences. arXiv preprint arXiv:2310.17639, 2023. +Ned Block. Semantics, conceptual role. *Routledge encyclopedia of philosophy*, 8:652-657, 1998. +Timothy F Brady, Talia Konkle, and George A Alvarez. Compression in visual working memory: using statistical regularities to form more efficient memory representations. Journal of Experimental Psychology: General, 138(4):487, 2009. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877-1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper_files/paper/2020/file/1457c0d6bcbd4967418bf8ac142f64a-Paper.pdf. +Collin Burns, Haotian Ye, Dan Klein, and Jacob Steinhardt. Discovering latent knowledge in language models without supervision. arXiv preprint arXiv:2212.03827, 2022. +Róbert Csordás, Christopher Potts, Christopher D Manning, and Atticus Geiger. Recurrent neural networks learn to store and generate sequences using non-linear representations. arXiv preprint arXiv:2408.10920, 2024. +Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, and et al. The llama 3 herd of models, 2024. URL https://arxiv.org/abs/2407.21783. + +Joshua Engels, Isaac Liao, Eric J. Michaud, Wes Gurnee, and Max Tegmark. Not all language model features are linear, 2024. URL https://arxiv.org/abs/2405.14860. +Ky Fan. On a theorem of weyl concerning eigenvalues of linear transformations i. Proceedings of the National Academy of Sciences, 35(11):652-655, 1949. +Jaden Fiotto-Kaufman, Alexander R Loftus, Eric Todd, Jannik Brinkmann, Caden Juang, Koyena Pal, Can Rager, Aaron Mueller, Samuel Marks, Arnab Sen Sharma, Francesca Lucchetti, Michael Ripa, Adam Belfki, Nikhil Prakash, Sumeet Multani, Carla Brodley, Arjun Guha, Jonathan Bell, Byron Wallace, and David Bau. Nnsight and ndif: Democratizing access to foundation model internals, 2024. URL https://arxiv.org/abs/2407.14561. +Shivam Garg, Dimitris Tsipras, Percy Liang, and Gregory Valiant. What can transformers learn in-context? a case study of simple function classes, 2023. URL https://arxiv.org/abs/2208.01066. +Mona M Garvert, Raymond J Dolan, and Timothy EJ Behrens. A map of abstract relational knowledge in the human hippocampal-entorhinal cortex. *elife*, 6:e17086, 2017. +Gemma Team. Gemma 2: Improving open language models at a practical size, 2024. URL https://arxiv.org/abs/2408.00118. +Pulkit Gopalani, Ekdeep Singh Lubana, and Wei Hu. Abrupt learning in transformers: A case study on matrix completion. arXiv preprint arXiv:2410.22244, 2024. +Wes Gurnee and Max Tegmark. Language models represent space and time. arXiv preprint arXiv:2310.02207, 2023. +David Ha and Jürgen Schmidhuber. World models. arXiv preprint arXiv:1803.10122, 2018. +Gilbert Harman. Conceptual role semantics. Notre Dame Journal of Formal Logic, 23(2):242-256, 1982. +Roee Hendel, Mor Geva, and Amir Globerson. In-context learning creates task vectors. In Houda Bouamor, Juan Pino, and Kalika Bali (eds.), Findings of the Association for Computational Linguistics: EMNLP 2023, pp. 9318-9333, Singapore, December 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023-findings-emnlp.624. URL https://aclanthology.org/2023-findings-emnlp.624. +H. Hooyberghs, B. Van Schaeybroeck, and J. O. Indekeu. Percolation on bipartite scale-free networks. Physica A: Statistical Mechanics and its Applications, 389(15):2920-2929, August 2010. ISSN 0378-4371. +Samyak Jain, Robert Kirk, Ekdeep Singh Lubana, Robert P Dick, Hidenori Tanaka, Edward Grefenstette, Tim Rocttäschel, and David Scott Krueger. Mechanistically analyzing the effects of fine-tuning on procedurally defined tasks. arXiv preprint arXiv:2311.12786, 2023. +Erik Jenner, Shreyas Kapur, Vasil Georgiev, Cameron Allen, Scott Emmons, and Stuart Russell. Evidence of learned look-ahead in a chess-playing neural network. arXiv preprint arXiv:2406.00877, 2024. +Jeevesh Juneja, Rachit Bansal, Kyunghyun Cho, Joao Sedoc, and Naomi Saphra. Linear connectivity reveals generalization strategies. arXiv preprint. arXiv:2205.12411, 2022. +Mikail Khona, Maya Okawa, Jan Hula, Rahul Ramesh, Kento Nishi, Robert Dick, Ekdeep Singh Lubana, and Hidenori Tanaka. Towards an understanding of stepwise inference in transformers: A synthetic graph navigation model. arXiv preprint arXiv:2402.07757, 2024. +Michael Laskin, Luyu Wang, Junhyuk Oh, Emilio Parisotto, Stephen Spencer, Richie Steigerwald, DJ Strouse, Steven Hansen, Angelos Filos, Ethan Brooks, et al. In-context reinforcement learning with algorithm distillation. arXiv preprint arXiv:2210.14215, 2022. + +Andrew Lee, Xiaoyan Bai, Itamar Pres, Martin Wattenberg, Jonathan K Kummerfeld, and Rada Mihalcea. A mechanistic understanding of alignment algorithms: A case study on dpo and toxicity. In *Forty-first International Conference on Machine Learning*, 2024a. URL https://arxiv.org/abs/2401.01967. +Jonathan Lee, Annie Xie, Aldo Pacchiano, Yash Chandak, Chelsea Finn, Ofir Nachum, and Emma Brunskill. Supervised pretraining can learn in-context reinforcement learning. Advances in Neural Information Processing Systems, 36, 2024b. +Belinda Z Li, Maxwell Nye, and Jacob Andreas. Implicit representations of meaning in neural language models. arXiv preprint arXiv:2106.00737, 2021. +Kenneth Li, Aspen K Hopkins, David Bau, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. Emergent world representations: Exploring a sequence model trained on a synthetic task. In The Eleventh International Conference on Learning Representations, 2022. +Kenneth Li, Aspen K Hopkins, David Bau, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. Emergent world representations: Exploring a sequence model trained on a synthetic task. In The Eleventh International Conference on Learning Representations, 2023a. URL https://openreview.net/forum?id=DeG07_TcZvT. +Kenneth Li, Oam Patel, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. Inference-time intervention: Eliciting truthful answers from a language model. In Thirty-seventh Conference on Neural Information Processing Systems, 2023b. URL https://openreview.net/forum?id=aLLuYpn83y. +Mukai Li, Shansan Gong, Jiangtao Feng, Yiheng Xu, Jun Zhang, Zhiyong Wu, and Lingpeng Kong. In-context learning with many demonstration examples. arXiv preprint arXiv:2302.04931, 2023c. +Bingbin Liu, Jordan T Ash, Surbhi Goel, Akshay Krishnamurthy, and Cyril Zhang. Transformers learn shortcuts to automata. arXiv preprint arXiv:2210.10749, 2022a. +Ziming Liu, Ouail Kitouni, Niklas S Nolte, Eric Michaud, Max Tegmark, and Mike Williams. Towards understanding grokking: An effective theory of representation learning. Advances in Neural Information Processing Systems, 35:34651-34663, 2022b. +Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. In Smaranda Muresan, Preslav Nakov, and Aline Villavicencio (eds.), Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 8086-8098, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.556. URL https://aclanthology.org/2022.acl-long.556. +Ekdeep Singh Lubana, Eric J Bigelow, Robert P Dick, David Krueger, and Hidenori Tanaka. Mechanistic mode connectivity. In International Conference on Machine Learning, pp. 22965-23004. PMLR, 2023. +Ekdeep Singh Lubana, Kyogo Kawaguchi, Robert P Dick, and Hidenori Tanaka. A percolation model of emergence: Analyzing transformers trained on a formal language. arXiv preprint arXiv:2408.12578, 2024. +Shirley Mark, Rani Moran, Thomas Parr, Steve W Kennerley, and Timothy EJ Behrens. Transferring structural knowledge across cognitive maps in humans and models. Nature communications, 11 (1):4783, 2020. +Shirley Mark, Philipp Schwartenbeck, Avital Hahamy, Veronika Samborska, Alon B Baram, and Timothy E Behrens. Flexible neural representations of abstract structural knowledge in the human entorhinal cortex. *Elife*, 13, 2024. +Samuel Marks and Max Tegmark. The geometry of truth: Emergent linear structure in large language model representations of true/false datasets, 2024. URL https://arxiv.org/abs/2310.06824. + +Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space, 2013. URL https://arxiv.org/abs/1301.3781. +Neel Nanda, Andrew Lee, and Martin Wattenberg. Emergent linear representations in world models of self-supervised sequence models. In Proceedings of the 6th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP, pp. 16-30, 2023. URL https://arxiv.org/abs/2309.00941. +M. E. J. Newman. The Structure and Function of Complex Networks. SIAM Review, 45(2):167-256, January 2003. ISSN 0036-1445, 1095-7200. +Kento Nishi, Maya Okawa, Rahul Ramesh, Mikail Khona, Ekdeep Singh Lubana, and Hidenori Tanaka. Representation shattering in transformers: A synthetic study with knowledge editing. arXiv preprint arXiv:2410.17194, 2024. +Core Francisco Park, Ekdeep Singh Lubana, Itamar Pres, and Hidenori Tanaka. Competition dynamics shape algorithmic phases of in-context learning. arXiv preprint arXiv:2412.01003, 2024a. +Core Francisco Park, Maya Okawa, Andrew Lee, Ekdeep Singh Lubana, and Hidenori Tanaka. Emergence of hidden capabilities: Exploring learning dynamics in concept space, 2024b. URL https://arxiv.org/abs/2406.19370. +Kiho Park, Yo Joong Choe, Yibo Jiang, and Victor Veitch. The geometry of categorical and hierarchical concepts in large language models. arXiv preprint arXiv:2406.01506, 2024c. +Kiho Park, Yo Joong Choe, and Victor Veitch. The linear representation hypothesis and the geometry of large language models, 2024d. URL https://arxiv.org/abs/2311.03658. +Roma Patel and Ellie Pavlick. Mapping language models to grounded conceptual spaces. In International conference on learning representations, 2022. +Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532-1543, 2014. +Ben Prystawski, Michael Li, and Noah Goodman. Why think step by step? reasoning emerges from the locality of experience. Advances in Neural Information Processing Systems, 36, 2024. +Tian Qin, Naomi Saphra, and David Alvarez-Melis. Sometimes i am a tree: Data drives unstable hierarchical generalization. arXiv preprint arXiv:2412.04619, 2024. +Rahul Ramesh, Ekdeep Singh Lubana, Mikail Khona, Robert P Dick, and Hidenori Tanaka. Compositional capabilities of autoregressive transformers: A study on synthetic, interpretable tasks. arXiv preprint arXiv:2311.12997, 2023. +Nina Rimsky, Nick Gabrieli, Julian Schulz, Meg Tong, Evan Hubinger, and Alexander Turner. Steering llama 2 via contrastive activation addition. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 15504-15522, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.acl-long.828. URL https://aclanthology.org/2024.acl-long.828. +Adam S Shai, Sarah E Marzen, Lucas Teixeira, Alexander Gietelink Oldenziel, and Paul M Riechers. Transformers represent belief state geometry in their residual stream. arXiv preprint arXiv:2405.15943, 2024. +Daniel Spielman. Spectral and algebraic graph theory. Yale lecture notes, draft of December, 4:47, 2019. +Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam R Brown, Adam Santoro, Aditya Gupta, Adrià Garriga-Alonso, et al. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models. arXiv preprint arXiv:2206.04615, 2022. + +Eric Todd, Millicent L Li, Arnab Sen Sharma, Aaron Mueller, Byron C Wallace, and David Bau. Function vectors in large language models. arXiv preprint arXiv:2310.15213, 2023. +Aaron Traylor, Roman Feiman, and Ellie Pavlick. Can neural networks learn implicit logic from physical reasoning? In *The eleventh international conference on learning representations*, 2022. +William Thomas Tutte. How to draw a graph. Proceedings of the London Mathematical Society, 3 (1):743-767, 1963. +Keyon Vafa, Justin Y Chen, Jon Kleinberg, Sendhil Mullainathan, and Ashesh Rambachan. Evaluating the world model implicit in a generative model. arXiv preprint arXiv:2406.03689, 2024. +Johannes Von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento, Alexander Mordvintsev, Andrey Zhmoginov, and Max Vlademyrov. Transformers learn in-context by gradient descent. In International Conference on Machine Learning, pp. 35151-35174. PMLR, 2023a. +Johannes Von Oswald, Maximilian Schlegel, Alexander Meulemans, Seijin Kobayashi, Eyvind Niklasson, Nicolas Zucchet, Nino Scherrer, Nolan Miller, Mark Sandler, Max Vlademyrov, et al. Uncovering mesa-optimization algorithms in transformers. arXiv preprint arXiv:2309.05858, 2023b. +Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. arXiv preprint arXiv:2206.07682, 2022. +Kaiyue Wen, Yuchen Li, Bingbin Liu, and Andrej Risteski. Transformers are uninterpretable with myopic methods: a case study with bounded dyck grammars. Advances in Neural Information Processing Systems, 36, 2024. +James CR Whittington, Timothy H Muller, Shirley Mark, Guifen Chen, Caswell Barry, Neil Burgess, and Timothy EJ Behrens. The tolman-eichenbaum machine: unifying space and relational memory through generalization in the hippocampal formation. Cell, 183(5):1249-1263, 2020. +Yongyi Yang, David P Wipf, et al. Transformers from an optimization perspective. Advances in Neural Information Processing Systems, 35:36958-36971, 2022. + +# A ADDITIONAL EXPERIMENTAL DETAILS + +Here we provide some additional details regarding our experimental setups. + +Context Windows. Our analyses require computing mean token representations $\pmb{h}_i$ for every token $i \in \mathcal{T}$ in our graphs. To do so, we grab the activations per each token in the most recent context window of $N_w$ tokens. Because we further require that each token is observed at least once in our window, we use a batch of prompts, where the batch size is equal to the number of nodes in our graph. For each prompt in the batch, we start our random traversal (or random pairwise sampling) with a different node, ensuring that each node shows up at least once in the context. In the case when our context length $(N_c)$ is longer than the window, we simply use every token $(N_w = N_c)$ . + +Computational Resources. We run our experiments on either A100 nodes, or by using the APIs provided by NDIF (Fiotto-Kaufman et al., 2024). + +# B THE CONNECTION BETWEEN ENERGY MINIMIZATION AND PCA STRUCTURE + +In this section, for a matrix $M \in \mathbb{R}^{n \times d}$ , we use lowercase bold letters with subscript to represent the columns for $M$ , e.g. $m_k$ represents the $k$ -th column of $M$ . Moreover, we use $\sigma_k(M)$ to represent the $k$ -th largest singular value of $M$ and when $M$ is PSD we use $\lambda_k(M)$ to represent the $k$ -th largest eigenvalue of $M$ . Moreover, we use $e_k$ to represent a vector with all-zero entries except a 1 at entry $k$ , whose dimension is inferred from context, and 1 to represent a vector with all entries being 1. For a natural number $n$ , we use $[n]$ to represent $\{1,2,\dots,n\}$ . + +Furthermore, we use $\left\{z^{(k)}\right\}_{k = 1}^n$ to represent the energy minimizers of the Dirichlet energy, defined in Section 4. Let $A\in \mathbb{R}^{n\times n}$ be the adjacency matrix of the graph, $D = \mathrm{diag}(A1)$ be the degree matrix, and $L = D - A$ be the Laplacian matrix. Through an easy calculation one can know that for any vector $\pmb {x}\in \mathbb{R}^n$ + +$$ +E _ {\mathcal {G}} (\boldsymbol {x}) = \langle \boldsymbol {x}, \boldsymbol {L} \boldsymbol {x} \rangle . \tag {9} +$$ + +Therefore, from the Spectral Theorem (e.g. Theorem 2.2.1 in Spielman (2019)), we know that $\mathbf{z}_k$ is the eigenvector of $\mathbf{L}$ corresponding to $\lambda_{n - k + 1}(\mathbf{L}) = E_{\mathcal{G}}(\mathbf{z}_k)$ . + +We will show that, if a matrix $\mathbf{H} \in \mathbb{R}^{n \times d}$ minimizes the energy and is non-degenerated (has several distinct and non-zero singular values), then the PCA must exactly give the leading energy minimizers, starting from $z_{2}$ . + +Theorem B.1. Let $\mathcal{G}$ be a graph and $\epsilon_1 > \epsilon_2 > \dots >\epsilon_s > 0$ be $s\leq \min \{n,d\} -1$ distinct positive numbers. Let matrix $\pmb {H}\in \mathbb{R}^{n\times d}$ be the solution of the following optimization problem: + +$$ +\boldsymbol {H} = \arg \min _ {\boldsymbol {X} \in \mathbb {R} ^ {n \times d}} E _ {\mathcal {G}} (\boldsymbol {X}) \tag {10} +$$ + +$$ +s. t. \quad \sigma_ {k} (\boldsymbol {X}) \geq \epsilon_ {k}, \forall k \in [ r ], \tag {11} +$$ + +then the $k$ -th principle component of $\mathbf{H}$ (for $k \in [r]$ ) is $\mathbf{z}^{(k+1)}$ . + +Proof. We first prove that the leading left-singular vectors of $\pmb{H}$ are exactly energy minimizers. Let $r = \min \{n, d\}$ . Let the SVD of $\pmb{H}$ be $\pmb{H} = \pmb{U} \pmb{\Sigma} \pmb{V}^{\top}$ , where $\pmb{\Sigma} = \mathrm{diag}\left[\sigma_{1}, \sigma_{2}, \dots, \sigma_{d}\right]$ are the singular values of $\pmb{H}$ , and $\pmb{U} \in \mathbb{R}^{n \times r}$ , $\pmb{V} \in \mathbb{R}^{r \times d}$ . + +Let $\pmb{h}_i'$ represents the $i$ -th row of $\pmb{H}$ . Notice that + +$$ +\begin{array}{l} E _ {\mathcal {G}} (\boldsymbol {H}) = \sum_ {i, j} \boldsymbol {A} _ {i, j} \left\| \boldsymbol {h} _ {i} ^ {\prime} - \boldsymbol {h} _ {j} ^ {\prime} \right\| ^ {2} (12) \\ = \sum_ {i, j} \boldsymbol {A} _ {i, j} \left\| \left(\boldsymbol {e} _ {i} - \boldsymbol {e} _ {j}\right) ^ {\top} \boldsymbol {H} \right\| ^ {2} (13) \\ = \sum_ {i, j} \boldsymbol {A} _ {i, j} \left\| \left(\boldsymbol {e} _ {i} - \boldsymbol {e} _ {j}\right) ^ {\top} \boldsymbol {U} \boldsymbol {\Sigma} \right\| ^ {2} (14) \\ = \sum_ {i, j} \sum_ {k = 1} ^ {r} \sigma_ {k} ^ {2} \left\langle \boldsymbol {e} _ {i} - \boldsymbol {e} _ {j}, \boldsymbol {u} _ {k} \right\rangle^ {2} (15) \\ = \sum_ {k = 1} ^ {r} \sigma_ {k} ^ {2} E _ {\mathcal {G}} \left(\boldsymbol {u} _ {k}\right). (16) \\ \end{array} +$$ + +Since $\sigma_{k}$ 's and $\pmb{u}_{k}$ 's are independent, no matter what are the values of $\pmb{u}_{k}$ , we know that each $\sigma_{k}$ will take the smallest possible value, and from the given condition, it is $\sigma_{k} = \epsilon_{k}, \forall k \in [s]$ , and $\sigma_{k} = 0, \forall k \in [r] \setminus [s]$ . + +Since $\pmb{u}_k$ 's are singular vectors, we have $\pmb{u}_k$ 's are orthogonal to each other. Using Theorem 1 in Fan (1949), we know that for any $s' \in [n]$ , the minimizer of $\sum_{k=1}^{s'} E_{\mathcal{G}}(\pmb{u}_k)$ is $\pmb{u}_k = \pmb{z}^{(k)}, \forall k \in [s']$ . Therefore, it is evident that the minimizer of $\sum_{k=1}^{s} \sigma_k^2 E_{\mathcal{G}}(\pmb{u}_k)$ must satisfy $\pmb{u}_k = \pmb{z}^{(k)}, \forall k \in [s]$ , since from the above argument of $\sigma_k$ 's and the given condition condition we know that $\sigma_1 > \sigma_2 > \dots > \sigma_s > 0$ . + +Now we have proved that $\pmb{u}_k = \pmb{z}^{(k)}, \forall k \in [s]$ . Next we consider the output of PCA. Let $\pmb{p}_k$ be the $k$ -th principle component output by the PCA of $H$ . We know that $\pmb{p}_k$ is the eigenvector of + +$$ +C = \widehat {H} \widehat {H} ^ {\top} \tag {17} +$$ + +that corresponds to the $k$ -th largest eigenvalue of $\pmb{C}$ , where $\widehat{\pmb{H}} = \pmb{H} - \frac{1}{n}\mathbf{11}^{\top}\pmb{H}$ is the centralized $\pmb{H}$ . + +From the Spectral Theorem, we have + +$$ +\boldsymbol {p} _ {k} = \arg \max _ {\substack {\boldsymbol {p} \in \mathbb {S} ^ {n - 1} \\ \boldsymbol {p} \perp \boldsymbol {p} _ {i}, \forall i \leq k - 1}} \left\langle \boldsymbol {p}, \boldsymbol {C} \boldsymbol {p} \right\rangle . \tag{18} +$$ + +Let $J = \operatorname{span}\{\mathbf{1}\}$ be the set of vectors whose every entry has the same value. Let $J^{\perp}$ be the subspace in $\mathbb{R}^n$ that is orthogonal to $J$ . For a subspace $K$ of $\mathbb{R}^n$ , let $\Pi_K: \mathbb{R}^n \to \mathbb{R}^n$ be the projection operator onto $K$ . + +We have that + +$$ +\begin{array}{l} \boldsymbol {p} _ {1} = \arg \max _ {\boldsymbol {p} \in \mathbb {S} ^ {n - 1}} \left\langle \boldsymbol {p}, \boldsymbol {C} \boldsymbol {p} \right\rangle (19) \\ = \arg \max _ {\boldsymbol {p} \in \mathbb {S} ^ {n - 1}} \left\langle \boldsymbol {p}, \left(\boldsymbol {I} - \frac {1}{n} \mathbf {1 1} ^ {\top}\right) \boldsymbol {H} \boldsymbol {H} ^ {\top} \left(\boldsymbol {I} - \frac {1}{n} \mathbf {1 1} ^ {\top}\right) \boldsymbol {p} \right\rangle (20) \\ = \arg \max _ {\boldsymbol {p} \in \mathbb {S} ^ {n - 1}} \left\langle \Pi_ {J ^ {\perp}} (\boldsymbol {p}), \boldsymbol {H} \boldsymbol {H} ^ {\top} \Pi_ {J ^ {\perp}} (\boldsymbol {p}) \right\rangle (21) \\ = \arg \max _ {\substack {\boldsymbol {p} \in \mathbb {S} ^ {n - 1} \\ \boldsymbol {p} \perp J}} \left\langle \boldsymbol {p}, \boldsymbol {H} \boldsymbol {H} ^ {\top} \boldsymbol {p} \right\rangle , (22) \\ \end{array} +$$ + +which, again from Spectral Theorem, is the eigenvector of the second largest eigenvalue of $\mathbf{HH}^\top$ , which is $\pmb{u}_2 = \pmb{z}^{(2)}$ . Using an induction and the same reasoning, it follows that for any $k \in [s]$ , we have $\pmb{p}_k = \pmb{z}^{(k + 1)}$ . This proves the proposition. + +# C ADDITIONAL RESULTS + +# C.1 DETAILED LAYER-WISE VISUALIZATION OF REPRESENTATIONS + +In Figure 9 and Figure 10 we provide additional visualizations per layer for each of our models and each of our data generating processes. + +![](images/b432c3a6e1b13f0989205e9b5ba18570867ce1940d3b441b4dc32941b14e278d.jpg) + +![](images/d521c44b6e4066d3051205c58034835eaf6b43b20b38ffe44c17216842cc5712.jpg) + +![](images/13aa91e61d43c0de0199ee02a548a0b1b7b74490e9903909efa57449086dac59.jpg) + +![](images/764e71536f464a41fb78a6c6b7de37694f72eb8e414b3fc3012a73ce87af2ebc.jpg) + +![](images/35faea26858a337012ff1b3ee32236c34cdd7095110cf06612898d58fc416e2e.jpg) + +![](images/c08c6240d45db9040d80430d14d7163e67a2f198f78e751c996c410ee65b334d.jpg) + +![](images/8394f24f2fce54b41c703c956266f7220cbeb2dbd9fc3f4437e84cd8606593dd.jpg) + +![](images/a8834e5f4ec7f20542ff6a36ecfc91c0e8c798dc71ef5d6ae999c0a40dee1e9e.jpg) + +![](images/2891c6ebe728229f95d1b3771fe0cc69e15b011903ae7348ea971a1e93b3cea8.jpg) + +![](images/f9e69fc4675743ba070596a1ce894834ecd94333b337fdf6179b0a90a0de7df8.jpg) + +![](images/b58b06a3d13da3fd72721509bc22842b089dbc2f14a08bcc75e8ecef4f04e781.jpg) + +![](images/f683f3909d9a3d93458750052746e77c5032794c518cbcdddd829954a05c6d96.jpg) + +![](images/0d116dcb23b20ae05e7d092338838432d09bfd276e1515dcaa70438868d62418.jpg) +Figure 9: We plot 2d PCA projections from every other layer in Llama3.1-8B (Dubey et al., 2024), given the grid-traversal task. In deeper layers, we can see a clear visualization of the grid. + +![](images/628f29bda78a82475696bda89b944dfce7f2c950a387b4adc6dfb929b272f782.jpg) + +![](images/6c055e11dcde83376196b15881db9bd0a1a72a84a49f731103df0fcc36a64457.jpg) + +![](images/33b3866c5fc9861b6ec51c61d26fbfb81ee76f1dcf4195ef5e8b87641a635209.jpg) + +![](images/dc3a063234a4a9ad7201e14c9f23483aea5c3aa03d0f4101630dc20c84c03c6f.jpg) + +![](images/00fc8319b8e465fa99408dc851ef20c4c41364684346a6f9a2938735fa04342f.jpg) + +![](images/3b69baec3e306e73525693962756200fc8e084bd1e77d1f4565a13362a325007.jpg) + +![](images/5d7eafb57fa28c8135ea3ea87c356590d7ac0944fa286660653e0fa1bc92f043.jpg) +Figure 10: We plot 2D PCA projections from every other layer in Llama3.1-8B (Dubey et al., 2024) for the hexagonal grid task. + +![](images/08458a93def6a8720364fd5400df22a9b334a113e78aca75e8695cc6d4e5d373.jpg) + +![](images/0f73c757bd912a8e323efdbf92949140b02b5e9825ed3d0d5ff00673b7e5d9c3.jpg) + +![](images/23906eaa3c76416467cf0479902a4b19c654e7c8dc5cbc8bdc64c66fea2e4881.jpg) + +![](images/43b1899f3d8baa4786fcce3eb39016ecc96a5403d9ec560f03cb16bc5f7aeedb.jpg) + +![](images/f853f6b4dc6cc0b2f27cf1053d7ce13807fec8f5d1c2e0ebd3be0794bcbcce42.jpg) + +![](images/81fc2f436c8ea8f9fbdb1bb3703291c5dd75e727fa394c3c277757939d3fc154.jpg) + +![](images/ede657fd7f73661e573411820e51ef8bbc191e90cb1311bfb6c26c47e7943ab7.jpg) + +![](images/a1e1b47a5caf8d1da7175d9ac55498ec7077aade219c4375eacacffc5196a05d.jpg) + +![](images/2626ccbc149fb39557421ce14c783588ffcfd3d6e6f823d312dac345eeee1787.jpg) + +![](images/ef39419a7d5f8a8ee4e77ab237a88c343a3f0713577edbb5444f4c2e4c3244bf.jpg) + +![](images/9ce547e5d06eec325eed439fb3758339c5e63a6e116c1a75b277541f5b4c9208.jpg) + +![](images/838c71ddab38f55f9642435709d7bdccd7c99be8e05ce74a6bb699f3283ce8d2.jpg) + +# C.2 PCA, DIRICHLET ENERGY, AND ACCURACY RESULTS ON OTHER MODELS + +Here we provide results from other language models, i.e., Llama3-1B (Dubey et al., 2024), Llama3-8B-Instruct, Gemma2-2B (Gemma Team, 2024), and Gemma2-9B. In Figure 11, we plot the 2d PCA projections from the last layer of various models for various data generating processes. In Figure 12, we plot the normalized Dirichlet energy curves against accuracy for various language models on various tasks. Across all models and tasks, we see results similar to the main paper. + +![](images/a9bb7482848d70163084c06b70156a8588d4fb617ff82d42eef3984811b01967.jpg) + +![](images/ecc352721977df801d122fc8f88ded58ac1de49bb9af03b4b5522d0e2b68321e.jpg) + +![](images/5fce90ce7783a9a0f9a5e73d023d10733b720a9a8656e23c226e3668c9e6b295.jpg) + +![](images/2debb5e2007db8653dc97b27caba2d513d7bad8e95715b09f2046222c9fd4063.jpg) + +![](images/c80cc918bdf2e4172bb0bd5be4abf5b38387789503ff35e7d9e241eddb56712b.jpg) + +![](images/4dc66533e52a98c3470baffcf5bc66add6191c61d93fac8739bff81e3fee6432.jpg) + +![](images/ac954d9d4a31e612ac606ca39126da220d6b84b6b85e9887f1d1d3a01dd81e7c.jpg) + +![](images/4c8e01bc8006968fa511e584dc134f9e95316c77a1cbfeba145ae68ac68bd4db.jpg) + +![](images/9cbca991527b570c1e33ad5d595f4ed839bf9552d68660f65f8b24c268ad3552.jpg) +Figure 11: We plot 2d PCA projections from the last layer of various language models, given various data generating processes. For the grid and hexagonal graphs, we apply PCA on the last layers. For the rings, we visualize layers 14, 10, 16, and 20 respectively. Interestingly, for Llama3.2-1B, we find the ring representation in the 2nd and 3rd principal components. + +![](images/73fa7abd42097824f8d91c3cb60b642b9dc9e38a9ae7d0e63765e23d48901349.jpg) + +![](images/f1fcaf2f82845b78b79c6b3e7e9b30877dd10f560f256022f851c461986f8f78.jpg) + +![](images/21caafe5fe75f2b166c575924c02f2f30894ab5c5d81ca8420ffabbecb776ce5.jpg) + +# C.3 STANDARDIZED DIRICHLET ENERGY + +In Fig. 13, we report Dirichlet energy values computed after standardization of representations, i.e., after mean-centering them and normalizing by the standard deviation. This renders the trivial solution to Dirichlet energy minimization infeasible, since assigning a constant representation to all nodes will yield infinite energy (due to zero variance). As can be seen in our results, the plots are qualitatively similar to the non-standardized energy results (Fig. 12), but more noisy, especially for the ring graphs. This is expected, since standardization can exacerbate the influence of noise, yielding fluctuations in the energy calculation. + +![](images/15ef95720b61fe3d73fb9305e7db6cb680a916e70c0c36f2fcf7c5d2fb6efaea.jpg) +Figure 12: Accuracy versus normalized Dirichlet energy curves for various language models on various tasks. For every model and task, we see energy minimized before accuracy starting to improve. + +![](images/a8724fdeda9267e1d43cb8b998d0bd391bcd628eb40217eda631ab8c636e5821.jpg) +Figure 13: Accuracy versus zero mean centered normalized Dirichlet energy curves for various language models on various tasks. Zero mean centering ensures that graph representations are not using the trivial solution to energy minimization (i.e., assigning the same representation for every node). + +# C.4 CAUSAL ANALYSIS OF REPRESENTATIONS + +In this section we report preliminary causal analyses of our graph representations. While fully understanding the mechanisms behind the formation of such representations, as well as the relationship between said representations and model outputs are an interesting future direction, this is not the focus of our work and thus we only ran proof-of-concept experiments. + +With that said, we ask: do the principal components that encode our graph representations have any causal role in the model's predictions? + +To test this, we attempt to "move" the location of the activations for one node of the graph to another by simply re-scaling its principal components. Namely, assume activation $h_i^\ell$ corresponding to node $i$ at layer $\ell$ . Say we wish to "move" the activation to a different target node $j$ . We first compute the mean representation of node $j$ using all activations corresponding to node $j$ within the most recent $N_w$ ( $= 200$ ) timesteps, notated as $\bar{h}_j$ . Assuming the first two principal components encode the "coordinates" of the node, we simply re-scale the principal components of $h_i$ to match that of $\bar{h}_j$ . + +We view this approach as rather rudimentary. Namely, there are likely more informative vectors that encode richer information, such as information about neighboring nodes. However, we do find that the first two principal components have some causal role in the model's predictions. + +We test our re-scaling intervention on 1,000 randomly generated contexts. For each context, assuming our underlying graph has $n$ nodes, we test "moving" the activations of the last token $i$ to all $n - 1$ other locations in the graph. We then report the averaged metric across the resulting $1,000 \times n - 1$ testcases. + +We report 3 metrics: accuracy (Hit@1), Hit@3, and "accumulated probability mass" on valid tokens. Hit@1 (and Hit@3) report the percentage of times at which the top 1 (top 3) predicted token is a valid neighbor of the target node $j$ . For "accumulated probability mass", we simply sum up the probability mass allocated to all neighbors (i.e., valid predictions) of the target node $j$ . + +Table 1 reports our results for our ring and grid tasks. We include results for re-scaling with 2 or 3 principal components, as well as null interventions and interventions with a random vector. Overall, we find that the principal components have some causal effect on the model's output predictions, but does not provide a full explanation. + +
RingGridHex
Hit@1Hit@3ProbHit@1Hit@3ProbHit@1Hit@3Prob
Interv. (n=2)0.610.910.60.570.950.550.300.320.69
Interv. (n=3)0.770.960.760.680.980.650.420.460.82
Null Interv.0.200.500.200.170.330.160.070.200.05
Random Interv.0.170.470.190.160.370.170.060.180.05
+ +Table 1: Intervention results for our ring and grid tasks. We demonstrate that often times, simply re-scaling the principal component for each token representation can "move" the token to a different position in the graph. However, we note that our simple re-scaling approach does not perfectly capture a causal relationship between principal components and model predictions. + +# C.5 EMPIRICAL SIMILARITY OF PRINCIPAL COMPONENTS AND SPECTRAL EMBEDDINGS + +Theorem 5.1 predicts that if the model representations are minimizing the Dirichlet energy, the first two principal components will be equivalent to the spectral embeddings $(z^{(2)},z^{(3)})$ + +Here we empirically measure whether the first two principal components are indeed equivalent to the spectral embeddings. In Table 2, we measure the cosine similarity scores between the principal components and spectral embeddings. + +# C.6 ACCURACY OF IN-CONTEXT TASKS WITH A CONFLICTING SEMANTIC PRIOR + +What would happen when an in-context task which contradicts a semantic prior is given to a model? Namely, Engels et al. (2024) show that words like days of the week have a circular representation. + +
|cos(PC 1, z(2))||cos(PC2, z(3))|
Grid0.9500.954
Ring0.9420.930
Hex0.7450.755
+ +Table 2: Absolute value of cosine distances of principal components from model activations and spectral embeddings. We empirically observe that in practice, these coordinates end up being very similar. For the grid and hexagon, we use principal components from the last layer, while for the ring, we use an earlier layer (layer 10) in which the ring is observed. + +In our experiment, we randomly shuffle tokens for days of the week (i.e., tokens {Mon, Tue, Wed, Thu, Fri, Sat, Sun} to define a new ring, and give random neighboring pairs from the newly defined ring as our in-context task. + +Figure 14 demonstrates the accuracy when given an in-context task that is contradictory to a semantic prior. Interestingly, we first observe the model make predictions that reflects the original semantic prior (pink). This accuracy drops very quickly as the model captures that the semantic rule is not being followed. With more exemplars, we see a slow decay of the remaining semantic accuracy and a transition in the model's behavior as it begins to make predictions that reflect the newly defined ordering of our ring (blue). + +![](images/b4c37c3f657c91b258f24ee0e3f1f7c7fe65cfd032df07fab49444592f1e4215.jpg) +Figure 14: In-context structure overrides semantic prior. Given an in-context task that contradicts a model's semantic prior, we observe the model transition from making predictions that adhere to the semantic prior (pink) to predictions that reflect the newly defined in-context task. + +Furthermore, in Fig. 15, we quantify the Dirichlet energy computed only from certain PC dimensions. We find that energy minimization happens in the dimensions corresponding to the in-context structure. + +![](images/c879e70c542d2c4ccb16edee2b606c1e6ae6778730cfc29f8a923d73c60eb1d4.jpg) +Figure 15: Energy minimization happens in the in-context component dimensions. We show the Dirichlet energy depending on the context given when taking 1) all 2) semantic (PCA 1,2) 3) in-context (PCA 3,4) dimensions. We show that energy minimization happens in PCA 3,4 corresponding to the in-context dimensions. + +# C.7 ADDITIONAL EMPIRICAL VERIFICATIONS OF TRANSITION PREDICTIONS + +Here we provide additional details for empirically verifying our predictions for model transitions. + +Figures 16, 17, and 18 demonstrate detailed accuracy curves for a wide range of graph sizes. + +![](images/e56d8d711d82e5cf21392dbbc0402461373004f7c23958636ff826f4cce45d19.jpg) + +![](images/7519e54747732065db93f6d6c1eba2f2cf470293fa4967114b677f324c5b6429.jpg) + +![](images/9ca8cbcfdc8ba232261579023ea7dbfd6fb7f43abe6044b5d1bee9e1efe1fcd9.jpg) + +![](images/de907d23481deda2216cb9a6df1634ad0bea34f0721338eef3b203c8db6a5b07.jpg) + +![](images/aec75593dde9f14ee583bdf98164da2379780a62c62c6a8827741767658a7553.jpg) + +![](images/f5f4be5ae6320aaf9ae15616fc830d62ddb8756b667c1c40c94972307f581ad7.jpg) + +![](images/3291b2fc920711d4e71d87284bbce4521b7ca223246368098388c86cd3f6c659.jpg) + +![](images/f0092f53f4c2b64c6c2db678d3da3e414ea600776ec9810870ae7b2ffc356c5a.jpg) + +![](images/978abe3b04e97897248bb6164b6fd6cd7859bed52ad4166317881b7b1cac4650.jpg) +Figure 16: Emergent behavior for varying task complexity (graph size) for the Hexagonal task. We plot the accuracy for varying levels of complexity (graph size) for the hexagonal in-context task. Interestingly, regardless of graph size, we see an abrupt, discontinuous change in the model's performance. Figure 19 demonstrates that we can predict when such abrupt change can be expected as a function of task complexity. + +![](images/36bd0410fb4cb7975e88ba7bc2512d051f9ef4ae52689f5e6456c9a96b18fa3d.jpg) + +![](images/3f0c67041f16239e33fb80e769ab24ea9b69daf4a0a21baa57d3fa637be3bfac.jpg) + +![](images/6afc7ef67b8f14de49a1b208cb4db6d1cfa2e676e19d8e8ad87c20ec2a666f55.jpg) + +![](images/cd39a6f97db256e91343de4628dc52de8ad9ed4eef143f644d92fb41c37e93b0.jpg) + +![](images/be73dbf80ce679817c9a3acf390b4a7e06f66109cf6afdc27c6960f7a9deffaa.jpg) + +![](images/1113272ad72d43f18800807fec7eb426908f9f102fb4a87ef8a35d6ac16e3812.jpg) + +![](images/d50b58d9d6f65f5654fad88e841fa205a9d23caf05e7e04ddb8821b298efb2f7.jpg) + +![](images/6568a59faa45933208e93ac376ccc717cae748c6c31425446017b6e48331b966.jpg) + +![](images/84002dafe283afa4a96cfb7ad327dc150e5a42c10ac6516d3f2a2e77330061bb.jpg) + +![](images/a629b9eac1d45e419d7760eecb4c9454d69eadd2b8178bea13bf1a95f6ec6ee6.jpg) + +![](images/144971880a65b6d32067312ee41e2272a2846a6aa838d8cdbe36bba963195391.jpg) + +![](images/c2bd80f28c6411de38f0961984c4a1afa789e98ff85b01a76f9c5bf3d299f85b.jpg) + +![](images/f720d3250218d7f3e3c3657236c347078df8d761dc2814839513b7773a6893b5.jpg) + +![](images/59918babe46800900104fbd8d4f8044eede4fa57a1dabb3a045ce1f71ed4aef9.jpg) + +![](images/05688391e7e6f6e73dbae3cc6f4356664970da72ad7966b5b8f2cde3f3bbf63e.jpg) + +![](images/2ff5383181bea1044b23e57eb5432281668bab8df5462a450541b82978cd3842.jpg) +Figure 17: Emergent behavior for varying task complexity (graph size) for the grid task. We plot the accuracy for varying levels of complexity (graph size) for the grid in-context task. Interestingly, regardless of graph size, we see an abrupt, discontinuous change in the model's performance. Figure 8 demonstrates that we can predict when such abrupt changes can be expected as a function of task complexity. + +![](images/08b1c0f87782ba0e6046771149a5160183b94621b117b042b2ce4941ccdd54c3.jpg) + +![](images/b20067760f7b8604abe87e3263fecaa10d24638443d475e97f7cf9f1ac6ecd8f.jpg) + +![](images/f51439e3ef6c1127c1b34522f23c97e23894bbd1da16f6e9298f76973c5eccbd.jpg) + +![](images/be12379893ed19ffea7796218917409de9cf291243e1df1c381551599a713482.jpg) + +![](images/2b171b5a4920c88cc90b31671a2fbf29e42f96906f83e3314ac74875b65b74f2.jpg) + +![](images/decfc2f734998725f015d10d77fbcd83032e4fb87c7151c71a6ced14678e739f.jpg) + +![](images/7f85332e7a00633f47b167fbe74e55d82dfb2a3b1ac764bfeed245ec79d14d05.jpg) + +![](images/4a7ab096d4e5a7057e4fa94f118e6b107af5da8d3a72a848b1afa236b70a8d6e.jpg) + +![](images/5efbea7647b1507e3b7f4d4807b1a9dd97489afac62f635dd4d7940ccc36be9d.jpg) + +![](images/aa0a6bf40824e155c596105a80c87ad3fda053d997275b72bf40dd677c7edf7b.jpg) + +![](images/a6f80fd09fb04203c24699cc63845994bcf743d5d9eaeb52631962bd4be38f1d.jpg) + +![](images/fc3c56c89a3589009d93f20177c9933332b2f17e4e4cad9cf8d123745de74d50.jpg) +Figure 18: Emergent behavior for varying task complexity (graph size) for the ring task. We plot the accuracy for varying levels of complexity (graph size) for the ring in-context task. Interestingly, regardless of graph size, we again see an abrupt, discontinuous change in the model's performance. + +![](images/7a9e0858f906e373d7d0a8a16e476e8ef6c0faf0ecfd232610f8343daafeb9a2.jpg) + +![](images/b3120da1b5a77d3cfa2f53dd67733a6bc8ec5dcba1a9000e9a0ecaa2e3eb5938.jpg) + +![](images/813b28f41cec1cc3244782e2c1ceef88dad2d827fefc5435cd5e1b017f6f98e1.jpg) +(a) #of Nodes 48 70 126 286 + +![](images/73a4b368858c490a9ca58d3dce8f2a5b42d5c3b49d216e526ae3b94a0a48720f.jpg) +(b) Llama-3.1-8B ---- Fit: $y = 2.934x^{0.666}$ + +![](images/fe77cd2ab7605969af08fbb364f346fe6a43a4703b367a12410c02b9583fc89b.jpg) +Figure 19: In-context emergence in a Hexagonal graph tracing task. We analyze the in-context accuracy curves as a function of context-size inputted to the model. The graph used in this experiment is an $m \times m$ grid, with a varying value for $m$ . (a) The rule following accuracy of a graph tracing task. The accuracy show a two phase ascent. We fit a piecewise linear function to the observed ascent to extract the transition point, which moves rightwards with increasing graph size. (b) Interestingly, the transition point scales as a power-law in $m$ , i.e., the number of nodes in the graph. + +![](images/19a13d2f2f268aa78c363e66fdf6a12bbb295e814201bfbe35127dcd19c411a7.jpg) +Figure 20: Hexagonal graph tracing accuracies compared to the memorization solution The rule following accuracies on the hexagonal graph compared to the memorization model in Sec. 4.1. Hexagonal graph with a) 48 b) 70 c) 126 d) 286 nodes. Generally we find that the hexagonal graph tracking accuracy from Llama-3.1-8B (Dubey et al., 2024) is lower than the 1,2-shot memorization model, indicating that there might be a different underlying process. + +![](images/af250f7ccfae4f63a6a9bd90138bc6cc68d74dc197b9805d72e78d224f4a2c7f.jpg) + +![](images/f5ae6e09d2874f8f1558e23dce76160fdaa29087cacc23c4902385eda3ce504f.jpg) + +# D LIMITATIONS + +We emphasize that our work has a few limitations. Namely, PCA, or more broadly, low dimensional visualizations of high dimensional data can be difficult to interpret or sometimes even misleading. Despite such difficulties, we provide theoretical connections between energy minimization and principal components to provide a compelling explanation for why structures elicited via PCA faithfully represent the in-context graph structure. Second, we find a strong, but nevertheless incomplete, causal relationship between the representations found by PCA and the model's predictions. We view the exact understanding of how these representations form, and the exact relationship between the representations and model predictions as an interesting future direction, especially given that such underlying mechanism seems to depend on the scale of the context. \ No newline at end of file diff --git a/ICLR/2025/ICLR_ In-Context Learning of Representations/images.zip b/ICLR/2025/ICLR_ In-Context Learning of Representations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1acc3b7cb95d82aab25bf6b01e2cc7b4df04b226 --- /dev/null +++ b/ICLR/2025/ICLR_ In-Context Learning of Representations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e47a5f505a40cd35eb49c879c47d51f7d25e392e0f0286835b9d239d12f57989 +size 1469578 diff --git a/ICLR/2025/ICLR_ In-Context Learning of Representations/layout.json b/ICLR/2025/ICLR_ In-Context Learning of Representations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..72971b02fdc301f4b17f75fb15d1ca8b94704ac6 --- /dev/null +++ b/ICLR/2025/ICLR_ In-Context Learning of Representations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c875c049928f138323e183028f6039d1936ed9e79ba2ef520dd91260005cc4e +size 849515 diff --git a/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_content_list.json b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a4d1c4852e14b6f016852408212748c53eefd58d --- /dev/null +++ b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30ecf142529148a4c999e8f827b74b6d442534532d48479a39fbbb4ba2d24b95 +size 84578 diff --git a/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_model.json b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2c2f4f624501852b175602f3cf3e4e66c70e2c42 --- /dev/null +++ b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dd687a6ccb17a5766e71438c3707b64e23135e0fea80945af6e259b65ae54ec +size 106546 diff --git a/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_origin.pdf b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..102ea510eebcb2a8025bb4556fcc9842fc55bc3e --- /dev/null +++ b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/8d1a01c0-448f-4415-b288-114bbbc68476_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d292d603eed0e9b7d4a058051d9be4928dc222a4f0eddf49da3868b8c6c806f7 +size 4497340 diff --git a/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/full.md b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d8efd794c7e36dc6dda7d593b9ed76c62a26d7d4 --- /dev/null +++ b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/full.md @@ -0,0 +1,348 @@ +# IDA-VLM: TOWARDS MOVIE UNDERSTANDING VIA ID-AWARE LARGE VISION-LANGUAGE MODEL + +Yatai Ji $^{1,2}$ , Shilong Zhang $^{1}$ , Jie Wu $^{3}$ , Peize Sun $^{1}$ , Weifeng Chen $^{3}$ , Xuefeng Xiao $^{3}$ , Sidi Yang $^{2}$ , Yujiu Yang $^{2*}$ , Ping Luo $^{1*}$ , The University of Hong Kong, Tsinghua University, ByteDance + +# ABSTRACT + +The rapid advancement of Large Vision-Language models (LVLMs) has demonstrated a spectrum of emergent capabilities. Nevertheless, current models only focus on the visual content of a single scenario, while their ability to associate instances across different scenes has not yet been explored, which is essential for understanding complex visual content, such as movies with multiple characters and intricate plots. Towards movie understanding, a critical initial step for LVLMs is to unleash the potential of character identities memory and recognition across multiple visual scenarios. To achieve the goal, we propose visual instruction tuning with ID reference and develop an ID-Aware Large Vision-Language Model, IDA-VLM. Furthermore, our research introduces a novel benchmark MM-ID, to examine LVLMs on instance IDs memory and recognition across four dimensions: matching, location, question-answering, and captioning. Our findings highlight the limitations of existing LVLMs in recognizing and associating instance identities with ID reference. This paper paves the way for future artificial intelligence systems to possess multi-identity visual inputs, thereby facilitating the comprehension of complex visual narratives like movies. + +# 1 INTRODUCTION + +Our real world contains a wide variety of information, such as texts, images, sounds, etc. Towards multimodal comprehension (Guo et al., 2019; Lu et al., 2023), inspired by the success of Large Language Models (LLMs) (OpenAI, 2023a; vicuna, 2023; Touvron et al., 2023; Meta, 2024; Google, 2023a), there is a surging interest in Large Vision-Language Models (LVLMs), such as LLaVA (Liu et al., 2023a), Otter (Li et al., 2023a), GPT-4V (OpenAI, 2023b), Gemini (Google, 2023b), and others. In the quest for Artificial General Intelligence (AGI), LVLMs serve as pivotal milestones, enhancing machines' capabilities in multimodal perception, reasoning, and knowledge. + +Typical LVLMs incorporate visual encoders with LLMs, such as LLaVA (Liu et al., 2023a), MiniGPT4 (Zhu et al., 2023). These models project an image's visual features into the embedding space of language models and employ visual instruction tuning, allowing users to complete a variety of visual tasks through language instructions, as depicted in Figure 1(a). However, pure language interaction makes VLMs hard to receive precise Region-of-Interest references from users, thus hindering their capability to focus on specific regions of an image. To address this issue, a series of works (Chen et al., 2023b; Zhang et al., 2023; Cai et al., 2023; Chen et al., 2023a; Zhao et al., 2023b; Rasheed et al., 2023) attempts to allow adding RoI references to language instructions and then use region-level data to align these RoI references to the image. As shown in Figure 1(b), these excellent works usually support using position coordinates or visual prompts as the RoI reference, which provides a more flexible interactive experience within specific areas. + +Previous LVLMs have demonstrated versatile capabilities for visual understanding from the image level to Region-of-Interest. However, these models can only process the visual input of a single scenario, and their ability to associate instances across different scenes has not yet been explored, which requires the model to memorize the instance identity and recognize it in different scenes. This ability, which we call 'ID awareness', is a fundamental human visual competency essential for + +![](images/54bf9eec744bf88be3584a7ff5adef490aae44ad9c85d21e3c4e5353ea426766.jpg) +Figure 1: Comparison of different Visual Instruction Tuning Formats. For visual instruction tuning with ID reference, we arrange the names and images of each character as references. The model should be able to recognize the correct character identity and then answer the user's instructions. + +comprehending complex multi-identity visual inputs, such as movies and animations. In the context of movie understanding, viewers should remember the name and appearance of each character, then recognize them across disparate scenes correctly, linking instances across diverse images for accurate narrative interpretation. + +To achieve ID awareness in LVLMs like humans, as shown in Figure 1(c), we propose visual instruction tuning with ID reference, which allows users to utilize the name and a reference image of the character (ID image) to define the identity in the prompt, and raise questions about test images. However, there is no off-the-shelf visual tuning data with ID reference, so we meticulously craft a dual-stage instruction tuning dataset based on existing datasets. The initial phase leverages annotations in datasets such as VCR (Zellers et al., 2019), Flickr30k (Plummer et al., 2017), and RefCOCO (Kazemzadeh et al., 2014) with our data configuration strategies, to tutor the model on associating the instances of ID images with test images, where ID references are extracted from the test image. The subsequent phase utilizes MovieNet (Huang et al., 2020) to generate Q&A and caption instruction tuning data with GPT-4V (OpenAI, 2023b). The second stage data contains ID references of higher quality, which is more similar to real movie understanding. These tuning data unleash the potential of LVLMs to memorize and recognize instance identities in different scenes. Based on the visual instruction tuning with ID reference, we develop an ID-aware LVLM, called IDA-VLM, suitable for multi-identity visual comprehension. Our model learns the fine-grained identity information from ID references and generalizes to recognize characters from different scenes of test images. We also introduce a specialized component, termed ID-Former, to enhance the model's capability of recognizing character identities. + +To measure ID recognition capability for movie understanding, we propose a new benchmark, namely MM-ID. Our MM-ID aims at challenging LVLMs to remember and recognize instance identities, further understanding complex visual scenes. MM-ID dissects LVLMs' competency across four progressively complex levels: matching, location, question-answering, and captioning. MM-ID comprises a collection of 585 diverse testing samples, whose instance identities source from the characters of movies, the roles of animations, and individualized animals and objects. We test both open-source models and closed-source APIs, which exposes their apparent deficiencies in identity memory and recognition, and the results are unsatisfactory even for GPT-4V. The evaluation results not only reveal the current limitations of LVLMs in instance recognition with ID reference but also highlight our benchmark's significance. In contrast, IDA-VLM achieves the best performance on MM-ID, which demonstrates the effectiveness of our instruction tuning strategies and model design. + +In a nutshell, our contributions are summarized as follows: + +- This paper is the first attempt to investigate ID awareness of LVLMs for complex multi-identity visual recognition and comprehension, which is a critical challenge towards movie understanding. We propose visual instruction tuning with ID reference and construct corresponding tuning datasets. + +- We develop an ID-aware LVLM, IDA-VLM to recognize character identities and understand visual content in an end-to-end manner. We adopt a dual-stage fine-tuning method to unleash the potential of LVLMs in identity memory and recognition across diverse scenes. +- We propose MM-ID, a novel benchmark to examine LVLMs on identity memory and recognition. We evaluate representative LVLMs on our benchmark, uncovering the limitations of existing LVLMs in contextual identity recognition. Furthermore, our IDA-VLM can serve as a reference and inspirational baseline model on MM-ID. + +# 2 RELATED WORK + +# 2.1 LARGE VISION-LANGUAGE MODELS + +Conventional multimodal models consist of uni-modal encoders and cross-modal fusion encoders. Relying on vision-language pre-training (Tan & Bansal, 2019; Lu et al., 2019; Dou et al., 2022; Wang et al., 2021; Ji et al., 2023b), they have shown an impressive cross-modal semantic alignment ability (Ji et al., 2023a; Tu et al., 2023), which brings substantial advances on various downstream tasks (Goyal et al., 2019; Plummer et al., 2017; Lin et al., 2014). However, due to the limitations of model size and training data scale, the performance of vision-language pre-training models is unsatisfied in open-ended scenarios. + +Nowadays, Large language model (LLM) has exhibited remarkable abilities to understand, reason, and generate texts. Large Vision-Language Model (LVLM) (Chen et al., 2023c; Dai et al., 2023; Dong et al., 2024) incorporates visual encoder and LLM, aligning visual features to the embedding space of LLM. Leveraging strong generalization and emergent capability of LLM, LVLM realizes free multimodal interactions with human. Flamingo (Alayrac et al., 2022) is a pioneering work on extending LLMs to vision-language pretraining by inserting additional cross-attention layers for visual input. BLIP-2 (Li et al., 2023d) proposes Q-former to map the visual features to the hidden space of language models. To date, various works have shown encouraging progress with instruction tuning, including MiniGPT-4 (Zhu et al., 2023), LLaVA (Liu et al., 2023a), Otter (Li et al., 2023a), which demonstrate impressive results on natural instruction-following and visual reasoning capabilities. The perceptual capabilities of LVLMs are evolving towards fine-grained understanding. Numerous models (Zhang et al., 2023; Liu et al., 2023a; Chen et al., 2023b; Wang et al., 2023) focus on region-level understanding, using visual instruction tuning with RoI reference, so that users could ask questions about specific instances within the content. Moreover, there are some LVLMs equipped with Stable Diffusion, which can produce multimodal outputs (Koh et al., 2023; Ge et al., 2023; Sun et al., 2023; Li et al., 2023c). LVLMs hold the potential to perform a wider array of functions and to understand more intricate visual information. For instance, movie is considered as one of the most intricate mediums for conveying visual information. This paper researches on recognizing characters across disparate scenes with ID reference, towards movie content understanding. + +# 2.2 MULTIMODAL BENCHMARK + +Previous evaluation for multimodal models measures some specific abilities, such as VQAv2 (Goyal et al., 2019), GQA (Hudson & Manning, 2019) for visual question answering, RefCOCO (Kazemzadeh et al., 2014) for visual grounding, Visual7W (Zhu et al., 2016) for PointQA, VCR (Zellers et al., 2019) for commonsense reasoning in an image, ChartMimic (Shi et al., 2024) for chart understanding. Recently, there is a surging interest in developing comprehensive benchmarks for evaluating LVLMs. MMBench (Liu et al., 2023b) consists of multiple-choice questions and introduces a CircularEval strategy for evaluation framework. LLaVA-Bench (Liu et al., 2023a) employs GPT-4 to assess responses from both GPT-4 and the model under evaluation, then provides scores and explanations for the answers. MM-Vet (Yu et al., 2023) assesses LVLMs across six fundamental visual-linguistic capabilities, utilizing a GPT-4-based evaluator for open-ended responses. MME (Fu et al., 2023) tests for perception and cognition competencies across 14 distinct subtasks, which requires models to provide simple 'yes' or 'no' answers. SEED-Bench (Li et al., 2023b) covers 12 evaluation dimensions and adopts an answer ranking strategy to evaluate LVLMs via multiple-choice questions. POPE (Li et al., 2023e) is a dedicated benchmark for assessing object hallucination. Existing benchmarks evaluate multifaceted performance of LVLMs, yet they predominantly focus on visual scenarios that lack character identities and intricate plots. + +![](images/c8d49aeb727f6d0656c9995367bb0331c9b2029f36d7bcfb09e3299998baa02b.jpg) +Figure 2: IDA-VLM is an end-to-end vision-language model for processing instructions that contain references to specific instances. We introduce ID reference as using a correlating character reference image and corresponding name to characterize an identity, exemplified as Julia is $$ . During tokenization and conversion to embeddings, the embedding of $$ and $$ in the instruction are replaced with the ID and Test image embeddings respectively. A simple yet effective image feature projector termed ID-Former is proposed to enhance the ID identification ability. As the output in the figure, IDA-VLM can memorize these character IDs, recognize them in test images, and respond to user instructions with the correct ID references. + +# 3 METHOD + +Movie understanding represents a considerable departure from conventional video understanding, which typically limits to a single scenario or activity. To understand complex visual input, for example, a movie or animation, the model need memorize and recognize character identities, linking characters in distinct scenes, with each scene represented by an image in our setting. As shown in Figure 2, we simplify movie understanding as given ID images of certain characters and keyframes from the movie or animation served as test images, the model completes instruction tasks. The ID images, test images, and instruction text are sent to the model together for inference in an interleaved format of images and text. The model need to memorize instance identities in ID references and recognize them in test images for providing responses. + +# 3.1 MODEL ARCHITECTURE + +In this paper, we adopt Qwen-VL-Chat (Bai et al., 2023) as our baseline model. In order to adapt the model to the task of instance ID recognition, we employ a dual-stage visual instruction tuning with ID reference. The architecture of IDA-VLM comprises three components: a visual encoder, ID-Former consisting of cross-attention mechanisms, and a subsequent large language model. + +As shown in Figure 2, the ID-Former is designed to project visual features into the input semantic space of LLM and contribute to recognizing instance identities. This is achieved by two cross-attention modules. The first one interacts learnable queries with the visual features through cross-attention, effectively compressing the visual semantics into a shorter, fixed-length feature encoding. The second cross-attention utilizes queries of ID images to modulate test image embeddings, activating identity information of test images. + +# 3.2 FIRST-STAGE TUNING + +In the first phase, we harness the off-the-shelf annotations available in existing datasets along with our proposed data configuration strategies, reducing the cost for extra annotations about ID recognition. Specifically, we utilize the public datasets containing instance spatial information, including Visual Commonsense Reasoning (VCR) (Zellers et al., 2019), RefCOCO (Kazemzadeh et al., 2014), and Flickr30k (Plummer et al., 2017) datasets, to construct visual instruction tuning data with ID reference, which contains three instruction tasks: question-answering (Q&A), location, captioning. + +VCR dataset consists of questions that require commonsense reasoning to answer, as well as choosing the reasons. These questions ask about particular people or objects, which have location anno + +![](images/7f4845ae88ccda89438a8f61737bdb3b03d6049b9ec68a24d65760c02f876ef1.jpg) +Figure 3: First-stage and second-stage instruction tuning data construction pipelines. + +tations. We crop sub-images of the individuals and assign them identifiable labels, such as person names. By replacing the people in the questions and answers with these labels, we gain a new set of QA data that necessitates ID recognition. RefCOCO (and variants RefCOCO+ and RefCOCOg) is a dataset targeted on visual localization based on descriptions. For the items to be localized, we create ID images after cropping them from the original images to perform localization tasks. Flickr30k, a dataset comprising image descriptions, includes coordinates for the people or objects mentioned in the descriptions. We extract the areas associated with individuals to produce ID images and provide names to generate corresponding descriptions. Additionally, we conduct some data augmentation and cleaning operations, such as filtering out samples with only one person or those with sub-images of inappropriate sizes. The annotation pipeline is shown in the upper part of Figure 3. + +The essential purpose of this stage is to train the model on its ability to build relationships between multiple images, using the ID images to identify and accurately locate or describe objects within test images. However, the instance ID images are cropped from the original images, which reduces the difficulty of recognition. + +# 3.3 SECOND-STAGE TUNING + +The second-stage fine-tuning data is based on the MovieNet (Huang et al., 2020) dataset. The original annotations in the MovieNet dataset encompass the names of the characters present in each movie shot and their coordinate location information. In the MovieNet, we select pictures that contain only a single character to serve as ID images, while those containing multiple characters are used as test images. This approach allows us to naturally develop a dataset for location task. Moreover, we compile ID images featuring the same character to construct data for matching task. + +For Q&A and caption tasks, we adopt GPT-4V to convert annotations from the MovieNet dataset into the question format that refers to specific roles. Specifically, as illustrated in the lower part of Figure 3, we feed test images along with their character location information into GPT-4V, and encourage the model to generate captions or question-answer pairs via prompt engineering. The detailed prompts used for generating descriptions or question-answer pairs are shown in Appendix + +![](images/85010da5fa6fac8f0db6a39b412290a9e41e124e5ef4e9033021b51d2969eba2.jpg) +Matchin + +![](images/c17eac0c1b0c3a7e4428e00ca4919685aeb7c2709990b0fb213c25ecb6e64088.jpg) + +![](images/eff6d8e9590ee49a57196a873722d3f8411e421afab21db1e5f9c06a2673a981.jpg) + +![](images/fb0bf8b4550e16ea731d11b35d16ede559b847c6243abb41f0af48a5bf3765ac.jpg) + +![](images/29b3cec7094cd70ae41ee10aac4661faa1e2d40842e05d36a4cb4ea3e312094a.jpg) + +![](images/724c7948d1037a6e666e826658f3d9b9f161c7101936e0e86e87c4b0e1d59243.jpg) + +Kazan is In the following four images, Which is Kazan? Image 1: Image 2: Image 3: Image 4: + +Model output: + +Image 2 + +![](images/aaa22289aa1a93dd63b3f873d9b9ef199564ddb284ebd46b27e7bc1f789b2d2b.jpg) +Location + + +![](images/75b580aaba8b719398ced6527eea7baa4ce287d23c58969a71fa4f25be43ce45.jpg) + + +![](images/665f38cec7f2155f6a6c4e7c1511ba05462733617df02a1a90b350f54a4e3b95.jpg) + +![](images/56b1ca24e5b73037a110ce279dc104637948509d56ef74e5af13ab33e52895c1.jpg) + + +Question: + +Wituawu is-cimg0x; Xiaoyui is-cimg1x, Lizi is-cimg2x. The image $\equiv$ img3, identify Xiaoyui with grounding. + +Model output: + +Xiayoujie(787,109),(998,975) + +![](images/a817c3074bf97283484dc190c3d9109f708442f5fe1979f041ccaecc85418b4c.jpg) + +![](images/14fc5e84744c905468745cd39317f5170ceba582285c890cd96f3d44a1257008.jpg) +Q&A + + +![](images/250279f1fe606a3b387db6f770f862e3c68b43da9b1459521c112ea2ee506ce0.jpg) + + +![](images/cede152ab0c58748e93800e6b93da4cd53955c7196de9c29bb0b68b0876e4e8b.jpg) + + +![](images/f562375362b726939b2b6d277797ad43473a8d9f46d066e6491b0184732a46ff.jpg) + + +Question: + +Shatang is , Abeiduo is , Kong is . In the image: Who is holding a sword? + +Model output: + +Kong is holding a sword. + +![](images/f0133258aa05b6e1a3fd011f4d75ac9b50d21cf05ffe11b21005b879997292ad.jpg) +Caption + + +![](images/1c741f086c0cf992a3d2caf21d190f2531a91eb8343f3c9ef8efcc60c7f3ad15.jpg) + + +![](images/af3a5f0a893190af107456e67052f4ec1144827d5111930bd9b5698b0b998cb1.jpg) + + +![](images/57f6661beac0b31c028ddd20dbdb4d197df17f9c305e940cdb1fc810e3c8ab5d.jpg) +dim + +Question: + +Charlie is . David is . Elise is . In the image: Give a description. + +Model output: + +Charlie is standing and appears to be in conversation with David, who is seated on the ground floor. He looks at Charlie and then looks back at them. "What are you doing?" They are in an outdoor dining area with other patrons in the background. + +![](images/6596267b56c6e30a3ffd2ad868eac1b09ea382ae1749d65b8e2c350e3e753b8d.jpg) +Caption + + +![](images/b67edd6536bdf7c763308cf4ffbdf92f5992241fe1c90040fe607ba29354ab94.jpg) + + +![](images/6b6ff539a9552f0d7aac7261da1e654bfd8673a6941884236663525858a0b36d.jpg) + +Figure 4: Data samples of MM-ID. Each sample consists of ID images of each character, and test images containing multiple characters. Our model can memorize the identity information in ID reference and generalizes to recognize characters from different scenes. + +![](images/841579c9ece98b55bd814b1b43e4d2d4ff8d30ac5a77f49425c74a2e115e2c9f.jpg) + + +Question: + +Julia is , Jack is . Give a description of the following images: . + +Model output: + +Jack and Julia are seated side by side in a vehicle, looking out at a desolate landscape. In a subsequent scene, Jack is seen standing and appears to be interacting with something or someone outside the vehicle while Julia is seated, watching him. The scene shifts to Jack attending to an injured Julia, who is lying on the ground. Finally, Jack is seen running away while Julia rests a cave, observing his actions. + +![](images/24368be42a0601360bf77ce10e60b7daca6bab7dd8e2335efe6c7c36b7d1e12a.jpg) + + +![](images/3fe2ca194ca228b031e0b76bd7bfb49215d88fa75d06ebce5099e3be3d9a6205.jpg) + + +B. Finally, we integrate ID images, test images and results of GPT-4V into conversation templates, producing second-stage instruction tuning data. + +After completing data construction process, we train our model with next-token prediction loss in two stages. The first stage tuning data contains approximately 80,000 samples, while the second one comprises around 60,000 samples. Moreover, to ensure that the model would not forget its previously learned knowledge during ID recognition training, we integrate instruction tuning data from LLaVA and ShareGPT4V with the aforementioned data, training them simultaneously. + +# 4 MM-ID + +# 4.1 PROBLEM DEFINITION + +To measure ID recognition capability of models, we propose a new benchmark, MM-ID. We appraise the capability of models to recognize IDs across four incrementally complex levels. The first sub-task we investigate is matching: given an instance image, which could feature a person, an animal, or a building, the model must choose an image from four options that contains the same instance. The second sub-task involves localizing the instance within a test image based on the ID image, and providing coordinates of the bounding box, with the challenge coming from numerous similar distractor objects or individuals present in the test image. The third and fourth sub-tasks—question-answering and caption generation—require the model to recognize the identities in the test images, then either respond to related questions or produce a comprehensive description. These represent the most difficult level of tasks, as the model should not only recognize each instance's identity in the image but also provide appropriate answers based on information related to their names, including states, actions, locations, and more. The samples of sub-tasks are shown in Figure 4. + +# 4.2 DATA ANNOTATION AND STATISTICS + +In the construction of MM-ID benchmark, we initially collect images that meet the specified conditions. To evaluate the model's capability of recognizing instance-level information, the images used for testing need to contain multiple characters. Furthermore, each character requires distinctiveness, such as different actions, clothing attributes, etc., to facilitate the design of questions. Our data sources primarily encompass three types: shot images of movie scenes from the MovieNet dataset, animated images with download links collected from the internet, and pictures of buildings, vehicles, and animals gathered from object re-identification (Re-ID) datasets (Ye et al., 2024; Jiao et al., 2023). In each example, there exists ID images corresponding to each character and one or more test images for inquiry. + +Following preparing images of MM-ID, we annotate questions and standard answers manually. For description and localization sub-tasks, we use GPT-4 to generate question templates. In question-answering task, annotators pose questions regarding specific characters' actions, attributes, clothing colors, positions, relationships, emotions, etc., following detailed annotation documents and guidance examples. The question design ensures that the model can only provide a correct answer when it accurately recognizes the characters. After question annotation, we request other individuals' assistance in refinement and balancing, increasing the diversity of expression and grammatical structure. Finally, the correct answers are labeled manually by other four annotators, providing accurate and detailed descriptions for caption task and correct answers for Q&A task. Everyone participates in discussions and makes peer reviews for each other. The instructions for question annotations and quantitative evaluation of inter-annotator agreement are shown in Appendix C. + +
Sub-taskQues NumImg NumSource
Matching67335MovieNet, Re-ID datasets
Location123360MovieNet, animations
Q&A154507MovieNet, animations
Caption2411110MovieNet, animations
+ +(a) + +![](images/cefd539b0a9ddd11975e0d4f67c8b4d90de72f554958723b1bb65ebcebb21b31.jpg) +Figure 5: MM-ID data statistics. (a) Sample number and data sources of four sub-tasks. (b) The proportion of each perspective of Q&A. + +(b) + +Totally, we collect and annotate 585 samples. The data composition is shown in Figure 5 (a). The "Q&A" and "Caption" sub-tasks are main parts of MM-ID benchmark. Because we use GPT-41 for scoring, it is costly to have too many evaluation samples and we select the most representative samples for MM-ID. As shown in Figure 5 (b), Questions of "Q&A" task comprehensively covers different perspectives of characters (actions, states, attributes, positions, emotions), which can sufficiently evaluate the ID recognition capability of LVLMs. + +# 4.3 EVALUATION STRATEGY + +Quantitative evaluation for open-domain LVLMs has always been challenging. Our MM-ID incorporates four sub-tasks, each presenting its unique answer format. For matching task, which resembles multiple-choice questions, accuracy is used as a metric. In localization task, we compare the predicted bounding box to the actual bounding box, computing the Intersection over Union (IoU) metric to measure accuracy. When IoU exceeds a threshold of 0.5, we consider the model recognizes instance identity accurately. + +For question-answering and caption generation tasks, due to the open-ended nature of the generated responses, it is challenging to employ rule-based evaluations. Hence, inspired by MM-Vet and LLaVA-Bench, GPT-4 is used to score the results. Under the condition of provided questions and correct answers, we design prompts to guide GPT-4 to focus on correspondence of character names and their states or actions, scoring the accuracy of characters' descriptions within model predictions. + +Table 1: The comparison results on MM-ID. Notably, The scores of 'Q&A' and 'Caption' are evaluated with GPT-4 absolute scoring strategy. '-' indicates the model can't complete corresponding instruction. + +
ModelMatchingLocationQ&ACaption
Open-source Models
MMICL (Zhao et al., 2023a)--3.533.18
SEED (Ge et al., 2023)--3.193.58
LLaVA-OneVision (Li et al., 2024)--3.912.86
Qwen-VL-Chat (Bai et al., 2023)-0.5043.632.65
InternLM-XComposer2 (Dong et al., 2024)-0.1063.442.93
Closed-source APIs
Qwen-VL-Plus (Bai et al., 2023)0.3130.1873.873.79
Qwen-VL-Max (Bai et al., 2023)0.2240.3014.644.23
Gemini-pro (Google, 2023b)0.6870.0814.974.04
GPT-4V (OpenAI, 2023b)0.6270.2444.774.67
IDA-VLM0.7160.8215.715.15
+ +It is found that outputs of GPT-4 still exist variance, so we utilize GPT-4 to score the predictions by 5 times and report average scores. + +We use both absolute and relative scoring strategies. Absolute scoring rates a model's prediction directly against the correct answer on a ten-point scale, while relative scoring pits two models' results against each other, providing more immediate comparative insights into the models' performance with a fraction. The prompts used for GPT-4 scoring are shown in Appendix C. Besides using GPT-4 scoring, we also employ conventional caption metrics like METEOR and CIDEr. + +# 5 EXPERIMENTS + +# 5.1 QUANTITATIVE RESULTS + +We use Qwen-VL-Chat for model initialization, which has 9.6B parameters. During IDA-VLM training, we set learning rate as 1e-5 for the first stage and 5e-6 for the second stage. The model is trained for 5 epochs in both the first and second stages. The batch size with gradient accumulation is set to 128. The visual encoder is fixed, while ID-Former and LLM are fine-tuned. + +We compare IDA-VLM with other open-source LVLMs (Zhao et al., 2023a; Ge et al., 2023; Bai et al., 2023; Dong et al., 2024) and closed-source APIs (Bai et al., 2023; Google, 2023b; OpenAI, 2023b) on MM-ID. To meet the requirement of ID recognition, the models selected for testing should support multiple images input. Because they are not fine-tuned for this task, the prompt is crucial for guiding models on ID awareness. We design appropriate prompts to guide them to respond according to character names. The details can be found in Appendix D. + +As illustrated in Table 1, our model achieves the best performance on MM-ID. According to the quantitative results, Gemini-pro exhibits best performance on matching and Q&A sub-tasks among previous models. In the location sub-task, Qwen-VL-Chat gains the highest score, even higher than other closed-source APIs. As for the caption sub-task, GPT-4V surpasses other models. Overall, our model outperforms previous LVLMs by a significant margin on four sub-tasks. The results demonstrate visual instruction tuning with ID reference unleashes the potential of LVLM on ID awareness, which can not be realized only by prompt engineering. + +As shown in Table 2, we calculate relative scores using GPT-4 to provide a further demonstration on the 'Q&A' and 'Caption' sub-tasks. We compare the predictions from various closed-source APIs against those from our model respectively. All relative scores are below 1, signifying that our model outperforms its counterparts. Among the closed-source APIs evaluated, GPT-4V exhibits comparatively superior results. In Table 3, our model also gains best performance on traditional metrics of caption task. + +Table 2: Using relative scoring strategy to compare previous LVLMs with our model. Each result is the ratio of the first model's score to that of the second model's, after feeding the predictions of two models into GPT-4 for comparison. + +
ModelQ&ACaption
GPT-4V / IDA-VLM0.9250.793
Gemini-pro / IDA-VLM0.8920.704
Qwen-VL-Chat / IDA-VLM0.7650.396
Qwen-VL-Plus / IDA-VLM0.7960.544
Qwen-VL-Max / IDA-VLM0.9180.636
+ +Table 3: METEOR and CIDEr metrics evaluation on 'Caption' sub-task. Both metrics take into account the semantic similarity of the captions. + +
ModelMETEORCIDEr
Qwen-VL-Chat0.0520.031
Qwen-VL-Plus0.1190.140
Qwen-VL-Max0.1340.083
Gemini-pro0.1210.185
GPT-4V0.1440.078
IDA-VLM0.1910.515
+ +Table 4: Performance of IDA-VLM on standard benchmarks. "w/o LLaVA data" means finetuning with only constructed ID reference datasets. + +
ModelMMESEED-Bench
PerceptionCognitionImageVideo
Qwen-VL-Chat1441.4387.50.6500.397
IDA-VLM (w/o LLaVA data)1167.5349.60.4410.311
IDA-VLM1484.6383.60.6470.412
+ +To assess the basic multimodal capabilities, we also evaluate IDA-VLM with the baseline model Qwen-VL-Chat on standard benchmarks. As shown in Table 4, the perception metric on MME gets improved, which is due to the ID-level recognition learning boosts fine-grained perception ability. On SEED-Bench, our training samples containing multiple test images enhance video understanding ability. Comparing the last two rows, the inclusion of LLaVA and ShareGPT4V data greatly contributes to preserving the original capabilities. + +# 5.2 QUALITATIVE COMPARISON + +As shown in Figure 6, we qualitatively compare the results of IDA-VLM with other models. In the first case, GPT-4V does not exhibit accurate localization ability, and Qwen-VL-Chat mistakenly recognizes Leizi as another similar person. In the second case, the model should determine which person walks in front and match the person with the given characters. Our model gives the right answer 'Ariadne' while GPT-4V and Gemini-pro recognizes inaccurately. In the last case, models are asked to provide a description for a movie scene with three characters. GPT-4V describes that David and Elise sit at a table, ignoring Charlie standing. Gemini-pro only gives a generic caption for the test image without recognizing characters' identities. In contrast, our model gives the most reasonable description of the scene. We present more qualitative examples in Appendix E. + +# 5.3 ABLATION STUDIES + +Effect of Dual-stage instruction tuning. We report the separate effect of each instruction tuning stage in Table 5. When the second stage of tuning is removed, there is a significant drop in performance, suggesting that the second stage has a more substantial impact than the first. During the second stage, the ID images are independent of the test images, which enhances the quality of data for model learning. When the first and second stages of tuning are combined, our model achieves its optimal performance. It is worth noting that the accuracy of 'Matching' gets lower when adding the first stage tuning, because the first stage tuning data can't improve matching ability. + +Table 5: The ablation study about separate stage instruction tuning. + +
ModelMatchingLocationQ&ACaption
w/o first stage tuning0.7460.8135.435.08
w/o second stage tuning-0.7154.083.86
Ours0.7160.8215.805.19
+ +![](images/82ffe8ad120ce6141c0b1a4c8b217d3502772f67372373fe58277cd8c5a9fa83.jpg) +Figure 6: We present visualizations of selected samples from MM-ID, corresponding to location, Q&A and caption sub-tasks. We showcase results of some representative models and ours (IDA-VLM). The detailed prompts for other models to complete instructions are shown in Appendix D. + +Table 6: The ablation study about ID-Former. + +
ModelMatchingLocationQ&ACaption
w/o ID-Former0.7010.8035.445.13
Ours0.7160.8215.715.15
+ +Effect of ID-Former. We use ID-Former to project visual features of ID images and test images to the semantic space of LLM. As depicted in Table 6, substituting the ID-Former with a standard query former leads to a reduction in all sub-task metrics. The ID-Former enhances the interaction between features of ID images and test images, thereby activating ID information within the test images. + +The ablation study for the mixing rate of LLaVA and ShareGPT4V instruction tuning data are depicted in Appendix B. + +# 6 CONCLUSION + +In this paper, we focus on the capability to recognize and link instances across various scenes, which is significant for understanding complex visual narratives, such as movies. We propose visual instruction tuning with ID reference, which unleashes the potential of LVLM in ID recognition and develop an ID-aware LVLM, IDA-VLM. The model memorizes the name and appearance of each character in ID reference, then recognizes them across disparate scenes correctly, and understands visual narrative in an end-to-end manner. To thoroughly assess ID awareness of LVLMs, a novel benchmark named MM-ID has been introduced, which consists of four sub-tasks. Our model can serve as a reference and inspirational baseline, which achieves best performance among previous models and closed-source APIs. Conclusively, this research contributes to broadening the horizons for future AI systems to efficiently understand multi-identity visual content. + +# 7 ACKNOWLEDGMENTS + +This work was partly supported by the National Key Research and Development Program of China (No. 2024YFB2808903), the research fund of Tsinghua University - Tencent Joint Laboratory for Internet Innovation Technology. This paper is partially supported by the National Key R&D Program of China No.2022ZD0161000 and the General Research Fund of Hong Kong No.17200622 and 17209324. + +# 8 LEGAL STATEMENT + +This work utilized the MovieNet dataset, which is publicly available under open-source license for academic research. For animation images from the internet, we provided weburls of the original content rather than redistributing the images directly, to respect potential copyright restrictions. The authors acknowledge full responsibility for the usage of all datasets in this research and have made best efforts to comply with relevant terms of use and copyright laws. The authors are responsible for any legal violations of data rights. + +# REFERENCES + +Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, Roman Ring, Eliza Rutherford, Serkan Cabi, Tengda Han, Zhitao Gong, Sina Samangooei, Marianne Monteiro, Jacob L. Menick, Sebastian Borgeaud, Andy Brock, Aida Nematzadeh, Sahand Sharifzadeh, Mikolaj Binkowski, Ricardo Barreira, Oriol Vinyals, Andrew Zisserman, and Karén Simonyan. Flamingo: a visual language model for few-shot learning. In NeurIPS, 2022. +Jinze Bai, Shuai Bai, Shusheng Yang, Shijie Wang, Sinan Tan, Peng Wang, Junyang Lin, Chang Zhou, and Jingren Zhou. Qwen-vl: A frontier large vision-language model with versatile abilities. CoRR, abs/2308.12966, 2023. +Mu Cai, Haotian Liu, Siva Karthik Mustikovela, Gregory P. Meyer, Yuning Chai, Dennis Park, and Yong Jae Lee. Making large multimodal models understand arbitrary visual prompts. CoRR, abs/2312.00784, 2023. +Jun Chen, Deyao Zhu, Xiaogian Shen, Xiang Li, Zechun Liu, Pengchuan Zhang, Raghuraman Krishnamoorthi, Vikas Chandra, Yunyang Xiong, and Mohamed Elhoseiny. Minigpt-v2: large language model as a unified interface for vision-language multi-task learning. CoRR, abs/2310.09478, 2023a. +Keqin Chen, Zhao Zhang, Weili Zeng, Richong Zhang, Feng Zhu, and Rui Zhao. Shikra: Unleashing multimodal llm's referential dialogue magic. CoRR, abs/2306.15195, 2023b. +Lin Chen, Jinsong Li, Xiaoyi Dong, Pan Zhang, Conghui He, Jiaqi Wang, Feng Zhao, and Dahua Lin. Sharegpt4v: Improving large multi-modal models with better captions. CoRR, abs/2311.12793, 2023c. +Wenliang Dai, Junnan Li, Dongxu Li, Anthony Meng Huat Tiong, Junqi Zhao, Weisheng Wang, Boyang Li, Pascale Fung, and Steven C. H. Hoi. Instructclip: Towards general-purpose vision-language models with instruction tuning. In NeurIPS, 2023. +Xiaoyi Dong, Pan Zhang, Yuhang Zang, Yuhang Cao, Bin Wang, Linke Ouyang, Xilin Wei, Songyang Zhang, Haodong Duan, Maosong Cao, Wenwei Zhang, Yining Li, Hang Yan, Yang Gao, Xinyue Zhang, Wei Li, Jingwen Li, Kai Chen, Conghui He, Xingcheng Zhang, Yu Qiao, Dahua Lin, and Jiaqi Wang. Internlm-xcomposer2: Mastering free-form text-image composition and comprehension in vision-language large model. CoRR, abs/2401.16420, 2024. +Zi-Yi Dou, Yichong Xu, Zhe Gan, Jianfeng Wang, Shuohang Wang, Lijuan Wang, Chenguang Zhu, Pengchuan Zhang, Lu Yuan, Nanyun Peng, Zicheng Liu, and Michael Zeng. An empirical study of training end-to-end vision-and-language transformers. In CVPR, pp. 18145-18155. IEEE, 2022. + +Chaoyou Fu, Peixian Chen, Yunhang Shen, Yulei Qin, Mengdan Zhang, Xu Lin, Zhenyu Qiu, Wei Lin, Jinrui Yang, Xiawu Zheng, Ke Li, Xing Sun, and Rongrong Ji. MME: A comprehensive evaluation benchmark for multimodal large language models. CoRR, abs/2306.13394, 2023. +Yuying Ge, Sijie Zhao, Ziyun Zeng, Yixiao Ge, Chen Li, Xintao Wang, and Ying Shan. Making llama SEE and draw with SEED tokenizer. CoRR, abs/2310.01218, 2023. +Google. Google bard. https://bard.google.com/chat/, 2023a. +Google. Gemini-pro. https://www.gemini-ai.org/gemini-pro-1-5/, 2023b. +Yash Goyal, Tejas Khot, Aishwarya Agrawal, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the V in VQA matter: Elevating the role of image understanding in visual question answering. Int. J. Comput. Vis., 127(4):398-414, 2019. +Wenzhong Guo, Jianwen Wang, and Shiping Wang. Deep multimodal representation learning: A survey. IEEE Access, 7:63373-63394, 2019. +Qingqiu Huang, Yu Xiong, Anyi Rao, Jiaze Wang, and Dahua Lin. Movienet: A holistic dataset for movie understanding. In ECCV(4), volume 12349 of Lecture Notes in Computer Science, pp. 709-727. Springer, 2020. +Drew A. Hudson and Christopher D. Manning. GQA: A new dataset for real-world visual reasoning and compositional question answering. In CVPR, 2019. +Yatai Ji, Rongcheng Tu, Jie Jiang, Weijie Kong, Chengfei Cai, Wenzhe Zhao, Hongfa Wang, Yujiu Yang, and Wei Liu. Seeing what you miss: Vision-language pre-training with semantic completion learning. In CVPR, pp. 6789-6798. IEEE, 2023a. +Yatai Ji, Junjie Wang, Yuan Gong, Lin Zhang, Yanru Zhu, Hongfa Wang, Jiaxing Zhang, Tetsuya Sakai, and Yujiu Yang. MAP: multimodal uncertainty-aware vision-language pre-training model. In CVPR, pp. 23262-23271. IEEE, 2023b. +Bingliang Jiao, Lingqiao Liu, Liying Gao, Ruiqi Wu, Guosheng Lin, Peng Wang, and Yanning Zhang. Toward re-identifying any animal. In NeurIPS, 2023. +Sahar Kazemzadeh, Vicente Ordonez, Mark Matten, and Tamara L. Berg. Referitgame: Referring to objects in photographs of natural scenes. In EMNLP, pp. 787-798. ACL, 2014. +Jing Yu Koh, Daniel Fried, and Russ Salakhutdinov. Generating images with multimodal language models. In NeurIPS, 2023. +Bo Li, Yuanhan Zhang, Liangyu Chen, Jinghao Wang, Jingkang Yang, and Ziwei Liu. Otter: A multi-modal model with in-context instruction tuning. CoRR, abs/2305.03726, 2023a. +Bo Li, Yuanhan Zhang, Dong Guo, Renrui Zhang, Feng Li, Hao Zhang, Kaichen Zhang, Yanwei Li, Ziwei Liu, and Chunyuan Li. Llava-onevision: Easy visual task transfer. CoRR, abs/2408.03326, 2024. +Bohao Li, Rui Wang, Guangzhi Wang, Yuying Ge, Yixiao Ge, and Ying Shan. Seed-bench: Benchmarking multimodal llms with generative comprehension. CoRR, abs/2307.16125, 2023b. +Huayang Li, Siheng Li, Deng Cai, Longyue Wang, Lemao Liu, Taro Watanabe, Yujiu Yang, and Shuming Shi. Textbind: Multi-turn interleaved multimodal instruction-following in the wild. CoRR, abs/2309.08637, 2023c. +Junnan Li, Dongxu Li, Silvio Savarese, and Steven C. H. Hoi. BLIP-2: bootstrapping language-image pre-training with frozen image encoders and large language models. In ICML, volume 202 of Proceedings of Machine Learning Research, pp. 19730–19742. PMLR, 2023d. +Yifan Li, Yifan Du, Kun Zhou, Jinpeng Wang, Wayne Xin Zhao, and Ji-Rong Wen. Evaluating object hallucination in large vision-language models. In EMNLP, pp. 292-305. Association for Computational Linguistics, 2023e. + +Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In Proc. of ECCV, 2014. +Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. In NeurIPS, 2023a. +Yuan Liu, Haodong Duan, Yuanhan Zhang, Bo Li, Songyang Zhang, Wangbo Zhao, Yike Yuan, Jiaqi Wang, Conghui He, Ziwei Liu, Kai Chen, and Dahua Lin. Mmbench: Is your multi-modal model an all-around player? CoRR, abs/2307.06281, 2023b. +Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In NeurIPS, pp. 13-23, 2019. +Jiasen Lu, Christopher Clark, Rowan Zellers, Roozbeh Mottaghi, and Aniruddha Kembhavi. UNIFIED-IO: A unified model for vision, language, and multi-modal tasks. In ICLR. Open-Review.net, 2023. +Meta. Llama-3. https://ai.meta.com/blog/meta-llama-3/, 2024. +OpenAI. Chatgpt. https://openai.com/blog/chatgpt/, 2023a. +OpenAI. Gpt-4v(ison) system card. https://cdn.openai.com/papers/GPTV_System_Card.pdf, 2023b. +Bryan A. Plummer, Liwei Wang, Chris M. Cervantes, Juan C. Caicedo, Julia Hockenmaier, and Svetlana Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. Int. J. Comput. Vis., 123(1):74-93, 2017. +Hanoona Abdul Rasheed, Muhammad Maaz, Sahal Shaji Mullappilly, Abdelrahman Shaker, Salman H. Khan, Hisham Cholakkal, Rao Muhammad Anwer, Erix Xing, Ming-Hsuan Yang, and Fahad Shahbaz Khan. Glamm: Pixel grounding large multimodal model. CoRR, abs/2311.03356, 2023. +Chufan Shi, Cheng Yang, Yaxin Liu, Bo Shui, Junjie Wang, Mohan Jing, Linran Xu, Xinyu Zhu, Siheng Li, Yuxiang Zhang, Gongye Liu, Xiaomei Nie, Deng Cai, and Yujiu Yang. Chart-mimic: Evaluating Imm's cross-modal reasoning capability via chart-to-code generation. CoRR, abs/2406.09961, 2024. +Quan Sun, Qiying Yu, Yufeng Cui, Fan Zhang, Xiaosong Zhang, Yueze Wang, Hongcheng Gao, Jingjing Liu, Tiejun Huang, and Xinlong Wang. Generative pretraining in multimodality. CoRR, abs/2307.05222, 2023. +Hao Tan and Mohit Bansal. LXMERT: learning cross-modality encoder representations from transformers. In EMNLP/IJCNLP (1), pp. 5099-5110. Association for Computational Linguistics, 2019. +Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, Aurélien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. Llama: Open and efficient foundation language models. CoRR, abs/2302.13971, 2023. +Rong-Cheng Tu, Yatai Ji, Jie Jiang, Weijie Kong, Chengfei Cai, Wenzhe Zhao, Hongfa Wang, Yujiu Yang, and Wei Liu. Global and local semantic completion learning for vision-language pretraining. CoRR, abs/2306.07096, 2023. +vicuna. Vicuna: An open-source chatbot impressing gpt-4 with $90\%$ chatgpt quality. https://vicuna.lmsys.org/, 2023. +Junjie Wang, Yatai Ji, Jiaqi Sun, Yujiu Yang, and Tetsuya Sakai. MIRTT: learning multimodal interaction representations from trilinear transformers for visual question answering. In EMNLP (Findings), pp. 2280-2292. Association for Computational Linguistics, 2021. +Wenhai Wang, Zhe Chen, Xiaokang Chen, Jiannan Wu, Xizhou Zhu, Gang Zeng, Ping Luo, Tong Lu, Jie Zhou, Yu Qiao, and Jifeng Dai. Visionllm: Large language model is also an open-ended decoder for vision-centric tasks. In NeurIPS, 2023. + +Mang Ye, Shuoyi Chen, Chenyue Li, Wei-Shi Zheng, David Crandall, and Bo Du. Transformer for object re-identification: A survey. CoRR, abs/2401.06960, 2024. +Weihao Yu, Zhengyuan Yang, Linjie Li, Jianfeng Wang, Kevin Lin, Zicheng Liu, Xinchao Wang, and Lijuan Wang. Mm-vet: Evaluating large multimodal models for integrated capabilities. CoRR, abs/2308.02490, 2023. +Rowan Zellers, Yonatan Bisk, Ali Farhadi, and Yejin Choi. From recognition to cognition: Visual commonsense reasoning. In CVPR, pp. 6720-6731. Computer Vision Foundation / IEEE, 2019. +Shilong Zhang, Peize Sun, Shoufa Chen, Min Xiao, Wenqi Shao, Wenwei Zhang, Kai Chen, and Ping Luo. Gpt4roi: Instruction tuning large language model on region-of-interest. CoRR, abs/2307.03601, 2023. +Haozhe Zhao, Zefan Cai, Shuzheng Si, Xiaojian Ma, Kaikai An, Liang Chen, Zixuan Liu, Sheng Wang, Wenjuan Han, and Baobao Chang. MMICL: empowering vision-language model with multi-modal in-context learning. CoRR, abs/2309.07915, 2023a. +Liang Zhao, En Yu, Zheng Ge, Jinrong Yang, Haoran Wei, Hongyu Zhou, Jianjian Sun, Yuang Peng, Runpei Dong, Chunrui Han, and Xiangyu Zhang. Chatspot: Bootstrapping multimodal llms via precise referring instruction tuning. CoRR, abs/2307.09474, 2023b. +Deyao Zhu, Jun Chen, Xiaoqian Shen, Xiang Li, and Mohamed Elhoseiny. Minigpt-4: Enhancing vision-language understanding with advanced large language models. CoRR, abs/2304.10592, 2023. +Yuke Zhu, Oliver Groth, Michael S. Bernstein, and Li Fei-Fei. Visual7w: Grounded question answering in images. In CVPR, pp. 4995-5004. IEEE Computer Society, 2016. \ No newline at end of file diff --git a/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/images.zip b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..591e53c3dd89a8596b356de67dd11a2f7c08e5af --- /dev/null +++ b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbac73a73e9a308a276ad0aceb3717109e4556691ff760073287fab4aed7ae30 +size 663488 diff --git a/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/layout.json b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f3c402cd05f28742a10e461a3b83a5ef4c0d47c8 --- /dev/null +++ b/ICLR/2025/IDA-VLM_ Towards Movie Understanding via ID-Aware Large Vision-Language Model/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe517084f88aab4d6bf0bbbc0395367fe8e82c4ef19b3552bcb4abd7b8bf435b +size 394307 diff --git a/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_content_list.json b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..06a63fb0b2c13e157ebcc53f2c7ad137e006fe62 --- /dev/null +++ b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39135c1ac1b7e8d83aad828966e27ea54860f66d7f955943e5a6d06934671b06 +size 114489 diff --git a/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_model.json b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1b3e697d6daa7933ed90316808ef5bc6d23d1e03 --- /dev/null +++ b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ef537fa534d78ec4afe79d31b468c31586c5f10a828699257dbaa7104631aaa +size 143746 diff --git a/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_origin.pdf b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..467d0a6254274fd51696087bd8f9d66a75cf0d97 --- /dev/null +++ b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/0ea036fa-9e98-4107-9d28-047b758dde8d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52e7c5319a56c34187dd1336e7caaab941620823490013ce9a977357fc450e14 +size 14419070 diff --git a/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/full.md b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0cb541a9ea9a9592884a45565103679918645a13 --- /dev/null +++ b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/full.md @@ -0,0 +1,517 @@ +# IDARB: INTRINSIC DECOMPOSITION FOR ARBITRARY NUMBER OF INPUT VIEWS AND ILLUMINATIONS + +Zhibing Li $^{1}$ , Tong Wu $^{1\dagger}$ , Jing Tan $^{1}$ , Mengchen Zhang $^{2,3}$ , Jiaqi Wang $^{3}$ , Dahua Lin $^{1,3,4\dagger}$ + +1 The Chinese University of Hong Kong 2 Zhejiang University +3 Shanghai AI Laboratory 4 CPII under InnoHK + +{1z022,wt020,dhlin}@ie.cuhk.edu.hk + +# ABSTRACT + +Capturing geometric and material information from images remains a fundamental challenge in computer vision and graphics. Traditional optimization-based methods often require hours of computational time to reconstruct geometry, material properties, and environmental lighting from dense multi-view inputs, while still struggling with inherent ambiguities between lighting and material. On the other hand, learning-based approaches leverage rich material priors from existing 3D object datasets but face challenges with maintaining multi-view consistency. In this paper, we introduce IDArb, a diffusion-based model designed to perform intrinsic decomposition on an arbitrary number of images under varying illuminations. Our method achieves accurate and multi-view consistent estimation on surface normals and material properties. This is made possible through a novel cross-view, cross-domain attention module and an illumination-augmented, view-adaptive training strategy. Additionally, we introduce ARB-Objaverse, a new dataset that provides large-scale multi-view intrinsic data and renderings under diverse lighting conditions, supporting robust training. Extensive experiments demonstrate that IDArb outperforms state-of-the-art methods both qualitatively and quantitatively. Moreover, our approach facilitates a range of downstream tasks, including single-image relighting, photometric stereo, and 3D reconstruction, highlighting its broad applications in realistic 3D content creation. Project website: https://lizb6626.github.io/IDArb/. + +# 1 INTRODUCTION + +The color we perceive from objects results from a complex interaction between the incident light, the material properties, and the surface geometry of those objects. Recovering these intrinsic properties from captured images is a fundamental challenge in computer vision, enabling a variety of downstream applications, such as relighting (Wimbauer et al., 2022) and photo-realistic 3D content generation (Zhang et al., 2024; Siddiqui et al., 2024). This decomposition process, commonly referred to as inverse rendering, is inherently ambiguous and severely under-constrained, particularly when only one or a limited number of observation views are available. For instance, a black pixel could indicate black base color or is the result of lacking incident light. + +Existing inverse rendering research can be broadly categorized into two approaches: optimization-based methods and learning-based methods. The former category (e.g. NeRFactor (Zhang et al., 2021b), NVDiffRecMC (Hasselgren et al., 2022), TensoIR (Jin et al., 2023)) typically requires hundreds of multi-view images as input and focuses on optimizing intrinsic properties for each case independently. This approach involves time-consuming iterative optimization, often requiring several hours. Moreover, without incorporating strong priors on material distribution or addressing the inherent ambiguity between lighting and texture, these optimization-based methods frequently converge to sub-optimal solutions. This can lead to unrealistic decompositions, such as embedding lighting effects into intrinsic components, as shown in Fig. 1(b). To address these limitations, learning-based methods aim to extract useful priors from large-scale training datasets and perform fast inference in a feed-forward manner. While many of these approaches focus on single-image decomposition, they tend to produce inconsistent intrinsic properties when applied across multiple + +![](images/5ba5b931141277987919a4b1488d20494af1a0d3e2a29e7f4f4c1e93bee21320.jpg) +Figure 1: IDArb tackles intrinsic decomposition for an arbitrary number of views under unconstrained illumination. Our approach (a) achieves multi-view consistency compared to learning-based methods and (b) effectively disentangles intrinsic components from lighting effects compared to optimization-based methods. Our method enhances a wide range of applications such as image editing, photometric stereo, and 3D reconstruction. + +views, as demonstrated in Fig. 1(a). Additionally, single-image models struggle to leverage complementary information from multiple views, making it difficult to resolve material ambiguities, which results in less accurate outcomes in more complex cases. + +To mitigate these challenges, we propose IDArb, a model capable of taking an arbitrary number of images captured under unconstrained, varying lighting conditions and predicting corresponding intrinsic components, including albedo, normal, metallic and roughness. Our key contributions are three-fold. First, we adopt the cross-view, cross-component attention module from Wonder3D (Long et al., 2023) to fuse information across different views and intrinsic components. This module facilitates holistic understanding of the multi-view correspondence and joint distribution of intrinsic components, enabling consistency across viewpoints and reducing decomposition uncertainty. Despite being trained on fixed number of input views, our model shows the flexibility to decompose an arbitrary number of input images without requiring camera poses. Second, to improve performance under complex lighting conditions, we create a custom dataset based on Objaverse (Deitke et al., 2022), namely ARB-Objaverse, which contains 5.7M multi-view RGB images and intrinsic components with varying illumination scenarios for effective training. Lastly, we devise a novel and effective illumination-augmented and view-adapted training strategy to achieve robust performance under varying lighting conditions and leverage both multi-view cues and general object material prior for better multi-view and single-view inverse rendering. + +We evaluate our model extensively on both synthetic and real data. Our approach significantly outperforms existing learning-based methods (Kocsis et al., 2024; Zeng et al., 2024; Chen et al., 2024) by a large margin, both qualitatively and quantitatively, achieving state-of-the-art results in intrinsic decomposition. Our model offers practical benefits for a range of downstream tasks, including material editing, relighting, and photometric stereo, and it can also serve as a strong prior to improve optimization-based methods by better disentangling lighting effects from intrinsic appearance. We believe that IDArb provides a unified solution across different input regimes in inverse rendering, advancing our ability to understand and model the physical world. + +# 2 RELATED WORK + +# 2.1 OPTIMIZATION-BASED INVERSE RENDERING + +Optimization-based inverse rendering methods aim to jointly reconstruct shape, materials, and lighting from multi-view images. Volumetric representation methods (Boss et al., 2021a; Kuang et al., + +2022; Boss et al., 2021b; Zhang et al., 2021b) extend NeRF (Mildenhall et al., 2020) to model intrinsic appearance and lighting conditions, rendering images using volume rendering techniques. Surface-based representation methods (Zhang et al., 2021a; 2022a;b; Sun et al., 2023; Wu et al., 2023) extract surfaces as signed distance functions (SDFs) (Wang et al., 2021) or differentiable meshes (Munkberg et al., 2022; Hasselgren et al., 2022), apply explicit material models such as Bidirectional Reflectance Distribution Functions (BRDFs) (Nicodemus, 1965), and render images through physics-based procedures. Recent works explore 3D Gaussian representation Kerbl et al. (2023); Gao et al. (2023) for this task, assigning intrinsic attributes to each Gaussian point. + +While existing methods effectively simulate global illumination, they often require dense multiview inputs and can be computationally expensive, especially for complex scenes. In addition, they face the inherent ambiguity between lighting and materials, which can lead to suboptimal solutions, such as incorrectly baked lighting into textures. In contrast, our proposed method offers an efficient solution for inverse rendering in a feed-forward manner. By leveraging well-learned priors from our large-scale, multi-view, multi-lighting dataset, we can significantly mitigate the issue of ambiguity. + +# 2.2 LEARNING-BASED INVERSE RENDERING + +With advances in deep neural networks, learning-based approaches (Barron & Malik, 2020; Li et al., 2019; Zhu et al., 2022; Bi et al., 2020; Careaga & Aksoy, 2023; Shi et al., 2016) have demonstrated impressive performance in intrinsic decomposition. They typically take a single image as input and decompose intrinsic properties from the input view, such as albedo, specular, and surface normal. Early learning-based methods (Li et al., 2018; Wu et al., 2021; Wimbauer et al., 2022; Sang & Chandraker, 2020; Boss et al., 2020; Yi et al., 2023) handle intrinsic decomposition as a deterministic problem, often leading to over-smoothed details in ambiguous pixels. Recent works (Kocsis et al., 2024; Chen et al., 2024; Zeng et al., 2024) adopt probabilistic distribution modeling with diffusion (Ho et al., 2020), estimating accurate intrinsic components with high-frequency details through a generative formulation. Zeng et al. (2024) presents a unified diffusion framework that addresses both RGB $\rightarrow$ X (estimating intrinsic properties) and X $\rightarrow$ RGB (generating realistic images) by training diffusion pipelines on multiple data sources. + +These learning-based approaches typically handle inverse rendering in a single-view setting, leading to inconsistent results when applied to multi-view data. Our work extends the feed-forward diffusion pipeline to address the under-explored challenge of multi-view inverse rendering, providing a unified solution for various input types and offering valuable intrinsic priors for downstream applications. + +# 2.3 DIFFUSION MODELS FOR OTHER MODALITIES + +Denoising Diffusion Probabilistic Models (DDPMs) and their variants (Ho et al., 2020; Rombach et al., 2021; Zhang et al., 2023) have gained significant attention in text-to-image generation, yielding promising results across various applications. Researchers have also explored adapting diffusion models to different output modalities such as normal (Fu et al., 2024), depth (Ke et al., 2024) and novel view images (Liu et al., 2023; 2024b; Kong et al., 2024). To generate multiple modality simultaneously, Wonder3D (Long et al., 2023) introduces additional cross-domain attention modules into diffusion model that generates multi-view normal maps and corresponding color images. We extend this concept to intrinsic decomposition by splitting the intrinsic components into three triplets and modeling their joint distribution. By leveraging pre-trained diffusion models, which capture rich structural, semantic, and material knowledge, we can overcome data limitations and ensure generalization to real-world scenarios, even when the models are trained on synthetic data. + +# 3 METHOD + +IDArb is a diffusion-based model for intrinsic decomposition that can handle an arbitrary number of input views and varying lighting conditions. We begin by outlining the problem statement in Section 3.1. Then, in Section 3.2, we describe the construction of our custom dataset tailored to this task. Finally, we discuss the model architecture and training strategy in Sec. 3.3. An overview of IDArb is provided in Fig. 2. + +# 3.1 PROBLEM STATEMENT + +We frame intrinsic decomposition as a conditional generation problem: + +$$ +\mathbf {X} _ {1: N} \sim p \left(\mathbf {X} _ {1: N} \mid \mathbf {I} _ {1: N}\right). \tag {1} +$$ + +![](images/5ba73698cb2e3a2f509e64c1f05679c640811f709bda6bfd21f78517652c74bc.jpg) +Figure 2: Top: Overview of IDArb. Bottom: Illustration of the attention block within the UNet. Our training batch consists of $N$ input images, sampled from $N_{v}$ viewpoints and $N_{i}$ illuminations. The latent vector for each image is concatenated with Gaussian noise for denoising. Intrinsic components are divided into three triplets $(D = 3)$ : Albedo, Normal and Metallic&Roughness. Specific text prompts are used to guide the model toward different intrinsic components. For attention block inside UNet, we introduce cross-component and cross-view attention module into it, where attention is applied across components and views, facilitating global information exchange. + +Here, $N \in \mathbb{N}$ denotes the number of input views; $\mathbf{I}_{1:N}$ denotes input RGB images, and $\mathbf{X}_{1:N}$ represents the intrinsic components of each view. We model $\mathbf{X}$ using the simplified Disney BRDF parameterization (Burley & Studios, 2012; Karis & Games, 2013), which includes albedo $\mathbf{A} \in \mathbb{R}^{H \times W \times 3}$ , roughness $\mathbf{R} \in \mathbb{R}^{H \times W \times 1}$ , metallic $\mathbf{M} \in \mathbb{R}^{H \times W \times 1}$ and surface normal $\mathbf{N} \in \mathbb{R}^{H \times W \times 3}$ . The number of input images $N$ can take on an arbitrary value from one to many, and the input images can be rendered under arbitrary unconstrained illuminations during both training and inference. + +# 3.2 ARB-OBJAVERSE DATASET + +Obtaining ground truth data for intrinsic decomposition in real-world settings is both time-consuming and technically challenging. To overcome this, we rely on synthetic data for training. Ideally, a suitable dataset should feature large-scale, diverse objects rendered under multiple lighting conditions. However, existing datasets have notable limitations. For example, G-Objaverse (Qiu et al., 2024) employs a single, low-contrast lighting setup, while ABO (Collins et al., 2022) is restricted to household items, suffering from a lack of diversity among the objects. + +To address these shortcomings, we develop a custom dataset, Arb-Objaverse. We select 68k 3D models from Objaverse Deitke et al. (2022), and filter out low-quality and texture-less cases. For each object, we render 12 views, using the Cycles render engine from Blender. For each viewpoint, we render 7 images under different lighting conditions. Six images are illuminated by randomly sampled high-dynamic range (HDR) environment maps from Poly Haven, which offers a collection of 718 varied environment maps. The last image is illuminated by two point light sources randomly positioned on a surrounding shell. Our Arb-Objaverse dataset ends up with 5.7 million rendered RGB images along with their intrinsic components. For training, we further enhance the variability by combining this dataset with G-Objaverse and ABO. Fig. 3 offers a visualization and comparison among these datasets. + +![](images/1e2caddebbddfdd5f9b086643188cecf5493c310ccb2c4729a65ee95f4bc02fc.jpg) +Figure 3: Overview of the Arb-Objaverse dataset. Our custom dataset features a diverse collection of objects rendered under various lighting conditions, accompanied by their intrinsic components. + +# 3.3 ARCHITECTURE AND TRAINING + +Given an arbitrary number of views from single to multi-view images, IDArb generates multi-view consistent intrinsic maps under unconstrained illumination using a text-guided diffusion model. We base our model on the pre-trained Stable Diffusion (SD) (Rombach et al., 2021) model to capitalize on its robust prior knowledge from RGB domain. Different from the 3-channel RGB images, intrinsic components possess higher channel dimensions and cannot be directly processed by original SD model. To repurpose the VAE in original SD for new intrinsic modalities, we divide intrinsic components $\mathbf{X}$ into three triplets: albedo $\mathbf{A}$ , normal $\mathbf{N}$ and $\mathbf{B} = [\mathbf{M},\mathbf{R},\mathbf{0}]$ , where $\mathbf{M}$ is metallic, $\mathbf{R}$ is roughness and $\mathbf{0}$ is left unused. Each triplet latent is channel-concatenated with the Gaussian noise for denoising. Specific text prompts for each triplet, i.e., 'albedo', 'normal', 'metallic&roughness', are devised to indicate denoising targets. + +Cross-view Cross-component Attention. In real-world scenarios, users may capture multiple images of an object, making it essential for the model to handle an arbitrary number of input views and ensure consistent results across all views. It is also crucial for 3D reconstruction to have these consistent decomposition results as material guidance. To address this, we propose cross-view attention module within the original attention block of UNet. As shown in Fig. 2, we concatenate input features from each view, enabling the attention operation to be performed across views. This allows the model to leverage multi-view information to reduce ambiguity and enforce consistency across different viewpoints. + +The reflected color results from the interplay between incident light, material properties, and the surface shape. For instance, a convex shape with a dark color increases the likelihood of a dark albedo. To better capture these relationships, we propose to model the joint distribution of intrinsic components rather than predicting them separately. Inspired by Wonder3D (Long et al., 2023) and GeoWizard (Fu et al., 2024), we adopt cross-component attention via repurposing the vanilla self-attention module to fuse global interactions between different intrinsic components. As demonstrated in Sec. 4.3, exchanging information between components effectively reduces decomposition uncertainty, especially for roughness and metallic. + +Illumination-Augmented and View-Adapted Training. Multi-view images captured in uncontrolled environments often experience varying lighting conditions, making it essential for algorithms to handle such differences effectively. To address this, we propose an illumination-robust data augmentation strategy, where multi-view images are sampled from various lighting conditions during training. These conditions include a range of setups, such as uniform ambient light, HDR environment maps, and point light sources. At each training step, given $N_v$ views and $N_i$ illumination variations for each instance in the dataset, we randomly sample $N$ images as input. This allows us to + +simulate complex input scenarios, including same-view-different-illumination, different-view-same-illumination, and different-view-different-illumination, thus enhancing the diversity of the training data. As a result, our model learns to distinguish different lighting conditions without the need for manually crafted modules, effectively leveraging photometric cues from multi-light captures to achieve robust intrinsic decomposition. It also shows superior generalization capability to handle unseen lighting conditions at inference time. + +However, training with fixed $N$ input images leads to downgraded performance when only one view is given (as shown in Sec. 4.3). We suppose that this may be because multi-view training guides the model to focus more on cross-view information to infer intrinsic information, while single-image decomposition requires the learning of general object material priors. To overcome this, we introduce a view-adapted training strategy, that swaps between multi-input and single-image settings. By incorporating this approach, our model gains robust generalization capability with an arbitrary number of input views. + +Noise Scheduler. The original SD model uses the scaled linear noise scheduler, which prioritizes generating high-frequency details and allocates fewer steps to low-frequency structures. However, this approach limits model's performance in intrinsic decomposition task, as the structure of intrinsic components, particularly metallic $\mathbf{M}$ and roughness $\mathbf{R}$ , differs significantly from input RGB images. Inspired by Shi et al. (2023), we shift the noise scheduler toward higher noise levels. As shown in Sec. 4.3, increasing the number of high-noise steps significantly improves the prediction of metallic and roughness components. + +# 4 EXPERIMENTS + +# 4.1 EXPERIMENTAL SETUP + +Implementation Details. We finetune the UNet from the pretrained Stable Diffusion with the zero terminal SNR schedule (Lin et al., 2024). We utilize the v-prediction as training objective and the AdamW optimizer with a learning rate of $1 \times 10^{-4}$ . The model is trained on downsampled $256 \times 256$ resolution over 80,000 steps. During training, the number of input images $N$ is randomly set to 3 or 1 per object. The entire training procedure takes approximately 4 days on a cluster of 16 Nvidia Tesla A100 GPUs. + +Baselines. We compare our method with two recent diffusion-based approaches: IID (Kocsis et al., 2024) and $\mathrm{RGB}\leftrightarrow \mathrm{X}$ (Zeng et al., 2024). Since $\mathrm{RGB}\leftrightarrow \mathrm{X}$ is not yet publicly available, we re-implemented it and trained the model on our training dataset. Additionally, we include IntrinsicAnything (Chen et al., 2024) for albedo comparison and GeoWizard (Fu et al., 2024) for normal comparison. We evaluate our model in two settings: (1) single-view setting, where each input image is processed independently, and (2) multi-view setting, where intrinsic components are jointly estimated from multiple views of each object. + +Metrics. For albedo evaluation, we use Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index Measure (SSIM) (Wang et al., 2004). Since albedo is defined up to a scale factor, we apply a scale-invariant PSNR metric by rescaling the predicted albedo as $A' = \mathrm{argmin}_{\alpha} ||A - \alpha \hat{A}||^2 \hat{A}$ . For surface normals, we measure Cosine Similarity. Mean Squared Error (MSE) is used to evaluate metallic and roughness components. + +Evaluation Dataset. We evaluate the effectiveness and generalization capability of our model on both synthetic and real-world datasets. For synthetic data, we sample 441 objects from Arb Objaverse and G-Objaverse, selecting four viewpoints for each object. For real-world data, we collect a set of images from Pixabay. All evaluations are conducted at a resolution of $512 \times 512$ . + +# 4.2 EXPERIMENTAL RESULTS + +Results on Synthetic Data. We present quantitative results in Tab. 1, where our method consistently achieves the highest accuracy across all metrics. Fig. 4 displays a visual comparison of our method in single-view setting against baseline methods. + +![](images/ce268ee504252b5dae268fe3c8264530db95a5c652dd07a688f3ce9c99827320.jpg) +Input + +![](images/292bff748e2f7a51a1cb7ce407c7d817fa44b57f0d69ccaef796d4cace8af990.jpg) +IID +(a) Albedo estimation. Our method effectively removes highlights and shadows. + +![](images/df3c0605d66ce2853c778ce173a83d3e9a891c6991f7d67c0c2453adc6cf9b62.jpg) +RGB $\leftrightarrow X$ + +![](images/630dc1250e14fe8abe52db32bc66cc93ca95356543830a862bb68530f1cd19d4.jpg) +IntrinsicAnything + +![](images/b010412b7c371f34414939602ceb5053d640e11d3a5f2baccb1cfe8c5b51be3a.jpg) +Ours + +![](images/a4a2f6aa66e57d45b47b567d90ac3a05d31ecc0dddf11b820e6408df5d75323e.jpg) +GT + +![](images/d75374d7e95ad03f1dcd1ff3785253da7cb2ea5d77c8f5950c3f9ca0d11bd570.jpg) +Input +(b) Normal estimation. Our method gives shape geometry while correctly predicting flat surface. + +![](images/a45c92b3e45070694f06795a0d7fdee6390608496369426d63d99045f4b9c099.jpg) +RGB $\leftrightarrow X$ + +![](images/1acdda9a4a3cc33cc125d2f401da6d9119a76c5c13d0a49673786f69fef88b4d.jpg) +GeoWizard + +![](images/0e3378149011ef9855d7e785b3aba16b0b36c068309069f69ff155da8061fbbc.jpg) +Ours + +![](images/4b5f39d17327341ed14a8ad10f3c984d5892f1e9e6eec63c554cfbe6d8edae07.jpg) +GT + +![](images/7679172826c92f9c3c9a999350b4a83af10a2404508c6ed96ba36589a0f824c8.jpg) +Input +(c) Metallic estimation. Our method outperforms IID and $\mathrm{RGB}\leftrightarrow \mathrm{X}$ with plausible results free of interference from texture patterns and lighting. + +![](images/62b849fcb6699f87d48f5e9572674cd05ba903b6d7dd19207c67f0285134a0b3.jpg) +IID + +![](images/0b9d01663ac431ccc33d29294ca37e19432292fb39b3726c47ae5804a7f64b91.jpg) +RGB $\leftrightarrow$ X + +![](images/824cc0ce273e98c2b6ab2b052d875af670e02ac6706ac74d2bc1c9d43bf04175.jpg) +Ours + +![](images/d706c9f9afc71bbe9f05b757cb1e9356c81b784e846a4be2ea332bf7fcbccc2f.jpg) +GT + +![](images/3a22228a7fbc6279c9d44c22ed5cb667b4688a0d5e90769c3ed574e667fca92e.jpg) +Input +(d) Roughness estimation. Our method outperforms IID and $\mathrm{RGB}\leftrightarrow \mathrm{X}$ with plausible results free of interference from texture patterns and lighting. + +![](images/37c87aa998b3f693dd0bcf6843499001fb7cad543b7616943e9ccc647a52bc67.jpg) +IID + +![](images/66c59d1e6ca11a2680030a7d55f253f0b2df1469eeda83f1473273200f1898e9.jpg) +RGB<>X + +![](images/cd330d5a95799e2761292d5ac0975814ae82f873abb0488e334845432af9e5c0.jpg) +Ours + +![](images/15bb51a8e479ad88bb83cfd544cda358e187461893dc6327230c8ebdc1b9c4d7.jpg) +GT + +Figure 4: Qualitative comparison on synthetic data. IDArb demonstrates superior intrinsic estimation compared to all other methods. +Table 1: Quantitative evaluation of IDArb against baselines. IDArb consistently achieves the best results among all albedo, normal, metallic and roughness metrics. + +
AlbedoNormalMetallicRoughness
SSIM↑PSNR↑Cosine Similarity ↑MSE ↓MSE ↓
IID0.90127.35-0.1920.131
RGB↔X0.90228.090.8340.1620.347
IntrinsicAnything0.90128.17---
GeoWizard--0.871--
Ours(single)0.93532.790.9280.0370.058
Ours(multi)0.93733.620.9410.0160.033
+ +For albedo estimation (Fig. 4a), our method effectively removes highlights and shadows, whereas IID and $\mathrm{RGB} \leftrightarrow \mathrm{X}$ tend to retain lighting effects in the albedo, and IntrinsicAnything produces unrealistic results for metallic surfaces. In normal estimation (Fig. 4b), our method provides sharp and accurate geometry, while $\mathrm{RGB} \leftrightarrow \mathrm{X}$ suffers from interference of object textures, and GeoWizard shows blurred details since it evaluates a number of samples and takes their mean. For metallic and roughness estimation (Fig. 4c and Fig. 4d), our method delivers more plausible results, eliminating interference from texture patterns and lighting. Additionally, we observe that incorporating multiview inputs significantly enhances metallic and roughness predictions, as they provide additional information to resolve material ambiguities. + +Results on Real-world Data. We present qualitative results on real-world data in Fig. 5 and compare our method with IntrinsicAnything for albedo estimation. IntrinsicAnything predicts overly dark albedo for metallic objects and produces blurry details (such as the toy's mouth in the third row), + +![](images/02635bbd685c87e88e0fc9235efa71c3925e67868d919f17ad122645eef3cec1.jpg) + +![](images/83a00605bf4dab9ce49782be3112f33c9cc0f7059233ef1a6beca158dde0faec.jpg) +Figure 5: Qualitative comparison on real-world data. +Figure 6: Ablative studies on (a) cross-component attention and (b) training strategy. + +leading to a loss of fidelity. In contrast, our model generates accurate and convincing decompositions with preserved details. Despite being trained on synthetic data, IDArb generalizes well to real-world images. Additionally, we conduct experiments on standard benchmarks, MIT-Intrinsic (Grosse et al., 2009) and Stanford-ORB (Kuang et al., 2023), with results presented in Appendix. D. + +# 4.3 ANALYSIS AND ABLATIVE STUDY + +Ablation on Cross-component Attention. To assess the effect of cross-component attention, we also trained our model without cross-component attention mechanism for comparison. As shown in Fig. 6a, exchanging information between different intrinsic components helps reduce material ambiguity, particularly for metallic and roughness, which are prone to uncertainty. + +Ablation on Training Strategy. Fig. 6b shows ablative studies on multi-single view interleaved training strategy and the noise scheduler. Training exclusively on multi-view inputs leads to performance degradation for single-image inputs, as these two settings emphasize different capabilities of the model, as discussed in Sec. 3.3. Additionally, shifting noise scheduler towards high noise level helps the model better adapt to intrinsic domains. + +Analysis of Viewpoints and Lighting Effects. We analysis the effects of the number of viewpoints and lighting conditions on our custom dataset. We evaluate our model with 1, 2, 4, 8, and 12 viewpoints under 1, 2 and 3 lighting conditions. As shown in Fig. 7, increasing the number of viewpoints + +![](images/52bbe10fd529713cf78c97df69c6989b64d42dcaabbf80a7421daf2070b7c48b.jpg) +Figure 7: Effects of number of viewpoints and lighting conditions. We find increasing the number of viewpoints and the lighting conditions generally improves decomposition performance. + +![](images/d0a26d21dbb18ca610c43a66fa77ae31c100d90123c4f6ae298b4dc0e6a1bd2e.jpg) + +![](images/634d9d8ff603c302f1b4b9dba287002eaf2e44c2c8f52bf0e2f81b50a76d9e4b.jpg) + +![](images/d5a7e85d1565db0dc863a5b12ac72d42730fcec25339bb3cb011da47deeebdd7.jpg) + +Table 2: Quantitative results for photometric stereo on NeRFactor. We evaluate performance using 2, 4, and 8 OLAT images, and achieve the best performance among all compared methods. + +
# OLAT Images Methods248
Albedo↑Normal↑Albedo↑Normal↑Albedo↑Normal↑
IID22.23-22.40-22.86-
RGB ↔X21.290.7122.080.7723.290.81
SDM-UniPS22.950.7423.200.7623.370.81
Ours23.500.8323.640.8425.150.85
+ +or lights generally improves prediction accuracy. For metallic and roughness predictions, multi-light captures are particularly effective in disentangling these components from lighting effects. Empirically, performance gains from adding more viewpoints diminish beyond eight viewpoints. Further details are provided in Appendix. B. + +More Results. Additional multi-view input results are provided in Appendix. E and supplementary video. For more real-world data results, please refer to Appendix. D. + +# 4.4 APPLICATIONS + +IDArb offers valuable intrinsic priors for various downstream applications. Here, we demonstrate the model's ability in handling single-image relighting and material editing, and photometric stereo problems. Additionally, we show that our generated intrinsic decompositions enhance the results of optimization-based inverse rendering. + +Single-image Relighting and Material Editing. Once high-quality intrinsic components are obtained, our method enables relighting of captured images under novel illumination. Additionally, we can optimize the lighting in the original scene and perform material editing. Specifically, we represent environment lighting as a cube map and adopt a differentiable split-sum approximation in NVDiffRec (Munkberg et al., 2022) to optimize its parameters. Fig. 8 showcases our relighting and material editing results. + +![](images/84aa4cda2d94fe1c16ee92820d1b3a938777fa52ec0fc95d8e13c6bc0ced2421.jpg) +(a) Captured real data + +![](images/2f219e9dc4c246e6899866c00555f203ae4b9d051bacd2a731cad57d79e2b21a.jpg) +(b) Relighting +Figure 8: Relighting and material editing results. From in-the-wild captures (a), our model allows for relighting under novel illumination (b) and material property modifications (c). + +![](images/febb0dc11e393700be9bdb81395bbdcbc44fe9fb809d53216108c75e3e237108.jpg) +(c) Material editing + +Photometric stereo. Photometric stereo is a long-standing challenge in computer vision, aiming to deducing the surface normal and albedo from images captured under varying lighting conditions with a fixed camera. We evaluate our method under the harsh One-Light-At-a-Time (OLAT) condition, where each image is illuminated by a single point light source without ambient illumination, leading to hard cast shadows. We additionally include SDM-UniPS (Ikehata, 2023) for comparison, which is specifically designed and trained for this task. We conduct experiments on the real-world OpenIllumination dataset (Liu et al., 2024a) and the synthetic NeRFactor dataset (Zhang et al., + +![](images/b0ba833dcb0f529b2e3c827b3ffb580e03417c9f55ea04da76ac822dbe0b1c06.jpg) +Figure 9: Optimization-based inverse rendering results. Our method guides NVDiffecMC generate more plausible material results. + +Table 3: Ablation on IDArb pseudo labels for optimization-based inverse rendering on NeRFactor and Synthetic4Relight datasets. + +
NerfactorSynthetic4Relight
Albedo (raw)Albedo (scaled)RelightingAlbedo (raw)Albedo (scaled)RelightingRoughness
NVDiffRecMC17.8925.8822.6517.0329.6424.050.046
NVDiffRecMC w/ Ours20.9026.6127.2026.4230.7331.010.014
+ +2021b). Quantitative results on NeRFactor are summarized in Tab. 2, and qualitative results are present in Appendix. C. Although our model is not explicitly trained for this setting, it still delivers reasonable estimates, particularly when the number of input images is limited. + +**Optimization-based Inverse Rendering.** Our method can be used as a prior to enhance optimization-based inverse rendering techniques. Specifically, we decompose each training image into its corresponding intrinsic components and treat these components as pseudo-material labels. We adopt NVDiffRecMC (Hasselgren et al., 2022) as the codebase for our experiments, as it employs the same PBR material model as our method. During each iteration, we introduce an additional L2 regularization term between the intrinsic components predicted by NVDiffRecMC and those predicted by our method to ensure physical plausibility. Tab. 3 presents material estimation and relighting results on these dataset. As illustrated in Fig. 9, our method significantly mitigates the color-shifting issue in the reconstructed albedo from NVDiffRecMC, leading to improved results in relighting tasks. + +# 5 CONCLUSION + +In this paper, we present IDArb, that solves intrinsic decomposition via a feed-forward diffusion pipeline. Our method can process arbitrary images captured under unknown and varying illuminations and estimate consistent intrinsic components, including albedo, normal, metallic and roughness. The cross-component attention module and illumination-augmented training further enhance our model's ability to reduce ambiguity, fostering more robust inverse rendering under complex, high-contrast lighting conditions. + +Limitations and Discussions. While our method demonstrates strong generalization capabilities on real-world data, it faces challenges in accurately predicting material maps for intricate objects, such as corroded bronze statues with spatially varying metallic and roughness properties due to corrosion levels. Given that most synthetic data employ global metallic and roughness values, our method may oversimplify estimations for complex real-world objects. Future research directions could involve incorporating real data through unsupervised techniques. Moreover, the current implementation of cross-view attention concatenates all input views, leading to a complexity of $O(N^2)$ and posing difficulties in handling dense input views with high resolutions. Future investigations could explore more efficient cross-view attention mechanism. Further discussion on failure cases can be found in Appendix F. + +# ACKNOWLEDGEMENT + +This project is funded in part by Shanghai Artificial Intelligence Laboratory, the National Key R&D Program of China (2022ZD0160201), the Centre for Perceptual and Interactive Intelligence (CPII) Ltd under the Innovation and Technology Commission (ITC)'s InnoHK. Dahua Lin is a PI of CPII under the InnoHK. + +# REFERENCES + +Jonathan T. Barron and Jitendra Malik. Shape, illumination, and reflectance from shading, 2020. URL https://arxiv.org/abs/2010.03592. +Jonathan T. Barron, Ben Mildenhall, Dor Verbin, Pratul P. Srinivasan, and Peter Hedman. Mip-nerf 360: Unbounded anti-aliased neural radiance fields. CVPR, 2022. +Sai Bi, Zexiang Xu, Kalyan Sunkavalli, David Kriegman, and Ravi Ramamoorthi. Deep 3d capture: Geometry and reflectance from sparse multi-view images, 2020. URL https://arxiv.org/abs/2003.12642. +Mark Boss, Varun Jampani, Kihwan Kim, Hendrik P.A. Lensch, and Jan Kautz. Two-shot spatially-varying brdf and shape estimation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020. +Mark Boss, Raphael Braun, Varun Jampani, Jonathan T. Barron, Ce Liu, and Hendrik P. A. Lensch. Nerd: Neural reflectance decomposition from image collections. In ICCV, pp. 12664-12674. IEEE, 2021a. +Mark Boss, Varun Jampani, Raphael Braun, Ce Liu, Jonathan T. Barron, and Hendrik P. A. Lensch. Neural-pil: Neural pre-integrated lighting for reflectance decomposition. In NeurIPS, pp. 10691-10704, 2021b. +Brent Burley and Walt Disney Animation Studios. Physically-based shading at disney. In Acm Siggraph, volume 2012, pp. 1-7. vol. 2012, 2012. +Chris Careaga and Yaqiz Aksoy. Intrinsic image decomposition via ordinal shading. ACM Transactions on Graphics, 43(1):1-24, November 2023. ISSN 1557-7368. doi: 10.1145/3630750. URL http://dx.doi.org/10.1145/3630750. +Xi Chen, Sida Peng, Dongchen Yang, Yuan Liu, Bowen Pan, Chengfei Lv, and Xiaowei Zhou. Intrinsicanything: Learning diffusion priors for inverse rendering under unknown illumination, 2024. URL https://arxiv.org/abs/2404.11593. +Jasmine Collins, Shubham Goel, Kenan Deng, Achleshwar Luthra, Leon Xu, Erhan Gundogdu, Xi Zhang, Tomas F Yago Vicente, Thomas Dideriksen, Himanshu Arora, Matthieu Guillaumin, and Jitendra Malik. Abo: Dataset and benchmarks for real-world 3d object understanding. CVPR, 2022. +Matt Deitke, Dustin Schwenk, Jordi Salvador, Luca Weihs, Oscar Michel, Eli VanderBilt, Ludwig Schmidt, Kiana Ehsani, Aniruddha Kembhavi, and Ali Farhadi. Objverse: A universe of annotated 3d objects, 2022. URL https://arxiv.org/abs/2212.08051. +Xiao Fu, Wei Yin, Mu Hu, Kaixuan Wang, Yuexin Ma, Ping Tan, Shaojie Shen, Dahua Lin, and Xiaoxiao Long. Geowizard: Unleashing the diffusion priors for 3d geometry estimation from a single image. In ECCV, 2024. +Jian Gao, Chun Gu, Youtian Lin, Hao Zhu, Xun Cao, Li Zhang, and Yao Yao. Relightable 3d gaussian: Real-time point cloud relighting with brdf decomposition and ray tracing. arXiv:2311.16043, 2023. +Roger Grosse, Micah K Johnson, Edward H Adelson, and William T Freeman. Ground truth dataset and baseline evaluations for intrinsic image algorithms. In 2009 IEEE 12th International Conference on Computer Vision, pp. 2335-2342. IEEE, 2009. + +Jon Hasselgren, Nikolai Hofmann, and Jacob Munkberg. Shape, Light, and Material Decomposition from Images using Monte Carlo Rendering and Denoising. arXiv:2206.03380, 2022. +Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840-6851, 2020. +Satoshi Ikehata. Scalable, detailed and mask-free universal photometric stereo. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023. +Haian Jin, Isabella Liu, Peijia Xu, Xiaoshuai Zhang, Songfang Han, Sai Bi, Xiaowei Zhou, Zexiang Xu, and Hao Su. Tensoir: Tensorial inverse rendering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023. +James T Kajiya. The rendering equation. In Proceedings of the 13th annual conference on Computer graphics and interactive techniques, pp. 143-150, 1986. +Brian Karis and Epic Games. Real shading in unreal engine 4. Proc. Physically Based Shading Theory Practice, 4(3):1, 2013. +Bingxin Ke, Anton Obukhov, Shengyu Huang, Nando Metzger, Rodrigo Caye Daudt, and Konrad Schindler. Repurposing diffusion-based image generators for monocular depth estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024. +Bernhard Kerbl, Georgios Kopanas, Thomas Leimkuhler, and George Drettakis. 3d gaussian splatting for real-time radiance field rendering, 2023. URL https://arxiv.org/abs/2308.04079. +Peter Kocsis, Vincent Sitzmann, and Matthias Nießner. Intrinsic image diffusion for indoor single-view material estimation, 2024. URL https://arxiv.org/abs/2312.12274. +Xin Kong, Shikun Liu, Xiaoyang Lyu, Marwan Taher, Xiaojuan Qi, and Andrew J Davison. Eschernet: A generative model for scalable view synthesis. arXiv preprint arXiv:2402.03908, 2024. +Zhengfei Kuang, Kyle Olszewski, Mengei Chai, Zeng Huang, Panos Achlioptas, and Sergey Tulyakov. Neroic: neural rendering of objects from online image collections. ACM Trans. Graph., 41(4):56:1-56:12, 2022. +Zhengfei Kuang, Yunzhi Zhang, Hong-Xing Yu, Samir Agarwala, Elliott Wu, Jiajun Wu, et al. Stanford-orb: a real-world 3d object inverse rendering benchmark. 2023. +Zhengqin Li, Zexiang Xu, Ravi Ramamoorthi, Kalyan Sunkavalli, and Manmohan Chandraker. Learning to reconstruct shape and spatially-varying reflectance from a single image. In SIGGRAPH Asia 2018 Technical Papers, pp. 269. ACM, 2018. +Zhengqin Li, Mohammad Shafiei, Ravi Ramamoorthi, Kalyan Sunkavalli, and Manmohan Chandraker. Inverse rendering for complex indoor scenes: Shape, spatially-varying lighting and svbrdf from a single image, 2019. URL https://arxiv.org/abs/1905.02722. +Shanchuan Lin, Bingchen Liu, Jiashi Li, and Xiao Yang. Common diffusion noise schedules and sample steps are flawed, 2024. URL https://arxiv.org/abs/2305.08891. +Isabella Liu, Linghao Chen, Ziyang Fu, Liwen Wu, Haian Jin, Zhong Li, Chin Ming Ryan Wong, Yi Xu, Ravi Ramamoorthi, Zexiang Xu, and Hao Su. Openillumination: A multi-illumination dataset for inverse rendering evaluation on real objects, 2024a. +Ruoshi Liu, Rundi Wu, Basile Van Hoorick, Pavel Tokmakov, Sergey Zakharov, and Carl Vondrick. Zero-1-to-3: Zero-shot one image to 3d object, 2023. +Yuan Liu, Cheng Lin, Zijiao Zeng, Xiaoxiao Long, Lingjie Liu, Taku Komura, and Wenping Wang. Syncdreamer: Generating multiview-consistent images from a single-view image, 2024b. URL https://arxiv.org/abs/2309.03453. + +Xiaoxiao Long, Yuan-Chen Guo, Cheng Lin, Yuan Liu, Zhiyang Dou, Lingjie Liu, Yuexin Ma, Song-Hai Zhang, Marc Habermann, Christian Theobalt, et al. Wonder3d: Single image to 3d using cross-domain diffusion. arXiv preprint arXiv:2310.15008, 2023. +Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020. +Jacob Munkberg, Jon Hasselgren, Tianchang Shen, Jun Gao, Wenzheng Chen, Alex Evans, Thomas Müller, and Sanja Fidler. Extracting Triangular 3D Models, Materials, and Lighting From Images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8280-8290, June 2022. +Fred E Nicodemus. Directional reflectance and emissivity of an opaque surface. Applied optics, 4 (7):767-775, 1965. +Lingteng Qiu, Guanying Chen, Xiaodong Gu, Qi Zuo, Mutian Xu, Yushuang Wu, Weihao Yuan, Zilong Dong, Liefeng Bo, and Xiaoguang Han. Richdreamer: A generalizable normal-depth diffusion model for detail richness in text-to-3d. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9914–9925, 2024. +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models, 2021. +Shen Sang and M. Chandraker. Single-shot neural relighting and svbrdf estimation. In ECCV, 2020. +Jian Shi, Yue Dong, Hao Su, and Stella X. Yu. Learning non-lambertian object intrinsics across shapenet categories, 2016. URL https://arxiv.org/abs/1612.08510. +Ruoxi Shi, Hansheng Chen, Zhuoyang Zhang, Minghua Liu, Chao Xu, Xinyue Wei, Linghao Chen, Chong Zeng, and Hao Su. Zero123++: a single image to consistent multi-view diffusion base model, 2023. +Yawar Siddiqui, Tom Monnier, Filippos Kokkinos, Mahendra Kariya, Yanir Kleiman, Emilien Garreau, Oran Gafni, Natalia Neverova, Andrea Vedaldi, Roman Shapovalov, and David Novotny. Meta 3d assetgen: Text-to-mesh generation with high-quality geometry, texture, and pbr materials. arXiv, 2024. +Cheng Sun, Guangyan Cai, Zhengqin Li, Kai Yan, Cheng Zhang, Carl S. Marshall, Jia-Bin Huang, Shuang Zhao, and Zhao Dong. Neural-pbir reconstruction of shape, material, and illumination. In ICCV, pp. 18000-18010. IEEE, 2023. +Peng Wang, Lingjie Liu, Yuan Liu, Christian Theobalt, Taku Komura, and Wenping Wang. Neus: Learning neural implicit surfaces by volume rendering for multi-view reconstruction. arXiv preprint arXiv:2106.10689, 2021. +Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600-612, 2004. +Felix Wimbauer, Shangzhe Wu, and Christian Rupprecht. De-rendering 3d objects in the wild, 2022. URL https://arxiv.org/abs/2201.02279. +Shangzhe Wu, Ameesh Makadia, Jiajun Wu, Noah Snavely, Richard Tucker, and Angjoo Kanazawa. De-rendering the world's revolutionary artefacts, 2021. URL https://arxiv.org/abs/2104.03954. +Tong Wu, Jiaqi Wang, Xingang Pan, Xudong Xu, Christian Theobalt, Ziwei Liu, and Dahua Lin. Voxurf: Voxel-based efficient and accurate neural surface reconstruction, 2023. URL https://arxiv.org/abs/2208.12697. +Chongjie Ye, Lingteng Qiu, Xiaodong Gu, Qi Zuo, Yushuang Wu, Zilong Dong, Liefeng Bo, Yuliang Xiu, and Xiaoguang Han. Stablenormal: Reducing diffusion variance for stable and sharp normal. ACM Transactions on Graphics (TOG), 2024. + +Weicai Ye, Shuo Chen, Chong Bao, Hujun Bao, Marc Pollefeys, Zhaopeng Cui, and Guofeng Zhang. IntrinsicNeRF: Learning Intrinsic Neural Radiance Fields for Editable Novel View Synthesis. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023. +Renjiao Yi, Chenyang Zhu, and Kai Xu. Weakly-supervised single-view image relighting, 2023. URL https://arxiv.org/abs/2303.13852. +Zheng Zeng, Valentin Deschaintre, Iliyan Georgiev, Yannick Hold-Geoffroy, Yiwei Hu, Fujun Luan, Ling-Qi Yan, and Miloš Hašan. RGB $\leftrightarrow$ X: Image decomposition and synthesis using material-and lighting-aware diffusion models. arXiv preprint arXiv:2405.00666, 2024. +Kai Zhang, Fujun Luan, Qianqian Wang, Kavita Bala, and Noah Snavely. Physg: Inverse rendering with spherical gaussians for physics-based material editing and relighting. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5453-5462, 2021a. +Kai Zhang, Fujun Luan, Zhengqi Li, and Noah Snavely. Iron: Inverse rendering by optimizing neural sdfs and materials from photometric images. In IEEE Conf. Comput. Vis. Pattern Recog., 2022a. +Longwen Zhang, Ziyu Wang, Qixuan Zhang, Qiwei Qiu, Anqi Pang, Haoran Jiang, Wei Yang, Lan Xu, and Jingyi Yu. Clay: A controllable large-scale generative model for creating high-quality 3d assets, 2024. URL https://arxiv.org/abs/2406.13897. +Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. Adding conditional control to text-to-image diffusion models, 2023. +Xiuming Zhang, Pratul P. Srinivasan, Boyang Deng, Paul Debevec, William T. Freeman, and Jonathan T. Barron. Nerfactor: neural factorization of shape and reflectance under an unknown illumination. ACM Transactions on Graphics, 40(6):1-18, December 2021b. ISSN 1557-7368. doi: 10.1145/3478513.3480496. URL http://dx.doi.org/10.1145/3478513.3480496. +Yuanqing Zhang, Jiaming Sun, Xingyi He, Huan Fu, Rongfei Jia, and Xiaowei Zhou. Modeling indirect illumination for inverse rendering. In CVPR, 2022b. +Rui Zhu, Zhengqin Li, Janarbek Matai, Fatih Porikli, and Manmohan Chandraker. Irisformer: Dense vision transformers for single-image inverse rendering in indoor scenes, 2022. URL https://arxiv.org/abs/2206.08423. + +# A PRELIMINARY + +# A.1 IMAGE DIFFUSION MODEL + +In Denoising Diffusion Probabilistic Models (DDPM) (Ho et al., 2020), a forward diffusion process is defined, gradually introducing small amounts of Gaussian noise to the sample at each timestep, represented by $q(\mathbf{x}_t|\mathbf{x}_{t - 1}) = \mathcal{N}(\mathbf{x}_t;\sqrt{1 - \beta_t}\mathbf{x}_{t - 1},\beta_t\mathbf{I})$ , where $t$ represents the timestep and $\beta$ acts as the variance scheduler. To recover samples from the random noise, DDPM learns to model the reverse diffusion process as $p_{\theta}(\mathbf{x}_{t - 1}|\mathbf{x}_t) = \mathcal{N}(\mathbf{x}_{t - 1};\mu_\theta (\mathbf{x},t),\Sigma_\theta (\mathbf{x}_t,t))$ and construct $\mathbf{x}_0$ through iterative denoising. + +Stable Diffusion (SD) (Rombach et al., 2021) employ an encoder $\mathcal{E}$ to compress the input image $\mathbf{x} \in \mathbb{R}^{H \times W \times 3}$ into a latent vector $\mathbf{z} \in \mathbb{R}^{H/8 \times W/8 \times 4}$ before performing the diffusion process in the latent space. Following denoising, the latent representation is then converted back to pixel space through a decoder $\hat{x} = \mathcal{D}(\mathbf{z}_0)$ . + +For conditional generation, the training objective of Stable Diffusion (SD) is formulated as: + +$$ +L := \mathbb {E} _ {\mathcal {E} (\mathbf {x}), y, \epsilon \sim \mathcal {N} (0, 1), t} [ \| \epsilon - \epsilon_ {\theta} (\mathbf {z} _ {t}, t, \tau_ {\theta} (y)) \| _ {2} ^ {2} ], \tag {2} +$$ + +where $t$ is uniformly sampled from $\{1,\dots,T\}$ , $\tau_{\theta}(y)$ represents the encoding of the condition $y$ and $\epsilon_{\theta}$ is implemented as a UNet. + +# A.2 INTRINSIC COMPONENTS FORMATION + +Our image formation is based on the classic rendering equation (Kajiya, 1986) to ensure physical correctness. For a point $\mathbf{x}$ with surface normal $\mathbf{n}$ , the incident light intensity at this point is denoted as $L_{i}(\omega_{i};x)$ , where $\omega_{i}$ represents the incident light direction. The Bidirectional Reflectance Distribution Function (BRDF) (Nicodemus, 1965), denoted as $f_{r}(\omega_{o},\omega_{i};x)$ , describes the reflectance properties of the material when viewed from direction $\omega_{o}$ . The observed light intensity $L_{o}(\omega_{0};x)$ is calculated over the hemisphere $\Omega = \{\omega_{i}:\omega_{i}\cdot n > 0\}$ as follows: + +$$ +L _ {o} \left(\omega_ {o}; x\right) = \int_ {\Omega} L _ {i} \left(\omega_ {i}; x\right) f _ {r} \left(\omega_ {o}, \omega_ {i}; x\right) \left(\omega_ {i} \cdot n\right) d \omega_ {i}. \tag {3} +$$ + +In our approach, we aim to recover the object's surface normal and BRDF material from the observed color on the left-hand side of Eq. 3, which are independent of illumination and view direction. We adopt the Disney Basecolor-Metallic model (Burley & Studios, 2012) for BRDF parametrization, which comprises the following components: albedo, representing the base color; roughness, controlling the diffuse and specular response; and metallic, governing the specular reflection. + +Specifically, given a single RGB image $\mathbf{I} \in \mathbb{R}^{H \times W \times 3}$ , we aim to jointly estimate the surface normal $\mathbf{N} \in \mathbb{R}^{H \times W \times 3}$ , albedo $\mathbf{A} \in \mathbb{R}^{H \times W \times 3}$ , roughness $\mathbf{R} \in \mathbb{R}^{H \times W \times 1}$ and metallic $\mathbf{M} \in \mathbb{R}^{H \times W \times 1}$ . + +# B DETAILS ABOUT THE EFFECTS OF VIEWPOINTS AND LIGHTING + +We present the numerical performance results across varying numbers of viewpoints (# V) and lighting conditions (# L), as shown in Tab. 4 to 7. + +Table 4: Albedo Performance $\uparrow$ across different numbers of viewpoints (# V) and lightings (# L). + +
#V +#L124812
129.1628.7230.1230.4930.77
229.9630.2630.9631.1331.26
330.2530.7331.1631.3331.40
+ +Table 6: Metallic Performance $\downarrow$ across different numbers of viewpoints (# V) and lightings (# L). + +
#V +#L124812
10.1050.1160.0680.0590.050
20.0610.0680.0470.0440.042
30.0610.0560.0480.0450.040
+ +Table 5: Normal Performance $\uparrow$ across different numbers of viewpoints (# V) and lightings (# L). + +
#V +#L124812
10.9090.9100.9250.9300.932
20.9220.9270.9300.9330.934
30.9260.9310.9310.9340.935
+ +Table 7: Roughness Performance $\downarrow$ across different numbers of viewpoints (# V) and lightings (# L). + +
#V +#L124812
10.0490.0500.0240.0190.021
20.0430.0260.0190.0160.015
30.0310.0220.0160.0140.013
+ +# C ADDITIONAL RESULTS ON PHOTOMETRIC STEREO + +We present qualitative results of photometric stereo in Fig. 10. + +# D ADDITIONAL RESULTS ON REAL-WORLD DATA + +We evaluate our method on two real-world benchmarks: MIT-Intrinsic (Grosse et al., 2009) and Stanford-ORB (Kuang et al., 2023). For MIT-Intrinsic, we compared our albedo estimation results with IntrinsicAnything (Chen et al., 2024), as shown in Tab. 8 and Fig. 11. For Stanford-ORB, we presented results for normal estimation, albedo estimation, and re-rendering, comparing our method with StableNormal (Ye et al., 2024) and IntrinsicNeRF (Ye et al., 2023), as shown in Tab. 9. For the re-rendering evaluation, we utilized the ground truth environment maps to render our decomposition results and compared them with the original images. + +Additionally, we present qualitative results on real-world data from the Internet in Fig. 12 and Fig. 13. + +![](images/7de6708e323584f8384ab7dd810309c8b642917f58403ef230aaf21173bdca2c.jpg) +Figure 10: Photometric stereo results using 4 OLAT images in OpenIllumination and NeRFactor. + +Table 8: Quantitative comparisons on MIT-Intrinsic. + +
SSIM↑PSNR↑LPIPS↓
Ours0.87627.980.117
IntrinsicAnything0.89625.660.150
+ +Table 9: Quantitative comparisons on Stanford-ORB. + +
NormalAlbedoRe-rendering
Cosine Distance↓SSIM↑PSNR↑LPIPS ↓PSNR-H↑PSNR-L↑SSIM↑LPIPS ↓
Ours(single)0.0410.97841.300.03924.1131.280.9690.024
Ours(multi)0.0290.97841.460.03824.3631.430.9700.024
StableNormal0.038
IntrinsicNeRF0.98139.310.048
+ +# E ADDITIONAL RESULTS ON MULTI-VIEW INPUTS + +We present additional results on multi-view input in Fig. 14. + +# F FAILURE CASES + +Several failure cases are illustrated in Fig. 16. First, our model struggles with outdoor scenes, as it is primarily trained on object-centric data. While the model exhibits some generalization capability, its performance degrades in these scenarios. Second, when the model is faced with text, the decomposition fails to recover the correct text structures. Finally, in the third row, the model produces overly simplified outputs in certain cases, failing to preserve subtle material details, such as the metallic + +![](images/a8de05f083dc3e590d82f1e38a614ede5ee8c094cdc8b888e23e9ef2a3ea4f2e.jpg) +Figure 11: Qualitative comparison on MIT-Intrinsic (Grosse et al., 2009) with IntrinsicAnything (Chen et al., 2024). Input image and ground truth have been contrast-adjusted for better visibility. + +features of a telephone. This issue arises from the synthetic training data, which often contains simpler material variations, leading the model to overly simplify fine-grained material properties. + +# G GENERALIZATION TO SCENE-LEVEL DATA + +Despite not being explicitly trained on such datasets, our model demonstrates generalization ability in outdoor and indoor scenes. We provide qualitative results in Fig. 17, Fig. 18 and Fig. 19. + +![](images/5a475e966c4836b68be76b0662967e53c590153da8089c6c6a8d917d60a0bcf0.jpg) +Figure 12: More results on real-world data. + +![](images/f52adbe04eb961b4dacc62cde1e0b4880a8939760247452395576a3b541305ab.jpg) +Input Image + +![](images/519b16985708eb4e9aa23e846c7077546e1f8382d7ac9c0674a8bd850b292589.jpg) +Albedo +Recon + +![](images/5cb387edf75490d714e3c5ee199b076793eb1b3439ee13442511f26e949cc54c.jpg) +Normal + +![](images/e00dfc4cc30013a90ee6df2b38972c596443b03c346b0b382d522dc2ec9dd45a.jpg) +Relit 1 + +![](images/30c82506efd00286701bd99745bd2caba1a71adc28944c30e8ac51376fa45275.jpg) +Metallic + +![](images/e009bbaa9dea21d369361fbb5c854b8c044858e150bcecd5c0439077c16d3469.jpg) +Relit 2 + +![](images/63998d93d3ea33f2750ee368ed50faed05349af6ec79e1ea61f47dd5c86e9d0a.jpg) +Roughness + +![](images/5b088568940ac512f57efd8386d4b719b27bcef52e2193bac0ffe62491bc2a0a.jpg) +Relit 3 + +![](images/586b505780eb16f8161998dea0a7a3c4569e57990e8f39b161acc88101ae4737.jpg) + +![](images/cbe44c744f940bdecbfe7f8f8c41fe5683a508cf273ff7760b073f5c289c7a7f.jpg) +Recon + +![](images/8ba5e407681fa18423ec6588b559d763030b6787aeb7c362e11fff4d9ce192f7.jpg) + +![](images/20f1d2aba928dcee74876b5af299e742b3c2c42581e34978ee5fbaf2ee9873b1.jpg) +Relit 1 + +![](images/d9940958c2d983c82713cbbf07cb415a314f28b9fcd0dde864911cb4e8915d26.jpg) + +![](images/a88c6e3e668c582f8a582fe91063ec530f3e5b57e5a4c38265404682ff02f175.jpg) +Relit 2 + +![](images/e9b928e7d62fa4999a15cfe379347a0f2ecaf2215ecdd7a48e8c834992e24943.jpg) + +![](images/66436789601a1ecbe5a033eba15b04cfa23d73ead9234ae1b7976eee89eb3467.jpg) +Relit 3 + +![](images/a98f57236ba93bc7a0e40b00f617a54cec2bb4b841ab64ba82c727634995f992.jpg) + +![](images/e29cda7de4fa94cca861dceebca9830940c67618804a6d48cd4d58688c94d0b4.jpg) +Recon + +![](images/c22b63cddf6b0d5ea707f9bb6eebd9708669ffb9b1fb7444fd2c37faad11f86d.jpg) + +![](images/037b237bcfc2d0c8b89575a30e23ee3d794922df75b60462b2a3e16ef320dfef.jpg) +Relit 1 + +![](images/e1609d7c266e2ece4b82cb08acc1061a015ed6b332e06517423de9a7924db9e5.jpg) + +![](images/7601789d90a57d0d2803533419a3531081fa7a419f3cea873894fddf1e9541f5.jpg) +Relit 2 + +![](images/fadb6a8e7ac2154c66f013df57219cade306e47ebb303e6e23cc73740d98fc47.jpg) + +![](images/073db89717e73b74b8564164eb2e80324ceca2db22e6f60d31904d029728d7bd.jpg) +Relit 3 + +![](images/386522591d4e982ec636c343ae420162a81268c31f0eb8e15a5fe8fa10be83dd.jpg) + +![](images/6867f249e556fd7c1368e46977d71bf3930154ac6c4b1277df433034c507650a.jpg) +Recon + +![](images/b6a53bc4bef453a1e650b93718f4eebceec54340c48a9b643eeb12f5381966b0.jpg) +Relit 1 + +![](images/bc89089e3ccfeaa0d9f719dc9c4d8ca08dcd1f0e6853522328205cf7baecbb86.jpg) +Relit 2 + +![](images/de188fcd2ad7bf567cac694b5200faa0987ad3ae79b33d58d50e3732afd79328.jpg) +Relit 3 + +![](images/fcab538866ab7e2f0d4e7737893f4912f851af7d0d2926c117c874cfd8181178.jpg) + +![](images/aa47bf9351a6c3ae34569065aaab0f1e0669edcbb5303495332545fc2db08bfc.jpg) + +![](images/72d3fd577c1717c73c50a63381ef64ef55052a4fddfc6b64f827a416c9097c90.jpg) +Figure 13: More results on real-world data. We also provide the reconstructed and relighting images. + +![](images/314f21e3e632c346b15868e005b001a8286183b2ed42570dd99191d90f67004f.jpg) + +![](images/58ad053045dde4fd1172ac0b72b096eba11a192ed678ab34ce771519f7fefc2d.jpg) +Figure 14: More results on multi-view data. + +![](images/01e9252e2b8f48db92c39ddc6b17b3a6fd73ff0b349c75e93d634ea8dbca54b3.jpg) +Figure 15: Multiview images with extreme lighting variation. For each scene in NeRD dataset (Boss et al., 2021a), we input 4 views. + +![](images/6bae5cf1f695915f5be1b7125f3639e5ede721044e03a9611f1530d16321c869.jpg) +Figure 16: Failure cases. + +![](images/3b5bce92ef94a9ec0d40ee9965093c8fad327c74db76fc632fda1eb63d8714d2.jpg) +Figure 17: Results on Mip-NeRF 360 (Barron et al., 2022) (Part 1, outdoor). We input 4 views for each scene. + +![](images/f1497a48053670eff63f81903644f8a4d121442340633d5ed0837ca9da69d217.jpg) +Figure 18: Results on Mip-NeRF 360 (Barron et al., 2022) (Part 2, indoor). We input 4 views for each scene. + +![](images/3c7cca1f3e9363f44721cf6bdaef9f4f15895150c50840c24748bd6d1cf40dc0.jpg) +Figure 19: Results on indoor and outdoor scenes. Input images are collected from the Internet. \ No newline at end of file diff --git a/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/images.zip b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bde1fb7e07c428a7748b245db12468ad1a7bdc1e --- /dev/null +++ b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc816e36bc8372a9b889b1f7131c15c57462553f2b6c8977842fc113b1b14054 +size 2475112 diff --git a/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/layout.json b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d0545d9ac27a4d42e79da40a1d65e69f233f4a7e --- /dev/null +++ b/ICLR/2025/IDArb_ Intrinsic Decomposition for Arbitrary Number of Input Views and Illuminations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df84f24dbd4277bc0fb487f5b1502c46799b9e608148c19a03e10ea8254b52fb +size 649373 diff --git a/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_content_list.json b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..18d3749a7afc55a493b490c25a0ebd992b1074f8 --- /dev/null +++ b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:776b9580cbdabc0b61c1e8e87704686c640f5f81160ac1e72fa1feaea23fe23c +size 182230 diff --git a/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_model.json b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..57418aee1ef0e52e0c1abf902e6fc3c7440d760f --- /dev/null +++ b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bdf59785d62a9e59a79232893f1b433c988b51078cd023cfd1f20fd21d6bd3cf +size 220359 diff --git a/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_origin.pdf b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..40495acc84af47c676fbf4f426c07b3d56750b69 --- /dev/null +++ b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/2055dfb8-c11c-443a-8cb1-89052c1d6a2a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30840995ebd42d4063f73d1773925c9db1529256c39c6c87a0253eb38d721652 +size 2878074 diff --git a/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/full.md b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/full.md new file mode 100644 index 0000000000000000000000000000000000000000..77dbc60a84489a68e3af93c0a85b8011ba6bbed8 --- /dev/null +++ b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/full.md @@ -0,0 +1,865 @@ +# IDINIT: A UNIVERSAL AND STABLE INITIALIZATION METHOD FOR NEURAL NETWORK TRAINING + +Yu Pan1 Chaozheng Wang2 Zekai Wu3 Qifan Wang4 Min Zhang5 Zenglin Xu6,7* + +$^{1}$ Huawei Noah's Ark Lab $^{2}$ The Chinese University of Hong Kong + +3The Hong Kong Polytechnic University 4MetaAI 5Harbin Institute of Technology, Shenzhen + +$^{6}$ Fudan University $^{7}$ Shanghai Academy of AI for Science + +iperryuu@gmail.com czwang23@cse.cuhk.edu.hk zenglin@gmail.com + +# ABSTRACT + +Deep neural networks have achieved remarkable accomplishments in practice. The success of these networks hinges on effective initialization methods, which are vital for ensuring stable and rapid convergence during training. Recently, initialization methods that maintain identity transition within layers have shown good efficiency in network training. These techniques (e.g., Fixup) set specific weights to zero to achieve identity control. However, settings of remaining weight (e.g., Fixup uses random values to initialize non-zero weights) will affect the inductive bias that is achieved only by a zero weight, which may be harmful to training. Addressing this concern, we introduce fully identical initialization (IDInit), a novel method that preserves identity in both the main and sub-stem layers of residual networks. IDInit employs a padded identity-like matrix to overcome rank constraints in non-square weight matrices. Furthermore, we show the convergence problem of an identity matrix can be solved by stochastic gradient descent. Additionally, we enhance the universality of IDInit by processing higher-order weights and addressing dead neuron problems. IDInit is a straightforward yet effective initialization method, with improved convergence, stability, and performance across various settings, including large-scale datasets and deep models. + +# 1 INTRODUCTION + +Deep neural networks have attracted significant attention due to their versatility in various applications (He et al., 2016; Li et al., 2021; Wang et al., 2023). Behind these successes, initialization methods play a crucial role in promoting stable and fast-convergent training processes for networks (Sutskever et al., 2013; Arpit et al., 2019; Pan et al., 2022; 2024). Usually, initialization methods make effects by controlling the magnitude of signals. For example, Xavier (Glorot & Bengio, 2010) initialization is originally proposed to maintain signals in the non-saturated region of the sigmoid activation function by restricting signal variances, which greatly solved the difficulty of training. Then, Poole et al. (2016) propose to initialize network weights by constraining signals on the edge of chaos through dynamical isometry, which can further benefit the network training. Later, Hardt & Ma (2017) analyzed the optimization landscape of linear residual networks, and found that weights that transit identity in layers can help networks converge fast as their F-norm is close to that of the final converged weights. And identity transition also corresponds to isometry theory (Zhang et al., 2019), thereby, contributing to avoiding gradient explosion and diffusion. + +An instance of preserving identity across neural network layers, known as "identity-control," is depicted in Figure 1 and formally expressed as $Y = X$ . This type of initialization can be implemented by setting specific weights (e.g., $W_{2}$ ) to $\mathbf{0}$ , thereby ensuring zero output in the sub-stem, as elucidated by Hardt & Ma (2017). This approach, however, poses challenges in configuring the remaining + +![](images/a8ddf190ff6e030acae28b7d7f870f40482dc6375364f410ab8f600109f9eb44.jpg) +Figure 1: A case of identity-control initialization, which sets $W_{2} = \mathbf{0}$ to satisfy $Y = X$ . + +![](images/a85b51765c7c17edb82b64e94cc2ec229c40b22df558a8874e4b04a161485a40.jpg) +Random + +![](images/f6f6bf53592e74eae3a9e561da35456f89c49a751bac88b1fd035901c2fe0cee.jpg) +Hadamard + +![](images/fca3e9c6598ba0f05c15d9e3526113fee203d7a994ffa587977dac880d0058d3.jpg) +Partial Identity + +![](images/1118451bd0d3447bb37c7f94d7cc2eaae4321d95979ed8ca17d206df8231744e.jpg) +IDInit +(a) Initialization methods. + +![](images/860240d9e06e008296651446f7b256dff53a26b4f97bad5e1983e6504ec0b311.jpg) +(b) Square Loss. +Figure 2: Analyzing effect of initializing $W_{1}$ while $W_{2} = 0$ . The experiment uses Cifar10 and blocks in Figure 1, and more details are in Appendix C.5. (a) The initialization methods for $W_{1}$ in a rectangular format. Fixup: "Random"; ZerO: "Hadamard". And "Partial Identity" and "IDInit" denote padding 0 and $I$ to an identity matrix, respectively. (b) Set $W_{1} \in \mathbb{R}^{240 \times 240}$ and $W_{2} \in \mathbb{R}^{240 \times 240}$ as square matrices. "Identity-1" represents a configuration where only one weight is initialized as 0. Interestingly, while "Random" and "Hadamard" methods may outperform "Identity-1" in initial training epochs due to more network weights, they are hard to capture the inductive bias of "Identity-1", resulting in convergence difficulties. In contrast, IDInit can effectively leverage the training dynamics associated with "Identity-1". (c) Set $W_{1} \in \mathbb{R}^{280 \times 240}$ and $W_{2} \in \mathbb{R}^{240 \times 280}$ as rectangle matrices. "Default" means $W_{1}$ and $W_{2}$ are initialized with Xavier. However, "Default" proves ineffective for training, as it conflicts with dynamical isometry. Furthermore, even though "Partial Identity" exhibits the capability to transmit partial signals, it performs poorly due to rank constraint issues. Finally, IDInit maintains well-training conditions by padding the identity matrix. + +![](images/552e8409b8397cbedd23ff9e95dac844778b0d1fb7a0d83a662649ac35fe5a39.jpg) +(c) Rectangle Loss. + +weight $W_{1}$ . Previous work such as Fixup (Zhang et al., 2019) and ZerO (Zhao et al., 2022) initialize $W_{1}$ using the Xavier and Hadamard methods, respectively. These initializations can adversely affect the inductive bias already established by setting $W_{2} = 0$ , a setting beneficial for training. As evidenced in Figure 2, both Xavier and Hadamard methods cause difficulties in achieving convergence. Observing this, we propose initializing $W_{1}$ with an identity matrix $I$ , which retains the inductive bias as $IW_{2} \equiv W_{2}$ . Moreover, $I$ also achieves dynamical isometry in the sub-stem layer as discussed by Zhao et al. (2022). Figure 2 demonstrates that using an identity matrix significantly aids in training convergence. Nonetheless, the practical application of an identity matrix faces two primary obstacles. First, an identity matrix requires square-shaped weights, a condition seldom met in practical networks. While a partial identity matrix (by padding $\mathbf{0}$ to an identity matrix) offers a workaround, it leads to rank constraints issues (Zhao et al., 2022) when the output dimension exceeds the input dimension, impairing network generalization. The second obstacle concerns the convergence capability. As Bartlett et al. (2019) pointed out, weights initialized with an identity matrix are difficult to converge to the ground truth, of which eigenvalues contain negative values. This convergence problem is important as it indicates a limited universality of applying an identity matrix as an initialization method. + +IDInit. In light of the preceding discussion, we aim to address these two major obstacles. To handle a non-square matrix, we pad a new identity matrix in adjacency to an identity matrix. We theoretically demonstrate this operation can resolve the rank constraint problem. Then, to alleviate the replica problem induced by this padding scheme, we impose a loosening condition on the padded identity-like matrix. Turning to the matter of convergence, we conduct an experiment to analyze it. Interestingly, we find that the convergence problem can be solved by adding a moment in an optimizer (e.g., the stochastic gradient descent optimizer), which is the most general setting for training neural networks. By introducing the identity-like matrix into the identity-control framework, we implement a fully identical initialization (IDInit), which ensures identity transition across both main and sub-stem layers. Moreover, we explore two additional techniques for improving the universality of IDInit and the identity-control framework: + +(1) Higher-order Weights: An identity matrix is a 2-D array and it is necessary to consider an efficient method to transfer the identity matrix to a higher-order weight (e.g., a 4-D convolution). A previous strategy is to keep identity along the channel (see Sec. 3.1.3). However, this causes diversity loss in channels, which is harmful to performance. To remedy this shortage, we keep identity in patches alternatively for more diversity in channels to achieve improvement. +(2) Dead Neurons: As an identity-control method, IDInit sets the last layer of the sub-stem to 0 for transiting identity in the main branch. However, a dead neuron problem is possibly caused by + +this setting, especially for residual convolutional networks (Zhang et al., 2019; Zhao et al., 2022). Addressing this, we select some elements to a small numerical value $\varepsilon$ to increase trainable neurons as in Figure 3. + +To our knowledge, IDInit is the first successful trial to maintain identity in both main- and sub-stems by breaking the rank constraints, which promise the expressive power of IDInit. Then, we address the replica problem by adding small noise while maintaining the dynamical isometry. By further proposing modifications to CNNs and solutions to dead neuron problems, we have significantly improved accuracy of classifying Cifar10 on ResNet-20 by $3.42\%$ and $5.89\%$ , respectively. (see Section 4.2). Note that, although the identity matrix is used as initialization in prior work, it was only used for square matrix, e.g., Le et al. (2015) set a hidden-to-hidden layer in a recurrent neural network with an identity matrix for better performance. IDInit is novel for the consideration of non-standard situations, e.g., non-square matrix. On ImageNet, compared to the default random initialization, IDInit demonstrates superior performance, achieving an average improvement of $0.55\%$ , and facilitates faster convergence across various settings, reducing the required training time by an average of 7.4 epochs. IDInit can accelerate the training procedure of BERT-Base, manifesting an $11.3\%$ reduction in computational cost. Therefore, our approach yields consistently significant advantages in the training of neural networks. + +# 2 RELATED WORK + +Consider an $L$ -layer residual network, each residual block of which consists of a residual connection and a residual stem that refers to the component excluding the residual connection. Assuming each residual stem contains two parameters, and the network's input signal is denoted as $x^{(0)}$ , the $i$ -th layer can be formulated as + +$$ +x ^ {(i + 1)} = a \left(I + \theta^ {(i, 0)} \theta^ {(i, 1)}\right) x ^ {(i)}, \tag {1} +$$ + +where $a(\cdot)$ denotes the activation function, $x^{(i)}$ means an input of $i$ -th residual block in a network, $I$ is an identity matrix denoting residual connection, and $\theta^{(i,0)}$ and $\theta^{(i,1)}$ are weights in the $i$ -th residual stem of a residual block. + +Dynamical Isometry. Assuming the signal magnitude (e.g., $\sigma^2(x^{(i)}))$ of each layer changing in a scale $\alpha$ , the last signal magnitude can reach $\alpha^L$ (e.g., $\sigma^2(x^{(L)}) = \alpha^L \sigma^2(x^{(0)})$ ), making it easy to cause signal explosion and diffusion, especially for large $L$ . To mitigate this issue, dynamic isometry provides an effective solution. Considering the input-output Jacobian which is defined as + +$$ +J _ {i o} = \frac {\partial x ^ {(L)}}{\partial x ^ {(0)}}, \tag {2} +$$ + +the dynamical isometry is achieved when all the singular values of $J_{io}$ are close to 1. Moreover, with the mean squared singular value of $J_{io}$ noted as $\chi$ , Pennington et al. (2017) and Bachlechner et al. (2021) show that $\chi > 1$ indicates that the model is in a chaotic phase, and back-propagated gradients will explode exponentially. By contrast, $\chi < 1$ means a model in an ordered manner that back-propagated gradients vanish exponentially. $\chi = 1$ is a critical line of initialization, avoiding gradient vanishing or exploding. The isometry can provide sufficient robustness for the network training (Gilboa et al., 2019; Poole et al., 2016; Yang & Schoenholz, 2017). + +Network Initialization. Common initialization methods are Xavier (Glorot & Bengio, 2010) and Kaiming initialization (He et al., 2015). Especially for residual networks efficiency, Hardt & Ma (2017) theoretically demonstrates that network training benefits from keeping identity. Le et al. (2015) set a hidden-to-hidden layer in a recurrent neural network with an identity matrix for better performance. Fixup (Zhang et al., 2019) and ZerO (Zhao et al., 2022) successfully initialize ResNets by setting residual stem to 0 (not residual connections) to guarantee the identity of signals. SkipInit (De & Smith, 2020) replaces Batch Normalization with a multiplier whose value is 0. ReZero (Bachlechner et al., 2021) directly adds extra parameters of value 0 to keep identity, leading to fast convergence. + +Identity-Control Training Framework. Net2Net (Chen et al., 2016) proposes to expand network depth by maintaining identity. DiracNet (Zagoruyko & Komodakis, 2017) maintains an identity + +![](images/c46a334db97bf1b94f046de98cf5c073763f19245cd4725aa484ff4a379ed8bd.jpg) +Figure 3: An overview of IDInit, which consists of identity-preserving initialization $\mathrm{IDI}_{\tau}$ and zero-preserving initialization $\mathrm{IDIZ}_{\varepsilon}$ , of which dimensions are denoted as $D^{\mathbf{I}}$ and $D^{\mathbf{0}}$ . $\tau$ and $\epsilon$ are usually set to 1 and 1e-6 to maintain identity and transit zero. $i$ and $i + 1$ mean two adjacent layer indices. + +for propagating information deeper into the network. However, it suffers from reducing residual connection, causing performance loss. ISONet (Qi et al., 2020) is an isometric learning framework that contains an identical initialization (i.e., the Dirac function that is also used in ZerO (Zhao et al., 2022) by padding 0 in a non-square matrix case), and isometric regulation in training. ISONet multiplies 0 to the residual stem like Fixup (Zhang et al., 2019). ISONet lacks the flexibility for various convolutions as it specifies the net without normalization, and requires SReLU. + +# 3 FULLY IDENTICAL INITIALIZATION + +The identity-control scheme serves as a practical initialization framework, with prior studies such as Fixup and ZerO demonstrating success within this paradigm. As depicted in Figure 3, IDInit achieves this scheme with two components: identity-preserving initialization and zero-preserving initialization, aimed at transferring identity and zero, respectively. We elaborate on the identity-preserving initialization, which involves padding identity matrices, in Section 3.1, and discuss the zero-preserving initialization, which addresses dead neurons, in Section 3.2. + +# 3.1 PRESERVING IDENTITY BY PADDING IDENTITY + +A standard identity matrix can naturally satisfy identity transition. However, in a non-square situation, this natural advantage is lost. To address this problem, we pad the identity matrix on an identity matrix to fit a non-square matrix. Specifically, for a fully-connected layer transformed from Eq. (1) as $x^{(i + 1)} = \theta^{(i)}x^{(i)}$ , we set the weight $\theta^{(i)}\in \mathbb{R}^{D_{i + 1}^{\mathbf{I}}\times D_i^{\mathbf{I}}}$ to + +$$ +\theta_ {m, j} ^ {(i)} = \left\{ \begin{array}{l l} \tau , & \text {i f} m \equiv j \pmod {D _ {i} ^ {\mathbf {I}}}, \\ 0, & \text {o t h e r w i s e .} \end{array} \right. \tag {3} +$$ + +The initialization formulated as Eq. (3) is termed as $\mathrm{IDI}_{\tau}$ , where IDI means the identical initialization function, and $\tau$ is calculated by considering the activation function, e.g., $\tau_{ReLU} = \sqrt{2}$ for the ReLU function. As shown in Figure 3, setting $\tau = 1$ can form $\mathrm{IDI}_1$ initialization. + +# 3.1.1 ANALYSIS ON CONVERGENCE ABILITY OF THE IDENTITY MATRIX + +As proposed by Bartlett et al. (2019), weights initialized with an identity matrix face difficulty in converging towards the target when its eigenvalues include negative values. This implies a potential constraint on the convergence efficacy of the IDInit method. Consequently, we will delve deeper into this issue in the following discussion. According to their study, when layers in a neural network are initialized using the identity matrix, all the weight matrices of layers will be symmetric at each step of the training process. This persistent symmetry leads to the weights of layers always being the same at any training step, causing the aforementioned convergence difficulty. Interestingly, we find that this problem is mainly caused by the gradient descent (GD) which uses all the data in one batch, and employing a stochastic gradient descent (SGD) of which data in different batches + +can be different, can effectively break the symmetry in gradients which facilitates convergence, and incorporating momentum can further accelerate the convergence process. + +To elaborate on this problem, we present a training case for a single-layer network expressed as $y = \theta x$ , where $x \in \mathbb{R}^d$ represents the input, $y \in \mathbb{R}^d$ denotes the output, and $\theta \in \mathbb{R}^{d \times d}$ is the weight matrix. The weight matrix $\theta$ is initialized to the identity matrix $I$ , denoted as $\theta^{(0)} = I$ . For our loss function, we employ the Mean Squared Error (MSE) and a learning rate denoted by $\eta$ . Consider two training pairs $\{x_1, y_1\}$ and $\{x_2, y_2\}$ sampled from the same dataset $\mathcal{D}$ . The network is initially trained with $\{x_1, y_1\}$ , and trained with $\{x_2, y_2\}$ in the next step. + +Being updated after two steps, the final gradient $\Delta \theta^{(1)}$ can be calculated as + +$$ +x _ {2} x _ {2} ^ {T} - \eta x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} + \eta y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} - y _ {2} x _ {2} ^ {T}. \tag {4} +$$ + +While $x_{2}x_{2}^{T}$ is symmetric, $x_{1}x_{1}^{T}x_{2}x_{2}^{T}$ , $y_{1}x_{1}^{T}x_{2}x_{2}^{T}$ , and $y_{2}x_{2}^{T}$ can be asymmetric. To quantify the magnitude of the asymmetry in $\Delta \theta^{(1)}$ , let $\Omega = -\eta x_{1}x_{1}^{T}x_{2}x_{2}^{T} + \eta y_{1}x_{1}^{T}x_{2}x_{2}^{T} - y_{2}x_{2}^{T}$ denote the asymmetric component. The magnitude of the asymmetry can be calculated as $\mathbb{E}(||\bar{\Omega} - \Omega^T||_F^2)$ . Assuming $x_{1}, x_{2}, y_{1}, y_{2} \in \mathbb{R}^{d}$ are random vectors with entries that are i.i.d. Gaussian random variables distributed as $N(0, \sigma^2)$ , the magnitude of the asymmetry is bounded as + +$$ +4 \eta^ {2} d ^ {3} \sigma^ {8} - 4 \eta^ {2} d ^ {2} \sigma^ {8} + 2 d ^ {2} \sigma^ {4} \leq \mathbb {E} \left(\left\| \Omega - \Omega^ {T} \right\| _ {F} ^ {2}\right) \leq 6 \eta^ {2} d ^ {3} \sigma^ {8} + 3 d ^ {2} \sigma^ {4}. \tag {5} +$$ + +As $\eta$ is usually $1e - 1$ , and both training pairs $\{x_{1},y_{1}\}$ and $\{x_{2},y_{2}\}$ can be generally normalized to $\mathcal{N} \sim (0,1)$ , thereby, the symmetry of the weight can be sufficiently influenced as + +$$ +\theta^ {(2)} = \theta^ {(1)} - \eta \Delta \theta^ {(1)}. \tag {6} +$$ + +When introducing a momentum $m^{(0)}$ initialized to $\Delta \theta^{(0)},\theta^{(2)}$ will be updated as + +$$ +m ^ {(1)} = \gamma m ^ {(0)} + \eta \Delta \theta^ {(1)}, +$$ + +$$ +\theta^ {(2)} = \theta^ {(1)} - m ^ {(1)} = \theta^ {(1)} - \gamma m ^ {(0)} - \eta \Delta \theta^ {(1)}, \tag {7} +$$ + +where $\gamma$ is the coefficient of $m$ . Therefore, momentum can promote the weight to become asymmetric by accumulating the asymmetry of gradients in steps and impact more when samples are increased. We show that SGD with momentum can effectively resolve the issue of layers being the same in networks initialized with the identity matrix during training, which facilitates the convergence process. The completed derivation is provided in Sec. A.2 of the appendix. + +As for networks of multiple layers, when their layers are asymmetric, each layer can be updated differently which breaks the convergence problem caused by the same gradients in each step (which is stated in Lemma 5 of Bartlett et al. (2019)). As illustrated in Figure 10 of the appendix, it is evident that layers trained using SGD are different from each other, with the momentum component amplifying the degree of this difference. + +# 3.1.2 ON RANK CONSTRAINT PROBLEM + +ZerO (Zhao et al., 2022) identifies that a dimension-increasing matrix may face a rank constraint problem if padding zero values. In this analysis, we investigate whether padding with an identity matrix results in this constraint. + +Rank Constraint Problem. Consider a 3-layer network with weights $\{\theta^{(i)}\}_{i = 0}^{2}$ , where $\theta^{(0)} \in \mathbb{R}^{D_h \times D_0}$ , $\theta^{(1)} \in \mathbb{R}^{D_h \times D_h}$ , $\theta^{(2)} \in \mathbb{R}^{D_L \times D_h}$ where $D_h > D_0, D_L$ . Given an input batch $x^{(0)} \in \mathbb{R}^{D_0 \times N}$ with a size $N$ , the formulation of the $i$ -th layer is $x^{(i + 1)} = \theta^{(i)} x^{(i)}$ , where $i \in [2]$ . Define residual component $\Delta \theta^{(1)} = \theta^{(1)} - I$ . When initializing the dimension-increasing + +![](images/d6233bb1e2436ae352a6657f8d23efbbc40d58d9e69f48484122919f492162e5.jpg) +Padding Zero (PZ) + +![](images/95a8f9f16351d77ac1ffcdcaab2bc6370e86302939fa6a12e8448381a3b4705e.jpg) +Padding Identity (PI) + +![](images/9adb4f79a0034f0c5185fd98097a795b279ff65452dae267731fce90758a19a0.jpg) +(a) Padding schemes. +(b) Rank plot. + +Figure 4: Two padding schemes and their influence on ranks of a layer. We trained a 3-layer network on MNIST, and set $D_0 = 768$ and $D_h = 2048$ . We plot $\mathrm{rank}(\Delta \theta^{(1)}) \in \mathbb{R}^{D_h \times D_h}$ in (b). As shown in (b), padding identity can achieve more than a rank of 768 like Hadamard, while padding zero is limited under 768. The loose condition can lead to better rank performance, however, cannot solve the rank constraint problem of padding zero. + +weight $\theta^{(0)}$ by padding zeros (PZ) values, the rank constraint problem refers to + +$$ +\operatorname {r a n k} \left(\Delta \theta^ {(1)}\right) \leq D _ {0}. \tag {8} +$$ + +This rank constraint issue signifies a performance limitation associated with the initialization method. Intriguingly, our findings indicate that the initialization method $\mathrm{IDI}_{\tau}$ successfully avoids this rank constraint, as detailed in Theorem 3.1. The proof is deferred to Appendix A.4. + +Theorem 3.1. If initializing all weights $\{\theta^{(i)}\}_{i = 0}^{2}$ by $\mathrm{IDI}_1$ , the rank of $\Delta \theta^{(1)}$ can attain + +$$ +\operatorname {r a n k} \left(\Delta \theta^ {(1)}\right) \geq D _ {0}, \tag {9} +$$ + +which breaks the rank constraint. + +Notably, Theorem 3.1 suggests that an IDInit initialized network can break this constraint through SGD without the help of non-linearity like ReLU which is mentioned as necessary in the prior study (Zhao et al., 2022). Specifically, when non-linearity like ReLU is not applied, the rank of the middle weight being limited to $D_0$ only happens at the beginning. After training for several steps, an IDInit-initialized network can break this constraint. + +Replica Problem. When recurrently padding the identity matrix, the output features are still replicated. According to Blumenfeld et al. (2020), such a replica problem can be solved by adding noise to weights. Inspired by that, we loosen the identity condition to generate $\tau \sim N(\tau, \epsilon_{\tau})$ , while keeping most identity. $\epsilon_{\tau}$ is a small value and set to 1e-6 in this paper. With this loose condition, IDInit can give additional noise to output features and bring more feature diversity. Profiting from the feature diversity, IDInit therefore can increase the rank values as shown in Figure 4(b). + +# 3.1.3 PATCH-MAINTAIN CONVOLUTION + +Convolution layers are important structures in deep neural networks. Here, we will explore an initialization pattern for convolution with the identity transition. A convolution kernel is usually defined as $\mathcal{C} \in \mathbb{R}^{k \times k \times c_{in} \times c_{out}}$ , where $c_{in}$ and $c_{out}$ denote the number of channels of input and output, respectively, and $k$ denotes convolutional kernel size. Similar to an identity matrix, Zhao et al. (2022) propose a channel-maintain convolution layer that transits identity by setting 0-filled $\mathcal{C}$ through $\mathrm{IDI}_{\tau}(\mathcal{C}_{n,n,::})$ , where $n \in \mathbb{N}^+$ and $k = 2n + 1$ . As a convolutional kernel window size, $k$ is usually an odd number. When $c_{in} = c_{out}$ , the convolution maintains the identity. When $c_{in} > c_{out}$ or $c_{in} < c_{out}$ , $\mathcal{C}$ will under-sample and over-sample on an input feature along channel respectively. Keeping identity is usually considered as an efficient way to improve model performance, however, we find that this setting can lead to a fatal performance degeneration (see Sec. 4.2). + +Patch-Maintain Convolution. Inspired by Han et al. (2020) that enhance model performance by increasing channel diversity, we propose to fuse spatial information by simply reshaping a matrix initialized with $\mathrm{IDI}_{\tau}$ . Specifically, we reshape the convolutional kernel $\mathcal{C}$ into a matrix $C \in \mathbb{R}^{c_{out} \times kkc_{in}}$ . We initialize $C$ as + +$$ +\mathrm {I D I} _ {\tau} (C). \tag {10} +$$ + +Then by reshaping $C$ into $\mathcal{C} \in \mathbb{R}^{k \times k \times c_{in} \times c_{out}}$ , our initialization for a convolution is completed. This reshaping strategy can shift spatial features, thereby increasing feature diversity. We utilize $\mathrm{IDIC}_{\tau}$ to denote such a reshaping process. A detailed description is in Figure 11 in the Appendix. + +# 3.2 PRESERVING ZERO BY TACKLING DEAD NEURONS + +Given a residual network formulated by Eq. (1), prior identity-control initialization (Zhang et al., 2019; Zhao et al., 2022) set the last transformation in the residual stem to 0, i.e., $\theta^{(i,0)} = 0$ , thereby maintaining an identity as + +$$ +x ^ {(i + 1)} = (I + 0) x ^ {(i)} = x ^ {(i)}. \tag {11} +$$ + +However, the setting can possibly cause dead neurons. + +Dead Neuron Problem. The dead neuron problem occurs when a neuron's weight becomes zero and receives zero gradients, rendering it incapable of updating. This issue is harmful to the training performance of models. Fixup (Zhang et al., 2019) only uses a multiplier of 1 after $\theta^{(i,0)} = 0$ , thereby obtaining non-zero gradients. However, in a realistic implementation of neural networks, the multiplier of Batch Normalization can be set to 0 (Goyal et al., 2017), and down-sampling operation + +can also cause 0 filled features $^{12}$ . Under the implementations, $\theta^{(i,0)}$ always acquires gradients with 0 values, known as the dead neuron problem, which causes failed weight updating. + +![](images/3b1d1ce98bfc83b5e8fc9e909de3dc524e440bed675f507d7256e5b1961a98f1.jpg) +(a) Weight initialized with numerical value 0. + +![](images/6e0bfdf60b5d1589c6a13c8efb91718c826b97893040d7389117a903b12e36cf.jpg) +(b) Weight initialized with $\mathrm{IDIZ}_{1e - 6}$ . +Figure 5: The last weight in a residual block of a trained ResNet. More than half of elements in (a) are not trained, which is known as the dead neuron. By contrast, $\mathrm{IDIZ}_{1e-6}$ successfully solves the dead neuron problem and makes all the elements in (b) trainable. + +Tackling this problem, we generate small values on $\theta^{(i,0)}$ to assist in training. Recall the goal of identity-control initialization that outputs 0. Therefore, we build a calculation to get the expectation and variance of outputs approaching 0. Considering two i.i.d variables, $v_{1}$ and $v_{2}$ , whose variances are $\sigma^2 (v_1) = \sigma^2 (v_2) = \varphi$ and means are $\mu (v_{1}) = \mu (v_{2}) = \gamma$ , the variable $v = \varepsilon (v1 - v2)$ have + +$$ +\left\{ \begin{array}{l} \mu (v) = 0, \\ \sigma^ {2} (v) = 2 \varphi \varepsilon^ {2}, \end{array} \right. \tag {12} +$$ + +where $\varepsilon$ is a coefficient, and $\sigma^2(v)$ will be limited to 0 when $\varepsilon$ is sufficiently small. Assuming elements of $x^{(i)}$ are i.i.d to each other, by applying subtraction on any two elements, the result has a mean of 0, and a variance related to $\varepsilon$ . We also take $\theta^{(i,0)} \in \mathbb{R}^{D_{i+1}^0 \times D_i^0}$ as an instance. At first, we initialize $\theta^{(i,0)}$ with $\mathrm{IDI}_{\varepsilon}$ . Then consider two cases: (i) if $D_{i+1}^0 < D_i^0$ , setting $\theta_{:,D_{i+1}^0 + 1:D_i^0}^{(i)}$ with $\mathrm{IDI}_{-\varepsilon}$ ; (ii) if $D_{i+1}^0 \geq D_i^0$ , set $\theta_{m,j}^{(i)} = -\varepsilon$ , when $m\% D_i^0 = j - 1$ . Therefore, we can obtain a variance of 0 by setting $\varepsilon$ to a small value. This method is termed as $\mathrm{IDIZ}_{\varepsilon}$ , and we illustrate some cases in Figure 3. In this paper, we set $\varepsilon = 1e - 6$ everywhere. As shown in Figure 5, $\mathrm{IDIZ}_{1e - 6}$ successfully initializes the last weight in a residual block. In addition, we also transform $\mathrm{IDIZ}_{\varepsilon}$ to a convolution form $\mathrm{IDIZC}_{\varepsilon}$ through the patch-maintain scheme. + +The IDInit framework is characterized as follows: (1) For Non-Residual Networks: It involves directly applying $\mathrm{IDI}\tau$ to fully-connected layers and $\mathrm{IDIC}\tau$ to convolutional layers. (2) For Residual Networks: This includes two steps: (i) Implementing $\mathrm{IDI}\tau$ and $\mathrm{IDIC}\tau$ across all fully-connected and convolutional layers, respectively; (ii) Utilizing $\mathrm{IDIZ}\varepsilon$ and $\mathrm{IDIZC}\varepsilon$ for fully-connected and convolutional layers positioned at the end of residual blocks, and for the final classification layer. + +# 4 EXPERIMENTS + +In this section, we first analyze hyperparameters in Sec. 4.1. Then, we implement an ablation experiment in Sec. 4.2 to show the effect of the proposed two modifications in Sec. 3. We conduct experiments on residual convolution in Sec. 4.3. And we conduct image classification on ImageNet in Sec. 4.4. Later we conduct a text classification experiment in Sec. 4.5. At last, we employ a pre-training experiment on the large-scale dataset in Sec. 4.6 separately. We conduct experiments on non-residual convolution in Sec. C.2. We also analyze the variance amplification in Sec. C.3, weight distribution in Sec. C.4, and dynamical isometry in Sec. C.5. + +# 4.1 EXPERIMENT FOR HYPERPARAMETERS + +In this experiment, we compare IDInit with Kaiming (He et al., 2015) by analyzing the training hyperparameters, i.e., the weight decay and the learning rate. We use Cifar10. The backbone is ResNet-32, we use SGD with a momentum of 0.9. The batch size is 1024. We train models for 200 epochs. The learning rate is reduced with a cosine function. Each setting is trained 3 times to calculate the standard deviation. More details and results are in Sec. B.1 of the appendix. + +Table 1: Results on Cifar10. ZerO performs worse for zero down-sampling as mentioned in Sec. 3.2. IDInit consistently facilitates rapid convergence when employed with SGD and Adam. + +
Initialization56 Layer (SGD/Adam)110 Layer (SGD/Adam)
Acc.Epochs to 80% Acc.Acc.Epochs to 80% Acc.
Zero γ92.32±0.19 / 87.37±0.4357±7 / 63±493.07±0.28 / 88.30±0.3136±2 / 56±7
ZerO90.57±0.31 / 83.53±0.4257±3 / 85±491.71±0.21 / 84.24±0.1055±3 / 76±2
Fixup93.24±0.82 / 89.50±0.1831±3 / 55±393.32±0.23 / 90.67±0.1233±3 / 49±2
SkipInit92.29±0.30 / 85.45±0.7426±1 / 81±392.67±0.16 / 87.18±0.9431±5 / 70±7
ReZero93.06±0.54 / 89.26±0.3033±2 / 44±394.03±0.26 / 90.25±0.2035±5 / 38±3
Kaiming93.36±0.14 / 87.55±0.3234±3 / 50±294.06±0.18 / 87.89±0.4133±4 / 56±3
IDInit93.41±0.10 / 90.01±0.3226±1 / 34±194.04±0.24 / 90.53±0.1027±1 / 36±2
+ +As shown in Figure 6, IDInit achieves a peak accuracy of $94.08\%$ with a weight decay of 1e-3 and a learning rate of 1e-1. In comparison to Kaiming, IDInit demonstrates superior stability, maintaining high accuracy even when the learning rate is reduced below 1e-1. Overall, IDInit consistently delivers robust performance while maintaining stability, making it a promising candidate for practical applications. + +# 4.2 ABLATION EXPERIMENT + +![](images/93318ca47e4c21c42f5e9c5d17635072efa378cea0bcd43df9b9a110194bdc2b.jpg) +(a) IDInit + +![](images/92b20754a01f49a63ed82b9691756213445d660e96d55a059ea475936b88b891.jpg) +(b) Kaiming +Figure 6: The hyperparameter experiment on Cifar10. IDInit demonstrates superior adaptability across a broader range of training configurations compared to Kaiming initialization, exhibiting notable stability. + +We conduct this experiment to validate the effect of the proposed two improvements. The dataset is Cifar10 and the backbone is ResNet-20 (He et al., 2016). We run four times following settings: (i) IDInit w/o $\mathrm{IDIC}_{\tau}$ and w/o $\mathrm{IDIZC}_{\varepsilon}$ ; (ii) IDInit w/o $\mathrm{IDIC}_{\tau}$ and w/ $\mathrm{IDIZC}_{\varepsilon}$ ; (iii) IDInit w/ $\mathrm{IDIC}_{\tau}$ and w/o $\mathrm{IDIZC}_{\varepsilon}$ ; (iv) IDInit. For model training for 200 epochs, we employ SGD with a momentum of 0.9, a weight decay of 5e-5, and an initial learning rate of 0.1, which is adjusted using a cosine annealing schedule. Additional details and results, including the Loose condition, can be found in Sec. B.3 of the appendix. + +The results are shown in Table 2. By applying the identity matrix directly, (i) obtains the lowest accuracy of $87.01\%$ among all cases. Re + +Table 2: Results of the ablation experiment on ResNet-20. + +
Setting(i)(ii)(iii)(iv)
Accuracy87.01±0.2992.9±0.1890.43±0.1493.22±0.05
+ +garding results of (ii) and (iii), both the two settings can make significant improvements of nearly $5.89\%$ and $3.42\%$ from (i), respectively. And $\mathrm{IDIZC}_{\varepsilon}$ can make a deeper effect than $\mathrm{IDIC}_{\tau}$ . Equipping $\mathrm{IDIC}_{\tau}$ and $\mathrm{IDIZC}_{\varepsilon}$ , IDInit will improve performance further, which demonstrates our modification is efficient. + +# 4.3 IMAGE CLASSIFICATION ON CIFAR10 + +In this experiment, we validate IDInit with the comparison with existing initialization, including (1) Fixup (Zhang et al., 2019); (2) SkipInit (De & Smith, 2020); (3) ReZero (Bachlechner et al., 2021); (4) Kaiming (He et al., 2015); (5) Zero $\gamma$ (Setting the scale in Batch Normalization (BN) to 0) (Goyal et al., 2017); (6) ZerO. We use ResNet-56/110 as backbones on Cifar10. For analyzing convergence, we adopt both SGD and Adam optimizer for updating models. We set SGD, with the momentum 0.9, the weight decay 5e-4, and the learning rate 0.2. For Adam, the learning rate is 0.001, $\beta_{1}$ is 0.9 and $\beta_{2}$ is 0.999. The training epoch is 200. + +Results are shown in Table 1. Although ZerO uses the Hadamard matrix to break the rank constraint problem, it can be damaged by zero down-sampling as mentioned in Sec. 3.2. Therefore, we reclaim the importance of using $\mathrm{IDIZ}_{\varepsilon}$ and $\mathrm{IDIZC}_{\varepsilon}$ for avoiding such potential damage. Compared with baselines, IDInit derives the best accuracies in most cases. In addition, IDInit can achieve the least epochs to reach $80\%$ accuracy in all settings, which shows a good convergence ability. + +Table 4: Results of text classification on SST2 and TREC-6. The subscript G denotes the embedding layer is initialized by Glove, while W indicates Word2Vec. "Default" means the default initialization of models, specifically, Kaiming for TextCNN, and Xavier for both TextRNN and Transformer. Fixup is only applicable to the Transformer, as it is specifically designed for residual networks. Std values larger than 1.0 are marked in red. More results can be found in Table 6. + +
DatasetsInit.TextCNNG/WTextRNNG/WTransformerG/WAverageG/W
SST2Default81.40±0.66 / 84.56±0.4381.69±0.30 / 84.29±0.7080.97±1.20 / 83.36±0.7681.35±0.72 / 84.07±0.63
Orthogonal82.24±0.44 / 84.37±0.3881.86±0.55 / 84.61±0.7882.22±0.87 / 83.99±0.2382.11±0.62 / 84.32±0.46
Fixup--78.72±0.78 / 81.25±0.27-
ZerO82.05±0.67 / 84.26±0.3982.03±0.41 / 84.80±0.6482.28±0.81 / 82.72±0.5582.12±0.63 / 83.93±0.53
IDInit82.60±0.24 / 85.67±0.4182.66±0.16 / 85.49±0.3382.48±0.55 / 84.51±0.2482.58±0.32 / 85.22±0.33
TREC-6Default90.80±0.94 / 92.06±1.0086.34±1.04 / 90.52±1.5486.68±2.68 / 89.20±1.2087.94±1.55 / 90.59±1.25
Orthogonal90.34±0.72 / 92.72±0.8485.86±0.90 / 89.88±1.5486.90±1.51 / 89.26±0.8687.70±0.71 / 90.62±0.75
Fixup--86.95±0.35 / 89.35±0.53-
ZerO90.89±0.41 / 92.90±0.5087.24±0.64 / 88.71±0.4086.97±0.75 / 89.38±0.6488.37±0.60 / 90.33±0.51
IDInit91.22±0.54 / 92.94±0.4887.04±0.26 / 90.60±0.5887.32±0.78 / 90.06±0.6088.53±0.53 / 91.20±0.55
+ +# 4.4 IMAGE CLASSIFICATION ON IMAGENET + +We validate ViT-B/32 (Dosovitskiy et al., 2021), ResNet-50/152 (RN-50/152) (He et al., 2016) and Se-ResNet-50 (SRN-50) (Hu et al., 2020) as backbones on ImageNet in this experiment. For ViT-B/32, the optimizer is AdamW with a learning rate 1e-3 and a weight decay 5e-2. The training epochs is 300. We use 30 epochs for warm-up. For RN-50/152 and SRN-50, we use SGD with a learning rate 1e-1 and + +a weight decay 1e-4 for 90-epoch training. We use 9 epochs for warm-up. For all models, the batch size is 1024, and we apply data augment including cutmix (Yun et al., 2019) with $\alpha = 1.0$ , mixup (Zhang et al., 2018) with $\alpha = 0.8$ , the switching probability is 0.5 and a label smoothing with 0.1. More details and results can be found in Sec. B.5. + +![](images/569d1210c3886686ada3ce8cb7ae59d38db8d5fe667447b309d3ba392b42af23.jpg) +(a) ViT-B/32 + +![](images/9d9a7579ba72cda8f392646bee137ce85aadf33d9857660835da70ab0dd53480.jpg) +(b) RN-50 +Figure 7: Results on ImageNet. "Default" means the default initialization of models. + +Results are shown in Figure 7 and Table 3. On three types of networks, i.e., ViT, ResNet and Se-ResNet, and multiple depths, IDInit always achieves faster conver + +Table 3: Results on ImageNet. The value in brackets means "Epochs to $60\%$ Acc". On average, IDInit enhances accuracy by $0.55\%$ compared to the baseline and expedites model convergence by 7.4 epochs. + +
ModelViT-B/32RN-50 (Adamw)RN-50SRN-50RN-152Avg (Δ)
Default71.05 (44)76.20 (20)75.70 (38)76.30 (32)78.76 (28)0 (0)
IDInit71.60 (42)76.71 (14)76.72 (24)76.93 (22)79.10 (23)0.55 (7.4)
+ +gence and better performance than the baseline. When training RN-50 with Adamw, the convergence of IDInit is consistently fast. Compared with RN-50, our initialization shows a faster convergence speed. IDInit has an average improvement of $0.55\%$ , which is significant to be in practice. This experiment shows the good practicability and promising probability of IDInit, which is beneficial to the artificial intelligence community. + +# 4.5 TEXT CLASSIFICATION + +We implement text classification on SST2 (Socher et al., 2013) and TREC-6 (Li & Roth, 2002) and select TextCNN (Kim, 2014), TextRNN (Lai et al., 2015) and Transformer (Vaswani et al., 2017) for comparison. For TextCNN and TextRNN, we use AdaDelta (Zeiler, 2012) optimizer with a learning rate 1.0 and adopt Adam (Kingma & Ba, 2015) for Transformer with a learning rate 1e-4. For the embedding layer, we utilize Glove (Pennington et al., 2014) and Word2Vec(Mikolov et al., 2013) to initialize the embedding weights. All models are trained up to 10 epochs for 5 times. + +As shown in Table 4, all the initialization methods can work normally. Default random initialization obtains the lowest accuracy in most cases on both SST2 and TREC-6. Orthogonal initialization always derives modest results. By contrast to baselines, IDInit can achieve the highest accuracy in all conditions. In addition, IDInit always obtains the smallest std values, showing stable performance. + +# 4.6 PRE-TRAINING ON LANGUAGE MODEL + +Pre-training plays an important role in various applications. We conduct the experiment to show the fast convergence on BERT (Devlin et al., 2019). The dataset is the concatenation of English Wikipedia and Toronto Book Corpus (Zhu et al., 2015). We train the BERT-Base for 40 epochs with 768 batch size. The optimizer is AdamW with learning rate 1e-4 and weight decay 1e-2. 32 NVIDIA V100s are used. + +As shown in Figure 8, "Default" means the default initialization of BERT-Base. IDInit achieves faster convergence. Specifically, IDInit shows an $11.3\%$ acceleration ratio in + +![](images/202973854d3e65d342831428a7bfe607b0a627d8454943db5167dd8b9fb807d6.jpg) +Figure 8: Results of BERT-Base. + +terms of FLOPs. Moreover, IDInit can derive a lower loss of 1.46 in the end. As a result, IDInit is promising used in practice for enhancing convergence ability and performance. + +# 5 DISCUSSION + +The position of ReLU. Pennington et al. (2017) pointed out that non-residual networks cannot achieve dynamical isometry when using the ReLU activation function. However, in residual networks, such as $Y = W_{2}\mathrm{ReLU}(W_{1}X) + X$ , the non-linearity resides within the sub-stem of the residual block. As explored in Bartlett et al. (2019) and Hardt & Ma (2017), when the weights in the sub-stem are small, residual networks with ReLU can effectively approximate a linear network. This enables the model to follow dynamical isometry, as illustrated in Figure 18, where IDInit results in most $\chi$ values being close to 1. Moreover, Tarnowski et al. (2019) provide a theoretical perspective, suggesting that any activation function within the residual stem can support dynamical isometry. However, this behavior changes if ReLU is instead placed in the main stem, such as in $Y = \mathrm{ReLU}(W_{2}W_{1}X + X)$ . In this configuration, the network fails to maintain isometry, as noted by Pennington et al. (2017). This indicates that placing ReLU in the main stem is not advisable. + +The mechanism behind the identical initialization. Figure 2 highlights the motivation behind the design of IDInit by demonstrating how identity-based initialization preserves structural bias while avoiding pitfalls such as rank constraints. However, the exact mechanism behind this improvement still remains an open question, which is a promising area for future research. Investigating this mechanism further could provide valuable insights and pave the way for the development of more efficient initialization strategies, benefiting the broader research community. + +Theoretical analysis regarding the convergence rate. Theoretical exploration of the convergence rate is a critical yet challenging aspect of initialization methods. The convergence process in deep neural networks is iterative and influenced by numerous factors beyond the initialization method, including the network architecture, optimization algorithm, learning rate, batch size, and data distribution. As this area holds significant importance, further research is necessary to gain deeper insights, which will contribute to a more comprehensive understanding of initialization. + +# 6 CONCLUSION + +An efficient initialization approach is crucial for training deep neural networks. In this paper, we introduce a fully identical initialization (IDInit) that is based on the identity matrix. Addressing the problems encountered when developing IDInit, i.e., dead neurons and performance degeneration, we give two concise solutions, namely using small numerical values to wipe off dead neurons and reshaping an identity-like matrix into a tensor thus increasing feature diversity, leading to a performance improvement. With good performance on wide generality, high stability, and fast convergence, IDInit is promising to be applicable in practice. In the future, we hope that this identical design can motivate the AI community to implement more novel initialization methods. + +# ACKNOWLEDGE + +We extend our sincere gratitude to all the reviewers whose insightful comments and constructive feedback during previous submissions greatly enhanced the quality of our paper. This research was partially supported by the CFFF platform at Fudan University. + +# IMPACT STATEMENTS & LIMITATION + +Impact Statements. This paper introduces IDInit, an initialization method designed to enhance stability and convergence of the training process for neural networks. This method is unlikely to have negative societal impacts. + +Limitation. While IDInit demonstrates notable advancements in convergence speed and performance enhancement, it faces challenges in converging to ground truths that include negative eigenvalues. However, this drawback can be easily mitigated by incorporating momentum into the optimizer. Given that momentum is a commonly used setting, this limitation can be implicitly resolved as we show in the main context. + +# REFERENCES + +Devansh Arpit, Víctor Campos, and Yoshua Bengio. How to initialize your network? robust initialization for weightnorm & resnets. In NeurIPS, pp. 10900-10909, 2019. +Thomas Bachlechner, Bodhisattwa Prasad Majumder, Huanru Henry Mao, Gary Cottrell, and Julian J. McAuley. Rezero is all you need: fast convergence at large depth. In UAI, volume 161 of Proceedings of Machine Learning Research, pp. 1352-1361. AUAI Press, 2021. +Peter L. Bartlett, David P. Helmbold, and Philip M. Long. Gradient descent with identity initialization efficiently learns positive-definite linear transformations by deep residual networks. *Neural Comput.*, 31(3), 2019. +Yaniv Blumenfeld, Dar Gilboa, and Daniel Soudry. Beyond signal propagation: Is feature diversity necessary in deep neural network initialization? In ICML, volume 119 of Proceedings of Machine Learning Research, pp. 960-969. PMLR, 2020. +Tianqi Chen, Ian J. Goodfellow, and Jonathon Shlens. Net2net: Accelerating learning via knowledge transfer. In ICLR, 2016. +Soham De and Samuel L. Smith. Batch normalization biases residual blocks towards the identity function in deep networks. In NeurIPS, 2020. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In *NAACL-HLT* (1), pp. 4171–4186. Association for Computational Linguistics, 2019. +Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR. OpenReview.net, 2021. +Dar Gilboa, Bo Chang, Minmin Chen, Greg Yang, Samuel S. Schoenholz, Ed H. Chi, and Jeffrey Pennington. Dynamical isometry and a mean field theory of lstms and grus. CoRR, abs/1901.08987, 2019. +Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, volume 9 of JMLR Proceedings, pp. 249-256. JMLR.org, 2010. +Priya Goyal, Piotr Dólar, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: training image in 1 hour. CoRR, abs/1706.02677, 2017. + +Kai Han, Yunhe Wang, Qi Tian, Jianyuan Guo, Chunjing Xu, and Chang Xu. Ghostnet: More features from cheap operations. In CVPR, pp. 1577-1586. Computer Vision Foundation / IEEE, 2020. +Moritz Hardt and Tengyu Ma. Identity matters in deep learning. In *ICLR (Poster)*. OpenReview.net, 2017. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, pp. 1026-1034. IEEE Computer Society, 2015. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pp. 770-778. IEEE Computer Society, 2016. +Jie Hu, Li Shen, Samuel Albanie, Gang Sun, and Enhua Wu. Squeeze-and-excitation networks. IEEE Trans. Pattern Anal. Mach. Intell., 42(8):2011-2023, 2020. +Yoon Kim. Convolutional neural networks for sentence classification. In EMNLP, pp. 1746-1751. ACL, 2014. +Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR (Poster), 2015. +Siwei Lai, Liheng Xu, Kang Liu, and Jun Zhao. Recurrent convolutional neural networks for text classification. In AAAI, pp. 2267-2273. AAAI Press, 2015. +Quoc V. Le, Navdeep Jaitly, and Geoffrey E. Hinton. A simple way to initialize recurrent networks of rectified linear units. CoRR, abs/1504.00941, 2015. +Nannan Li, Yu Pan, Yaran Chen, Zixiang Ding, Dongbin Zhao, and Zenglin Xu. Heuristic rank selection with progressively searching tensor ring network. Complex & Intelligent Systems, pp. 1-15, 2021. +Xin Li and Dan Roth. Learning question classifiers. In COLING, 2002. +Tomás Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. In ICLR (Workshop Poster), 2013. +Yu Pan, Zeyong Su, Ao Liu, Jingquan Wang, Nannan Li, and Zenglin Xu. A unified weight initialization paradigm for tensorial convolutional neural networks. In ICML, volume 162 of Proceedings of Machine Learning Research, pp. 17238-17257. PMLR, 2022. +Yu Pan, Ye Yuan, Yichun Yin, Zenglin Xu, Lifeng Shang, Xin Jiang, and Qun Liu. Reusing pretrained models by multi-linear operators for efficient training. In NeurIPS, 2023. +Yu Pan, Ye Yuan, Yichun Yin, Jiaxin Shi, Zenglin Xu, Ming Zhang, Lifeng Shang, Xin Jiang, and Qun Liu. Preparing lessons for progressive training on language models. In AAAI, pp. 18860-18868. AAAI Press, 2024. +Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In EMNLP, pp. 1532-1543. ACL, 2014. +Jeffrey Pennington, Samuel S. Schoenholz, and Surya Ganguli. Resurrecting the sigmoid in deep learning through dynamical isometry: theory and practice. In NIPS, pp. 4785-4795, 2017. +Ben Poole, Subhaneil Lahiri, Maithra Raghu, Jascha Sohl-Dickstein, and Surya Ganguli. Exponential expressivity in deep neural networks through transient chaos. In NIPS, pp. 3360-3368, 2016. +Haozhi Qi, Chong You, Xiaolong Wang, Yi Ma, and Jitendra Malik. Deep isometric learning for visual recognition. In ICML, volume 119 of Proceedings of Machine Learning Research, pp. 7824-7835. PMLR, 2020. + +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Y. Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, pp. 1631-1642. ACL, 2013. +Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin A. Riedmiller. Striving for simplicity: The all convolutional net. In ICLR (Workshop), 2015. +Ilya Sutskever, James Martens, George E. Dahl, and Geoffrey E. Hinton. On the importance of initialization and momentum in deep learning. In ICML (3), volume 28 of JMLR Workshop and Conference Proceedings, pp. 1139-1147. JMLR.org, 2013. +Wojciech Tarnowski, Piotr Warchol, Stanisław Jastrzebski, Jacek Tabor, and Maciej A. Nowak. Dynamical isometry is achieved in residual networks in a universal way for any activation function. In AISTATS, volume 89 of Proceedings of Machine Learning Research, pp. 2221-2230. PMLR, 2019. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, pp. 5998-6008, 2017. +Maolin Wang, Yu Pan, Zenglin Xu, Xiangli Yang, Guangxi Li, and Andrzej Cichocki. Tensor networks meet neural networks: A survey and future perspectives. arXiv preprint arXiv:2302.09019, 2023. +Greg Yang and Samuel S. Schoenholz. Mean field residual networks: On the edge of chaos. In NIPS, pp. 7103-7114, 2017. +Sangdoo Yun, Dongyoon Han, Sanghyuk Chun, Seong Joon Oh, Youngjoon Yoo, and Junsuk Choe. Cutmix: Regularization strategy to train strong classifiers with localizable features. In ICCV, pp. 6022-6031. IEEE, 2019. +Sergey Zagoruyko and Nikos Komodakis. Diracnets: Training very deep neural networks without skip-connections. CoRR, abs/1706.00388, 2017. +Matthew D. Zeiler. ADADELTA: an adaptive learning rate method. CoRR, abs/1212.5701, 2012. +Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In *ICLR (Poster)*. OpenReview.net, 2018. +Hongyi Zhang, Yann N. Dauphin, and Tengyu Ma. Fixup initialization: Residual learning without normalization. In ICLR (Poster). OpenReview.net, 2019. +Jiawei Zhao, Florian Tobias Schaefer, and Anima Anandkumar. Zero initialization: Initializing neural networks with only zeros and ones. Transactions on Machine Learning Research, 2022. ISSN 2835-8856. URL https://openreview.net/forum?id=1AxQpKmiTc. +Yukun Zhu, Ryan Kiros, Richard S. Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In ICCV, pp. 19-27. IEEE Computer Society, 2015. + +# A IDINIT DETAILS + +# A.1 FULL IDINIT SCHEME + +Here, we show the full IDInit scheme in Figure 9. + +![](images/7f1d583acb7349fabbc6ce57f51ffe67d5bb6c9b1811d3ab5abbf012b68eb103.jpg) +Identity Preserving Initialization + +![](images/0d5438f81bbca1e082eca83874b7c525b5d750fff2129aaaf60f25a236a70935.jpg) +Figure 9: Illustration of IDInit with all conditions. + +# A.2 ANALYSIS ON CONVERGENCE + +The issue of convergence was proposed by Bartlett et al. (2019). According to their study, when layers in a neural network are initialized using the identity matrix, all the weight matrices of layers will be symmetric at each step of the training process. This persistent symmetry leads to the weights of layers being the same as each other at any step, posing a significant challenge in converging to the ground truth of which eigenvalues with negative values. Our findings indicate that employing a stochastic gradient descent (SGD) approach can effectively break the symmetry which facilitates convergence, and incorporating momentum can further accelerate the convergence process. In this context, we provide formal proof demonstrating that SGD with momentum can alleviate the convergence issue. + +Proof. First of all, we present a training case for a single-layer network expressed as $y = \theta x$ , where $x \in \mathbb{R}^d$ represents the input, $y \in \mathbb{R}^d$ denotes the output, and $\theta \in \mathbb{R}^{d \times d}$ is the weight matrix. The weight matrix $\theta$ is initialized to the identity matrix $I$ , denoted as $\theta^{(0)} = I$ . For our loss function, we employ the Mean Squared Error (MSE) and a learning rate denoted by $\eta$ . Consider two training pairs $\{x_1, y_1\}$ and $\{x_2, y_2\}$ sampled from the same dataset $\mathcal{D}$ . The network is initially trained with $\{x_1, y_1\}$ , and trained with $\{x_2, y_2\}$ in the next step. + +In the first step, we can get the prediction as + +$$ +\hat {y} _ {1} = \theta^ {(0)} x _ {1}. \tag {13} +$$ + +The updated $\theta^{(1)}$ can be derived by + +$$ +\Delta \theta^ {(0)} = (\hat {y} _ {1} - y _ {1}) x _ {1} ^ {T} = (\theta^ {(0)} x _ {1} - y _ {1}) x _ {1} ^ {T} = (x _ {1} - y _ {1}) x _ {1} ^ {T}, +$$ + +$$ +\theta^ {(1)} = \theta^ {(0)} - \eta \Delta \theta^ {(0)} = \theta^ {(0)} - \eta \left(x _ {1} - y _ {1}\right) x _ {1} ^ {T} = I - \eta \left(x _ {1} - y _ {1}\right) x _ {1} ^ {T}. \tag {14} +$$ + +Therefore, in the second step, the gradient $\Delta \theta^{(1)}$ can be calculated as + +$$ +\begin{array}{l} \Delta \theta^ {(1)} = (\hat {y} _ {2} - y _ {2}) x _ {2} ^ {T}, \\ = \left(\theta^ {(1)} x _ {2} - y _ {2}\right) x _ {2} ^ {T}, \\ = \left(\left(I - \eta \left(x _ {1} - y _ {1}\right) x _ {1} ^ {T}\right) x _ {2} - y _ {2}\right) x _ {2} ^ {T}, \\ = x _ {2} x _ {2} ^ {T} - \eta x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} + \eta y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} - y _ {2} x _ {2} ^ {T}. \tag {15} \\ \end{array} +$$ + +While $x_{2}x_{2}^{T}$ is symmetric, $x_{1}x_{1}^{T}x_{2}x_{2}^{T}$ , $y_{1}x_{1}^{T}x_{2}x_{2}^{T}$ , and $y_{2}x_{2}^{T}$ can be asymmetric. To calculate the magnitude of the asymmetry in $\Delta \theta^{(1)}$ , letting $\Omega = -\eta x_{1}x_{1}^{T}x_{2}x_{2}^{T} + \eta y_{1}x_{1}^{T}x_{2}x_{2}^{T} - y_{2}x_{2}^{T}$ denotes the asymmetric component, the magnitude of asymmetry that can be calculated as $\mathbb{E}(|\Omega - \Omega^T||_F^2)$ . Assuming $x_{1}, x_{2}, y_{1}, y_{2} \in \mathbb{R}^{d}$ are random vectors with entries that are i.i.d. Gaussian random variables, following $N(0, \sigma^2)$ , then the magnitude of asymmetry is bounded as + +$$ +4 \eta^ {2} d ^ {3} \sigma^ {8} - 4 \eta^ {2} d ^ {2} \sigma^ {8} + 2 d ^ {2} \sigma^ {4} \leq \mathbb {E} \left(\left\| \Omega - \Omega^ {T} \right\| _ {F} ^ {2}\right) \leq 6 \eta^ {2} d ^ {3} \sigma^ {8} + 3 d ^ {2} \sigma^ {4}. \tag {16} +$$ + +The proof can be found in Sec. A.3. As $\eta$ is usually $1e - 1$ , and both training pairs $\{x_{1},y_{1}\}$ and $\{x_{2},y_{2}\}$ can be generally normalized to $\mathcal{N} \sim (0,1)$ , thereby, the symmetry of the weight can be sufficiently influenced as + +$$ +\theta^ {(2)} = \theta^ {(1)} - \eta \Delta \theta^ {(1)}. \tag {17} +$$ + +When introducing a momentum $m^{(0)}$ initialized to $\Delta \theta^{(0)}$ , assuming the coefficient of $m$ is $\gamma$ , $\theta^{(2)}$ will be updated as + +$$ +m ^ {(1)} = \gamma m ^ {(0)} + \eta \Delta \theta^ {(1)}, +$$ + +$$ +\theta^ {(2)} = \theta^ {(1)} - m ^ {(1)} = \theta^ {(1)} - \gamma m ^ {(0)} - \eta \Delta \theta^ {(1)}. \tag {18} +$$ + +Therefore, momentum can promote the weight to become asymmetric by accumulating the asymmetry of gradients in steps and impact more when samples are increased. + +As for networks of multiple layers, when their layers are asymmetric, each layer can be updated differently which breaks the convergence problem caused by the same gradients in each step (which is stated in Lemma 5 of Bartlett et al. (2019)). + +This proof primarily demonstrates that SGD with momentum can effectively resolve the issue of layers being the same in networks initialized with the identity matrix during training, which facilitates the convergence process. As illustrated in Figure 10, it is evident that layers trained using SGD are different from each other, with the momentum component amplifying the degree of this difference. By theoretically and empirically demonstrating that SGD with momentum can efficiently address this convergence problem, we hope this finding can offer valuable insights for the research community, encouraging further investigation into identity initialization and its significant role in model training. + +# A.3 ANALYSIS ON ASYMMETRY + +In this section, we analyze the magnitude of asymmetry in the gradient. + +Setup and Target. Here, we assume $x_{1}, x_{2}, y_{1}, y_{2} \in \mathbb{R}^{d}$ are random vectors with entries that are i.i.d. Gaussian random variables, following $N(0, \sigma^2)$ . According to Eq. (4), the asymmetry in the gradient arises from: + +$$ +\Omega = - \eta x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} + \eta y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} - y _ {2} x _ {2} ^ {T}. \tag {19} +$$ + +Our target is to compute the magnitude of asymmetry that can be calculated as + +$$ +\begin{array}{l} \mathbb {E} \left(\left\| \Omega - \Omega^ {T} \right\| _ {F} ^ {2}\right) \\ = \mathbb {E} \{\left\| \left[ - \eta x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} + \left(\eta x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T}\right) ^ {T} \right] + \left[ \eta y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} - \left(\eta y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T}\right) ^ {T} \right] \right. \\ + \left[ - y _ {2} x _ {2} ^ {T} + \left(y _ {2} x _ {2} ^ {T}\right) ^ {T} \right] \left\| _ {F} ^ {2} \right\} \tag {20} \\ \end{array} +$$ + +Lower Bound. Introducing substitutions $u = y_{1} - x_{1}$ , and $s = x_{1}^{T}x_{2} = x_{2}^{T}x_{1}$ , we rewrite: + +![](images/ba61662f2265cea4ae6d32276a4ba77bb2e1057786781aedddbbbdd6033896b8.jpg) +(a) GD w/o momentum + +![](images/614e2b74cb3dce8cc85fcf4691f3d05618c5b5438f9554c179535e8e2e294d06.jpg) +(b) GD w/ momentum + +![](images/410375c580616d06b567a6fd10291bab6a7b938157a613a87fce22aadd5985b6.jpg) +(c) SGD w/o momentum + +![](images/8e102fc0729de0dae3d251d1e6474e10f5e4b7e50505d45ef006d63986a876bd.jpg) +(d) SGD w/ momentum +Figure 10: The distance between two layers in a 4-layer network after training. In this experiment, we set the target matrix as $-I \in \mathbb{R}^{10 \times 10}$ . The weights are $W_0, W_1, W_2, W_3 \in \mathbb{R}^{10 \times 10}$ . We randomly generated 4000 data pairs $\{X_i, Y_i\}$ by $Y_i = -IX_i + \xi$ , where $X_i, Y_i \in \mathbb{R}^{10}$ , and $\xi$ is noise with mean 0 and std 1e-2. We use 2000 samples for training the network. We use the other 2000 samples for testing. Batch size is 4. Mean squared error (MSE) is used as the loss function. We calculate the distance by averaging the absolute value from the difference value of two layers. Layers trained using SGD display distinct differences from one another, and the incorporation of momentum significantly increases these differences, thereby accelerating the convergence speed. + +$$ +\mathbb {E} \left(\left\| \Omega - \Omega^ {T} \right\| _ {F} ^ {2}\right) = \mathbb {E} \left\{\left\| \eta s \left(u x _ {2} ^ {T} - x _ {2} u ^ {T}\right) - \left(y _ {2} x _ {2} ^ {T} - x _ {2} y _ {2} ^ {T}\right) \right\| _ {F} ^ {2} \right\}, \tag {21} +$$ + +Let $w = \eta s u - y_{2}$ , then: + +$$ +\begin{array}{l} \mathbb {E} \left(\left\| \Omega - \Omega^ {T} \right\| _ {F} ^ {2}\right) = \mathbb {E} \left\{\left\| w x _ {2} ^ {T} - x _ {2} w ^ {T} \right\| _ {F} ^ {2} \right\}, (22) \\ = \mathbb {E} \left\{2 \left(\left\| w \right\| ^ {2} \left\| x _ {2} \right\| ^ {2} - \left(w ^ {T} x _ {2}\right) ^ {2}\right) \right\}, (23) \\ = 2 \left(\mathbb {E} [ \| w \| ^ {2} ] \mathbb {E} [ \| x _ {2} \| ^ {2} ] - \mathbb {E} \left[ \left(w ^ {T} x _ {2}\right) ^ {2} \right]\right), (24) \\ \end{array} +$$ + +Expanding and computing expectations: + +$$ +\begin{array}{l} \mathbb {E} \left(\left| \left| \Omega - \Omega^ {T} \right| \right| _ {F} ^ {2}\right) \geq 2 \left(\left(\eta^ {2} \left(2 d ^ {2} - d\right) \sigma^ {6} + d \sigma^ {2}\right) d \sigma^ {2} - \eta^ {2} d ^ {2} \sigma^ {8}\right), (25) \\ = 4 \eta^ {2} d ^ {3} \sigma^ {8} - 4 \eta^ {2} d ^ {2} \sigma^ {8} + 2 d ^ {2} \sigma^ {4}. (26) \\ \end{array} +$$ + +Upper Bound. We derive the upper bound as + +$$ +\begin{array}{l} \mathbb {E} \left(\left\| \Omega - \Omega^ {T} \right\| _ {F} ^ {2}\right) (27) \\ = \mathbb {E} \left\{\left| \left| \left[ - \eta x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} + \left(\eta x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T}\right) ^ {T} \right] + \left[ \eta y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} - \left(\eta y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T}\right) ^ {T} \right] \right. \right. \right. \\ + \left[ - y _ {2} x _ {2} ^ {T} + \left(y _ {2} x _ {2} ^ {T}\right) ^ {T} \right] \| _ {F} ^ {2} \} (28) \\ \end{array} +$$ + +According to Relaxed Triangle Inequality, there is + +$$ +\begin{array}{l} \leq 3 \left\{\eta^ {2} \mathbb {E} \left[ | | - x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} + \left(x _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T}\right) ^ {T} | | _ {F} ^ {2} \right] + \eta^ {2} \mathbb {E} \left[ | | y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T} - \left(y _ {1} x _ {1} ^ {T} x _ {2} x _ {2} ^ {T}\right) ^ {T} | | _ {F} ^ {2} \right] \right. \\ + \mathbb {E} [ | | - y _ {2} x _ {2} ^ {T} + \left(y _ {2} x _ {2} ^ {T}\right) ^ {T} | | _ {F} ^ {2} ] \} \tag {29} \\ \end{array} +$$ + +$$ +\begin{array}{l} \leq 3 \left(\eta^ {2} d ^ {3} \sigma^ {8} + \eta^ {2} d ^ {3} \sigma^ {8} + d ^ {2} \sigma^ {4}\right) (30) \\ = 6 \eta^ {2} d ^ {3} \sigma^ {8} + 3 d ^ {2} \sigma^ {4} (31) \\ \end{array} +$$ + +This shows that a higher learning rate promotes greater asymmetry, further explaining the observed differences. However, a high learning rate can affect training stability. Therefore, while using a higher learning rate to reduce symmetry, it is crucial to carefully select its magnitude to maintain stability. + +# A.4 PROOF FOR THEOREM 3.1. + +Proof. Consider a network with a single hidden layer (i.e. $L = 3$ ) and a batch of linearly independent samples, $x_{1}^{(0)} = \{x_{1}^{(0,1)}, \ldots, x_{1}^{(0,N)}\}$ , with $N = D_{0}$ . Using $\Pi_{1} = \sum_{i=1}^{N} \frac{\partial \mathcal{L}}{\partial x_{1}^{(3,i)}} \times x_{1}^{(0,i)}$ , the gradients for the first update step can be written as + +$$ +\frac {\partial \mathcal {L}}{\partial \theta^ {(0)}} = \binom {\Pi_ {1}} {\mathbf {0}} \quad \frac {\partial \mathcal {L}}{\partial \theta^ {(1)}} = \binom {\Pi_ {1}} {\mathbf {0}} \quad \frac {\Pi_ {1}}{\mathbf {0}} \quad \frac {\partial \mathcal {L}}{\partial \theta^ {(2)}} = (\Pi_ {1} \quad \Pi_ {1}). \tag {32} +$$ + +After updating the weights with learning rate $\eta > 0$ , we have + +$$ +\theta^ {(0)} = \left( \begin{array}{c} \boldsymbol {I} - \eta \Pi_ {1} \\ \boldsymbol {I} \end{array} \right) \quad \theta^ {(1)} = \left( \begin{array}{c c} \boldsymbol {I} - \eta \Pi_ {1} & - \eta \Pi_ {1} \\ \mathbf {0} & \boldsymbol {I} \end{array} \right) \quad \theta^ {(2)} = \left(\boldsymbol {I} - \eta \Pi_ {1} - \eta \Pi_ {1}\right). \tag {33} +$$ + +As a result, the gradients of $\theta^{(1)}$ for the second update with a second batch of linearly independent samples $x_{2}^{(0)} = \{x_{2}^{(0,1)},\ldots ,x_{2}^{(0,N)}\}$ , are given by + +$$ +\begin{array}{l} \frac {\partial \mathcal {L}}{\partial \theta^ {(1)}} = \sum_ {i = 1} ^ {N} \left(\theta^ {(0)} \cdot x _ {2} ^ {(0, i)}\right) \times \left(\frac {\partial \mathcal {L}}{\partial x _ {2} ^ {(3 , i)}} \cdot \theta^ {(2) ^ {\intercal}}\right) (34) \\ = \left( \begin{array}{c c} \left(\boldsymbol {I} - \eta \Pi_ {1} ^ {\mathsf {T}}\right) \Pi_ {2} \left(\boldsymbol {I} - \eta \Pi_ {1} ^ {\mathsf {T}}\right) & \left(\boldsymbol {I} - \eta \Pi_ {1} ^ {\mathsf {T}}\right) \Pi_ {2} \\ - \eta \Pi_ {1} ^ {\mathsf {T}} \Pi_ {2} \left(\boldsymbol {I} - \eta \Pi_ {1} ^ {\mathsf {T}}\right) & - \eta \Pi_ {1} ^ {\mathsf {T}} \Pi_ {2} \end{array} \right), (35) \\ \end{array} +$$ + +with $\Pi_2 = \sum_{i=1}^{N} \frac{\partial \mathcal{L}}{\partial x_2^{(3,i)}} \times x_2^{(0,i)}$ . Using the gradients of the second batch to update the parameters with the same learning rate, we obtain + +$$ +\theta^ {(1)} = \left( \begin{array}{c c} {\pmb {I} - \eta \Pi_ {1} - \eta (\pmb {I} - \eta \Pi_ {1} ^ {\top}) \Pi_ {2} (\pmb {I} - \eta \Pi_ {1} ^ {\top})} & {- \eta \Pi_ {1} - \eta (\pmb {I} - \eta \Pi_ {1} ^ {\top}) \Pi_ {2}} \\ {\eta^ {2} \Pi_ {1} ^ {\top} \Pi_ {2} (\pmb {I} - \eta \Pi_ {1} ^ {\top})} & {\pmb {I} + \eta^ {2} \Pi_ {1} ^ {\top} \Pi_ {2}} \end{array} \right). +$$ + +Consequently, the difference of the weights after two updates to the initial value, $I$ , is given by + +$$ +\Delta \theta^ {(1)} = \left( \begin{array}{c c} - \eta \Pi_ {1} - \eta (\pmb {I} - \eta \Pi_ {1} ^ {\mathsf {T}}) \Pi_ {2} (\pmb {I} - \eta \Pi_ {1} ^ {\mathsf {T}}) & - \eta \Pi_ {1} - \eta (\pmb {I} - \eta \Pi_ {1} ^ {\mathsf {T}}) \Pi_ {2} \\ \eta^ {2} \Pi_ {1} ^ {\mathsf {T}} \Pi_ {2} (\pmb {I} - \eta \Pi_ {1} ^ {\mathsf {T}}) & \eta^ {2} \Pi_ {1} ^ {\mathsf {T}} \Pi_ {2} \end{array} \right). +$$ + +Assuming that the gradients $\frac{\partial\mathcal{L}}{\partial x_1^{(3)}}$ and $\frac{\partial\mathcal{L}}{\partial x_2^{(3)}}$ are also linearly independent, $\mathrm{rank}(\Pi_1) = \mathrm{rank}(\Pi_2) = D_0$ . Due to Sylvester's rank inequality, we can conclude that also $\mathrm{rank}(\Pi_1\Pi_2) = D_0$ . As a result, the lower-right part of the difference has rank $D_0$ , from which we can conclude that $\mathrm{rank}(\Delta \theta^{(1)}) \geq D_0$ . + +# A.5 IMPLEMENTING IDINIT ON ATTENTION LAYER IN TRANSFORMER + +In this part, we show the way to initialize the attention layer with IDInit. Prior to that, formulating an attention layer as + +$$ +\operatorname {A t t} (Q, K, V) = \operatorname {s o f t m a x} \left(\frac {Q W ^ {Q} W ^ {K} K}{\sqrt {d}}\right) V W ^ {V} W ^ {O}, \tag {36} +$$ + +where $Q$ is the query matrix, $K$ means the key matrix, $V$ denotes the value matrix, $W^{Q}$ , $W^{K}$ and $W^{V}$ represents the weights for $Q$ , $K$ , and $V$ respectively, and $W^{O}$ is the output transformation. Following the instruction of IDInit in Sec. 3, we firstly use $\mathrm{IDI}_{\tau}$ to initialize $W^{Q}$ , $W^{K}$ , $W^{V}$ and $W^{O}$ . And then, we use $\mathrm{IDIZ}_{\varepsilon}$ to initialize the last fully-connected layer $W^{O}$ . The $\tau$ and $\varepsilon$ are consistently set with the paper content to 1 and 1e-6, respectively. + +# A.6 DETAILS OF PATCH-MAINTAIN CONVOLUTION + +We illustrate the figure to show the comparison between channel-maintain convolution and patch-maintain convolution in Figure 11. + +![](images/240d319a45f59386b86221ae3d3de504c6de06b9eeb6434df982b049d1fe1d52.jpg) +Figure 11: A case of number "7" on Identical Convolution Layer. The upper sub-figure maintains the identity transition. The under sub-figure is $\mathrm{IDIC}_{\tau}$ initialization that shifts features for increasing diversity. More feature diversity from $\mathrm{IDIC}_{\tau}$ is beneficial for improving model performance. + +# B DETAILED SETTINGS OF EXPERIMENTS + +In this paper, for ReLU activated networks, $\tau$ is set to $\sqrt{2}$ for the first layer in a network and 1 for other $\mathrm{IDI}_{\tau} / \mathrm{IDIC}_{\tau}$ initializing layers, while for tanh-activated networks, all $\mathrm{IDI}_{\tau}$ is set to 1, and $\varepsilon$ is $1e - 6$ for all $\mathrm{IDIZ}_{\varepsilon} / \mathrm{IDIZC}_{\varepsilon}$ initializing layers. + +# B.1 EXPERIMENT FOR HYPERPARAMETERS + +In this experiment, we compare IDInit with other initialization methods, including (1) Fixup; (2) ReZero; (3) Kaiming; and (4) Zero, by analyzing the training hyperparameters, i.e., the weight decay and the learning rate. We use Cifar10. The backbone is ResNet-32, we use SGD with a momentum of 0.9. The batch size is 1024. We train models for 200 epochs. The learning rate is reduced with a cosine function. Each setting is trained 3 times to calculate the standard deviation. + +We scanned the learning rate from 1e-3 to 1e1 and weight decay from 1e-8 to 1e-1, ensuring that the best-performing hyperparameters are not at the corners or edges of the grid. As shown in Figure 12, IDInit achieves a peak accuracy of $94.08\%$ with a weight decay of 1e-3 and a learning rate of 1e-1. In comparison to other initialization methods including Kaiming, Fixup, and Rezero, IDInit demonstrates superior stability, maintaining high accuracy even when the learning rate is reduced below 1e-1. Although ZerO exhibits comparable stability at lower learning rates owing to its Hadamard matrix's ability to sustain dynamics, it underperforms at higher learning rates due to the dead neurons caused by the zero weights in its residual stems. Fixup, on the other hand, lacks stability by + +![](images/18db8716c1615025c2a93380c070fac2189dd2e1e8f28ddb61165173e14c1332.jpg) +(a) IDInit + +![](images/49064410907e2910d28f2ddc41a76354cd1672dfd9be6d7162b2e9267e2198a2.jpg) +(b) ZerO + +![](images/c5baa5dd7dd0fae2669dcf3fb26b09a938797ab7d0e3d8e1e4e67e59771ec2c7.jpg) +(c) Kaiming + +![](images/03ded7fa0dda82bf7aab1632f0ac1ed6d04c9654f3b866ba6a41ba590e9b42d2.jpg) +(d) Fixup +Figure 12: The expanded hyperparameter experiment on Cifar10 on ResNet-32. + +![](images/9c5232fa4e699d326b96a21b9bf07c59ba4b55e926a5e9857ec6922505e7d655.jpg) +(e) Rezero + +eliminating batch normalization, rendering it unsuitable for high learning rates. Overall, IDInit consistently delivers robust performance while maintaining stability, making it a promising candidate for practical applications. + +# B.2 DETAILS OF IMAGE CLASSIFICATION ON CIFAR10 EXPERIMENT + +In this experiment, we validate the proposed initialization with the comparison with existing initialization, including (1) Fixup; (2) SkipInit; (3) ReZero; (4) Kaiming; (5) Zero $\gamma$ (Setting the scale in Batch Normalization (BN) to 0). We use ResNet-56/110 as backbones on CIFar10. For analyzing convergence, we adopt both SGD and Adam optimizer for updating models. We set SGD, with the momentum 0.9, the weight decay 5e-4, and the learning rate 0.2. For Adam, the learning rate is 0.001, $\beta_{1}$ is 0.9 and $\beta_{2}$ is 0.999. We train models for 200 epochs. The learning rate is reduced with a cosine function. The experiment is conducted on one Nvidia A100. + +We perform a detailed hyperparameter analysis for ResNet-110, evaluating the learning rates $\{1$ , $2e - 1$ , $1e - 1\}$ and weight decays $\{1e - 4, 5e - 4, 1e - 3\}$ on the standard baseline Kaiming and the more fragile Fixup method. As shown in Figure 13, both Kaiming and Fixup achieve optimal accuracy with a learning rate of $2e - 1$ and a weight decay of $5e - 4$ . However, Fixup fails to train with a learning rate of 1. Consequently, selecting a learning rate of $2e - 1$ and a weight decay of $5e - 4$ as the training hyperparameters in Section 4.3 is justified. + +# B.3 DETAILS OF ABLATION EXPERIMENT + +The dataset is Cifar10 and the backbone is ResNet-20. We choose SGD with momentum 0.9, weight decay 5e-4, and learning rate 0.1 to train the models for 200 epochs. The learning rate is reduced with a cosine function. And data-augment mixup is applied. The experiment is conducted on one Nvidia A100. + +![](images/65d24ce12c2d4b508bf9499e3f54aed0ba1ddca0eddf1672ed9efec05afdc7d6.jpg) +(a) Kaiming + +![](images/d48149e14379fab5f4044f16b6a212133165fcf9531d81e9b7feee557122fe72.jpg) +(b) Fixup +Figure 13: The tuning hyperparameters on Cifar10 on ResNet-110. + +The extended analysis in Table 5 shows that the Loose condition, along with the components IDIC and IDIZ, contributes independently to performance improvements. Furthermore, the combination of these components yields the most significant results. Across all comparison pairs—specifically, settings $1/4$ , $2/6$ , $3/7$ , and $5/8$ —the Loose condition consistently demonstrates performance improvements. This highlights its practical value and its role in enhancing the overall effectiveness of the initialization methods. + +Table 5: Analysis of components. + +
ComponentSetting 1Setting 2Setting 3Setting 4Setting 5Setting 6Setting 7Setting 8
Loose✓✓✓✓
IDIC✓✓✓✓
IDIZ✓✓✓✓
Accuracy86.12±0.5292.68±0.0889.47±0.2487.01±0.2992.95±0.2192.9±0.1890.43±0.1493.22±0.05
+ +# B.4 DETAILS OF TEXT CLASSIFICATION EXPERIMENT + +We also explore performance networks on text classification datasets including SST2, SST5 (Socher et al., 2013) and TREC-6, and we select TextCNN (Kim, 2014), TextRNN (Lai et al., 2015) and Transformer (Vaswani et al., 2017) for comparison. For TextCNN and TextRNN, we use AdaDelta (Zeiler, 2012) optimizer with a learning rate 1.0 and adopt Adam (Kingma & Ba, 2015) for Transformer with a learning rate 1e-4. For the embedding layer, we utilize Glove (Pennington et al., 2014) and Word2Vec (Mikolov et al., 2013) to initialize the embedding weights. All models are trained up to 10 epochs, and we run all the random initialization 5 times. The experiment is conducted on one Nvidia A100. + +![](images/44f71f1ab1fa6c00dbd6cbe6fb4b0ed0526cdc079f8d80fbd1bce128fe81e63f.jpg) +(a) ViT-B/32 +(b) +Figure 14: Results on ImageNet. "Default" means the default initialization of models. RN-50 (Adamw) means that ResNet-50 is trained with the same optimizer Adamw as the ViT-B/32. + +![](images/78080b025e1c5675f13733309f5ef6301e277d0fea3020bf3535009a132d1fb3.jpg) +RN-50 + +![](images/4801830d9193371682957c2ee8714b04c85bed6ce04103077432599434b9154b.jpg) +(c) RN-50 + +![](images/cf26f5ba0f16797d4984aeaeb46f7527aee43d4561ffd7aa2255bf8f18de1009.jpg) +(d) SRN-50 + +![](images/1e0a54ca8750573833685780805d98d7c695536966c6666b7a074f4754b17f59.jpg) +(e) RN-152 + +# B.5 DETAILS OF IMAGE CLASSIFICATION ON IMAGENET EXPERIMENT + +In this experiment, we use ImageNet for validation. We use ViT-B/32 (Dosovitskiy et al., 2021), ResNet-50/152 (RN-50/152) and Se-ResNet-50 (SRN-50) as backbones. For ViT-B/32 that inputs $32 \times 32$ patch window, the optimizer is AdamW with a learning rate 1e-3 and a weight decay of 5e-2. And the batch size is 1024. The epoch for training is 300. We use 30 epochs for warm-up. The input + +Table 6: Results of text classification on SST2 and TREC-6. The subscript G denotes the embedding layer is initialized by Glove, while W indicates Word2Vec. "Default" means the default initialization of models, specifically, Kaiming for TextCNN, and Xavier for both TextRNN and Transformer. Fixup, ReZero and SkipInit are only applicable to the Transformer, as it is specifically designed for residual networks. Std values larger than 1.0 are marked in red. + +
DatasetsInit.TextCNNG/WTextRNNG/WTransformerG/WAverageG/W
SST2Default81.40±0.66 / 84.56±0.4381.69±0.30 / 84.29±0.7080.97±1.20 / 83.36±0.7681.35±0.72 / 84.07±0.63
Orthogonal82.24±0.44 / 84.37±0.3881.86±0.55 / 84.61±0.7882.22±0.87 / 83.99±0.2382.11±0.62 / 84.32±0.46
Fixup--78.72±0.78 / 81.25±0.27-
ReZero--81.67±0.77 / 82.32±0.51-
SkipInit--82.30±0.47 / 84.12±0.75-
ZerO82.05±0.67 / 84.26±0.3982.03±0.41 / 84.80±0.6482.28±0.81 / 82.72±0.5582.12±0.63 / 83.93±0.53
IDInit82.60±0.24 / 85.67±0.4182.66±0.16 / 85.49±0.3382.48±0.55 / 84.51±0.2482.58±0.32 / 85.22±0.33
TREC-6Default90.80±0.94 / 92.06±1.0086.34±1.04 / 90.52±1.5486.68±2.68 / 89.20±1.2087.94±1.55 / 90.59±1.25
Orthogonal90.34±0.72 / 92.72±0.8485.86±0.90 / 89.88±1.5486.90±1.51 / 89.26±0.8687.70±0.71 / 90.62±0.75
Fixup--86.95±0.35 / 89.35±0.53-
ReZero--86.92±0.98 / 89.36±0.52-
SkipInit--83.59±0.61 / 87.10±0.41-
ZerO90.89±0.41 / 92.90±0.5087.24±0.64 / 88.71±0.4086.97±0.75 / 89.38±0.6488.37±0.60 / 90.33±0.51
IDInit91.22±0.54 / 92.94±0.4887.04±0.26 / 90.60±0.5887.32±0.78 / 90.06±0.6088.53±0.53 / 91.20±0.55
+ +image size is $224 \times 224$ . The dropout rates of the embedding layer and the network layer are all 0.1. For RN-50/152 and SRN-50, the optimizer is SGD with a learning rate 1e-1 and a weight decay of 1e-4. And the batch size is 1024. The epoch for training is 90. We use 9 epochs for warm-up. The input image size is $160 \times 160$ for the front 35 epochs and $224 \times 224$ for the remaining epochs. For all models, we apply data-augment including cutmix (Yun et al., 2019) with $\alpha = 1.0$ , mixup (Zhang et al., 2018) with $\alpha = 0.8$ , the switching probability is 0.5 and a label smoothing with 0.1. The experiment is conducted on 4 Nvidia A100. + +To further compare with other identity-control methods, we conducted experiments on ResNet-50 using Fixup and Zero. As shown in Table 7, IDInit outperforms both Fixup and ZerO, demonstrating its superior performance on large-scale datasets. + +Table 7: Comparison among Default, Fixup, ZerO and IDInit initialized ResNet-50 on ImageNet. + +
Init.Epochs to 60% AccuracyAccuracy
Default3875.70
Fixup2475.83
ZerO3075.64
IDInit2476.72
+ +# B.6 DETAILS OF PRE-TRAINING ON LANGUAGE MODEL + +Pre-training plays an important role in various applications. We conduct the experiment to show the fast convergence on BERT (Devlin et al., 2019). The dataset is the concatenation of English Wikipedia and Toronto Book Corpus Zhu et al. (2015). We train the BERT-Base for 40 epochs with 768 batch size. The optimizer is set to AdamW with learning rate 1e-4 and weight decay 1e-2. 32 NVIDIA V100s are used. + +# C ADDITIONAL EXPERIMENTS + +We provide additional experiments to further validate IDInit. $\tau$ and $\varepsilon$ are set the same as Sec. B. + +# C.1 VALIDATION ON THE LINEAR STRUCTURE + +This experiment is conducted on MNIST. We use five linear layers named Liner-5 whose hidden layers are all of dimension 512. The optimizer is SGD with momentum 0.9, weight decay 5e-4, + +Table 8: Results of Linear-5 on MNIST. "Default" means the default initialization of models where Xavier is for Linear-5-tanh and Kaiming is adopted for Linear-5-ReLU. + +
Init.Linear-5-tanhLinear-5-ReLU
Default98.2698.21
IDInit98.3298.4
+ +and a learning rate 1e-1. The learning rate scheduler adopts a cosine reduction strategy. We run the model in 30 epochs on one Nvidia A100. We both consider Linear-5-tanh and Linear-5-ReLU which consist of Linear-5, and tanh and ReLU activation functions, respectively. The experiment is conducted on one Nvidia A100. + +As shown in Table 8, IDInit can achieve the highest accuracy in both different tanh and ReLU conditions. The results show the ability of our proposed method to train a model with only fully-connected layers. + +# C.2 VALIDATION ON NON-RESIDUAL CONVOLUTION + +We use this experiment to show IDInit can achieve a good initial state for training on non-residual convolutional networks. In this experiment, we use AllConv (Springenberg et al., 2015) which consists of nine convolutional layers as the backbone network. We show the structure of AllConv in Table 9. The dataset is Cifar10. The optimizer is Stochastic Gradient Descent (SGD) with momentum 0.9, weight decay 5e-4, and learning rate 1e-1. The learning rate scheduler adopts a warm-up cosine reduction strategy. We run the model in 300 epochs on one Nvidia A100. We adopt Kaiming initialization and IDInit w/o $\mathrm{IDIC}_{\tau}$ initialization for comparison. Since there is no residual connection, we do not consider the $\mathrm{IDIZC}_{\varepsilon}$ function in this experiment. For each initialization, we have run them with 0, 10, 20, 30, 40, 50, and 60 warm-up epochs. The experiment is conducted on one Nvidia A100. + +Table 9: Architectures of the tensorial All-Conv networks. Window means the convolutional kernel window size. Channels indicate $\mathbf{c}_{in}$ and $\mathbf{c}_{out}$ of a standard convolutional kernel $\mathcal{C} \in \mathbb{R}^{\mathbf{c}_{in} \times \mathbf{c}_{out} \times k \times k}$ . The avg pool denotes the average pooling operation. + +
LayerWindowChannels
conv13×33×96
conv23×396×96
conv33×396×96
conv43×396×192
conv53×3192×192
conv63×3192×192
conv73×3192×192
conv81×1192×192
conv91×1192×10 avg pool
+ +Results are shown in Figure 16, without a warm-up strategy which is a strong trick for training, both Kaiming and IDInit w/o $\mathrm{IDIC}_{\varepsilon}$ fail to train the model. By contrast, our initialization can train AllConv and maintain the highest performance in all situations, showing a strong effect on stability and performance. As IDInit w/o $\mathrm{IDIC}_{\varepsilon}$ performs poorly, we demonstrate the patch-maintain strategy + +![](images/0c3f4f13c853cd7416488957d393c21f9dd3555a4a35b322af7f09b92a323d0f.jpg) +(a) FC-0.00 + +![](images/a1d43b0796e7e32af1973ed03ce91c8d833c74ca7d3b29c3c6e4ff618cd61213.jpg) +(b) ResFC-0.00 + +![](images/32751959477fa06742db6174eba11a032d62b5a02622407fdbf56c1b59736e64.jpg) +(c) Conv-0.00 + +![](images/962dd8a51a4b482dbb8a13c55ee76376dfefe612d80d3ad348d2655e57159183.jpg) +(d) ResConv-0.00 + +![](images/603f36132ea7f41606ad4fa96ce71afb11bb28bdd5c78ab794e70d87d2fb2d40.jpg) +(e) FC-0.01 + +![](images/766a3a7a04b7fd10a469e2e77cda2ea7b6eab978fe9d0e44182c1615337acada.jpg) +(f) ResFC-0.01 + +![](images/210dd651048041649290da83b6f0ba785e6c9e4e7f05a44280e60edd635c4a0d.jpg) +(g) Conv-0.01 + +![](images/bb779a56530d6a7046b830abb33b47aa0ed5477195e5b6a209a40f0eb17588e6.jpg) +(h) ResConv-0.01 + +![](images/aece883dae40f9c473074a7dd9fb8c383bcaa65320472837bd77a3184d45cb17.jpg) +(i) FC-0.10 + +![](images/4f75fd1cba4ddfb8185e70c2dd531bdb9f2caccc914fb228f55d43cc9ccd36aa.jpg) +(j) ResFC-0.10 + +![](images/cc725cb8909f86f338eae9793bd1f96bdd469428f8b5e6e595595b7542bc5159.jpg) +(k) Conv-0.10 + +![](images/989d7637984e20a6968d7e99311b3b4d75650846e54b99ecac5e4235d539a9ce.jpg) +(1) ResConv-0.10 + +![](images/0804b2ac5735c262beb64c039f2c2796cc06defeb7e7983c9341e69e486cd527.jpg) +(m) FC-1.00 + +![](images/034b1ef40ed66300ac3a12737b03cc0a9a4e9f467b9a7a6fee457f5e13ed8066.jpg) +(n) ResFC-1.00 + +![](images/6f3146515549ff4269dd63c83195734a01bed45e21fbf75e64575b505f98b664.jpg) +(o) Conv-1.00 + +![](images/d73bab87f7df658eb6a98d71ac6de026bc5f6b72ff42ba7601b0d290087831a6.jpg) +(p) ResConv-1.00 +Figure 15: Results of the analysis on variance propagation. The numerical value after the model name means the standard derivation of the noise. "Default" means the default initialization of models, specifically, Xavier for FC and ResFC, and Kaiming for Conv and ResConv. The default methods can only work on non-residual networks FC and Conv, however, fail on residual networks ResFc and ResConv, for cause instability with giant standard derivation. By contrast, IDInit can consistently transit data-flow in an appropriate scale on all models and various noises, which shows sufficient robustness, and can provide models with stable and efficient training. + +mentioned in Sec. 3.1.3 can be good for increasing feature diversity. This experiment shows the identical method can be a feasible initialization for non-residual networks. + +# C.3 ANALYSIS ON VARIANCE PROPAGATION + +Here we conduct an experiment on Cifar10 to demonstrate data-flow will keep stable. We use 4 types of networks: (1) FC: 10-layer fully-connected layers; (2) ResFC: 10 residual blocks (two fully-connected layers in a block); (3) Conv: 9-layer AllConv in Sec. C.2; (4) ResConv: 10 residual blocks (two convolutional layers in a block). For (1) and (2) two fully-connected networks, we reshape Cifar10 data as $\mathbf{X} \in \mathbb{R}^{32 \times 96}$ as input and does not use any activation function. For (1), hidden lengths are $\{200, 400, 600, 800, 1000, 1000, 800, 600, 400, 200\}$ . For (2), hidden lengths are all set to 96. For (3) and (4) two convolution networks, we directly input images to them, and use ReLU as the activation function. For (3), we directly use AllConv as shown in Table 9. For (4), we first use convolution to transfer an image to 16 channels, and then set the channels of all convolution within residual blocks to 16. For comparison, we use Xavier for (1) and (2), and Kaiming for (3) and (4) in + +![](images/fc1feea94fd4b9284185e9888a60e325789b3a914c66ec44ba88f86cc4015f8d.jpg) +(a) Test Top-1 + +![](images/782a501244df2dc38c812cc39a2c738478f8396d00a52a6ee98efeb35f30a23f.jpg) +(b) Test Best +Figure 16: Results of AllConv on Cifar10. The number behind the initialization denotes the warm-up epochs. + +terms of the activation function. We also employ noises with 0 mean, and $\{0.00, 0.01, 0.10, 1.00\}$ for comparing robustness. In the experiment, we run 500 rounds for each model. The experiment is conducted on one Nvidia A100. + +Results are shown in Figure 15. The regular methods Xavier and Kaiming can only work on non-residual networks. On residual networks, they both cause giant standard derivation, leading to instability. By contrast, the proposed IDInit can consistently transit data-flow in an appropriate scale on all models and various noises, which shows sufficient robustness, and can provide models with stable and efficient training. + +# C.4 ANALYSIS ON WEIGHT DISTRIBUTION + +In this experiment, we conduct an experiment on Cifar10 with ResNet-20 to show the weight distribution of IDInit. We use an SGD optimizer with a learning rate 0.2, and weight decay 5e-4. The batch size is 1024. Training epochs are 200. The learning rate is reduced with a cosine function. The experiment is conducted on one Nvidia A100. + +![](images/36f23499e2d6100bfd97f2e7746f3906634df0a6914275a57db1f4eceec817f1.jpg) +(a) Kaiming-E4 + +![](images/dbdf71363e9eed8a61961b3273eab78011557a425624ed72c41aaecbea0d849a.jpg) +(b) Kaiming-E24 + +![](images/3b1b80b58e8ec26d6677bf76548fd6e731e1b7ca9d44ebbce5f33d4be7def61c.jpg) +(c) Kaiming-E104 + +![](images/9f308e771b99be226734413ab862f60cb1156cc3fa0dda6c382934292e1fe33c.jpg) +(d) Kaiming-E194 + +![](images/17d98c2dfbd0c906b38f274255c11a4e1604cefb70af7ccc6711378617a152cc.jpg) +(e) IDInit-E4 +Figure 17: Histograms of the first convolution weights in ResNet-20. "E" means the epoch index. IDInit contains more zero values in each epoch compared with Kaiming initialization. + +![](images/e48b15aa43542089449841460002eec35a9691bd0002f9b8cc177009b46a3428.jpg) +(f) IDInit-E24 + +![](images/67391fc48d0c1e821a9ef856ce53264f8e65905f4cd7a2ea2630889e1f1102c9.jpg) +(g) IDInit-E104 + +![](images/f0403d9a43c16e1d7d083cf42cc460fac45078d02a33ea2e4fc66d4a6c26b4f5.jpg) +(h) IDInit-E194 + +The results are shown in Figure 17, weights initialized with IDInit are almost full of zero at the beginning, while Kaiming uses a Gaussian distribution. At the end of the training, IDInit still contains more zero values than Kaiming, which is beneficial for memory occupation since a 0 value will not cost memory space. + +# C.5 ANALYSIS ON INPUT-OUTPUT JACOBIAN + +Here we conduct an experiment on Cifar10 with 64 blocks in Figure 1 to demonstrate IDInit follows the dynamical isometry. We use the open-source code3. We remove batch normalization for the more clear difference between IDInit and Kaiming. We use an Adagrad optimizer with a learning rate 0.01. The batch size is 100. The activation is ReLU. The experiment is conducted on one Nvidia A100. + +![](images/a6f059f54d3a0084c8fa5b97068e1688de980bd0fde28d15a56cbf47a23ea2ba.jpg) +(a) Default-E1 + +![](images/c851da1fd8dd756b9ffba65926bd3d13139263437a5822b919984fa057826b85.jpg) +(b) Default-E2 + +![](images/b8ded94ba07d4a7ac194ee072ff800400308aac39e989a1cbb75080f158c60cb.jpg) +(c) Default-E3 + +![](images/91dd371045a4feecb055ef21b788481731073ca4274ecfb67667dd54af62f2cc.jpg) +(d) Default-E4 + +![](images/4ffb4294772cfde6dc1e338317825a7720eaa796f0596aa21563e4d7ad3bfa9a.jpg) +(e) IDInit-E1 + +![](images/39016855dd49de074b12d745a19d97dfdb5fb1aca742ca676667f7d274cfad80.jpg) +(f) IDInit-E2 + +![](images/fa78520312074bc92f30acdf87eb88be2fa582f2f28422ad8b5ef08cd448110a.jpg) +(g) IDInit-E3 + +![](images/c921cbc34fa4c2e741f5d433bc3c3e744b3af50727ecd068eeba8a86afe4eb56.jpg) +(h) IDInit-E4 +Figure 18: Histograms of log singular values $(\log (\lambda_{i_0}))$ for the input-output Jacobian. "E" means the epoch index. Compared with Default initialization, IDInit has a significantly smaller squared singular value $\chi$ , which can achieve a faster reduction of the loss. + +As shown in Figure 18, Default initialization cause a high squared singular value $\chi$ , reaching more than 2000. Compared to Default, IDInit only derives $\chi$ around 1, indicating correspondence to the dynamical isometry. In addition, the loss of IDInit decreases faster than Default, which shows a good convergent ability. + +# C.6 FAILURE OF LONG RESIDUAL STEM + +We conduct this experiment to show the failure case when the residual stem is long to show the importance of the stability of the residual stem. In this experiment, we conduct an experiment on Cifar10. We use a residual network named Res-112 as in Table 10. We set 109 layers in the residual stem. Batch normalization is not applied for fairly validating the stability of initialization methods. We use an SGD optimizer with a learning rate 0.2, and weight decay 1e-8. The batch size is 768. Training epochs are 35. The learning rate is reduced with a cosine function. One Nvidia A100 is used. + +Results are shown in Figure 19. When the network is trained for 4 epochs, both Kaiming and Fixup fail to train the network, since the standard derivations of their outputs explode. By contrast, IDInit successfully trains this network and the standard derivation of the output converges to a stable value. This experiment demonstrates the ability of IDInit to stabilize the residual stem, which can benefit the training of the whole network. + +# C.7 EXPERIMENT ON GPT-BASE-MOE + +We conducted experiments on GPT-Base-MOE, modifying the GPT-Base with 8 experts. The training settings mainly follow Pan et al. (2023). The results, shown in Figure 20, indicate that IDInit can achieve $20\%$ faster performance compared to the default random initialization, demonstrating the superior performance of IDInit. + +![](images/96b054af586d5b444cf2f638b4e75a1ecb36cc6dfef9f8c89ac135549b1f5ece.jpg) +(a) Test Accuracy + +![](images/a61dffe0ae0e6fcce0f4bf5c421947c7a5a59474620891b9f9c9210592b70d0a.jpg) +(b) Standard Derivation +Figure 19: Result of the experiment on the residual network with the long residual stem. Figure 19(a) shows the accuracy of different initialization. Figure 19(b) shows the standard derivations of the outputs of networks with different initialization methods. The black dash line is the standard derivation of the network input. + +Table 10: Architectures of Res-112. Window means the convolutional kernel window size. Channels indicate $\mathbf{c}_{in}$ and $\mathbf{c}_{out}$ of a standard convolutional kernel $\mathcal{C} \in \mathbb{R}^{\mathbf{c}_{in} \times \mathbf{c}_{out} \times k \times k}$ . The avg pool denotes the average pooling operation. Linear means a linear layer. + +
LayerWindowChannels
conv13×33×16
Residual Block3×3[16×16]×18
3×316×32
[32×32]×17
3×332×64
[64×64]×17
3×364×64
conv23×364×64
avg pool
Linear64×10
+ +# C.8 EXPERIMENT ON DI + +We train DiT-S/4 on ImageNet using the provided code4. The experiment is conducted using the default training settings. As illustrated in Figure 21, IDInit consistently achieves faster convergence compared to the default initialization. + +# D DYNAMICAL ISOMETRY IN IDINIT + +Following Bachlechner et al. (2021), we utilize a simple example of the mechanism that dynamical isometry helps IDInit to obtain a fast convergence. Considering a $L$ -layer network with a simple special case of Eq. (1): + +$$ +x ^ {(L)} = \left(r + w ^ {(2)} w ^ {(1)}\right) ^ {L} x ^ {(0)}, \tag {37} +$$ + +![](images/dc318c62276d86cfb66ceee51fcd5e841a1e32dfdb01003737154b0e3602c227.jpg) +Figure 20: Pretraining on GPT-Base-MOE. IDInit can achieve $20\%$ after than Default initialization. + +![](images/1dd68cde98a27bf447cefb73923aefdce993022d70f933164a604c2ebafec62e.jpg) +Figure 21: Training on DiT-S/4. + +where $w^{(1)}$ and $w^{(2)}$ denote the first weight and last weight in a residual stem respectively, and $x^{(*)}$ is the feature in layers. $r \in \{0, 1\}$ determines residual connection. Specifically, $r = 0$ and $r = 1$ represent non-residual and residual conditions respectively. The Jacobian of Eq. (37) is $J_{0L} = (r + w^{(2)}w^{(1)})^L$ . Obviously, identity transition on both non-residual and residual settings, namely $\{r = 0, w^{(2)} = w^{(1)} = 1\}$ and $\{r = 1, w^{(1)} = 1, w^{(2)} = 0\}$ respectively, will achieve $J_{0L} = 1$ , which conforms to the dynamical isometry mechanism that helps improving training ability (Pennington et al., 2017). Further, we delve into a gradient update analysis. Following gradient descent, $w_{1}$ can be updated with + +$$ +\Delta w ^ {(1)} = - \lambda L w ^ {(2)} x ^ {(0)} \left(r + w ^ {(2)} w ^ {(1)}\right) ^ {L - 1} \partial_ {x} R (x) | _ {x = x ^ {(L)}}, \tag {38} +$$ + +where $R$ means the loss function, and $\lambda$ is a learning rate. As $w^{(1)}$ and $w^{(2)}$ are equivalent in Eq. (37), $w^{(2)}$ can be updated similar to Eq. (38). When $w^{(1)} = 1$ , updates are required less than 1. Therefore, the learning rate is constrained to + +$$ +\left\{ \begin{array}{l l} \lambda \propto L ^ {- 1}, & \text {i f n o n - r e s i d u a l ,} \\ \lambda \propto L ^ {- 1} (1 + w ^ {(2)}) ^ {L - 1}, & \text {i f r e s i d u a l .} \end{array} \right. \tag {39} +$$ + +![](images/e204675900d95cb3611f73c88eac92372c975e0b20781b882eb2350370eb2364.jpg) +(a) Non-Residual Plot. + +![](images/84d5e049ff3bcc00214add9fd8dcdfd7bb2d02b4ce58ab9b1f0be782640e02e9.jpg) +(b) Residual Plot. +Figure 22: Contour plots of the log gradient norm $\log ||\partial R||_2$ on non-residual and residual networks. $w^{(1)}$ and $w^{(2)}$ are both weights. The training process set as Bachlechner et al. (2021), which is conducted on ground-truth $x^{(L)} = 50 \times x_0$ via gradient descent using a training set of $x_0 = \{1, 1, 1, \dots, 1, 8\}$ . (a) shows $\{w^{(2)} = w^{(1)} = 1\}$ can avoid poorly conditioned regions around 0, and converge to $w^{(1)}w^{(2)} = 2.19$ . (b) cares about two initial positions $\{w^{(1)} = 0, w^{(2)} = 1\}$ and $\{w^{(2)} = 1, w^{(1)} = 0\}$ . The two points' trajectories do not also pass the poor regions around $w^{(1)} = -1, w^{(2)} = 1$ and converge to the solution $w^{(1)}w^{(2)} = 1.19$ . + +For the non-residual condition, the learning rate is polynomial to $L$ , thereby insensitive to the depth. By contrast, in the residual block, $w^{(2)} >> 0$ will cause learning rate exponentially small and $w^{(2)} = -1$ also cause gradient diffusion. On this condition, setting $w^{(2)} = 0$ can be a good solution for avoiding large output and restricting gradients in a suitable norm. Besides, it is feasible to update $w^{(2)}$ with the first non-trial step + +$$ +w ^ {(2)} = - \lambda L w ^ {(1)} x ^ {(0)} \partial_ {x} R (x) | _ {x = x ^ {(L)}}, \tag {40} +$$ + +and will converge with a learning rate that is polynomial in the depth $L$ of the network. We plot the training dynamics in Figure 22, and use this simple example to illustrate the mechanism of IDInit, which is always a well-conditioned position for training. \ No newline at end of file diff --git a/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/images.zip b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2c776029e7fd2a88c676f4f279b161e02f432763 --- /dev/null +++ b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5601431c56b7b2a52b97e0de29526969bb7337521e41efb533c5e3d01075e6e1 +size 1542393 diff --git a/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/layout.json b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a9671030ae3683064a67953ce66c41d00b943b91 --- /dev/null +++ b/ICLR/2025/IDInit_ A Universal and Stable Initialization Method for Neural Network Training/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8aa4437024c67805771b71c412931b99974de79f451ae7f821645dfe223d7175 +size 1137848 diff --git a/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_content_list.json b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..46af2d32fc04f44f7c3c924057168dd1b9e4f087 --- /dev/null +++ b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efa3cce40846ebd26c4a806137e520cbaca55e3476adf70c967e3681f2054473 +size 90352 diff --git a/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_model.json b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1fb9b569c8acb8c3fb1bf93e517d54e5994581a0 --- /dev/null +++ b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d468fa78edc5122896a43c5c3807dea1604279c42b9b34708fa48f7fdd18c02e +size 114021 diff --git a/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_origin.pdf b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3fcca53ec7bc7bad3d197dcd86929cfb7380a2c0 --- /dev/null +++ b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/6229a27e-7afe-4b4f-aef5-ae2434acd504_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ada29a718058742d8b923f2e09d6a3fa1a0ea795291be5de1230915591b76a0 +size 421521 diff --git a/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/full.md b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/full.md new file mode 100644 index 0000000000000000000000000000000000000000..97838f8bde49d812de95c03f22631813dfde9414 --- /dev/null +++ b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/full.md @@ -0,0 +1,273 @@ +# IFORMER: INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION + +Chuanyang Zheng + +Independent Researcher + +chuanyang_zheng@sjtu.edu.cn + +# ABSTRACT + +We present a new family of mobile hybrid vision networks, called iFormer, with a focus on optimizing latency and accuracy on mobile applications. iFormer effectively integrates the fast local representation capacity of convolution with the efficient global modeling ability of self-attention. The local interactions are derived from transforming a standard convolutional network, i.e., ConvNeXt, to design a more lightweight mobile network. Our newly introduced mobile modulation attention removes memory-intensive operations in MHA and employs an efficient modulation mechanism to boost dynamic global representational capacity. We conduct comprehensive experiments demonstrating that iFormer outperforms existing lightweight networks across various tasks. Notably, iFormer achieves an impressive Top-1 accuracy of $80.4\%$ on ImageNet-1k with a latency of only 1.10 ms on an iPhone 13, surpassing the recently proposed MobileNetV4 under similar latency constraints. Additionally, our method shows significant improvements in downstream tasks, including COCO object detection, instance segmentation, and ADE20k semantic segmentation, while still maintaining low latency on mobile devices for high-resolution inputs in these scenarios. Code and models are available at: https://github.com/ChuanyangZheng/iFormer. + +# 1 INTRODUCTION + +Building lightweight neural networks facilitates real-time analysis of images and videos captured by mobile applications such as smartphones. This not only enhances privacy protection and security by processing data locally on the device but also improves overall user experience. + +Through the decades, convolutional neural networks (CNNs) (Krizhevsky et al., 2012; Szegedy et al., 2015; He et al., 2016) have emerged as the primary choice for balancing latency and performance on resource-constrained mobile devices. However, a significant limitation of CNNs is their reliance on a local sliding window mechanism, which imposes crucial inductive biases that may hinder modeling flexibility. Recently, the soaring development of vision transformers (ViTs) (Dosovitskiy et al., 2020) has begun to dominate various computer vision tasks, including image classification (Zhai et al., 2022), object detection (Liu et al., 2021a), and semantic segmentation (Xie et al., 2021). The core mechanism underlying ViTs is self-attention, which dynamically learns interactions between all image patches. This enables the model to focus on important regions adaptively and capture more global features. Nevertheless, deploying ViTs on mobile devices with limited re + +sources poses significant challenges. On the one hand, the quadratic computational complexity of attention renders them unsuitable for large feature maps, which are common in the early stages of vi + +![](images/128d001d6c4515ac1466e518b786f6b8d1ae5c4dae13a285981c2a33605c6361.jpg) +Figure 1: Comparison of latency and accuracy between our iFormer and other existing methods on ImageNet-1k. The latency is measured on an iPhone 13. Our iFormer is Pareto-optimal. + +sion networks. On the other hand, the multi-head mechanism requires reshaping operations, leading to increased memory usage. + +Many research efforts are devoted to combining the advantages of both CNNs and ViTs in designing lightweight networks while mitigating inefficient operations in mobile applications. Some studies (Zhang et al., 2023; Wang et al., 2024; Ma et al., 2024) revisit the architectural designs of lightweight CNNs from a ViT perspective and incorporate key components that contribute to the performance of ViTs into CNNs. Although these pure lightweight CNNs show improved performance compared to previous mobile networks (Howard et al., 2017; Zhang et al., 2018; Sandler et al., 2018), they still lag behind the powerful self-attention in ViTs. Another line of works (Mehta & Rastegari, 2021; Chen et al., 2022b; Li et al., 2023; Cai et al., 2023; Shaker et al., 2023; Vasu et al., 2023a; Qin et al., 2024) proposes innovative attention mechanisms to address the limitation of standard attention (Vaswani, 2017) and blend convolutions to achieve a better balance between latency and performance. These attention mechanisms either reduce the number of queries and keys (Shaker et al., 2023; Qin et al., 2024), limit the attention span (Wan et al., 2023), or adopt linear attention (Cai et al., 2023), which may compromise performance to some extent. + +In this work, we present the iFormer, a herd of lightweight models that integrates the strengths of both CNNs and ViTs, achieving a state-of-the-art balance between latency and accuracy. Specifically, we employ a hierarchical architecture consisting of four stages. In the earlier, high-resolution stages, we utilize fast convolution to extract local representations. To construct the convolutional block, we start with a "modern" ConvNeXt (Liu et al., 2022), which incorporates a series of design decisions inspired by ViTs. Then we progressively "lighten" the ConvNeXt to create a streamlined lightweight network, optimizing it for real-time mobile latency on an iPhone 13, in contrast to the FLOPs and parameters used in prior works (Mehta & Rastegari, 2021; Chen et al., 2022b). This results in a fast convolutional architecture with strong performance. To further enhance the dynamic properties and its ability to model long-range contexts, we incorporate self-attention in the later low-resolution stages. However, direct implementation of standard multi-head self-attention (MHA) brings notable memory overheads and slows down inference speed on mobile devices. We identify that the increased latency stems primarily from the reshaping operations in MHA. More analyses reveal that multiple attention heads behave similarly. Therefore, we propose a simple yet effective single-head modulation self-attention (SHMA), which significantly minimizes memory costs while preserving strong performance. Fig. 4 provides an illustration of SHMA. In detail, SHMA learns spatial context interactions through optimized self-attention. Concurrently, a parallel feature extraction branch is employed to capture informative features. Finally, we fuse the outputs of these two branches to facilitate a more flexible and dynamic exchange of information, compensating for the slight performance degradation of the single-head attention when compared to MHA. + +Benefiting from the fast local representation capacity of convolution and the efficient global modeling proficiency of the proposed SHMA, iFormer outperforms existing pure lightweight CNNs and hybrid networks across multiple visual recognition tasks, including image classification, object detection, instance segmentation, and semantic segmentation. For instance, in the context of image classification as shown in Fig. 1, iFormer-M achieves a Top-1 accuracy of $80.4\%$ with only 1.10 ms on an iPhone 13 without advanced training strategies such as knowledge distillation (Touvron et al., 2021a) or reparameterization (Ding et al., 2021). Notably, our model obtains a $0.5\%$ improvement in Top-1 accuracy compared to the recent MNV4-Conv-M (Qin et al., 2024), while being $1.4\times$ faster than FastViT-SA12 (Vasu et al., 2023a) with similar accuracy. These results demonstrate the effectiveness of the proposed network in capturing both local and global feature representations. + +# 2 RELATED WORK + +# 2.1 EFFICIENT CONVOLUTIONAL NETWORKS + +In the past 2010s, computer vision was dominated by CNNs, and so were efficient networks. The first remarkable breakthrough in mobile CNNs is MobileNets (Howard et al., 2017), which hatches the concept of decomposing standard convolution into depthwise and pointwise counterparts. Subsequently, MobileNetV2 (Sandler et al., 2018) introduces an inverted residual bottleneck block to push the state-of-the-art for mobile models. Numerous studies have aimed to accelerate CNNs via various approaches, such as channel shuffle in ShuffleNet (Zhang et al., 2018; Ma et al., 2018) and cheap linear transformations in GhostNet (Han et al., 2020). Meanwhile, Neural architecture search + +(NAS) has emerged as a method for automating the design of neural networks, optimizing for performance under resource constraints. EfficientNet (Tan & Le, 2019), MobileNetV3 (Howard et al., 2019), and FBNet (Wu et al., 2019) all achieve rather good performance. Besides, MobileOne (Vasu et al., 2023b) proposes to train a model using reparameterizable branches, which are merged during inference. Recently, following the revolution of ViTs, several methods reexamine the design spaces and training strategies (Liu et al., 2024) for mobile CNNs. For instance, RepViT (Wang et al., 2024) integrates efficient architectural designs from ViTs into MobileNetV3, outperforming existing lightweight CNNs. Other approaches, such as FocalNet (Yang et al., 2022a), Conv2Former (Hou et al., 2024), and EfficientMod (Ma et al., 2024), fuse features from context modeling and feature projection branches, also known as modulation mechanism, to enhance the model with dynamic properties analogous to attention. However, pure CNNs remain inherently spatially localized and their reliance on stationary weights restricts their flexibility. Although modulation can partially mitigate this limitation by enhancing dynamic capacity, they still exhibit deficiencies in building global interactions. + +# 2.2 EFFICIENT VISION TRANSFORMERS + +The success of Vision Transformer (Dosovitskiy et al., 2020) offers a compelling demonstration of the potential to apply transformer to computer vision tasks. Following this, ViT and its numerous variants (Liu et al., 2021a; Dong et al., 2022; Li et al., 2022a) sweep across various scenarios. However, the quadratic complexity of self-attention behind ViTs poses significant challenges for efficiency. The following researches seek to boost ViT efficiency through efficient attention mechanisms (Wang et al., 2021; Zhu et al., 2023; Hatamizadeh et al., 2023), model compression (Liu et al., 2021b; Zheng et al., 2022), knowledge distillation (Hao et al., 2021), and token reduction (Rao et al., 2021; Bolya et al., 2022). Recent studies further introduce ViTs into mobile applications. One mainstream of work combines efficient convolution and ViT to create lightweight hybrid networks (Mehta & Rastegari, 2022; Vasu et al., 2023a). MobileViT (Mehta & Rastegari, 2021) directly integrates MobileNetv2 blocks and ViT blocks, while Mobile-Former (Chen et al., 2022b) features a parallel design of MobileNet and ViT with a two-way bridge connecting the two. To further accelerate inference, some approaches replace the standard attention (Vaswani, 2017) with efficient variants within the hybrid networks. These include reducing the number of delegate tokens for computing attention (Pan et al., 2022), employing channel attention (Maaz et al., 2022), substituting projection in attention with efficient ghost modules (Ma et al., 2022), and utilizing linear attention mechanisms (Zhao et al., 2022). Besides manual designs, EfficientFormer (Li et al., 2022b; 2023) and MobileNetv4 (Qin et al., 2024) search for efficient architectures in a unified space encompassing both convolution operators and transformer operators. Another stream of work focuses on efficient attention mechanisms and directly employs them throughout the entire network (Shaker et al., 2023; Cai et al., 2023). For example, CMT (Guo et al., 2022) takes advantage of depth-wise convolution to downsample key and value to reduce computation. GhostNetV2 (Tang et al., 2022) applies two fully connected layers along the horizontal and vertical directions to compute attention, a decoupled version of MLP-Mixer (Tolstikhin et al., 2021). Recently, SHViT observes computational redundancy in the multi-head attention module and proposes to apply sing-head attention. In contrast to these existing approaches, we introduce a novel efficient attention module without sacrificing informative interactions, thereby maintaining strong representational capacity. Regarding attention design, ours is a bit similar to SHViT but is considerably superior as shown in Table 18 in the supplementary material. The key difference lies in the novel modulation attention. In addition, we explore efficient attention mechanisms in an on-device environment while SHViT focuses on general-purpose GPUs, fundamentally different hardware. + +# 3 METHOD + +We present the overall architecture of our iFormer in Fig. 4, which offers a Pareto-optimal accuracy-latency trade-off on mobile applications. Our exploration towards a streamlined lightweight network unfolds as follows: 1) establishing the baseline and measure metric in Sec. 3.1. 2) exploring acceleration techniques consisting of macro and micro designs in Sec. 3.2. 3) injecting global attention in Sec. 3.3. Finally, we create a new family of efficient hybrid vision transformers tailored for mobile applications in Sec. 3.3. A detailed trajectory illustrating the evolution from a general hierarchical CNN to a fast hybrid vision transformer is depicted in Fig. 2. + +![](images/7339c2107281e1bde978aa87d03542b4e4f69a4af62fa5986fd982f221f5e1d2.jpg) +Figure 2: Illustration of the evolution from the ConvNeXt baseline towards the lightweight iFormer. The orange bars are model accuracies and the light blue bars are model latencies. We also include a red latency outline for better visualization. + +![](images/56e9f1cb8aeffdbf9bbc86d482bd7f41e85a87a6b5c0f4bc9067ba1811cde192.jpg) +Figure 3: The distribution of average cosine similarity among multiple heads within the MHA mechanism. As the layer depth increases, the similarity goes higher. + +Table 1: Latency comparison between multi-head and single-head baseline. + +
ModelsLatency (ms)Top-1 Acc. (%)
MHA Baseline1.4079.9
SHA Baseline1.12 (1.25×)79.8
+ +# 3.1 PREPARING CONVNEXT + +Our goal is to create an efficient multiscale network, where spatial dimensions of intermediate representations shrink as inference proceeds. In this hierarchical architecture, early network layers have larger spatial dimensions and fewer channels (e.g. $56 \times 56 \times 48$ ), which renders them memory-bound. Highly optimized convolution is more appropriate for these layers. Guided by this principle, we choose a pure convolutional network as our base architecture, specifically ConvNeXt (Liu et al., 2022) which absorbed several key components from ViTs and competes favorably against ViTs. We gradually "lighten" the network to achieve a more favorable balance between latency and accuracy. For speed metric, we utilize on-device latency, measured on an actual iPhone 13 and compiled by Core ML Tools (CoreML), rather than FLOPs and parameter counts in previous methods (Mehta & Rastegari, 2021; Chen et al., 2022b; Zhang et al., 2022), which are not well correlated with latency. Regarding performance, we follow the training recipe in ConvNeXt while removing the layer scale to align prior methods (Li et al., 2022b; Wang et al., 2024) for a fair comparison. Please refer to Sec. B in the supplementary material for more details. To initiate our study, we systematically scale down the ConvNeXt by reducing the number of blocks and the width. This results in a lightweight model with a latency of $1.07~\mathrm{ms}$ and a Top-1 accuracy of $74.9\%$ , serving as our initial baseline. + +# 3.2 LIGHTENING BASELINE + +Seeing Better with Early Convolutions Following ViTs, ConvNeXt adopts an aggressive "patchify" strategy as the stem cell, specifically by splitting the input image into a series of non-overlapping patches via a 4x4 non-overlapping convolutional layer. However, some studies (Xiao et al., 2021; Chen et al., 2022a) indicate that an early convolutional stem can increase optimization stability and facilitate faster model convergence. Moreover, compared to general models, lightweight models typically have fewer parameters and a reduced capacity. An aggressive non-overlapping layer may lead to the premature loss of rich information. Consequently, we opt to replace the non-overlapping "patchify" stem with a stack of overlapping convolutional layers, as shown in Fig. 4. This modification elevates the top-1 accuracy to $76.7\%$ with a negligible increase in latency of $0.1~\mathrm{ms}$ . + +Normalization An obvious difference between ConvNeXt and previous CNNs is the normalization layer. ConvNeXt utilizes Layer Normalization (LN) (Ba et al., 2016), commonly used in Natural Language Processing (NLP), whereas the latter uses Batch Normalization (BN) (Ioffe, 2015). Albeit its superior performance, LN requires on-the-fly statistics calculation in inference along with + +![](images/a3264b8caf02eb0f41419981dd18a3dab71b332c1a919afb0d574bb5c2276fa6.jpg) +Figure 4: Overview of iFormer architecture, detailed convolutional stem, block design, and SHMA. The hatched area in SHMA indicates extra memory-intensive reshaping operations that are eliminated by SHMA. $S(\cdot)$ denotes the softmax function. $R$ is the ratio for reducing channels of query and key. It is set to 2 in iFormer. We omit BN following project or convolution for simplicity. + +division and square root operations, leading to inefficiency on mobile hardware (Yang et al., 2022b). On the contrary, BN operates with fixed statistics during inference as an offline method and can be seamlessly fused with other linear operations, providing a "free lunch". This significantly reduces computational demands and memory overheads on mobile devices. Therefore, we substitute LN with BN throughout the network and merge it during inference. Additionally, we also substitute non-overlapping downsample layers with overlapping counterparts. These adjustments result in a reduction of overall latency to $0.77\mathrm{ms}$ while enhancing the Top-1 accuracy slightly to $77.10\%$ . + +Going Deeper There is considerable evidence indicating that increasing the depth of a model can enhance its capacity and yield performance benefits (Touvron et al., 2021b; Yang et al., 2022a). Most lightweight models typically stack more blocks to boost performance within constrained resources, as exemplified by the MobileNet series (Howard et al., 2019; Qin et al., 2024). In this study, we explore the potential of deepening ConvNeXt by increasing the number of blocks in each stage from (2,2,6,2) to (3,3,9,3). This increase in depth leads to a substantial improvement, raising the accuracy from $77.1\%$ to $78.8\%$ , although causing a temporary increase in latency to $1.05~\mathrm{ms}$ . + +Stage Ratio The stage ratio in ConNeXt is not optimized for lightweight models. A substantial number of depthwise convolutions in the early stages incurs significant memory transfer costs. Meanwhile, the presence of many blocks with a channel expansion ratio of 4 in the Feed-Forward Network (FFN) in the last stage, which already has a high channel dimension, imposes substantial computational demands. These factors lead to a sub-optimal allocation of computational resources. To address these issues, we propose reallocating more computational resources to the third stage while reducing memory access costs in the early stage. Specifically, the blocks in each stage are adjusted from $(3,3,9,3)$ to $(2,2,18,2)$ . As expected, this achieves a better balance between latency and performance, with Top-1 accuracy increasing to $79.1\%$ while enjoying a lower latency of $1.01\mathrm{ms}$ . + +Kernel Size Here we examine the effects of different kernel sizes in mobile settings and observe that utilizing a larger kernel size introduces nearly no latency burden, as shown in Table 2. So we maintain the convolutional kernel size at $7 \times 7$ in each basic block, consistent with ConvNeXt. Furthermore, previous approaches use a kernel size of $3 \times 3$ in the convolutional stem. This small receptive field may hinder feature representation during the early downsampling process. As pre + +Table 2: Latency under different convolutional kernel sizes. + +
Kernel SizeLatency (ms)
3×31.00
7×71.01
+ +Previously noted, the early layers are memory-bound, allowing for opportunities to employ compute-intensive operations (i.e., dense convolution). Therefore, we enlarge the kernel size of the dense + +convolutional layer in the stem cell to $5 \times 5$ . As illustrated in Fig. 2, this change has no impact on inference latency while enhancing Top-1 accuracy by $0.3\%$ . + +# 3.3 SINGLE-HEAD MODULATION ATTENTION + +Single-Head vs. Multi-Head ViTs typically apply MHA, which projects the queries, keys, and values multiple times with different learnable linear projections and performs multiple attention functions simultaneously. In practice, the multi-head mechanism requires the reshaping of feature maps first, causing large memory access and transfer costs. This can seriously impact inference latency, especially on resource-constrained mobile devices. To investigate this issue, we substitute the last half of the convolutional blocks in the third stage and all blocks in the last stage with standard ViT blocks, as depicted in Fig. 4. We refer to this hybrid network as the MHA baseline. Next, we build another network by substituting the MHA with Single-Head self-Attention (SHA), referring to it as the SHA baseline. The comparison is shown in Table 1. The SHA baseline shows a $1.25 \times$ acceleration over its MHA counterpart on the iPhone 13. This verifies that additional reshaping operations in MHA incur significant memory access costs, leading to a considerable decline in inference speed. + +This naturally calls for optimizing MHA. Recent methods (Pan et al., 2022; Qin et al., 2024) primarily focus on downsampling the query or the key, which may hurt global attention capacity. Instead, we aim to reduce the redundant reshaping of MHA while preserving all token-to-token interactions. Previous works (Michel et al., 2019; Yun & Ro, 2024) indicate that a single attention head can approach the performance of multiple heads in general plain transformer models, such as DeiT. To investigate this on the mobile application, we analyze the average cosine similarity of multiple heads within the same layer of the aforementioned MHA baseline, which is a hierarchical lightweight network, and present our findings in Fig. 3. We clearly see that the average cosine similarity reaches $50\%$ and even $75\%$ in the final layer. Furthermore, the SHA baseline, as shown in Table 1, exhibits only a negligible accuracy drop of $0.1\%$ . These suggest that SHA achieves a more favorable balance between accuracy and latency, obtaining an accuracy of $79.8\%$ with a latency of $1.12\mathrm{ms}$ . + +Modulation Attention We further introduce a novel modulation attention to boost performance and strengthen flexibility in modeling, as illustrated in Fig. 4. Formally, we start from the abstracted modulation mechanism (Ma et al., 2024), similar to the gate mechanism Shazeer (2020). Assume we are given an input feature map $\mathbf{x} \in \mathbb{R}^{C \times H \times W}$ where $C$ , $H$ , and $W$ denote the channels, height, and width of the feature map. The modulated output can be written as follows: + +$$ +\mathbf {x} _ {\mathbf {o}} = f (\mathbf {x}) \odot \operatorname {c t x} (\mathbf {x}), \tag {1} +$$ + +where $f(\cdot)$ denotes the feature mapping branch and $\mathrm{ctx}(\cdot)$ is the context modeling branch. The output $\mathbf{x_o}$ is the fused features from both branches via efficient element-wise multiplication. The key idea of our approach is to modulate the feature using SHA instead of relying on convolutional layers, as seen in previous works (Yang et al., 2022a; Ma et al., 2024). Since SHA captures global interactions through self-attention, it excels in extracting rich contextual information and better controlling the flow of information. This process can be expressed as follows: + +$$ +\operatorname {c t x} (\mathbf {x}) = \operatorname {S H A} \left(\mathbf {W} ^ {\mathbf {Q}} \mathbf {x}, \mathbf {W} ^ {\mathbf {K}} \mathbf {x}, \mathbf {W} ^ {\mathbf {V}} \mathbf {x}\right), \tag {2} +$$ + +where $\mathbf{W}^{\mathrm{Q}},\mathbf{W}^{\mathrm{K}},\mathbf{W}^{\mathrm{V}}$ are the project weights for query, key, and value, respectively. For simplicity, we omit the bias term. To minimize inference costs, we utilize a single projection layer in the feature mapping branch. To enhance expressivity and improve optimization stability, we apply individual nonlinear activation functions to both branches, as follows: + +$$ +\mathbf {x} _ {\mathbf {o}} = \sigma \left(\mathbf {W} ^ {\mathbf {M}} \mathbf {x}\right) \odot \sigma (\operatorname {c t x} (\mathbf {x})), \tag {3} +$$ + +where $\sigma$ is the sigmoid function and $\mathbf{W}^{\mathrm{M}}$ denotes the feature projection weight. We also experiment with various activation functions for modulation in Sec. 5 and observe that the sigmoid works rather well. Finally, the output from the modulation attention is projected in a manner as standard attention. + +Equipped with Single-Head Modulation Attention (SHMA), our model improves the accuracy to $80.4\%$ with an intermediate latency of $1.15~\mathrm{ms}$ . This performance notably surpasses that of the recent MobileNetV4, which achieves an accuracy of $79.9\%$ . + +Reducing Width Until now, we have developed a lightweight network that performs pretty well, but at a bit slow speed. To push the trade-off toward the state-of-the-art, we revise the width configuration in the SHMA. The modulation mechanism enriches the output by enabling more dynamic modeling in both spatial and channel dimensions, making it possible to use a weaker SHA and FFN. In light of this, we reduce the head dimension in the SHMA (i.e., $\mathbf{W}^{\mathbf{Q}}$ , $\mathbf{W}^{\mathbf{K}}$ ) to a small factor of the feature dimension, further details can be found in Table 15 in the supplementary material. Simultaneously, we shrink the expansion ratio in FFN following SHMA from 4 to 3. This process obtains a lower latency of $1.10~\mathrm{ms}$ , although a slight drop of $0.2\%$ in accuracy. + +Positional Embedding Last but not least, positional information plays a crucial role in self-attention as it regards input as a set of tokens. Adding positional embedding will help the attention learn permutation-variant features. We apply conditional positional encodings (CPE) (Chu et al., 2021) that are dynamically generated and conditioned on the local neighborhood of the input tokens, as illustrated in Fig. 4. The integration of CPE further enhances our model's performance, achieving a Top-1 accuracy of $80.4\%$ with only $1.10~\mathrm{ms}$ , establishing a state-of-the-art trade-off. + +iFormer The result of these modifications is an extremely fast and efficient hybrid network, which we denote iFormer. The overall architecture is depicted inFig. 4. It integrates fast local convolutional layers in the early stages that operate on higher resolution and global SHMA in later stages which processes lower resolution. Besides, we create a series of iFormer models tailored to various hardware resource constraints. For detailed architectural hyperparameters of these model variants, please refer to Table 15 in the supplementary material. + +# 4 EXPERIMENTS + +# 4.1 IMAGE CLASSIFICATION + +Settings. We first evaluate our models on classification on ImageNet-1K (Deng et al., 2009). To ensure a fair comparison with prior studies, we follow the previous training recipe (Touvron et al., 2021a; Liu et al., 2022) and train all models for 300 epochs with a standard image size of $224 \times 224$ . Please refer to Sec. B in the supplementary material for details. Besides Top-1 validation accuracy, we also report the latency measured on an iPhone 13 with models compiled by Core ML Tools (CoreML) under a batch size of 1, as done in (Li et al., 2023; Wang et al., 2024; Vasu et al., 2023b). It's worth highlighting that we do not apply any advanced strategies such as distillation (Li et al., 2023) and reparameterization (Ding et al., 2021). + +Table 3 summarizes a comparison between our iFormer and state-of-the-art lightweight models, organized by latency. iFormer demonstrates a Pareto-optimal trade-off between accuracy and latency. For example, iFormer-M obtains $80.4\%$ top-1 accuracy with a latency of only $1.1~\mathrm{ms}$ surpassing recent MobileNetV4-Conv-M and RepViT-M1 by $0.5\%$ and $1.0\%$ respectively. This is noteworthy considering that MobileNetV4 requires a longer training schedule (500 vs. 300) and takes a larger input resolution (256 vs. + +Table 4: Results with distillation on ImageNet-1K. * indicates the model is trained with a strong training strategy (i.e., reparameterization). + +
ModelLatency (ms)Reso.EpochsTop-1 (%)
EfficientFormerV2-S1 (2023)1.0222430079.0
EfficientFormerV2-S1 (2023)1.0222445079.7
MobileViGv2-S*(2024)1.2422430079.8
FastViT-T12* (2023a)1.1225630080.3
RepViT-M1.1* (2024)1.0422430080.7
iFormer-M1.1022430081.1
SHViT-S4 (2024)1.4822430080.2
EfficientFormerV2-S2 (2023)1.6022430081.6
MobileViGv2-M(2024)1.7022430081.7
FastViT-SA12* (2023a)1.5025630081.9
EfficientFormerV2-S2 (2023)1.6022445082.0
RepViT-M1.5* (2024)1.5422430082.3
iFormer-L1.6022430082.7
+ +224). When compared to other recent models using reparameterization, including FastViT-T12, GhostNetV3- $1.3\times$ , and MobileOne-S3, iFormer-M achieves superior accuracy while maintaining lower latency. Moreover, iFormer outperforms various hybrid networks. Thanks to the efficient SHMA, iFormer-L achieves more outstanding performance than other attention variants, such as multi-query attention in MNV4-Hybrid-M, additive attention in SwiftFormer-L1, and linear attention in EfficientVIT-B1-r288. + +Table 3: Classification results on ImageNet-1K. $\dagger$ indicates models that are trained with a variety of advanced training strategies including complex reparameterization, distillation, optimizer, and so on. We provide a more comprehensive comparison in Sec. G in the supplementary material. + +
ModelParams (M)GMACsLatency ↓ (ms)Reso.EpochsTop-1 (%)
MobileNetV2 1.0x (2018)3.40.300.7322450072.0
MobileNetV3-Large 0.75x (2019)4.00.160.6722460073.3
MNV4-Conv-S (2024)3.80.200.6022450073.8
iFormer-T2.90.530.6022430074.1
MobileNetV2 1.4x (2018)6.90.591.0222450074.7
MobileNetV3-Large 1.0x (2019)5.40.220.7622460075.2
SwiftFormer-XS (2023)3.50.600.9522430075.7
SBCFormer-XS (2024)5.60.700.7922430075.8
GhostNetV3 1.0xt (2024)6.10.170.9922460077.1
MobileOne-S2 (2023b)7.81.300.9222430077.4
RepViT-M1.0 (2024)6.81.100.8522430078.6
iFormer-S6.51.090.8522430078.8
EfficientMod-xxs (2024)4.70.601.2922430076.0
SBCFormer-S (2024)8.50.901.0222430077.7
MobileOne-S3 (2023b)10.11.901.1622430078.1
SwiftFormer-S (2023)6.11.001.1222430078.5
GhostNetV3 1.3xt (2024)8.90.271.2422460079.1
FastViT-T12 (2023a)6.81.401.1225630079.1
RepViT-M1.1 (2024)8.21.301.0422430079.4
MNV4-Conv-M (2024)9.21.001.0825650079.9
iFormer-M8.91.641.1022430080.4
Mobile-Former-294M (2022b)11.40.292.6622445077.9
MobileViT-S (2021)5.62.003.5525630078.4
MobileOne-S4 (2023b)14.82.981.7422430079.4
SBCFormer-B (2024)13.81.601.4422430080.0
GhostNetV3 1.6xt (2024)12.30.401.4922460080.4
EfficientViT-B1-r288 (2023)9.10.863.8728845080.4
FastViT-SA12 (2023a)10.91.901.5025630080.6
MNV4-Hybrid-M (2024)10.51.201.7525650080.7
SwiftFormer-L1 (2023)12.11.601.6022430080.9
EfficientMod-s (2024)12.91.402.5722430081.0
RepViT-M1.5 (2024)14.02.301.5422430081.2
iFormer-L14.72.631.6022430081.9
+ +Results with distillation on ImageNet-1K. We conducted rigorously fair training as the previous methods above. Recently, some works report enhanced performance leveraging more advanced training strategies. We investigate whether these training recipes can also improve iFormer. Following previous works (Li et al., 2023; Wang et al., 2024), we employ the RegNetY-16GF (Radosavovic et al., 2020) model with a top-1 accuracy of $82.9\%$ as the teacher model for distillation. Our findings reveal that iFormer improves obviously over its counterpart without distillation. For example, iFormer-L shows a $1.0\%$ increase under the same latency. iFormer also outperforms EfficientFormerV2-S2, despite the latter being trained with a $1.5\times$ longer schedule. + +# 4.2 OBJECT DETECTION AND INSTANCE SEGMENTATION + +To validate the effectiveness of iFormer on downstream tasks, we train Mask R-CNN (He et al., 2017) with iFormer as the backbone for 12 epochs $(1\times)$ , using the MMDetection toolkit (Chen et al., 2019). We also report backbone latency measured at a resolution of $512\times 512$ on an iPhone 13. The results are presented in Table 5. In comparison to lightweight models, iFormer-M surpasses FastViT-SA12 by $+1.9\% / + 2.0\%$ in $\mathrm{AP^{box} / AP^{mask}}$ while running $1.32\times$ faster. iFormer-L also obtains $+0.1\% / + 0.6\%$ in $\mathrm{AP^{box} / AP^{mask}}$ than EfficientMod-S, which utilizes a convolutional modulation mechanism to learn dynamics similar to self-attention. Notably, EfficientMod-S operates $3.7\times$ slower when processing high-resolution input, underscoring that the proposed novel attention mechanism is more suitable for mobile networks. Meanwhile, when compared to general networks that are not optimized for mobile applications, iFormer demonstrates significant advantages. For instance, iFormer-L exceeds the performance of ConvNeXt-T with improvements of $+1.2\% / + 1.4\%$ in + +Table 5: Object detection & instance segmentation results on MS COCO 2017 using Mask R-CNN. Semantic segmentation results on ADE20K using the Semantic FPN framework. We measure all backbone latencies with image crops of $512 \times 512$ on iPhone 13 by Core ML Tools. Failed indicated that the model runs too long to report latency by the Core ML. + +
BackboneParam (M)Latency ↓ (ms)Object DetectionInstance SegmentationSemantic
APboxAPbox50APbox75APmaskAPmask50APmask75mIoU
EfficientNet-B0 (2019)5.34.5531.951.034.529.447.931.2-
ResNet18 (2016)11.72.8534.054.036.731.251.032.732.9
PoolFormer-S12 (2022)11.95.7037.359.040.134.655.836.937.2
EfficientFormer-L1 (2022b)12.33.5037.960.341.035.457.337.338.9
FastViT-SA12 (2023a)10.95.2738.960.542.235.957.638.138.0
RepViT-M1.1 (2024)8.23.1839.861.943.537.258.840.140.6
iFormer-M8.94.0040.862.544.837.959.740.742.4
ResNet50 (2016)25.57.2038.058.641.434.455.136.736.7
PoolFormer-S24 (2022)21.410.040.162.243.437.059.139.640.3
ConvNeXt-T (Liu et al., 2022)29.013.641.062.145.337.759.340.441.4
EfficientFormer-L3 (2022b)31.38.4041.463.944.738.161.040.443.5
RepViT-M1.5 (2024)14.05.0041.663.245.338.660.541.543.6
PVTv2-B1 (2022)14.027.0041.864.345.938.861.241.642.5
FastViT-SA24 (2023a)20.68.9742.063.545.838.060.540.541.0
EfficientMod-S (2024)32.624.3042.163.645.938.560.841.243.5
Swin-T (2021a)28.3Failed42.264.446.239.161.642.041.5
iFormer-L14.76.6042.264.246.039.161.441.944.5
+ +$\mathrm{AP^{box} / AP^{mask}}$ , while requiring fewer parameters and only $50\%$ mobile latency, suggesting iFormer's efficient design in feature extraction and strong potential for mobile applications. + +# 4.3 SEMANTIC SEGMENTATION + +We conduct experiments on the ADE20K (Zhou et al., 2017) using the Semantic FPN (Kirillov et al., 2019), based on the MMSegmentation toolkit (Contributors, 2020). Thanks to its efficient attention design, iFormer outperforms all competing methods in mIoU with similar and much lower latency. For example, iFormer-L surpasses FastViT-SA24 by $+3.5\%$ in mIoU with a $1.36 \times$ faster inference speed. In addition, iFormer-M demonstrates superior mIoU compared to general networks, which typically exhibit substantially greater latency when processing higher-resolution inputs on mobile devices. Although PVTv2-B utilizes downsampled attention, it still requires $27~\mathrm{ms}$ for latency. Similarly, Swin-T involves intensive operations in window partitioning, making it less suitable for mobile applications. Running at $6.6~\mathrm{ms}$ , iFormer-L achieves $+2.0\%$ better mIoU than PVTv2-B1 and $+3.0\%$ better than Swin-T. These results suggest that the proposed attention mechanism offers significant benefits for tasks requiring the perception of fine-grained details. + +# 5 ABLATION STUDIES + +Activation Function Here we explore whether an activation function without an upper bound can enhance the SHMA by allowing neurons to express arbitrarily large values. We compare the widely used Sigmoid Linear Unit (SiLU) (Shazeer, 2020) with the sigmoid function and present the results in Table 6. Directly replacing the activation function in + +Table 6: Activation function comparison in SHMA. PostBN indicates that BN is applied after projection. Pre-LN means that LN is implemented before the projection, as in standard MHA (Vaswani, 2017). + +
SHMA SettingParams (M)GMACsLatency (ms)Top-1 Acc. (%)
SiLU + Post-BN8.91.601.10msDiverged
SiLU + Pre-LN8.91.641.17ms80.3
Sigmoid + Post-BN8.91.601.10ms80.4
+ +SHMA with SiLU will encounter diverging loss during training. The underlying cause is primarily attributed to the element-wise multiplication of the unbounded context branch. To address this, we replace Post-BN in SHMA with Pre-LN, as LN adaptively normalizes each token feature. The modified model experiences a slight decrease in accuracy but incurs an additional 0.07 ms latency, primarily brought by LN. The results suggest that the sigmoid function not only mitigates training instability but also facilitates better convergence. + +Choice of Conv v.s. ViT Bloks In Section 3.3, we replace the convolutional blocks in Stages 3 and 4 with the proposed SHMA block. We provide further ablation studies on the choice of ratio for the ViT blocks. Specifically, We choose the model after enlarging the kernel size as a starting point, then we progressively replace the convolutional blocks in Stages 3 and 4. We do not modify Stages 1 and 2 as their larger spatial dimensions would considerably increase the memory requirements for the self-attention mechanism. + +Table 7: Different ratio of ViT Block. + +
Ratio SettingParams (M)GMACs Latency (ms)Top-1 Acc. (%)
Baseline9.4M1760M1.0ms
Replacing 22% Conv Blocks in Stage 3 as SHA9.1M1724M1.02ms
Replacing 22% Conv Blocks in Stage 3 as SHMA9.2M1739M1.04ms
Replacing 50% Conv Blocks in Stage 3 as SHA8.8M1689M1.04ms
Replacing 50% Conv Blocks in Stage 3 as SHMA8.9M1712M1.07ms
Replacing 78% Conv Blocks in Stage 3 as SHA8.3M1635M1.12ms
Replacing 78% Conv Blocks in Stage 3 as SHMA8.5M1685M1.17ms
Replacing 100% Conv Blocks in Stage 3 as SHA7.9M1599M1.17ms
Replacing 100% Conv Blocks in Stage 3 as SHMA8.3M1665M1.25ms
Replacing 100% Conv Blocks in Stage 3 as SHMA and 100% in Stage 410.0M1792M1.15ms
+ +We present our findings in Table 7. Given that Stage 4 contains only two blocks, we do not conduct further splitting for the ratio. As illustrated in Table 7, although the ViT block has lower FLOPs, it still incurs increased runtime. Substituting all the convolutional blocks in Stage 3 results in the worst performance and the highest latency. Instead, by replacing half of the convolutional blocks in the third stage and all blocks in the final stage, we can better integrate these two operators, thus achieving a favorable trade-off between accuracy and latency. + +Scaling to Larger Model Although iFormer is designed for mobile-device applications, the combination of fast local representation capacity of convolution and the efficient global modeling proficiency of the proposed SHMA enables its scalability for a broader range of applications. To demonstrate the scalability of iFormer, we developed a larger model named iFormer-H with 99M parameters and trained it for 300 epochs following the same strategy outlined in Section B. It is important to note that we add drop path and layer scale, which are commonly used in the training of larger models (Liu et al., 2022; Tu et al., 2022; Shi, 2024). + +We summarize the results in Table 8. A highlight from the results is that iFormer is not specifically designed or trained for this scale. Despite this, iFormer-H outperforms ConvNeXt, achieving a $1.0\%$ increase in accuracy while maintaining a similar + +number of FLOPs. Additionally, it demonstrates comparable performance to TransNeXt-Base, despite utilizing fewer FLOPs. These findings indicate the potential for broader applications of iFormer. We plan to explore larger models suitable for mobile devices in future work. Further ablation studies can be found in Sec. C in the supplementary material. + +Table 8: Scaling to the larger model with 99M parameters. + +
ModelParams (M)GMACs (G)Top-1 Acc. (%)
ConvNeXt-Base (2022)8915.483.8
TransNeXt-Base (2024)9018.484.8
iFormer-H9915.584.8
MaxViT-Base (2022)12024.084.9
+ +# 6 CONCLUSION + +This work proposes iFormer, which integrates highly optimized convolutional operations for the early layers alongside a novel and efficient single-head modulation attention for the later layers. iFormer achieves SOTA Pareto-front in terms of Top-1 accuracy and mobile latency. We also validate the effectiveness of iFormer on downstream dense prediction tasks, including COCO object detection, instance segmentation, and ADE20K semantic segmentation. These inspiring results highlight the potential for mobile applications. We hope iFormer can facilitate the application of artificial intelligence on more mobile devices. In future work, we will seek to alleviate inference bottlenecks sociated with high-resolution images. Meanwhile, we plan to optimize iFormer for more hardware platforms, such as Android devices and NVIDIA Jetson Nano. + +# REFERENCES + +William Avery, Mustafa Munir, and Radu Marculescu. Scaling graph convolutions for mobile vision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5857-5865, 2024. +Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. +Daniel Bolya, Cheng-Yang Fu, Xiaoliang Dai, Peizhao Zhang, Christoph Feichtenhofer, and Judy Hoffman. Token merging: Your vit but faster. arXiv preprint arXiv:2210.09461, 2022. +Han Cai, Junyan Li, Muyan Hu, Chuang Gan, and Song Han. Efficientvit: Lightweight multi-scale attention for high-resolution dense prediction. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 17302-17313, 2023. +Kai Chen, Jiaqi Wang, Jiangmiao Pang, Yuhang Cao, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jiarui Xu, et al. Mmdetection: Open mmlab detection toolbox and benchmark. arXiv preprint arXiv:1906.07155, 2019. +Qiang Chen, Qiman Wu, Jian Wang, Qinghao Hu, Tao Hu, Errui Ding, Jian Cheng, and Jingdong Wang. Mixformer: Mixing features across windows and dimensions. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5249-5259, 2022a. +Yinpeng Chen, Xiyang Dai, Dongdong Chen, Mengchen Liu, Xiaoyi Dong, Lu Yuan, and Zicheng Liu. Mobile-former: Bridging mobilenet and transformer. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5270-5279, 2022b. +Xiangxiang Chu, Zhi Tian, Bo Zhang, Xinlong Wang, and Chunhua Shen. Conditional positional encodings for vision transformers. arXiv preprint arXiv:2102.10882, 2021. +MMSegmentation Contributors. MMSegmentation: Openmmlab semantic segmentation toolbox and benchmark. https://github.com/open-mmlab/mmsegmentation, 2020. +CoreML. In https://github.com/apple/coremltools. +Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. +Xiaohan Ding, Xiangyu Zhang, Ningning Ma, Jungong Han, Guiguang Ding, and Jian Sun. Repvgg: Making vgg-style convnets great again. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 13733-13742, 2021. +Xiaoyi Dong, Jianmin Bao, Dongdong Chen, Weiming Zhang, Nenghai Yu, Lu Yuan, Dong Chen, and Baining Guo. Cswin transformer: A general vision transformer backbone with cross-shaped windows. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12124-12134, 2022. +Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. +Jianyuan Guo, Kai Han, Han Wu, Yehui Tang, Xinghao Chen, Yunhe Wang, and Chang Xu. Cmt: Convolutional neural networks meet vision transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12175-12185, 2022. +Kai Han, Yunhe Wang, Qi Tian, Jianyuan Guo, Chunjing Xu, and Chang Xu. Ghostnet: More features from cheap operations. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 1580-1589, 2020. +Zhiwei Hao, Jianyuan Guo, Ding Jia, Kai Han, Yehui Tang, Chao Zhang, Han Hu, and Yunhe Wang. Learning efficient vision transformers via fine-grained manifold distillation. arXiv preprint arXiv:2107.01378, 2021. + +Ali Hatamizadeh, Greg Heinrich, Hongxu Yin, Andrew Tao, Jose M Alvarez, Jan Kautz, and Pavlo Molchanov. Fastervit: Fast vision transformers with hierarchical attention. arXiv preprint arXiv:2306.06189, 2023. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 2961-2969, 2017. +Qibin Hou, Cheng-Ze Lu, Ming-Ming Cheng, and Jiashi Feng. Conv2former: A simple transformer-style convnet for visual recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024. +Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al. Searching for mobilenetv3. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 1314-1324, 2019. +Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. +Sergey Ioffe. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. +Alexander Kirillov, Ross Girshick, Kaiming He, and Piotr Dólar. Panoptic feature pyramid networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6399-6408, 2019. +Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25, 2012. +Yanghao Li, Chao-Yuan Wu, Haoqi Fan, Karttikeya Mangalam, Bo Xiong, Jitendra Malik, and Christoph Feichtenhofer. Mvitv2: Improved multiscale vision transformers for classification and detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4804-4814, 2022a. +Yanyu Li, Geng Yuan, Yang Wen, Ju Hu, Georgios Evangelidis, Sergey Tulyakov, Yanzhi Wang, and Jian Ren. Efficientformer: Vision transformers at mobilenet speed. Advances in Neural Information Processing Systems, 35:12934-12949, 2022b. +Yanyu Li, Ju Hu, Yang Wen, Georgios Evangelidis, Kamyar Salahi, Yanzhi Wang, Sergey Tulyakov, and Jian Ren. Rethinking vision transformers for mobilenet size and speed. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 16889-16900, 2023. +Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 10012-10022, 2021a. +Zhenhua Liu, Yunhe Wang, Kai Han, Wei Zhang, Siwei Ma, and Wen Gao. Post-training quantization for vision transformer. Advances in Neural Information Processing Systems, 34:28092-28103, 2021b. +Zhenhua Liu, Zhiwei Hao, Kai Han, Yehui Tang, and Yunhe Wang. Ghostnetv3: Exploring the training strategies for compact models. arXiv preprint arXiv:2404.11202, 2024. +Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11976-11986, 2022. +Xiangyong Lu, Masanori Suganuma, and Takayuki Okatani. Sbcformer: Lightweight network capable of full-size imagenet classification at 1 fps on single board computers. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 1123-1133, 2024. + +Hailong Ma, Xin Xia, Xing Wang, Xuefeng Xiao, Jiashi Li, and Min Zheng. Mocovit: Mobile convolutional vision transformer. arXiv preprint arXiv:2205.12635, 2022. +Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In Proceedings of the European conference on computer vision (ECCV), pp. 116-131, 2018. +Xu Ma, Xiyang Dai, Jianwei Yang, Bin Xiao, Yinpeng Chen, Yun Fu, and Lu Yuan. Efficient modulation for vision networks. arXiv preprint arXiv:2403.19963, 2024. +Muhammad Maaz, Abdelrahman Shaker, Hisham Cholakkal, Salman Khan, Syed Waqas Zamir, Rao Muhammad Anwer, and Fahad Shahbaz Khan. Edgenext: efficiently amalgamated cnn-transformer architecture for mobile vision applications. In European conference on computer vision, pp. 3-20. Springer, 2022. +Sachin Mehta and Mohammad Rastegari. Mobilevit: light-weight, general-purpose, and mobile-friendly vision transformer. arXiv preprint arXiv:2110.02178, 2021. +Sachin Mehta and Mohammad Rastegari. Separable self-attention for mobile vision transformers. arXiv preprint arXiv:2206.02680, 2022. +Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? Advances in neural information processing systems, 32, 2019. +Moritz Nottebaum, Matteo Dunnhofer, and Christian Micheloni. Lowformer: Hardware efficient design for convolutional transformer backbones. arXiv preprint arXiv:2409.03460, 2024. +Junting Pan, Adrian Bulat, Fuwen Tan, Xiatian Zhu, Lukasz Dudziak, Hongsheng Li, Georgios Tzimiropoulos, and Brais Martinez. Edgevits: Competing light-weight cnns on mobile devices with vision transformers. In European Conference on Computer Vision, pp. 294-311. Springer, 2022. +Danfeng Qin, Chas Leichner, Manolis Delakis, Marco Fornoni, Shixin Luo, Fan Yang, Weijun Wang, Colby Banbury, Chengxi Ye, Berkin Akin, et al. Mobilenetv4-universal models for the mobile ecosystem. arXiv preprint arXiv:2404.10518, 2024. +Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dólár. Designing network design spaces. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10428-10436, 2020. +Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. Dynamicvit: Efficient vision transformers with dynamic token sparsification. Advances in neural information processing systems, 34:13937-13949, 2021. +Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 4510-4520, 2018. +Abdelrahman Shaker, Muhammad Maaz, Hanoona Rasheed, Salman Khan, Ming-Hsuan Yang, and Fahad Shahbaz Khan. Swiftformer: Efficient additive attention for transformer-based real-time mobile vision applications. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 17425-17436, 2023. +Noam Shazeer. Glu variants improve transformer. arXiv preprint arXiv:2002.05202, 2020. +Dai Shi. Transnext: Robust foveal visual perception for vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 17773-17783, 2024. +Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dimitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1-9, 2015. +Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International conference on machine learning, pp. 6105-6114. PMLR, 2019. + +Yehui Tang, Kai Han, Jianyuan Guo, Chang Xu, Chao Xu, and Yunhe Wang. Ghostnetv2: Enhance cheap operation with long-range attention. Advances in Neural Information Processing Systems, 35:9969-9982, 2022. +Ilya O Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, et al. Mlp-mixer: An all-mlp architecture for vision. Advances in neural information processing systems, 34:24261-24272, 2021. +Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In International conference on machine learning, pp. 10347-10357. PMLR, 2021a. +Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 32-42, 2021b. +Zhengzhong Tu, Hossein Talebi, Han Zhang, Feng Yang, Peyman Milanfar, Alan Bovik, and Yinxiao Li. Maxvit: Multi-axis vision transformer. In European conference on computer vision, pp. 459-479. Springer, 2022. +Pavan Kumar Anasosalu Vasu, James Gabriel, Jeff Zhu, Oncel Tuzel, and Anurag Ranjan. Fastvit: A fast hybrid vision transformer using structural reparameterization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 5785-5795, 2023a. +Pavan Kumar Anasosalu Vasu, James Gabriel, Jeff Zhu, Oncel Tuzel, and Anurag Ranjan. Mobileone: An improved one millisecond mobile backbone. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 7907-7917, 2023b. +Ashish Vaswani. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. +Qiang Wan, Zilong Huang, Jiachen Lu, Gang Yu, and Li Zhang. Seaformer: Squeeze-enhanced axial transformer for mobile semantic segmentation. arXiv preprint arXiv:2301.13156, 2023. +Ao Wang, Hui Chen, Zijia Lin, Jungong Han, and Guiguang Ding. Repvit: Revisiting mobile cnn from vit perspective. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15909-15920, 2024. +Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 568-578, 2021. +Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pvt v2: Improved baselines with pyramid vision transformer. Computational Visual Media, 8(3):415-424, 2022. +Bichen Wu, Xiaoliang Dai, Peizhao Zhang, Yanghan Wang, Fei Sun, Yiming Wu, Yuandong Tian, Peter Vajda, Yangqing Jia, and Kurt Keutzer. Fbnet: Hardware-aware efficient convnet design via differentiable neural architecture search. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10734-10742, 2019. +Tete Xiao, Mannat Singh, Eric Mintun, Trevor Darrell, Piotr Dólar, and Ross Girshick. Early convolutions help transformers see better. Advances in neural information processing systems, 34:30392-30400, 2021. +Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. Segformer: Simple and efficient design for semantic segmentation with transformers. Advances in neural information processing systems, 34:12077-12090, 2021. +Jianwei Yang, Chunyuan Li, Xiyang Dai, and Jianfeng Gao. Focal modulation networks. Advances in Neural Information Processing Systems, 35:4203-4217, 2022a. + +Qiming Yang, Kai Zhang, Chaoxiang Lan, Zhi Yang, Zheyang Li, Wenming Tan, Jun Xiao, and Shiliang Pu. Unified normalization for accelerating and stabilizing transformers. In Proceedings of the 30th ACM International Conference on Multimedia, pp. 4445-4455, 2022b. +Weihao Yu, Mi Luo, Pan Zhou, Chenyang Si, Yichen Zhou, Xinchao Wang, Jiashi Feng, and Shuicheng Yan. Metaformer is actually what you need for vision. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10819-10829, 2022. +Seokju Yun and Youngmin Ro. Shvit: Single-head vision transformer with memory efficient macro design. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5756-5767, 2024. +Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12104-12113, 2022. +Haokui Zhang, Wenze Hu, and Xiaoyu Wang. Edgeformer: Improving light-weight convnets by learning from vision transformers. arXiv preprint arXiv:2203.03952, 2, 2022. +Jiangning Zhang, Xiangtai Li, Jian Li, Liang Liu, Zhucun Xue, Boshen Zhang, Zhengkai Jiang, Tianxin Huang, Yabiao Wang, and Chengjie Wang. Rethinking mobile block for efficient attention-based models. In 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 1389-1400. IEEE Computer Society, 2023. +Tianfang Zhang, Lei Li, Yang Zhou, Wentao Liu, Chen Qian, and Xiangyang Ji. Cas-vit: Convolutional additive self-attention vision transformers for efficient mobile applications. arXiv preprint arXiv:2408.03703, 2024. +Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6848-6856, 2018. +Mingshu Zhao, Yi Luo, and Yong Ouyang. Repnext: A fast multi-scale cnn using structural reparameterization. arXiv preprint arXiv:2406.16004, 2024. +Youpeng Zhao, Huadong Tang, Yingying Jiang, Qiang Wu, et al. Lightweight vision transformer with cross feature attention. arXiv preprint arXiv:2207.07268, 2022. +Chuanyang Zheng, Kai Zhang, Zhi Yang, Wenming Tan, Jun Xiao, Ye Ren, Shiliang Pu, et al. Savit: Structure-aware vision transformer pruning via collaborative optimization. Advances in Neural Information Processing Systems, 35:9010-9023, 2022. +Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 633-641, 2017. +Lei Zhu, Xinjiang Wang, Zhanghan Ke, Wayne Zhang, and Rynson WH Lau. Bifformer: Vision transformer with bi-level routing attention. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10323-10333, 2023. \ No newline at end of file diff --git a/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/images.zip b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..20d0775325b5245d76a897dba8ab3279d85d1435 --- /dev/null +++ b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5526cbe95d90e98c27f671c4ea3aff1291c470a007101c256b9aa1820230f7d8 +size 568068 diff --git a/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/layout.json b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..47c35311a41d4ae13d6c790a0ad8939dc55e9b23 --- /dev/null +++ b/ICLR/2025/IFORMER_ INTEGRATING CONVNET AND TRANSFORMER FOR MOBILE APPLICATION/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c178c6f40fdac17fad2896550e277cd4761b85f3d49742ba8a0a8a9d3d2aa94b +size 403969 diff --git a/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_content_list.json b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c519fbabe3559fc2926a0e832cd7e21883c8f5ca --- /dev/null +++ b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e09bf72a2f0dff98a0b0a4873cb1869eccdadac78ebfbfe1005d4d3f031902eb +size 144919 diff --git a/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_model.json b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7ebb19d10c11189d6df6fbf43dd7b81ea59be3b1 --- /dev/null +++ b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be555681af03096a8527ff859a8347c54f0bbd1a3955037190d48bc437dfaf5d +size 183867 diff --git a/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_origin.pdf b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..24256c8d2312ec736bd9bf3b307a978648e71d31 --- /dev/null +++ b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/e801daba-424a-4913-abd4-b0db936c4bc7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e47d31c0127907ae5b0a297610f3e8d99507bbbb526809382f2db1319fd583da +size 16798803 diff --git a/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/full.md b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d6463c943fd2f939c4109a8f8db8e21e7f4c5617 --- /dev/null +++ b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/full.md @@ -0,0 +1,455 @@ +# ILLUSION: UNVEILING TRUTH WITH A COMPREHENSIVE MULTI-MODAL, MULTI-LINGUAL DEEPFAKE DATASET + +Kartik Thakral\*, Rishabh Ranjan\*, Akanksha Singh\*, Akshit Jain\*, Mayank Vatsa\*, and Richa Singh\* + +IIT Jodhpur, India, IIISR Bhopal, India + +# ABSTRACT + +The proliferation of deepfakes and AI-generated content has led to a surge in media forgeries and misinformation, necessitating robust detection systems. However, current datasets lack diversity across modalities, languages, and real-world scenarios. To address this gap, we present ILLUSION (Integration of Life-Like Unique Synthetic Identities and Objects from Neural Networks), a large-scale, multi-modal deepfake dataset comprising 1.3 million samples spanning audio-visual forgeries, 26 languages, challenging noisy environments, and various manipulation protocols. Generated using 28 state-of-the-art generative techniques, ILLUSION includes faceswaps, audio spoofing, synchronized audio-video manipulations, and synthetic media while ensuring a balanced representation of gender and skin tone for unbiased evaluation. Using Jaccard Index and UpSet plot analysis, we demonstrate ILLUSION's distinctiveness and minimal overlap with existing datasets, emphasizing its novel generative coverage. We benchmarked image, audio, video, and multi-modal detection models, revealing key challenges such as performance degradation in multilingual and multi-modal contexts, vulnerability to real-world distortions, and limited generalization to zero-day attacks. By bridging synthetic and real-world complexities, ILLUSION provides a challenging yet essential platform for advancing deepfake detection research. The dataset is publicly available at https://www.iab-rubric.org/illusion-database. + +# 1 INTRODUCTION + +The emergence of social media platforms has fundamentally transformed our mode of communication and information dissemination. Platforms such as Facebook, YouTube, Instagram, and TikTok, which boast billions of users worldwide, have expanded the scope of shared content beyond text to include images, videos, and other forms of multimedia Narayan et al. (2022a); Ranjan et al. (2024b). This shift has precipitated a surge in the volume of multi-modal content accessible online. As social networks evolve rapidly, they have emerged as the primary conduit for disseminating user-generated multi-modal content. The data circulating on these social networks is predominantly multi-modal, encompassing videos, + +audio, and images. With their billions-strong user base, these platforms generate enormous data every minute. Nonetheless, the rise of social media and multi-modal content has concurrently fueled an upsurge in the spread of deepfakes and synthetic media fabricated by deep learning techniques. The advancements in generative techniques like Generative Adversarial Networks (GANs), Variational Auto-Encoders (VAEs), and diffusion-based models, have significantly enhanced the realism of + +![](images/678fb97ceae2d47eb1d57c7a824fbe974ef028ca583214fcc931ccd5b202b379.jpg) +Figure 1: Comparative analysis of the proposed dataset with existing ones based on modalities, size, and manipulations. + +![](images/d85a09b81a5b18b42505cf6f418188b5fc74adab6745cd6fcbea9d4ef6aadb07.jpg) +Figure 2: Visual representation and organization of each subset in the proposed ILLUSION dataset. + +synthetically generated content, making it more convincing to the untrained eye Nirkin et al. (2019); Thakral et al. (2024); Korshunova et al. (2017); Rombach et al. (2022); Ranjan et al. (2023b). These AI foundational models and diffusion-based Generative AI (GenAI) models have exhibited unparalleled competence in comprehending and generating human-like videos, images, and sounds (Ranjan et al., 2024a). In 2023, 95,820 deepfake videos were circulated online, which is a $550\%$ increase from 2019 (Deepfake Statistics). Projections indicate that by 2026, up to $90\%$ of online content may be synthetically generated (Synthetic AI Stats). This rapid surge highlights the urgent need for robust deepfake detection techniques. In response, numerous researchers have developed methods specifically targeting identity-based deepfakes (Afchar et al., 2018; Nguyen et al., 2019; Agarwal et al., 2019; Khalid & Woo, 2020; Thakral et al., 2023; Chhabra et al., 2024; Ranjan et al., 2023a). + +The success of deepfake detection depends on the quality of the dataset, including diversity in modalities, generation methods, and the realism of samples. Table 1 offers a comprehensive overview of public deepfake detection datasets. Early datasets such as DF-TIMIT (Korshunov, 2018), FaceForensics++ (Rössler et al., 2018), Celeb-DF (Li et al., 2020), WildDeepfake (Zi et al., 2020), and DeeperForensics-1.0 (Jiang et al., 2020) were relatively small and unimodal, while larger datasets like FFIW $_{10k}$ (Zhou et al., 2021), KoDF (Kwon et al., 2021), and DF-Platter (Narayan et al., 2023) primarily focused on visual manipulations. Unimodal audio-based forgeries were introduced in ASVSpoof (Wang et al., 2020b), WaveFake (Frank & Schonherr, 2021), and TIMIT-TTS (Salvi et al., 2023), whereas multi-modal deepfake detection emerged in DFDC (Dolhansky et al., 2020) and FakeAVCeleb (Khalid et al., 2021). More recently, large-scale multi-modal datasets such as LAV-DF (Cai et al., 2022) and AV-Deepfake1M (Cai et al., 2024) introduced audio-video manipulations, though they lacked non-identity-based AIGC. + +Existing data sets have mainly focused on a few specific generation techniques. To bridge this gap, we introduce ILLUSION: Integration of Life-Like Unique Synthetic Identities and Objects from Neural Networks (ILLUSION Leaderboard), a novel multi-modal, multi-lingual deepfake dataset divided across four sets (visualized in Figure 2). Set A is an identity forgery dataset with audio-video synchronized. Set B incorporates AI-generated synthetic data covering three media modalities: image, audio, and video. Set C, a test set, includes a pool of real-world AI-generated content (AIGC) sampled from different sources and set D includes multi-lingual and multi-modal deepfake samples spanning over 26 different languages. The dataset is prepared with continuous usage of 40 GPUs, accounting for 2000 GB of cumulative memory. With over 800 GBs in size, the dataset contains over 1.3 million samples encompassing the four sets. To the best of our knowledge, this is one of the largest datasets containing vast variability of generation methods, different modalities, multiple languages, and various challenges (refer Figure 1). + +The proposed comprehensive dataset provides diverse AI-generated content to serve as a valuable asset for research in detecting AI-generated media varying in input modality, generation models, different languages, and content type. To assess and analyze the utility of our dataset, we conduct extensive experiments and benchmark using 11 baseline deepfake methods and analyze their performance when tested in different settings. This dataset is presented as a leaderboard (ILLUSION Leaderboard) for + +Table 1: Details of publicly available deepfake datasets. + +
Dataset NameYearReal SamplesFake SamplesTotal SamplesGeneration TechniquesIdentity SwappingAI Generated ContentMulti-LinguialAI-Swap Lingual
ImagesAudioVideo
Deepfake-TIMIT (Korshunov, 2018)2018640N/AN/A3209602✓×××
FaceForensics++ (Rossler et al., 2019)20191000N/AN/A4,00050004✓×××
Celeb-DF (Li et al., 2020)2020590N/AN/A5,6396,2291✓×××
DFDC (Dolhansky et al., 2020)202023,654N/AN/A104,500128,1548✓×××
DeeperForensics-1.0 (Jiang et al., 2020)202050,000N/AN/A10,00060,0001✓×××
ASVSpoof (Yamagishi, 2019)202116,492N/A148,148N/A164,64019✓×××
WaveFake (Frank & Schonherr, 2021)20210N/A117,985N/A117,9856✓×××
FakeAVCeleb (Khalid et al., 2021)2021500N/A500900010,0004✓×××
TIMIT-TTS (Salvi et al., 2023)2022430N/A80,000N/A80,43014✓×××
DeePhy (Narayanan et al., 2022b)2022100N/AN/A5,0405,1403✓×××
LAV-DF (Cai et al., 2022)202236,431N/A33,17665,997136,3042✓×××
Midjourney Kaggle (Iulia Turc, 2022)20220250,000N/AN/A250,0001×✓××
DF-Platter (Narayanan et al., 2023)2023764N/AN/A132,496133,2603✓×××
AV-Deepfake1M (Cai et al., 2024)2023286,721N/AN/A860,0391,146,7603✓×××
AGIQA1K (Zhang et al., 2023)202301,080N/AN/A1,0802×✓××
TWIGMA (Chen & Zou, 2023)20240800,000N/AN/A800,000N/A×✓××
DeePhyV2 (Thakral et al., 2025)2025100N/AN/A8,9609,0604✓×××
ILLUSION (Proposed)2025139,740905,54827,244299,4541,371,98628✓✓✓✓
+ +researchers to test the performance of their algorithms and foster the development of generalizable detection methods. The primary contributions of our work are summarized below: + +- We introduce a multi-modal deepfake dataset developed using 28 GenAI models grounded in GANs, VAEs, Transformers, and Diffusion-based models, spanning image, audio, and video modalities. This dataset is partitioned into four distinct sets. +- The dataset encompasses identity manipulations, where forgery can manifest across audio, video, or both. This set is seamlessly synchronized across audio-visual channels and maintains a balance in terms of sex and skin tone. +- The dataset also includes AI-generated content (AIGC) produced by various text-to-modality models across image, audio, and video domains. It encompasses a subset of entirely synthetic faces. Additionally, the dataset features real-world deepfakes, designed to evaluate detection algorithms in a practical context that spans multiple modalities and languages. +- We benchmark the proposed dataset using state-of-the-art detection methods and conduct a comprehensive analysis of their performance across a range of challenging protocols. + +# 2 THE ILLUSION DATASET + +In this paper, we introduce ILLUSION: Integration of Life Like Unique Synthetic Identities and Objects from Neural networks, a comprehensive large-scale multi-modal deepfake dataset1. The dataset comprises 1,376,371 samples across image, audio, video, and synchronized audio-video modalities, making it the largest multi-modal resource available in the deepfake literature. The dataset is organized into four subsets: Set A, Set B, Set C, and Set D. Set A includes identity manipulations featuring faceswaps, voice proofs, and both. Set B comprises synthetically generated media, including images and videos of sceneries, objects, situations, and music audio. This set also incorporates synthetic faces generated from the website (TPDNE). Set C encompasses real-world testing samples, i.e., Fakes in the Wild, generated using proprietary generative models, and Set D is a multi-lingual multi-modal deepfake testing set. ILLUSION is produced using 28 distinct generative models, encompassing both open-source and proprietary systems. Unlike many publicly available deepfake datasets that suffer from imbalances in sex and skin tone (Nadimpalli & Rattani, 2022; Xu et al., 2022a), the ILLUSION dataset ensures equitable representation across these subgroups. An overview of the dataset is provided in Figure 2. + +# 2.1 DATASET STATISTICS AND ORGANIZATION + +This section discusses the statistics and organization of each set of the proposed ILLUSION dataset. Table 2 presents the set-wise statistics. + +Set A: This set comprises a total of 13 identity manipulations, generated from 200 unique identities sampled from the CelebV-Text dataset (Yu et al., 2023). Each audio, video, and audio-synchronized + +![](images/3eb09ce975ff995cd5d85f7e20028fb4ea4fdfd2d66760ff19a09ee63f633689.jpg) +Figure 3: Illustration of generation pipeline employed in set A for identity swaps. + +clip in this set is 20 seconds long. The samples in this set incorporate variations such as occlusions (e.g., hats, glasses, beards, etc.), body movements, and lighting conditions, thereby ensuring a diversity of variations in the dataset. This set is categorized into four classes: (i) Real Audio-Real Video (RA-RV), (ii) Real Audio and Fake Video (RA-FV), (iii) Fake Audio and Real Video (FA-RV), and (iv) Fake Audio and Fake Video (FA-FV) (as visualized in Figure 3). Table 2 summarizes the number of samples available in each class of Set A. Manipulations in images and videos for each of these classes are introduced by swapping the faces of the source identity onto the target video. For this purpose, we employ 6 different face-swapping models, namely, MobileFaceSwap (Xu et al., 2022b), FSGAN (Nirkin et al., 2019), FaceShifters (Li et al., 2019b), ROOP (Roop, 2023), DiffFace (Kim et al., 2022), and DiffSwap (Zhao et al., 2023). The audio deepfakes are created using the English transcription generated through the MMS model (Pratap et al., 2024). This transcription is then employed by Text-to-Speech systems to create identity-swapped voice clones. We utilize 7 different audio-generative models, namely, FreeVC (Li et al., 2023), XTTS (Eren & The Coqui TTS Team, 2021), DiffVC (Popov et al., 2021b), DiffHierVC (Choi et al., 2023), YourTTS (Casanova et al., 2022), DiffGAN-TTS (Liu et al., 2022), and GradTTS (Popov et al., 2021a) for voice-swapping. For classes RA-FV, FA-RV, and FA-FV, we employ Alignment, a fingerprinting-based model to ensure seamless synchronization between the audio and video, thereby enhancing the realism of the generated fake. The details of all the models utilized in this set are available in the Appendix. + +Set B: This set comprises a total of 523,222 entirely synthetic samples and their 138,708 real counterparts, generated through 11 open-source models and one closed-source model. This set includes images, audio, and videos primarily generated using diffusion models and transformers. For the generation of synthetic images, we employ the images and their corresponding prompts from the training set of the COCO dataset (Lin et al., 2014) to generate using four text-to-image generative models. These models include Stable DiffusionXL (Podell et al., 2023), Kandinsky 2.1 (Razzhigaev et al., 2023), MultiDiffusion (Bar-Tal et al., 2023), and SDXL-Turbo (Sauer et al., 2023). We also collected + +Table 2: Dataset Statistics: In Set A, audio and images are extracted from videos for manipulation, with three compression levels (raw, C23, and C40). + +
SetsModalityGeneration MethodsReal SamplesFake SamplesTotal
Set AAudio8N/A6,4006,400
Images2N/A403,200403,200
Videos41,032278,400279,432
Set BAudio45,21120,84426,055
Images4118,287473,148591,435
Videos37,01021,03028,040
Faces18,2008,20016,400
Set CImages2N/A21,00021,000
VideosN/AN/A2424
Set DAudiosN/A160025604160
VideosN/A100125225
Total28141,4401,234,9311,376,371
+ +8,200 synthetic face images from "This Person Does Not Exist", ensuring a balance in terms of sex and skin tone. These identities are entirely synthetic, have not been swapped, and do not exist in the real world. To generate synthetic audio, we utilize audios and corresponding captions from the MusicCaps dataset (Agostinelli et al., 2023) and generate 5,211 synthetic audio samples each from three text-to-audio generative models and one audio-to-audio model, namely, AudioLDM (Liu et al., 2023), MusicGen (Copet et al., 2023), MAGNeT (Ziv et al., 2024), and Audio Diffusion. Similarly, we also generated synthetic videos using three text-to-video generative models, namely, Text2Video-Zero (Khachatryan et al., 2023), ModelScopeT2V (Wang et al., 2023a), and Zeroscope. For this, we borrow the corresponding caption for each video from the training set of MSRVTT dataset (Xu et al., 2016) and utilize it to generate 7,010 synthetic videos. The details of all the models utilized in this set are available in the Appendix. + +Set C: This set serves as a real-world test set, comprising 21,024 fake samples. It is a curated collection of viral deepfake videos circulated on social media platforms and samples generated using + +
DatasetAGIQA-1KAV-Deepfake1MDF-PlatterMidjourney-KaggleLAV-DFDeePhyTIMIT-TTSFakeAVCelebForgeryNetKoDFDiffusionFaceDIREWaveFake
Jaccard Index0.000.030.070.040.000.070.000.030.050.030.030.000.00
+ +Table 3: Jaccard Index Comparison of ILLUSION with existing deepfake datasets that highlights the uniqueness of the proposed dataset. + +proprietary models such as Midjourney and ArtGuru. The former includes 24 identity-swapped videos. The latter consists of synthetic images generated through a premium API and a web interface, respectively. For Midjourney, we utilize prompts from the COCO dataset validation set, and for each prompt, we obtain four corresponding images, resulting in a total of 20,000 images. ArtGuru, specializes in generating identity-driven images for a given prompt. Therefore, we randomly select 1000 prompts from class "person" from COCO dataset to generate a total of 1000 images. + +Set D: This is a multi-lingual, multi-modal real-world test set containing 4,385 samples curated from social media across 26 languages including French, German, Italian, Chinese, Korean, Arabic, Japanese, Tamil, Kannada, Oriya, Hindi, Sanskrit, Latin, Punjabi, and Gujarati. It is divided into D.1 with 4,160 web-curated samples and D.2, a subset of 225 deepfake samples annotated with four classes (RA-RV, RA-FV, FA-RV, FA-FV), with synchronized audio and video from diverse origins. + +# 2.2 SIZE AND FORMAT + +The ILLUSION dataset is $\sim 800$ GB, with Set A clips lasting 20 seconds. All facial images are either synthetically generated or sourced from publicly available datasets with appropriate licensing. Videos are stored in MPEG4.0 format at a resolution of $512\times 512$ , preserving the original frame rate. Consistency is maintained across the dataset through uniform resolution, compression, and generation techniques, with H.264 compression applied at c23 and c40 levels. Skin tones are categorized into four Fitzpatrick scale bins (see Appendix) and combined with two sexes to form eight sub-groups—identity swaps occur only within these groups. In Set B, videos are generated at 24 frames per second using Text2Video-Zero and ZeroScope, and at 40 frames per second using ModelScopeT2V. Set C, curated from various sources, varies in resolution and length; however, images from MidJourney and ArtGuru consistently maintain resolutions of $1024\times 1024$ and $512\times 512$ , respectively. + +# 2.3 AUDIO AND VISUAL QUALITY ASSESSMENT AND COMPARISON + +To assess the visual quality of ILLUSION, we compute the BRISQUE score (Mittal et al., 2012) across all four sets (Figure 4), yielding a mean score of 38.04 on a 0 (best) - 100 (worst) scale. Table 4 compares BRISQUE scores with FaceForensics++, CelebDF, DFDC, OpenForensics, and DF-Platter, approximated from (Narayan et al., 2023). Additionally, we report FAD scores (Kilgour et al., 2018), capturing audio quality, with a mean FAD of 9.43. These scores highlight that the ILLUSION is of high quality and is challenging with multiple covariates. Additionally, we + +compute the Jaccard Similarity Index to quantify the overlap between ILLUSION and other datasets. As shown in Table 3, the results indicate minimal overlap, with values as low as 0.03 (FakeAVCeleb, KoDF) and 0.07 (DF-Platter). Notably, AGIQA-1K, LAV-DF, and DIRE show no overlap (0.00), highlighting ILLUSION's unique generative diversity. + +![](images/1e673d87ce8f2eaf5d9b6741e7b1f22e9cc408ee3fd7993545b780ebd45bb2d3.jpg) +Figure 4: Comparing Brisque Score of ILLUSION with other datasets. + +# 2.4 COMPUTATIONAL SETUP + +In Set A, we utilize a total of 13 generation methods to produce identity-swaps across image, audio, video, and audio-video synchronized modalities. This process is facilitated by Nvidia A100 with 16 GPUs, each with 80GBs of memory. Set B is generated through 11 open + +Table 4: Audio and visual quality assessment of ILLUSION dataset. + +
Dataset SplitVision (Mean Brisque Score)Audio (Mean Fréchet Audio Distance)
Train SetTest SetOverallTrain SetTest SetOverall
Set A49.0842.9848.696.377.306.41
Set B29.4329.2929.406.646.586.55
Set CN/A35.6635.66N/AN/AN/A
Set D.1N/AN/AN/AN/A40.3940.39
Set D.2N/A66.8866.88N/AN/AN/A
Overall: 38.04Overall: 9.43
+ +source and one closed-source generative models, utilizing two Nvidia A40 GPUs, each with 48GBs + +of memory, and three Nvidia DGX stations, each equipped with four V100 GPUs of 32GB memory. Set C comprises samples generated from two proprietary models, produced on 2 Nvidia 3090 GPUs, each with 24 GBs of memory. The benchmarking experiments for the dataset are conducted on 2 A40, each with 48GBs of memory, and 6 A30 GPUs, each with 24GBs of memory, in a multi-GPU setup. + +# 3 EXPERIMENTAL SETUP + +This section outlines the training and testing protocol established for the proposed ILLUSION dataset, followed by a discussion on the deepfake detection methods and evaluation metrics employed for benchmarking. The proposed dataset is designed to address the following pivotal research questions: + +RQ1: How effective are the detection systems in detecting multi-modal identity-swaps? + +RQ2: How effective are the detection systems in identifying synthetically generated media? + +RQ3: How robust and reliable are the current state-of-the-art detection algorithms when deployed in real-world scenarios? + +RQ4: Is it feasible to detect identity swaps and synthetic media in a zero-day attack setting? + +RQ5: Is it possible to successfully trace back the source of a given deepfake? + +# 3.1 EVALUATION PROTOCOLS + +The ILLUSION dataset is composed of four sets. Sets A and B are partitioned into training and testing subsets in a ratio of 3:1. The training data is split into a 9:1 ratio to divide into train and validation data. To mitigate the skew between the "Real" and "Fake" classes in set A, we borrow an additional 144 videos (18 subjects/sub-group) from the CelebV-Text dataset. In contrast, set C and D is exclusively a test set. For all the videos in Set A, we extract 10 frames from each fake video and all from each real video. For Set B, we pick 24 frames each from the generative models and select every sixth frame from real videos. Further, for synthetic images generated from four text-to-image models, we repeat their corresponding real images four times. This approach addresses the imbalance between the dataset's real and fake samples. + +Protocol 1 - Multi-modal Deepfake Detection: This protocol utilizes Sets A and B, each with their respective training and test sets. Set A is divided in a subject-disjoint manner, incorporating 160 subjects in the training set (20 subjects/sub-group) and 40 subjects in the test set (5 subjects/sub-group). The audio, video, and multi-modal deepfake detection models are then trained and tested on the samples from Set A. The results are presented in three compression settings - raw, C23, and C40 - to facilitate the assessment of deepfake quality in the dataset relative to existing datasets (results are shown in the Appendix). For Set B, images borrowed from the COCO dataset (Lin et al., 2014) and BFW dataset (Robinson, 2022) serve as real samples corresponding to the fake samples generated using text-to-image models and synthetic faces, respectively. Similarly, audio and video samples from the MusicCaps dataset (Agostinelli et al., 2023) and the MSRVTT dataset (Xu et al., 2016) are used as real samples corresponding to fake samples generated using text-to-audio and text-to-video models. We extract 24 frames from fake videos to classify synthetic videos and select every 6th real video frame to maintain data balance. + +Protocol 2 - Zero-shot/Zero-day Generalization: The primary aim of this protocol is to test the generalizability of detections on new or unseen generation methods. The detection models are initially trained on the train set of Set A and subsequently tested on the test set of Set B. The performance of the models is also evaluated in a vice-versa setting. + +Protocol 3 - Generalization on Real-World Deepfake Media: This protocol assesses the performance of existing state-of-the-art models on real-world deepfake samples. Here, the models are trained on the train set of Set A, Set B, or both, and their performance is evaluated on Set C. + +Protocol 4 - Performance on Model Attribution: The final protocol presents a challenging model attribution task, i.e. to predict the generative technique used to create the input deepfake. The models are trained and tested on fake samples generated from each technique from Set A and Set B. The detection models are evaluated separately for image, video, and audio modalities. + +Table 5: Classification performance for visual components of the dataset obtained by varying the training and testing sets. + +
Trained OnModelsSet ASet BSet C (All Fake)
AccuracyAccuracy-FakeAccuracy-RealAUCAccuracyAccuracy-FakeAccuracy-RealAUCAccuracy
Set AF3Net0.8510.7510.9510.9450.4680.4750.4600.4620.341
DSP-FWA0.9840.9820.9860.9970.4280.4370.4180.3960.214
MesoInceptionNet0.5050.9990.8820.8830.5050.9880.4730.4870.991
Xception0.8510.8460.8560.9200.4970.7490.2830.5150.633
Set BF3Net0.4980.0080.9930.4970.9810.9910.9700.9980.717
DSP-FWA0.4980.0010.9990.5010.9930.9950.9900.9990.727
MesoInceptionNet0.4950.0090.9870.3860.7570.5530.9670.9190.045
Xception0.5020.0180.9920.5260.9770.9870.9660.9970.725
Set A + Set BF3Net0.8810.9260.8360.9580.9560.9860.9250.9940.703
DSP-FWA0.9720.9750.9700.9950.9920.9950.9891.0000.863
MesoInceptionNet0.4810.0130.4250.7010.8340.8060.9120.9480.241
Xception0.8810.9260.8350.9540.9720.9820.9630.9970.650
+ +# 3.2 BENCHMARKING DETAILS + +DeepFake Detection Methods We utilize four state-of-the-art video and four audio deepfake detection models to benchmark all three sets of the proposed dataset. For video deepfake detection, we employ MesoInceptionNet (Afchar et al., 2018), XceptionNet (Chollet, 2017), DSP-FWA (Li & Lyu, 2018), and F3Net (Wei et al., 2020). For audio deepfake detection, we use RawGAT-ST (Tak et al., 2021), AASIST (Jung et al., 2022), SSLModel (Tak et al., 2022), and Conformer (Gulati et al., 2020). We also benchmark the proposed dataset using multi-modal deepfake detection algorithms. Specifically, we employ methods such as MRDF (Zou et al., 2024) and FACTOR (Reiss et al., 2023). Additionally, we use an ensemble of F3Net and SSLModel, which are baseline unimodal models (referred to as unimodal ensembling), and report class-wise video-level accuracy. Benchmarking the proposed ILLUSION dataset with 11 baseline algorithms provides a comprehensive evaluation that encompasses both typical methods and type-complete approaches. The unimodal baselines focus on modality-specific behaviors, enabling a deeper understanding of how state-of-the-art algorithms perform within their respective domains (e.g., image, audio, or video). In contrast, multimodal baselines evaluate type-complete methods, capturing the interplay between multiple modalities and offering insights into cross-modal generalization and robustness. This dual benchmarking strategy ensures a balanced assessment of both specialized and holistic detection capabilities. Detailed descriptions of all these algorithms are provided in the Appendix. + +Evaluation Metrics For models trained on image and video data, we provide frame-level accuracy and Area Under the Curve (AUC) scores. Each frame in a video classified as fake or real. We also present class-wise accuracy for additional analysis. For audio data, we report the Equal Error Rate (EER) and AUC score. For models trained on multi-modal data, such as combined video and audio, we provide video-level accuracy, using a threshold set at $50\%$ of frames to classify a video as fake. + +Implementation Details The DSFD detector (Li et al., 2019a) is used to extract faces from the frames of videos containing faces. For all protocols, the models are trained for 30 epochs with early stopping, and the models with the best validation accuracy are selected. We use the Adam optimizer with an initial learning rate of 0.0001. A batch size of 256 is used for distributed training. + +# 4 RESULTS AND DISCUSSION + +This section discusses the benchmark results obtained using the state-of-the-art deepfake detection models mentioned in Section 3.2 when trained and evaluated on the proposed ILLUSION dataset. The performance analyzed is in accordance with the protocols described in section 3.1. + +Protocol 1 - Multi-Modal Deepfake Detection: To analyze the performance of audio and visual detection models, we trained and tested them on both Set A and Set B of the proposed ILLUSION dataset. From Tables 5 and 6, for set A, we observe that all architectures perform well for visual as well as audio detection models, with DSP-FWA achieving the best performance for visual data (99.3% accuracy on Set B) and SSLModel excelling in audio data with an EER of 0.006. A similar trend is visible in set B, where we observe that all the detection models, when trained on synthetic data, are able to achieve a promising detection performance. + +We observe significant variability among the models when evaluating performance on Set C—which consists entirely of curated real-world and compressed deepfakes. For instance, DSP-FWA achieves + +Table 6: Classification performance for audio components of the dataset obtained by varying the training and testing sets. + +
Trained OnModelsSet ASet B
EERAccuracy-FakeAccuracy-RealAUCEERAccuracy-FakeAccuracy-RealAUC
Set ARawGAT-ST0.4431.0000.0000.5760.4700.9990.0040.539
AASIST0.0490.8791.0000.9910.4300.2400.9220.563
Conformer0.0250.9960.9750.9910.5620.7150.0810.395
SSLModel0.0060.9801.0001.0000.5830.6760.1040.356
Set BRawGAT-ST0.3810.1251.0000.6990.0320.9880.9390.995
AASIST0.2610.0711.0000.8050.0200.9880.9700.997
Conformer0.8210.0080.8250.1190.0050.9920.9940.999
SSLModel0.6940.0050.9250.2520.0060.9930.9930.999
Set A + Set BRawGAT-ST0.0250.9430.9750.9940.0350.9730.9580.995
AASIST0.0500.9460.9500.9920.0270.9830.9510.996
Conformer0.0300.9590.9750.9950.0200.9900.9590.997
SSLModel0.0690.9380.9250.9880.0220.9920.9520.998
+ +only $21.4\%$ accuracy when trained on Set A (synthetic data) and tested on Set C, compared to $72.7\%$ accuracy when trained on Set B (real-world data) and tested on Set C. This discrepancy highlights the challenges of generalizing from synthetic training data to real-world deepfake scenarios. Conversely, MesoInceptionNet exhibits unusually high accuracy on Set C due to its tendency to classify most inputs as fake. Since Set C contains only fake samples, this bias results in inflated performance metrics for MesoInceptionNet. Set C was intentionally designed as a challenging test set that closely mimics real-world deepfakes crafted for mass misinformation campaigns. Its inclusion emphasizes the necessity for detection models to handle a diverse array of generative techniques and the complexities inherent in real-world scenarios. This highlights the limitations of current approaches and showcases the forward-looking design of the ILLUSION dataset in advancing deepfake detection research. + +We evaluated the effectiveness of multi-modal deepfake detection methods on Set A of the proposed ILLUSION dataset. These methods were trained on audio-video synchronized samples from Set A. The performance achieved are detailed in Table 7. Our findings show that MRDF outperforms FACTOR across all classes, notably achieving an $87.1\%$ class-wise accuracy for the FakeAudio-FakeVideo category. Conversely, FACTOR + +Table 7: Classification performance of multi-modal deepfake detection methods on set A. + +
ModelsRA-RVRA-FVFA-RVFA-FV
MRDF0.7750.4460.8270.871
FACTOR0.1570.3520.3690.413
Unimodal Ensembling0.2080.8870.3590.779
+ +consistently underperforms, with a notable low of $15.7\%$ accuracy for the RealAudio-RealVideo class. Unimodal Ensembling shows potential, achieving a $77.9\%$ accuracy on the FakeAudio-FakeVideo class, but falls short for the RealAudio-RealVideo class. + +To assess the impact of noise and neural compression, we evaluate baseline models trained on Sets A and B, testing them on the corrupted version of Set C (as shown in Table 1 of the Appendix). Here we observe a significant performance degradation. Additionally, we investigate different compression levels for deepfake detection models, individually training and testing them on raw, C23, and C40 compressions of Set A. From Table 2 (Appendix), DSP-FWA consistently performs well across most combinations. While there's a drop in performance when models are trained on higher quality and tested on compressed samples, those trained on C23 and C40 exhibit better generalization for both raw and C40 samples. + +Protocol 2 - Zero-Day Attack Generalization: We evaluate the deepfake detection models on the challenging setting of zero-day attack detection. In this, each model is trained on training data from one set of the ILLUSION dataset and is tested on the test data of the other set. For evaluation on unseen attack setting, we train each model on train data of set A and test its performance on test data of set B, and vice-versa. The performance achieved is reported in Table 5 and Table 6. We clearly observe that all the visual and audio detection models, when trained on set A data and tested on set B data, consistently achieve random performance. The same observation is made for both visual and audio detection models when training data of set B is trained and evaluated on test data of set A. From this, we infer that the artifacts introduced in identity-swaps deepfakes and completely synthetic deepfakes are completely different. Due to this, the detection models trained on one is unable to generalize on the other. With this, we note that the proposed ILLUSION dataset will provide the researchers with a diverse range of deepfakes to capture variety of artifacts in training for better generalizability in real-world deployment. + +Protocol 3 - Generalization on Real-World Deepfake Media: Since set C contains only visual deepfake media, we train the visual deepfake detection models in three different settings and report the accuracy on set C in Table 5. First, the models are trained on the image and video data of set A and then tested on set C. Then, the models are trained on set B and tested on set C. Finally, we train the models on a combination of visual data from sets A and B and test it on set C. We observe that models perform better on set C when trained on set B than when trained on set A. This behavior is observed because most samples are synthetically generated using text-to-image models like MidJourney and ArtGuru. Whereas identity swaps are very few. We also observe a slight increase in performance on set C when the detection models are trained on a combination of set A and set B. + +We further perform a comprehensive evaluation of audio and multimodal detection models on Set D, with detailed results presented in Tables 8 and 9, respectively. The samples in Set D were assessed using audio detection models for both subsets D.1 and D.2. For Set D.1, we employed audio detection models pretrained on a combination of Set A and Set B from the ILLUSION dataset. As shown in Table 8, all architectures encountered significant challenges in generalization, with the conformer model achieving the highest AUC of 0.488. For Set D.2, we utilized MRDF, FACTOR, and Unimodal Ensembling for multi-modal baselining and report the performance in Table 9. It is evident that model + +performance drastically declines when evaluated on Set D, which involves multi-modal real-world fakes. Nonetheless, FACTOR outperformed Unimodal Ensembling. + +Table 8: Classification accuracy of audio deepfake detection models (trained on Sets A and B) tested on Set D.1. Set D comprises audio samples from more than 26 languages. + +
ModelsEERAUC
SSLModel0.5780.397
Conformer0.5230.488
AASIST0.5060.471
RawGAT_ST0.5710.402
+ +These results highlight the formidable challenge posed by the multi-lingual and multi-modal nature of Set D, revealing that current state-of-the-art algorithms struggle to generalize to real-world deepfakes. Our observations indicate that state-of-the-art detection models face significant difficulties when confronted with the complexity of multi-modal and multi-lingual deepfakes prevalent on social media platforms. These findings + +Table 9: Classification performance of multi-modal deepfake detection methods on set D.2 of the ILLUSION dataset. + +
ModelsRA-RVRA-FVFA-RVFA-FV
MRDF0.310.100.150.09
FACTOR0.350.120.200.13
Unimodal Ensembling0.250.090.110.05
+ +highlight the challenges and limitations these models encounter in adapting to the diverse and evolving nature of deepfake content. + +Protocol 4 - Performance on Model Attribution: Different generation techniques introduce distinct artifacts in deepfakes (Wang et al., 2020a; Frank et al., 2020; Wang et al., 2023b). From Protocol 2, we observe that identity-swap deepfakes exhibit artifacts different from those in fully synthetic media. To analyze detection models' ability to identify the source generation technique, we report their performance in Table 10. All visual models, except MesoInceptionNet, accurately classify identity-swap deepfakes, with DSP-FWA achieving + +near-perfect accuracy. A similar trend is seen in audio models, where Conformer performs best. + +Table 10: Model attribution on Set A + +
AttributeModelsAccuracyAUC
VideoF3Net0.9230.933
DSP-FWA0.9871.000
MesoInceptionNet0.4440.620
Xception0.8800.832
AudioRawGAT-ST0.9410.995
AASIST0.9570.998
Conformer0.9670.999
SSLModel0.9590.998
+ +For the model attribution in set B, detection models are evaluated separately for each modality. We report the performance in Table 11. For attribution in text-to-image (including synthetic faces samples) and text-to-video models, DSP-FWA consistently achieves the highest performance with an AUC of $97.8\%$ and $99.9\%$ , respectively. Similarly, for attribution in text-to-audio data, all the detection models are successfully able to identify the source of the generation model with comparable performance. From these observations, we note that each generative model introduces unique signatures in their generated output. The detection + +Table 11: Model attribution on Set B + +
AttributeModelsAccuracyAUC
ImagesF3Net0.8780.971
DSP-FWA0.9110.978
MesoInceptionNet0.4990.822
Xception0.8890.972
VideoF3Net0.9940.999
DSP-FWA0.9980.999
MesoInceptionNet0.9090.994
Xception0.9960.999
AudioRawGAT-ST0.9910.999
AASIST0.9930.999
Conformer0.9890.998
SSLModel0.9890.999
+ +models pick these signatures for a near-perfect performance on model attribution task. + +# 5 DISCUSSION AND CONCLUSION + +In this paper, we introduce the ILLUSION dataset, a significant step towards a comprehensive, multimodal deepfake resource. Created using 28 state-of-the-art generative models, ILLUSION provides diverse AI-generated content across image, audio, and video modalities, including both curated real-world deepfakes and synthetic media. This design enables models trained on ILLUSION to learn features that extend beyond synthetic artifacts, enhancing generalization across domains, particularly in multilingual and noisy settings. Results show that detection models trained on ILLUSION outperform those trained on existing datasets when evaluated on unseen generative techniques and real-world forgeries. Designed to aid the development of robust, multi-modal, multilingual detection systems, the ILLUSION dataset reveals several key insights through our analysis: + +Multi-Modal Deepfake Detection: The high performance of models like DSP-FWA and AASIST on both visual and audio data suggests that current models are effective at detecting deepfakes when trained on data from same distribution. However, the disparity in performance between identity swaps and completely synthetic data indicates that models may be learning to identify artifacts specific to the generation method rather than generalizable features of deepfakes. + +Zero-Day Attack Generalization: The significant drop in performance when models trained on one set are tested on another accentuates the challenge of zero-day attack detection. This suggests that models are currently not robust against deepfakes generated by unfamiliar methods, highlighting the need for diverse datasets like ILLUSION. + +Generalization on Real-World Multi-Linguial Deepfake Media: The subpar performance of models trained on identity-swap and synthetic data, when tested on real-world deepfakes across various languages, depicts the necessity of a curated, multi-lingual deepfake dataset. Such a dataset is crucial for enabling models to effectively generalize to the diverse deepfakes encountered in the wild. + +Model Attribution: The ability of models to identify the source generation technique with high accuracy demonstrates that generative models leave distinct signatures in their outputs. This could have implications for the traceability of deepfakes and the accountability of generative model creators. + +The ILLUSION dataset specifically addresses deepfake detection challenges using specialized generative AI techniques, while acknowledging that generalized forgery methods—such as digital watermarking, image manipulations, and Photoshop-based edits—represent another important aspect of media forensics. These generalized methods, often easier for deep-learning-based detectors to identify and fundamentally different from generative deepfake techniques, would require additional design considerations to maintain dataset consistency. Moreover, ILLUSION prioritizes quality and diversity over sheer size, with each subset carefully curated for distinct purposes, such as evaluating generalizability or robustness to compression artifacts. By incorporating 28 distinct generative methods, along with multi-modal, multi-lingual, and real-world samples, the dataset minimizes redundancy, ensuring relevance and providing valuable insights into detection performance under diverse conditions. Future extensions of ILLUSION will explore the integration of generalized forgery methods to broaden its scope and utility. + +# 6 ETHICS STATEMENT + +Our analysis estimates that approximately $245\mathrm{kg}CO_{2}$ -equivalent was emitted during the creation of this dataset (ML $CO_{2}$ Impact). Despite this environmental impact, the societal benefits are significant. ILLUSION offers a valuable resource for researchers to explore detection methods across diverse types of fake media. Additionally, its balanced representation of gender and skin tone promotes fairness in the development and evaluation of detection techniques. As a comprehensive multi-modal, multi-lingual deepfake dataset, ILLUSION is instrumental in the global fight against misinformation. + +# 7 ACKNOWLEDGEMENT + +This research is supported through a grant from MEITY under the National Supercomputing Mission. Thakral received partial support from the PMRF Fellowship and Vatsa is partially supported by the Swarnajayanti Fellowship. + +# REFERENCES + +Darius Afchar, Vincent Nozick, Junichi Yamagishi, and Isao Echizen. Mesonet: a compact facial video forgery detection network. In In IEEE International Workshop on Information Forensics and Security, pp. 1-7, 2018. +Shruti Agarwal, Hany Farid, Yuming Gu, Mingming He, Koki Nagano, and Hao Li. Protecting World Leaders Against Deepfakes. In IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, 2019. +Andrea Agostinelli, Timo I Denk, Zalán Borsos, Jesse Engel, Mauro Verzetti, Antoine Caillon, Qingqing Huang, Aren Jansen, Adam Roberts, Marco Tagliasacchi, et al. MusicLM: Generating Music from Text. arXiv preprint arXiv:2301.11325, 2023. +Audio Alignment. https://github.com/benfmiller/audalign. [Accessed 06-06-2024]. +ArtGuru. https://www.artguru.ai/. [Accessed 06-06-2024]. +Audio Diffusion. https://huggingface.co/tetricio.audio-diffusion-256. +Omer Bar-Tal, Lior Yariv, Yaron Lipman, and Tali Dekel. Multidiffusion: Fusing Diffusion Paths for Controlled Image Generation. In International Conference on Machine Learning, pp. 1737 - 1752, 2023. +Zhixi Cai, Kalin Stefanov, Abhinav Dhall, and Munawar Hayat. Do you really mean that? Content Driven Audio-Visual Deepfake Dataset and Multimodal Method for Temporal Forgery Localization. In IEEE International Conference on Digital Image Computing: Techniques and Applications, pp. 1-10, 2022. +Zhixi Cai, Shreya Ghosh, Aman Pankaj Adatia, Munawar Hayat, Abhinav Dhall, Tom Gedeon, and Kalin Stefanov. AV-Deepfake1M: A Large-Scale LLM-Driven Audio-Visual Deepfake Dataset. In ACM International Conference on Multimedia, pp. 7414–7423, 2024. +Edresson Casanova, Julian Weber, Christopher D Shulby, Arnaldo Candido Junior, Eren Gölgé, and Moacir A Ponti. YourTTS: Towards Zero-Shot Multi-Speaker TTS and Zero-Shot Voice Conversion for Everyone. In International Conference on Machine Learning, pp. 2709-2720, 2022. +Yiqun Chen and James Y Zou. TWIGMA: A dataset of AI-Generated Images with Metadata From Twitter. In Advances in Neural Information Processing Systems, 36:37748-37760, 2023. +Zhengxue Cheng, Heming Sun, Masaru Takeuchi, and Jiro Katto. Learned Image Compression with Discretized Gaussian Mixture Likelihoods and Attention Modules. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7936-7945, 2020. +Saheb Chhabra, Kartik Thakral, Surbhi Mittal, Mayank Vatsa, and Richa Singh. Low Quality Deepfake Detection via Unseen Artifacts. In IEEE Transactions on Artificial Intelligence, 5(4): 1573-1585, 2024. +Ha-Yeong Choi, Sang-Hoon Lee, and Seong-Whan Lee. Diff-HierVC: Diffusion-based Hierarchical Voice Conversion with Robust Pitch Generation and Masked Prior for Zero-shot Speaker Adaptation. In INTERSPEECH 2023, pp. 2283–2287, 2023. +François Chollet. Xception: Deep Learning with Depthwise Separable Convolutions. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1251-1258, 2017. +Jade Copet, Felix Kreuk, Itai Gat, Tal Remez, David Kant, Gabriel Synnaeve, Yossi Adi, and Alexandre Défossez. Simple and Controllable Music Generation. In Advances in Neural Information Processing Systems, 36:47704-47720, 2023. +Deepfake Statistics. https://tinyurl.com/deepstats. + +Brian Dolhansky, Joanna Bitton, Ben Pflaum, Jikuo Lu, Russ Howes, Menglin Wang, and Cristian Canton Ferrer. The Deepfake Detection Challenge (DFDC) Dataset. arXiv preprint arXiv:2006.07397, 2020. +Gölge Eren and The Coqui TTS Team. Coqui TTS, January 2021. URL https://github.com/coqui-ai/TTS. +Hugging Face. Audio diffusion. https://huggingface.co/tetricio/ audio-diffusion-256. [Accessed 06-06-2024]. +Joel Frank and Lea Schonherr. Wavefake: A DataSet to Facilitate Audio Deepfake Detection. arXiv preprint arXiv:2111.02813, 2021. +Joel Frank, Thorsten Eisenhofer, Lea Schonherr, Asja Fischer, Dorothea Kolossa, and Thorsten Holz. Leveraging Frequency Analysis for Deep Fake Image Recognition. In International Conference on Machine Learning, pp. 3247-3258, 2020. +Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, et al. ConFormer: Convolution-Augmented Transformer for Speech Recognition. arXiv preprint arXiv:2005.08100, 2020. +ILLUSION Leaderboard. https://www.iab-rubric.org/illusion-database. +Gaurav Nemade Iulia Turc. Midjourney User Prompts amp; Generated Images (250k), 2022. URL https://www.kaggle.com/ds/2349267. +Liming Jiang, Ren Li, Wayne Wu, Chen Qian, and Chen Change Loy. DeeperForensics-1.0: A Large-Scale Dataset for Real-World Face Forgery Detection. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2889-2898, 2020. +Jee-weon Jung, Hee-Soo Heo, Hemlata Tak, Hye-jin Shim, Joon Son Chung, Bong-Jin Lee, Ha-Jin Yu, and Nicholas Evans. AASIST: Audio Anti-Spoofing using Integrated Spectro-Temporal Graph Attention Networks. In IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 6367-6371, 2022. +Levon Khachatryan, Andranik Movsisyan, Vahram Tadevosyan, Roberto Henschel, Zhangyang Wang, Shant Navasardyan, and Humphrey Shi. Text2Video-Zero: Text-to-Image Diffusion Models are Zero-Shot Video Generators. arXiv preprint arXiv:2303.13439, 2023. +Hasam Khalid and Simon S. Woo. OC-FakeDect: Classifying Deepfakes Using One-class Variational Autoencoder. In IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 2794-2803, 2020. +Hasam Khalid, Shahroz Tariq, Minha Kim, and Simon S Woo. FakeAVCeleb: A Novel Audio-Video Multimodal Deepfake Dataset. In Advances in Neural Information Processing Systems Datasets and Benchmarks Track, 2021. +Kevin Kilgour, Maurizio Zuluaga, Dominik Roblek, and Matthew Sharifi. Fr\`echet Audio Distance: A Metric for Evaluating Music Enhancement Algorithms. arXiv preprint arXiv:1812.08466, 2018. +Kihong Kim, Yunho Kim, Seokju Cho, Junyoung Seo, Jisu Nam, Kychul Lee, Seungryong Kim, and KwangHee Lee. DiffFace: Diffusion-based Face Swapping with Facial Guidance. arXiv preprint arXiv:2212.13344, 2022. +Marcel Sébastien Korshunov, Pavel. Deepfakes: A New Threat to Face Recognition? Assessment and Detection. arXiv preprint arXiv:1812.08685, 2018. +Iryna Korshunova, Wenzhe Shi, Joni Dambre, and Lucas Theis. Fast Face-Swap using Convolutional Neural networks. In IEEE/CVF International Conference on Computer Vision, pp. 3677-3685, 2017. +Patrick Kwon, Jaeseong You, Gyuhyeon Nam, Sungwoo Park, and Gyeongsu Chae. KoDF: A Large-Scale Korean DeepFake Detection Dataset. In IEEE/CVF International Conference on Computer Vision, pp. 10744-10753, 2021. + +Jian Li, Yabiao Wang, Changan Wang, Ying Tai, Jianjun Qian, Jian Yang, Chengjie Wang, Jilin Li, and Feiyue Huang. DSFD: Dual Shot Face Detector. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5060-5069, 2019a. +Jingyi Li, Weiping Tu, and Li Xiao. FreeVC: Towards High-Quality Text-Free One-Shot Voice Conversion. In IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 1-5, 2023. +Lingzhi Li, Jianmin Bao, Hao Yang, Dong Chen, and Fang Wen. FaceShifter: Towards High Fidelity and Occlusion Aware Face Swapping. arXiv preprint arXiv:1912.13457, 2019b. +Yuezun Li and Siwei Lyu. Exposing Deepfake Videos by Detecting Face Warping Artifacts. arXiv preprint arXiv:1811.00656, 2018. +Yuezun Li, Xin Yang, Pu Sun, Honggang Qi, and Siwei Lyu. Celeb-DF: A Large-Scale Challenging Dataset for Deepfake Forensics. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3207-3216, 2020. +Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft COCO: Common Objects in Context. In European Conference on Computer Vision, pp. 740-755. Springer, 2014. +Haohe Liu, Zehua Chen, Yi Yuan, Xinhao Mei, Xubo Liu, Danilo Mandic, Wenwu Wang, and Mark D Plumbley. AudioLDM: Text-to-Audio Generation with Latent Diffusion Models. arXiv preprint arXiv:2301.12503, 2023. +Songxiang Liu, Dan Su, and Dong Yu. DiffGAN-TTS: High-Fidelity and Efficient Text-to-Speech with Denoising Diffusion GANs. arXiv preprint arXiv:2201.11972, 2022. +Midjourney. https://www.midjourney.com/home. [Accessed 06-06-2024]. +David Minnen, Johannes Balle, and George D Toderici. Joint Autoregressive and Hierarchical Priors for Learned Image Compression. In Advances in Neural Information Processing Systems, 31, 2018. +Anish Mittal, Anush Krishna Moorthy, and Alan Conrad Bovik. No-Reference Image Quality Assessment in the Spatial Domain. In In IEEE Transactions on Image Processing, volume 21, pp. 4695-4708, 2012. +ML $CO_2$ Impact. https://mlco2.github.io/impact/. +Aakash Varma Nadimpalli and Ajita Rattani. GBDF: Gender Balanced Deepfake Dataset Towards Fair Deepfake Detection. In International Conference on Pattern Recognition, pp. 320-337. Springer, 2022. +Kartik Narayan, Harsh Agarwal, Surbhi Mittal, Kartik Thakral, Suman Kundu, Mayank Vatsa, and Richa Singh. DeSI: Deepfake Source Identifier for Social Media. In IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 2858-2867, 2022a. +Kartik Narayan, Harsh Agarwal, Kartik Thakral, Surbhi Mittal, Mayank Vatsa, and Richa Singh. Deepphy: On Deepfake Phylogeny. In IEEE International Joint Conference on Biometrics, pp. 1-10, 2022b. +Kartik Narayan, Harsh Agarwal, Kartik Thakral, Surbhi Mittal, Mayank Vatsa, and Richa Singh. DF-Platter: Multi-Face Heterogeneous Deepfake Dataset. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9739-9748, 2023. +Huy H Nguyen, Junichi Yamagishi, and Isao Echizen. Use of a Capsule Network to Detect Fake Images and Videos. arXiv preprint arXiv:1910.12467, 2019. +Yuval Nirkin, Yosi Keller, and Tal Hassner. FSGAN: Subject Agnostic Face Swapping and Reenactment. In IEEE/CVF International Conference on Computer Vision, pp. 7184-7193, 2019. + +Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Müller, Joe Penna, and Robin Rombach. SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis. arXiv preprint arXiv:2307.01952, 2023. +Vadim Popov, Ivan Vovk, Vladimir Gogoryan, Tasnama Sadekova, and Mikhail Kudinov. Grad-TTS: A Diffusion Probabilistic Model for Text-to-Speech. In International Conference on Machine Learning, pp. 8599-8608, 2021a. +Vadim Popov, Ivan Vovk, Vladimir Gogoryan, Tasnama Sadekova, Mikhail Kudinov, and Jiansheng Wei. Diffusion-based Voice Conversion with Fast Maximum Likelihood Sampling Scheme. arXiv preprint arXiv:2109.13821, 2021b. +Vineel Pratap, Andros Tjandra, Bowen Shi, Paden Tomasello, Arun Babu, Sayani Kundu, Ali Elkahky, Zhaoheng Ni, Apoorv Vyas, Maryam Fazel-Zarandi, et al. Scaling Speech Technology to 1,000+ Languages. In Journal of Machine Learning Research, 25(97):1-52, 2024. +Rishabh Ranjan, Mayank Vatsa, and Richa Singh. SV-DeiT: Speaker Verification with DeiTcap Spoofing Detection. In IEEE International Joint Conference on Biometrics, pp. 1-10, 2023a. +Rishabh Ranjan, Mayank Vatsa, and Richa Singh. Uncovering the Deceptions: An Analysis on Audio Spoofing Detection and Future Prospects. In International Joint Conference on Artificial Intelligence., pp. 6750-6758, 8 2023b. +Rishabh Ranjan, Bikash Dutta, Mayank Vatsa, and Richa Singh. Faking Fluent: Unveiling the Achilles' Heel of Multilingual Deepfake Detection. In IEEE International Joint Conference on Biometrics, pp. 1-10, 2024a. +Rishabh Ranjan, Mayank Vatsa, and Richa Singh. Context Encoded Multi-Modal Attention Network for Detecting Audio Spoofing. In IEEE International Joint Conference on Biometrics, pp. 1-11, 2024b. +Anton Razzhigaev, Arseniy Shakhmatov, Anastasia Maltseva, Vladimir Arkhipkin, Igor Pavlov, Ilya Ryabov, Angelina Kuts, Alexander Panchenko, Andrey Kuznetsov, and Denis Dimitrov. Kandinsky: An Improved Text-to-Image Synthesis with Image Prior and Latent Diffusion. arXiv preprint arXiv:2310.03502, 2023. +Tal Reiss, Bar Cavia, and Yedid Hoshen. Detecting Deepfakes Without Seeing Any. arXiv preprint arXiv:2311.01458, 2023. +Joseph Robinson. Balanced Faces in the Wild, 2022. URL https://dx.doi.org/10.21227/nmsj-df12. +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-Resolution Image synthesis with Latent Diffusion Models. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10684–10695, 2022. +Roop. https://github.com/s0md3v/roop, 2023. +Andreas Rössler, Davide Cozzolino, Luisa Verdoliva, Christian Riess, Justus Thies, and Matthias Nießner. FaceForensics: A Large-Scale Video Dataset for Forgery Detection in Human Faces. arXiv preprint arXiv:1803.09179, 2018. +Andreas Rossler, Davide Cozzolino, Luisa Verdoliva, Christian Riess, Justus Thies, and Matthias Nießner. FaceForensics++: Learning to Detect Manipulated Facial Images. In IEEE/CVF International Conference on Computer Vision, pp. 1-11, 2019. +Davide Salvi, Brian Hosler, Paolo Bestagini, Matthew C Stamm, and Stefano Tubaro. TIMIT-TTS: A Text-to-Speech Dataset for Multimodal Synthetic Media Detection. In IEEE Access, 11: 50851-50866, 2023. +Axel Sauer, Dominik Lorenz, Andreas Blattmann, and Robin Rombach. Adversarial Diffusion Distillation. arXiv preprint arXiv:2311.17042, 2023. +Synthetic AI Stats. Synthetic AI stats: https://tinyurl.com/syntheticaistats. + +Hemlata Tak, Jee-ween Jung, Jose Patino, Madhu Kamble, Massimiliano Todisco, and Nicholas Evans. End-to-End Spectro-Temporal Graph Attention Networks for Speaker Verification Anti-Spoofing and Speech Deepfake Detection. arXiv preprint arXiv:2107.12710, 2021. +Hemlata Tak, Massimiliano Todisco, Xin Wang, Jee-weon Jung, Junichi Yamagishi, and Nicholas Evans. Automatic Speaker Verification Spoofing and Deepfake Detection using Wav2Vec 2.0 and Data Augmentation. arXiv preprint arXiv:2202.12233, 2022. +Kartik Thakral, Surbhi Mittal, Mayank Vatsa, and Richa Singh. PhygitalNet: Unified Face Presentation Attack Detection Via One-Class Isolation Learning. In IEEE International Conference on Automatic Face and Gesture Recognition, pp. 1-6, 2023. +Kartik Thakral, Shashikant Prasad, Stuti Aswani, Mayank Vatsa, and Richa Singh. ToonerGAN: Reinforcing GANs for Obfuscating Automated Facial Indexing. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10875-10884, 2024. +Kartik Thakral, Harsh Agarwal, Kartik Narayan, Surbhi Mittal, Mayank Vatsa, and Richa Singh. Deephynet: Towards Detecting Phylogeny in Deepfakes. In IEEE Transactions on Biometrics, Behavior, and Identity Science, 7(1):132-145, 2025. +TPDNE. This Person Does Not Exist. https://thispersondoesnotexist.com. [Accessed 06-06-2024]. +Jiuniu Wang, Hangjie Yuan, Dayou Chen, Yingya Zhang, Xiang Wang, and Shiwei Zhang. ModelScope Text-to-Video Technical Report. arXiv preprint arXiv:2308.06571, 2023a. +Sheng-Yu Wang, Oliver Wang, Richard Zhang, Andrew Owens, and Alexei A Efros. CNN-Generated Images are Surprisingly Easy to Spot... For Now. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8695-8704, 2020a. +Xin Wang, Junichi Yamagishi, Massimiliano Todisco, Héctor Delgado, Andreas Nautsch, Nicholas Evans, Md Sahidullah, Ville Vestman, Tomi Kinnunen, Kong Aik Lee, et al. ASVspoof 2019: A Large-Scale Public Database of Synthesized, Converted and Replayed Speech. Computer Speech & Language, 64:101114, 2020b. +Zhendong Wang, Jianmin Bao, Wengang Zhou, Weilun Wang, Hezhen Hu, Hong Chen, and Houqiang Li. Dire for Diffusion-Generated Image Detection. In IEEE/CVF International Conference on Computer Vision, pp. 22445–22455, 2023b. +Jun Wei, Shuhui Wang, and Qingming Huang. F3Net: Fusion, Feedback and Focus for Salient Object Detection. In AAAI Conference on Artificial Intelligence, volume 34, pp. 12321-12328, 2020. +Jun Xu, Tao Mei, Ting Yao, and Yong Rui. MSR-VTT: A Large Video Description Dataset for Bridging Video and Language. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5288-5296, 2016. +Ying Xu, Philipp Terhörst, Kiran Raja, and Marius Pedersen. A Comprehensive Analysis of AI Biases in Deepfake Detection with Massively Annotated Databases. arXiv preprint arXiv:2208.05845, 2022a. +Zhiliang Xu, Zhibin Hong, Changxing Ding, Zhen Zhu, Junyu Han, Jingtuo Liu, and Errui Ding. MobileFaceSwap: A Lightweight Framework for Video Face Swapping. In AAAI Conference on Artificial Intelligence, volume 36, pp. 2973-2981, 2022b. +Massimiliano; Sahidullah Md; Delgado Héctor; Wang Xin; Evans Nicolas; Kinnunen Tomi; Lee Kong Aik; Vestman Ville; Nautsch Andreas. Yamagishi, Junichi; Todisco. ASVspoof 2019: The 3rd Automatic Speaker Verification Spoofing and Countermeasures Challenge Database. University of Edinburgh. The Centre for Speech Technology Research, 2019. +Jianhui Yu, Hao Zhu, Liming Jiang, Chen Change Loy, Weidong Cai, and Wayne Wu. CelebV-Text: A Large-Scale Facial Text-Video Dataset. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2023. + +Zeroscope. https://huggingface.co/cerspense/zeroscope_v2_576w. [Accessed 06-06-2024]. +Zicheng Zhang, Chunyi Li, Wei Sun, Xiaohong Liu, Xiongkuo Min, and Guangtao Zhai. A Perceptual Quality Assessment Exploration for AIGC Images. In IEEE International Conference on Multimedia and Expo Workshops, pp. 440-445, 2023. +Wenliang Zhao, Yongming Rao, Weikang Shi, Zuyan Liu, Jie Zhou, and Jiwen Lu. Diffswap: High-fidelity and controllable face swapping via 3d-aware masked diffusion. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8568-8577, 2023. +Tianfei Zhou, Wenguan Wang, Zhiyuan Liang, and Jianbing Shen. Face Forensics in the Wild. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5778-5788, 2021. +Bojia Zi, Minghao Chang, Jingjing Chen, Xingjun Ma, and Yu-Gang Jiang. WildDeepFake: A Challenging Real-World Dataset for Deepfake Detection. In ACM International Conference on Multimedia, pp. 2382-2390, 2020. +Alon Ziv, Itai Gat, Gael Le Lan, Tal Remez, Felix Kreuk, Alexandre Défossez, Jade Copet, Gabriel Synnaeve, and Yossi Adi. Masked Audio Generation using a Single Non-Autoregressive Transformer. arXiv preprint arXiv:2401.04577, 2024. +Heqing Zou, Meng Shen, Yuchen Hu, Chen Chen, Eng Siong Chng, and Deepu Rajan. Cross-Modality and Within-Modality Regularization for Audio-Visual DeepFake Detection. arXiv preprint arXiv:2401.05746, 2024. + +# APPENDIX + +# A EXTENDED DETAILS OF ILLUSION DATASET + +Details of Skin Tone Scales: In this dataset, we have adopted the simplified Fitzpatrick Scale. This scale has been reorganized from six categories to four. The details of each category are as follows: + +- Bin 1: Light (Fitzpatrick I and II) +Bin 2: Light-Medium (Fitzpatrick III) +- Bin 3: Medium-Dark (Fitzpatrick IV) +- Bin 4: Dark (Fitzpatrick V and VI) + +![](images/e0cb5830d20ff1dcf081906d670003230fe9b5ccd609e85831ac5f0744fcec95.jpg) +Figure 5: Visualization of diverse samples from the proposed ILLUSION dataset, showcasing variations in resolution, quality, and generative techniques across different sets. + +Performance on Noisy data and Neural Compression: We investigate the robustness of deep learning models against Gaussian and salt-and-pepper noise, as well as neural compression algorithms. To achieve this, we evaluate baseline models trained on Sets A and B from the proposed ILLUSION dataset. Specifically, we analyze the performance of these models on the noisy and compressed samples from Set C, as summarized in Table 12. Our findings reveal that the models face challenges in generalizing effectively when confronted with noisy and neurally compressed data from Set C. + +Performance on Compressed Data: In this research, we examine the influence of varying degrees of compression on the performance of visual deepfake detection models. These models are individually trained and evaluated on three distinct versions of dataset A, namely raw, C23, and C40 compressions. Our observations, as detailed in Table 13, reveal that the DSP-FWA model consistently outperforms others across nearly all combinations of training and testing conditions. Interestingly, we notice a decline in performance when the models are trained on high-quality (raw) data and subsequently tested on compressed samples. This suggests a potential challenge in the model's ability to generalize from high-quality training data to lower-quality testing scenarios. + +However, promising results emerge when we consider models trained on C23 and C40 compressions. These models demonstrate enhanced generalization when evaluated on both raw and C40 samples, underscoring the benefits of training on compressed data. Consequently, this approach improves the robustness and adaptability of deepfake detection models across varying input qualities. + +Table 12: Classification performance on different noise and neural compression added to Set C. The models are evaluated on Gaussian noise (with deviations of 0.5 and 0.75), Salt and Pepper Noise (with noise density of 100 and 150), and Neural Compression (Cheng et al. (2020) and Minnen et al. (2018)). The baseline models are trained on Set A and Set B and tested on the noisy version of Set C. + +
Trained OnModelsGaussian NoiseSalt and Pepper NoiseNeural Compression
σ = 0.5σ = 0.75100150Cheng et al.Minnen et al.
Set AF3Net0.6120.6010.6340.6220.5250.481
DSP-FWA0.5920.5710.6010.5840.5160.508
MesoInceptionNet0.5530.520.5380.4950.5020.497
Xception0.6270.6050.6430.6260.5820.554
Set BF3Net0.6040.5930.6270.6060.5440.504
DSP-FWA0.5820.5720.5750.5720.4850.493
MesoInceptionNet0.5370.5440.5130.5080.4980.498
Xception0.6010.5930.6120.5820.6040.582
+ +Table 13: Classification performance for visual components of the dataset for intra and cross-compression of set A + +
Trained OnModelsRawC-23C-40
AccuracyAccuracy-PakeAccuracy-RealAUCAccuracyAccuracy-PakeAccuracy-RealAUCAccuracyAccuracy-PakeAccuracy-RealAUC
RawF3Net0.8510.7510.9510.9450.8260.7030.9400.9270.7750.7340.8130.852
DSP-FWA0.9840.9820.9860.9970.9780.9750.9810.9970.8150.6880.9350.874
MesInsceptionNet0.5050.9990.8820.8830.4810.9990.0010.8490.4861.0000.0000.730
Xception0.8510.8460.8560.9200.8360.8260.8450.9060.7450.8610.6340.843
C-23F3Net0.8760.8780.8730.9490.8610.8610.8610.9380.7570.8670.6530.856
DSP-FWA0.9790.9870.9710.9950.9770.9860.9680.9960.8100.9310.6960.930
MesInsceptionNet0.8450.8120.8780.9170.8350.7950.8730.9110.7420.8050.6820.825
Xception0.8660.8640.8670.9290.8520.8450.8600.9170.7730.8700.6800.859
C-40F3Net0.7170.4740.9640.8400.7630.8390.6940.8620.7940.6770.9050.884
DSP-FWA0.7760.8530.6980.8690.7280.4820.9560.8380.9270.9510.9040.978
MesInsceptionNet0.5120.0330.9960.7380.5350.0360.9960.8140.5480.0890.9820.869
Xception0.7540.5820.9270.8470.7680.6060.9180.8510.8090.8180.7990.879
+ +Comparison with Existing Deepfake Datasets: We evaluate ILLUSION's uniqueness and relevance in comparison to existing datasets through a series of analyses. + +We employed the Jaccard Similarity Index, defined as the ratio of the intersection to the union of two sets, to quantitatively assess the overlap between the ILLUSION dataset and existing datasets. This metric, ranging from 0 (disjoint sets) to 1 (identical sets), provides a measure of set similarity. The results, as summarized in Table 3, demonstrate a substantial lack of overlap. This confirms ILLUSION's distinctive coverage and its unique contribution to the landscape of generative method datasets. + +Next, we utilized the UpSet plot (visualized in Figure 6) to analyze the distribution of generative techniques, which revealed both unique contributions and shared intersections. The largest intersection corresponds to generative techniques exclusive to ILLUSION, including diffusion-based algorithms such as DiffSwap, DiffFace, DiffVC, and DiffGAN-TTS, as well as multi-modal synthesis methods. These highlight ILLUSION's novel contributions to media forensics. In contrast, smaller intersections with large-scale datasets like ForgeryNet and KoDF represent shared techniques such as GAN-based image synthesis and lip-sync forgeries, ensuring ILLUSION's benchmarking relevance against state-of-the-art methods. The relatively smaller shared intersections, compared to ILLUSION's unique contributions, highlights the dataset's comprehensive design in bridging gaps across modalities while introducing underexplored generative methods. + +To directly assess feature differences, we conducted feature embedding analyses using ResNet50 pre-trained on ImageNet. Uniformly sampled data (50,000 samples each) from ILLUSION and FakeAVCeleb were compared. The t-SNE plot (visualized in Figure 7) reveals distinct clustering patterns with minimal overlap, indicating significant differences in feature distributions. Additionally, the KL divergence of 1.62 between the feature embeddings quantitatively reinforces this dissimilarity. These objective metrics affirm that ILLUSION introduces novel and diverse generative techniques to the detection ecosystem, complementing existing datasets. + +# B GENERATION PIPELINE + +In this section, we discuss the methods used for the generation of the proposed ILLUSION dataset. + +![](images/0ebbd7aeb156d65e14a3fe4e07f1e730233f57d75a3fbfd8d4849e83c97a2216.jpg) +Figure 6: Overlap of Generative Techniques Across Datasets (UpSet Plot) - This plot illustrates the overlap of generative techniques across ILLUSION and other publicly available datasets. The largest intersection corresponds to 23 generative techniques unique to ILLUSION, including diffusion-based methods and advanced multi-modal synthesis techniques. Smaller intersections highlight shared generative methods between ILLUSION and datasets like ForgeryNet, KoDF, and DF-Platter. The plot highlights ILLUSION's distinctiveness while maintaining relevance through its integration of shared techniques. + +# B.1 SET A: IDENTITY SWAP DEEPFAKES + +The process of generating identity swaps of set A is visualized in Figure 2 (of the main paper). To generate these swaps, we utilize the YouTube videos from the CelebV-Text dataset (Li et al., 2020). We select 200 unique real identities, ensuring that 25 identities were chosen for each sub-group within the four skin-tone bins (as described in section A) and for both sexes, Male and Female, to maintain balance in the dataset in terms of sex and skin-tone group. Each real video clip is 20 seconds long and includes various occlusions, such as hats, glasses, excessive body movements, and harsh lighting, to ensure diversity in our dataset. Furthermore, for Females from the third bin of the Fitzpatrick scale, we scraped 25 videos from YouTube to compensate for the lack of English language videos in CelebV-Text and generate 25 images from "This Person Does Not Exist" (TPDNE) for face-swapping. We then assigned one identity from the YouTube video to another identity from the same generated images. + +We utilize 6 video generative models, 7 audio generative models, and an audio-video synchronization tool. Each of them is discussed below in detail. + +![](images/afd3a0a0e641102ceb64f56e86fa7aa5341d03c1da5720a39590fa400ba46757.jpg) +Figure 7: Feature-Level Comparison Between ILLUSION and FakeAVCeleb (PCA and t-SNE) - The PCA (left) and t-SNE (right) plots compare the feature embeddings of 10,000 randomly sampled data points from ILLUSION and FakeAVCeleb, extracted using a ResNet50 model pre-trained on ImageNet. The plots reveal distinct clustering patterns with minimal overlap, indicating significant differences in feature distributions. A KL-divergence of 1.23 further quantifies these differences, validating that ILLUSION provides unique feature representations compared to existing datasets. + +Visual Generation: For identity swapping i.e., face swapping in videos, 6 different models are employed, namely, MobileFaceSwap (Xu et al., 2022b), FSGAN (Nirkin et al., 2019), FaceShifters (Li et al., 2019b), ROOP (Roop, 2023), DiffFace (Kim et al., 2022), and DiffSwap (Zhao et al., 2023). For all possible combinations within a sub-group, the source (from which facial features are extracted) is swapped onto the target faces (which provide the face shape and background). Each manipulated video has the same duration as the corresponding real video in the base dataset. Each of the video models used for manipulating faces are discussed below: + +- FSGAN (Nirkin et al., 2019) is a Face Swapping GAN model for face swapping and reenactment. It is subject-agnostic and can be applied to pairs of faces without requiring training on those faces. The model for video-to-video is used with default hyperparameters. +- FaceShifter (Li et al., 2019b) generates the swapped face, extracting target attributes and embedding them onto the source. FaceShifter is robust against occlusions using two network pipelines, AEI-Net and HEAR-Net, trained to recover anomaly regions self-supervised without manual annotations. The pre-trained weights of ArcFace and AEI-Net are used to extract identity embeddings, and utilize source images and target videos to generate videos. +- MobileFaceSwap (Xu et al., 2022b) is a lightweight Identity-aware Dynamic Network (IDN) for subject-agnostic face swapping by dynamically adjusting the model parameters according to the identity information. The ArcFace and model pre-trained weights are used for identity embedding extraction and inference. We utilize source images and target videos to generate videos with default hyperparameters. + +- Roop (Roop, 2023) is one of the most widely used open-source deepfake generation software. Roop uses a face-swapping pre-trained model of InsightFace by DeepInsight. The default hyperparameters are used for generation while extracting a source frame to swap onto a target video. +- DiffFace (Kim et al., 2022) is a diffusion-based face-swapping framework composed of training ID conditional DDPM, sampling with facial guidance, and target-preserving blending. 40 equidistant frames are extracted from videos to create face swap images for the unseen test set. The default hyperparameters and pre-trained weights are utilized. +- DiffSwap (Zhao et al., 2023) is a diffusion model-based framework for high-fidelity and controllable face swapping. We use the pre-trained weights for face and landmark detection. + +Audio Generation: The identity swapping for audio i.e., audio spoofing is performed using 7 different audio-generative models, namely, FreeVC (Li et al., 2023), XTTS (Eren & The Coqui TTS Team, 2021), DiffVC (Popov et al., 2021b), DiffHierVC (Choi et al., 2023), YourTTS (Casanova et al., 2022), DiffGAN-TTS (Liu et al., 2022), GradTTS (Popov et al., 2021a) to create this dataset. The audio is extracted from the selected videos, and the MMS model (Pratap et al., 2024) is used to identify the language and English audio is selected. Next, we generate a transcription of the audio using the MMS model. This generated transcription is then used to generate synthetic audio. Additionally, the raw audio is used to create voice-cloned audio of the source speaker. We clone voices for all the combinations of source (speech which is cloned) and target (text of the audio borrowed from) within a sub-group. This ensures that the dataset's quality is maintained and that altered content is realistic by preserving the unique accents within a sub-group. Each audio is limited to 20 seconds in length to maintain the quality of the synthesized speech without compromising on the audio's duration. We discuss each of the audio models used for generating audio below: + +- FreeVC (Li et al., 2023) is an end-to-end model for voice conversion (VC) based on the approach proposed in VITS. The FreeVC model is a variational auto-encoder-based architecture pre-trained on the VCTK speech corpus. We use the model provided by Coqui to generate cloned voices using the pre-trained speaker encoder model. +- XTTS (Eren & The Coqui TTS Team, 2021) is an end-to-end voice generation model for voice cloning into different languages built on Tortoise. XTTS has significant model changes that simplify cross-language voice cloning and multi-lingual speech generation. Coqui is used to generate clones. +- DiffVC (Popov et al., 2021b) is another zero-shot many-to-many voice conversion method designed for the general case when source and target speakers do not belong to the training dataset. The model is trained using HifiGAN vocoder, and for voice conversion, the model is trained on VCTK and LibriTTS speech corpus. We use the pre-trained speaker encoder and voice conversion model trained on VCTK for cloning. +- Diff-HierVC (Choi et al., 2023) is a diffusion-based hierarchical VC system for voice conversion. For voice style transfer, Diff-HierVC uses two diffusion models, DiffVoice and DiffPitch. We use BigVGAN vocoder and pre-trained model weights with default hyperparameters. +- YourTTS (Casanova et al., 2022) was originally a text-to-speech model based on the end-to-end VITS but with a separate speaker embedding (from a speaker recognition model) to encode speaker identity. The inclusion of speaker encoding allows the use of YourTTS in a zero-shot voice conversion manner by simply substituting the embedding of one speaker with the embedding of another. Coqui implementation of the model is used for generation. +- DiffGAN-TTS (Liu et al., 2022) is a Denoising Diffusion Probabilistic Model (DDPM) - based TTS model. It is based on denoising diffusion generative adversarial networks (GANs), which adopt an adversarily-trained expressive model to approximate the denoising distribution. The shallow model trained on the VCTK dataset for 400000 steps is used. We assign a unique speaker ID from VCTK data to an identity of a sub-group and create spoofes within a train or test set of sub-groups. +- GradTTS (Popov et al., 2021a) is a text-to-speech model with a score-based decoder producing mel-spectrograms by gradually transforming noise predicted by the encoder and aligning with text input employing Monotonic Alignment Search. GradTTS uses a HifiGAN + +vocoder. We use the pre-trained weights of the model and vocoder trained on the LibriTTS dataset. A unique speaker ID from VCTK data is assigned to an identity in a sub-group, and spoofes are created within a train or test set of sub-groups. + +Audio-Video Synchronization: We combine the audio and video using the Audalign (Alignment). It is an open-source project that uses audio fingerprinting, cross-correlation, cross-correlation with spectrograms, or visual alignment techniques to align audio and video timestamps. The extracted audio from the real video is combined with face-swapped manipulated videos, giving us our dataset's ii) Real Audio and Fake Video class. Moreover, we also combined the generated audio spoofs afterSyncing with real and face-swapped video. This gives us the two other classes of our dataset: iii) Fake Audio and Real Video and iv) Fake Audio and Fake Video. This gives us all four classes of the generated dataset. + +# B.2 SET B: AI GENERATED CONTENT + +With the advent of generative AI methods, the amount of completely synthetic media across modalities has surged in social media platforms. These methods better capture contextual information since they generate media based on a textual prompt or guidance from pre-existing media. In this set, we present a subset of completely synthetic AI-generated content. The generation procedure for each modality is discussed below in detail- + +Video Generation: We use the MSRvTT (Xu et al., 2016) dataset for video-caption pairs. It is a large-scale dataset for open-domain video captioning containing video clips annotated with 20 English sentences by Amazon Mechanical Turks. From the publicly available dataset, 7010 captions are used to generate videos. For this, we use three different text-to-video models: Text2Video-Zero (Khachatryan et al., 2023), ModelScopeT2V (Wang et al., 2023a) and ZeroScope (Zeroscope). 24 frames are generated for every video from Text2Video-Zero and ZeroScope, and 40 frames are generated for each from ModelScopeT2V. More frames are generated from ModelScopeT2V because the videos generated from this model have a-Shutterstock watermark. The higher number of frames can separately be used later to check how different detection algorithms perform on samples that contain a watermark. Watermarks have become increasingly common in internet content as more organizations prefer to add their watermark on their respective media. Each of the generative video models is discussed briefly below: + +- ModelScopeT2V (Wang et al., 2023a) is a generative text-to-video synthesis model that evolves from Stable Diffusion. It uses spatiotemporal blocks, VQGAN, a text encoder, and a denoising UNet, resulting in consistent frame generation and smooth movement transitions. The videos generated from this model have a-Shutterstock watermark. We use its public implementation, which is available in the Huggingface diffusers library. +- Zeroscope (Zeroscope) is a generative model based on ModelScope itself, but it has been improved to produce higher-quality videos with a fixed aspect ratio and no-Shutterstock watermark. We used zeroscape-v2-576w. +- Text2Video-Zero (Khachatryan et al., 2023) is a zero-shot text-to-video generation model. It uses existing text-to-image synthesis methods (e.g., Stable Diffusion), making them suitable for the video domain. Mainly, it includes frame-level self-attention using new cross-frame attention of each frame on the first frame to preserve the context, appearance, and identity of the foreground object. + +Audio Generation: We use the MusicCaps (Agostinelli et al., 2023) dataset to generate music samples, a large-scale dataset containing 5,211 music examples, each labelled with an English aspect list and a free text caption written by musicians. For each caption, we use three text-to-music models, namely: AudioLDM (Liu et al., 2023), MusicGen (Copet et al., 2023) and MAGNeT (Ziv et al., 2024). Further, we download the original audio clip from Youtube, and corresponding to each audio clip, we use an audio-to-audio model: Audio Diffusion (Face). Each of the generative models are discussed below: + +- MusicGen (Copet et al., 2023) is an end-to-end model for text-to-audio generation specifically tailored for music generation. It comprises a single-stage transformer language + +model capable of generating conditioned high-quality music samples. We use its public implementation from the AudioCraft library. + +- MAGNeT (Ziv et al., 2024) is an end-to-end model for text-conditioned music generation. It is a Masked Audio Generation method utilizing a single non-autoregressive transformer. Its public implementation from the AudioCraft library is used. +- AudioLDM (Liu et al., 2023) is an end-to-end model for text conditioned audio generation. A latent diffusion model (LDM) learns continuous audio representations from CLAP latent. We used its public implementation from the diffuser library. +- Audio Diffusion (Face) is an end-to-end model for audio to audio generation. It converts audio input into a mel spectrogram, then uses a Variational Auto-Encoder (VAE) model to encode and decode images to and from latent, and finally a UNet2DConditionModel to denoise the encoded image latents. Public implementation from the diffusers library is used for generation. + +Image Generation: We use the training set of the COCO dataset to get 118,287 image-caption pairs. Now, corresponding to each caption in the dataset, we use four text-to-image models, namely: Stable Diffusion XL (Podell et al., 2023), Kandinsky 2.1 (Razzhigaev et al., 2023), MultiDiffusion (Bar-Tal et al., 2023) and SDXL-Turbo (Sauer et al., 2023). Further, the original image from the dataset is kept as the corresponding real for each generated image. We discuss each of the generative models below: + +- Stable Diffusion XL (Podell et al., 2023) is an end-to-end model for text-conditioned image generation and is an improvement to the previous stable diffusion models with a much larger UNet and a combination of OpenCLIP ViT-bigG/14 text encoder with the original text encoder. We used its public implementation from the diffusers library. +- Kandinsky 2.1 (Razzhigaev et al., 2023) is an end-to-end model for text-conditioned image generation. As the text and image encoder, it uses the CLIP model and diffusion image prior (mapping) between latent spaces of CLIP modalities to generate photo-realistic images. We use its public implementation from the diffusers library. +- MultiDiffusion (Bar-Tal et al., 2023) is a recent technique for text-conditioned image generation, making any pre-trained text-to-image model usable for generation without fine-tuning and training with a higher control over output. We used it in conjugation with StableDiffusionPanoramaPipeline as available in its public implementation from the diffusers library. +- SDXL-Turbo (Sauer et al., 2023) is an end-to-end model for text to image generation. It is a distilled version of SDXL-1.0 and uses a novel training method called Adversarial Diffusion Distillation (ADD) for much faster, high-quality generation. We used its public implementation from the diffusers library. + +Synthetic-Faces Dataset: We scrape image samples from a popular deep fake generation website thispersondoesnexist.com. Further, we classified these samples as per sex and skin tone into eight subgroups to create a demographically balanced dataset that contains 1025 synthetic faces for each subgroup cumulating to a total of 8,200 synthetic face images. Now, to have an equal number of real faces in our dataset, we collect an equal number of samples from Balanced Faces in the Wild (BFW) (Robinson, 2022). + +# B.3 SET C: FAKES IN THE WILD + +We use Midjourney (Midjourney) and Artguru (ArtGuru), both premium tools that allow users to generate synthetic images via text-to-image modality through a premium API and a web interface, respectively. For Midjourney, we use prompts from the validation set of the COCO dataset, and for each prompt, we get four corresponding images to generate a total of 20,000 images. Artguru, however, specializes more in generating identity-driven images for a given prompt. Therefore, we randomly pick 1000 prompts from the person class of the COCO dataset to generate a total of 1000 images. Apart from these images, we have 24 real-world doctored videos used for testing. + +# C BASELINE MODELS + +In our evaluation of the ILLUSION dataset, we employ a diverse set of eleven deepfake detection methods. The selection of these methods is primarily guided by the availability of their respective codebases. For each method, we adhere to the default parameters provided, ensuring a fair and consistent comparison across all detection methods. In the following sections, we provide a succinct discussion of each of these detection methods: + +# C.1 VISUAL MODELS + +- MesoInceptionNet (Afchar et al., 2018) is a CNN architecture used for deepfake and face-to-face image forgery detection. It develops on the Inception module. Going deeper with convolutions for the first two convolutional layers of the Meso-4 architecture, MesoInception-4 is created. +- XceptionNet (Chollet, 2017) is a deep CNN architecture using depthwise separable convolutions. Inception modules in CNNs can be seen as a transitional stage between conventional convolutions and depthwise separable convolutions, which combine depthwise and pointwise convolutions. This insight leads to a new Inception-inspired deep CNN design, where depthwise separable convolutions replace Inception modules. +- DSP-FWA (Li & Lyu, 2018) It uses face-warping artifacts from deepfake generation to identify swapped videos. It employs a CNN trained with negative examples created by mimicking affine face warping steps and positive face images. To simulate artifacts, these negative examples involve recognizing faces, resizing them, applying Gaussian blur, and then affine warping. The technique uses CNN models like VGG16 and ResNet to detect inconsistencies between manipulated facial regions and their surroundings. +- F3Net (Wei et al., 2020) or Frequency in Face Forgery Network is a network that deep mines the forgery patterns through a two-stream collaborative learning framework, utilising two complementary but distinct frequency-aware clues: 1) frequency-aware decomposed image components, and 2) local frequency statistics. It uses DCT frequency-domain transformation. + +# C.2 AUDIO MODELS + +- RawGAT-ST (Tak et al., 2021), is a spectro-temporal graph attention network that learns to detect spoofed speech from raw waveform inputs. It creates separate spectral and temporal sub-graphs, employs graph attention to capture relationships within each sub-graph, fuses the sub-graphs at the model level, and uses graph pooling to improve discrimination. This approach automatically learns relevant spectro-temporal artifacts without hand-crafted features or separate systems for different attacks. +- AASIST (Jung et al., 2022) or Attention-Augmented Speaker Inconsistency Stacking Transformer for detecting spoofed utterances. It uses a heterogeneous stacking graph attention layer that models artifacts spanning both temporal and spectral domains using a heterogeneous attention mechanism and a stack node. The model employs a max graph operation with a competitive mechanism and an extended readout scheme. +- SSLModel (Tak et al., 2022) proposes an embedding fusion scheme that combines representations from supervised learning (SL) and self-supervised learning (SSL) models for spoofed speech detection. It performs weighted score fusion between SL and best SSL models and then minimizes the embedding distribution between selected SL and SSL representations using a comprehensive statistical analysis to select appropriate layers. This fusion approach leverages knowledge from both SL and SSL frameworks to improve performance. +- Conformer (Gulati et al., 2020) model has statistical pooling for jointly performing speaker verification and voice spoofing detection. It utilizes the Conformer architecture, which combines Transformer and CNNs and employs statistical pooling to aggregate frame-level representations. The model is trained on both tasks simultaneously, enabling it to reject both spoofed utterances and utterances from different speakers. + +# C.3 MULTI-MODAL MODELS + +- FACTOR (Reiss et al., 2023) is a detection method that utilizes fact-checking adapted from fake news detection. It verifies the claimed facts (e.g., identity) by comparing them with the actual observed media (e.g., appearance) to identify real versus fake content. It does not require training, uses readily available features, and achieves higher accuracy without prior exposure to deepfakes, especially in face-swapping and audio-visual synthesis scenarios. + +- MRDF (Zou et al., 2024) proposes cross-modality and within-modality regularization to maintain modality distinctions during multi-modal representation learning. The approach includes an audio-visual transformer module for modality correspondence and a cross-modality regularization module to align paired audio-visual signals. Additionally, a within-modality regularization module refines unimodal representations to retain modality-specific details. + +- Unimodal Ensembling integrates an ensemble of two best performing models, F3Net and SSLModel. For any given deepfake input, we first extract the video and audio components. Subsequently, we fuse the predictions derived from each modality to arrive at a final prediction. This process ensures a comprehensive analysis of the deepfake content, leveraging both visual and auditory cues. \ No newline at end of file diff --git a/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/images.zip b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7ade78c0561d3b07bb61eef6b68050e6ba54b778 --- /dev/null +++ b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:daa7adcfaa499e7619ff25a4c94a725080f3a8eeac4fe6b430903bf70168e285 +size 1037243 diff --git a/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/layout.json b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..dcf85f6dabaec99b92756ecbf1d8eeffdcba3b69 --- /dev/null +++ b/ICLR/2025/ILLUSION_ Unveiling Truth with a Comprehensive Multi-Modal, Multi-Lingual Deepfake Dataset/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d087115467adfda0199d4ce2e32864e1bbebd754fb1bc22ce6e353e4760a9801 +size 570531 diff --git a/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_content_list.json b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1a90022aa6b068bd03a8c77d06b836c5aba40b98 --- /dev/null +++ b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:773adc242bc08a2fc331ffc0b048475aced0b4405b4689955c0bec447386ab08 +size 154453 diff --git a/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_model.json b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9d6421c2b770d7197f7b944a10c0f1c0a657f1ab --- /dev/null +++ b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8b6b4ec42e1321b6c10bb7a403aeea05f9fe883491c8f6c4fd4f77a853a136a +size 188147 diff --git a/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_origin.pdf b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2b54bb8c28debe0ee1abd281c712b93e971799a9 --- /dev/null +++ b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/5e9c17a1-b9c6-4ea8-a5c0-f40122e854f5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e26ee8ac546f33a4753acd9cf2a592f13431e3c029912be526a7623f16af63ad +size 4680529 diff --git a/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/full.md b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5e5fff119f442f779218359f247a8cbbcf1aa10c --- /dev/null +++ b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/full.md @@ -0,0 +1,595 @@ +# IMDPROMPTER: ADAPTING SAM TO IMAGE MANIPULATION DETECTION BY CROSS-VIEW AUTOMATED PROMPT LEARNING + +Quan Zhang $^{1*}$ , Yuxin Qi $^{2*}$ , Xi Tang $^{1}$ , Jinwei Fang $^{3}$ , Xi Lin $^{2}$ , Ke Zhang $^{1\dagger}$ , Chun Yuan $^{1\dagger}$ + +$^{1}$ Tsinghua University $^{2}$ Shanghai Jiao Tong University + +3University of Science and Technology of China + +{zhangqua22, ke-zhang19}@mails.tsinghua.edu.cn, + +qiyuxin98@sjtu.edu.cn, yuanc@sz.tsinghua.edu.cn + +# ABSTRACT + +Using extensive training data from SA-1B, the Segment Anything Model (SAM) has demonstrated exceptional generalization and zero-shot capabilities, attracting widespread attention in areas such as medical image segmentation and remote sensing image segmentation. However, its performance in the field of image manipulation detection remains largely unexplored and unconfirmed. There are two main challenges in applying SAM to image manipulation detection: a) reliance on manual prompts, and b) the difficulty of single-view information in supporting cross-dataset generalization. To address these challenges, we develop a cross-view prompt learning paradigm called IMDPrompter based on SAM. Benefiting from the design of automated prompts, IMDPrompter no longer relies on manual guidance, enabling automated detection and localization. Additionally, we propose components such as Cross-view Feature Perception, Optimal Prompt Selection, and Cross-View Prompt Consistency, which facilitate cross-view perceptual learning and guide SAM to generate accurate masks. Extensive experimental results from five datasets (CASIA, Columbia, Coverage, IMD2020, and NIST16) validate the effectiveness of our proposed method. + +# 1 INTRODUCTION + +With the continuous emergence of powerful editing tools Zhang et al. (2025a), image manipulation has become unprecedentedly simple. These new opportunities have sparked the creativity of both benevolent and malicious users. In the past, organizing multimedia misinformation activities required complex skills, with attackers limited to splicing, copying, or deleting objects. Recently, deep learning has advanced at a rapid pace, leading to the development of more user-friendly and powerful image editing tools. As a result, users can now swiftly generate images of fictional characters or create highly convincing deepfakes. Generative models can produce realistic image edits based on natural language prompts, perfectly matching inserted elements with the style and lighting of the environment Avrahami et al. (2023); Nichol et al. (2021). + +However, the risks of these tools falling into the wrong hands are evident. In recent years, governments and funding agencies have shown increasing interest in developing forensic tools capable of addressing such attacks, particularly focusing on local image tampering that alters the semantic content of images Le et al. (2021). In response to these challenges, the fields of multimedia forensics and related sciences have rapidly expanded, proposing various methods and tools for image manipulation detection (IMD) and localization Guillaro et al. (2023). Despite significant progress in this area, the performance of state-of-the-art detectors in practical applications remains insufficient, primarily limited by several shortcomings that require further research: a) limited generalization ability; b) limited robustness; c) poor detection performance. + +To address the shortcomings of existing IMD methods, we turn our attention to foundational models Kirillov et al. (2023); Radford et al. (2021); Jia et al. (2021); Sharif Razavian et al. (2014). Thanks to large-scale pretraining, foundational models like GPT-4 Achiam et al. (2023), Flamingo Alayrac et al. (2022), and SAM Kirillov et al. (2023) have made significant strides and contributed importantly to societal advancements. Among them, SAM, trained on one billion masks, demonstrates exceptional generalization ability, inspiring our research. However, using SAM for image manipulation detection tasks presents significant challenges: a) reliance on manual prompts: SAM's interactive framework requires predefined prompts for input images, such as points, boxes, or masks. As a category-agnostic segmentation method, these limitations hinder SAM's ability to achieve fully automated understanding in IMD tasks; b) single-view information struggles to support cross-dataset generalization: previous studies Zhou et al. (2020) have reported that DeepLabv2 Chen et al. (2017) trained on the CASIAv2 Dong et al. (2013) dataset performed well on the CAISAv1 Dong et al. (2013) dataset (sourced from CASIAv2) but poorly on the non-sourced COVER Wen et al. (2016) dataset. Similar behavior has also been observed with FCN Long et al. (2015) in this research. + +To activate SAM's IMD capabilities, we propose a cross-view automated prompt learning paradigm called IMDPrompter, aimed at learning how to generate prompts to enhance SAM's functionality: a) Inspired by Battle & Gollapudi (2024) using automated prompt optimizers to improve the performance of LLMs, we constructed the automated prompt learning paradigm IMDPrompter, which generates prompt information automatically; b) To enhance SAM's cross-dataset generalization ability, we introduced three noise views: SRM filtering, Bayer Conv, and Noiseprint, aiming to generate enhanced prompt information from multiple perspectives. To integrate information from multiple views, previous methods Zhai et al. (2023) employed a strategy of weighted averaging of the outputs from multiple views. However, due to the inaccuracy of prompts generated from individual views, simple weighted averaging can smooth out the accurate prompts from the optimal view to suboptimal ones. To + +preserve the accurate prompts from the optimal view, we propose an Optimal Prompt Selection (OPS) module based on minimizing localization loss; meanwhile, we noted that ideally, the prompt information from each view should converge toward the optimal prompt. Based on this motivation, we constructed a Cross-View Prompt Consistency (CPC) constraint to achieve alignment enhancement across views. For the mask generation process, we developed an Attention-based Cross-view Feature Perception (CFP) module and a Multi-Layer Perceptron-based Prompt Mixing module (PMM) to achieve the fusion of cross-view information and the integration of multiple types of prompts sequentially. + +![](images/158f06c7e99a6bdc71e21a153a6f5b7eac7205fa610a71fb35c489196bfee309.jpg) +Figure 1: Improvements of proposed IMDPrompter over existing pipelines of baselines: (a). Automated prompt learning without the need for manual input. (b). Flexible integration of semantic-agnostic information crucial for Image Manipulation Detection. + +In summary, our main contributions are as follows. + +- We are the first to apply SAM to the field of image manipulation detection and propose an automated prompt learning paradigm, IMDPrompter, eliminating the original SAM's reliance on manual prompts. +- We propose modules such as Optimal Prompt Selection and Cross-View Prompt Consistency Constraint, achieving alignment enhancement across views. +- We propose Cross-view Feature Perception and Prompt Mixing modules, achieving the fusion of cross-view information and the integration of multiple types of prompts. + +- We demonstrate extensive results across five different image manipulation detection datasets, thoroughly validating the strong in-distribution and out-of-distribution image manipulation detection and localization capabilities of IMDPrompter. + +# 2 RELATED WORK + +Image Manipulation Detection. Currently, methods for image manipulation detection can be broadly categorized into two types, primarily distinguished by their recognition of manipulated artifacts. Some techniques Wu et al. (2019); Chen et al. (2021); Wu et al. (2022); Bi et al. (2019); Hu et al. (2020); Yang et al. (2020); Marra et al. (2020) rely on detecting abnormal features and often use high-pass noise filters Yang et al. (2020); Li & Huang (2019) to suppress content information. Other methods Park et al. (2018); Kwon et al. (2022); Mareen et al. (2022) attempt to detect inconsistencies in compression within tampered images, as they assume different compression Quality Factors (QFs) before and after the operation. Additionally, some researchers focus their attention on camera-based artifacts, such as model fingerprints Mareen et al. (2022); Cozzolino & Verdoliva (2019); Cozzolino et al. (2015). + +Foundational Models. In recent years, foundational models have sparked a tremendous transformation in the field of artificial intelligence. These models, trained on extensive datasets, have demonstrated impressive generalization capabilities across various scenarios Kirillov et al. (2023); Cai et al. (2024); Liu et al. (2024b); Pan et al. (2024b;a; 2025). Renowned models such as Chat-GPT Ouyang et al. (2022), GPT-4 Achiam et al. (2023), and Stable Diffusion Rombach et al. (2022) have further propelled the development of artificial intelligence, making significant contributions to human civilization and exerting considerable influence across various industries. Inspired by the success of foundational models in natural language processing (NLP), researchers have begun exploring their potential applications in computer vision. While most of these models are aimed at extracting accessible knowledge from freely available data Alayrac et al. (2022); Radford et al. (2021); Chen et al. (2023), the recent SAM model Kirillov et al. (2023) adopts an innovative approach by constructing a data engine where the model co-develops annotations with environmental datasets. SAM uniquely leverages a vast collection of masks, showcasing robust generalization capabilities. However, it was initially designed as a task-agnostic segmentation model, requiring prompts (i.e., inputs of prior points, bounding boxes, or masks), and therefore does not directly facilitate end-to-end automated segmentation perception. This paper does not delve into the design and training of foundational image manipulation detection models; instead, we explore the potential of utilizing SAM's powerful universal segmentation capabilities for image manipulation detection and localization. Furthermore, the proposed method of learning prompts can be extended to other visual foundational models beyond SAM. + +Prompt Learning. In the past, machine learning tasks were primarily focused on fully supervised learning, where task-specific models were trained only on labeled instances of the target task Krizhevsky et al. (2017). However, over time, there has been a significant shift in learning paradigms, transitioning from fully supervised learning towards pretraining and fine-tuning approaches for downstream tasks. This shift allows models to leverage general features acquired during pretraining Russakovsky et al. (2015); Simonyan & Zisserman (2014); He et al. (2016). More recently, with the advent of foundational models, a new paradigm has emerged known as pretraining and prompting Chen et al. (2023); Lester et al. (2021); Liu et al. (2023); Zhou et al. (2022). In this paradigm, researchers no longer train models specifically for downstream tasks but instead redesign inputs using prompts to reformulate the downstream tasks to align with the original pretraining task Radford et al. (2021); Devlin et al. (2018); Radford et al. (2019). Prompting helps to reduce semantic gaps, bridge the gap between pretraining and fine-tuning, and prevent overfitting of the heads. Since the advent of GPT-3 Brown et al. (2020), prompting has evolved from traditional discrete Liu et al. (2023) and continuous prompt constructions Chen et al. (2023); Zhou et al. (2022) to large-scale model-centric contextual learning Alayrac et al. (2022), instruction tuning Liu et al. (2024a); Peng et al. (2023); Gupta et al. (2022), and chaining approaches Wei et al. (2022); Wang et al. (2022a); Zhang et al. (2022). Currently, methods for constructing prompts include manual templates, heuristic-based templates, generation, fine-tuning word embeddings, and pseudo-labeling Liu et al. (2023); Wang et al. (2022b). In this paper, we propose a prompt generator for generating prompts compatible with SAM. + +# 3 PROPOSED METHOD + +![](images/ef814835bb42c9c6ce3572e7cfa8198f52f9be296d0038d186753acf550c0d8e.jpg) +Figure 2: Overall framework of IMDPrompter. The prompter part consists of four views: RGB, SRM, Bayar and Noiseprint. OPS selects the optimal prediction from the four views to generate the best prompt. CPC enhances cross-view consistency. CFP achieves cross-view feature perception fusion. PMM achieves a mixture of multiple prompt information. + +As illustrated in Figure 2, we introduce IMDPrompter, an automated prompt learning framework leveraging cross-view perception to unlock SAM's detection and localization capabilities. It employs an optimal prompt selection module to identify the best prompts, enhances alignment via cross-view prompt consistency, and achieves efficient image manipulation detection and localization through feature fusion and prompt mixing. + +# 3.1 MULTI-VIEW FEATURE REPRESENTATION + +Current technology Zhou et al. (2020) shows that while RGB views work well for in-domain (IND) manipulation detection, they perform poorly in out-of-domain (OOD) detection. Moreover, using noise views to capture semantic-agnostic information enhances performance. Therefore, relying solely on RGB view data is inadequate for detecting and localizing manipulations. To address this, we incorporate three semantic-agnostic views: SRM, Bayer, and Noiseprint noise views, as outlined below: + +$$ +F _ {\mathrm {s a m}} = \Phi_ {\mathrm {s a m - i m g}} (\mathcal {I}), \tag {1} +$$ + +$$ +f _ {\mathrm {R G B}} = \Phi_ {\mathrm {S e g} - \mathrm {R G B}} (\mathcal {I}), f _ {\mathrm {S R M}} = \Phi_ {\mathrm {S e g} - \mathrm {S R M}} \left(\Phi_ {\mathrm {S R M}} (\mathcal {I})\right), f _ {\mathrm {B a y e r}} = \Phi_ {\mathrm {S e g} - \mathrm {B a y e r}} \left(\Phi_ {\mathrm {B a y e r}} (\mathcal {I})\right), \tag {2} +$$ + +$$ +f _ {\text {N o i s e p r i n t}} = \Phi_ {\text {S e g - N o i s e p r i n t}} \left(\Phi_ {\text {N o i s e p r i n t}} (\mathcal {I})\right). \tag {3} +$$ + +In the system, $\mathcal{I}$ represents the input image, and $\Phi_{\mathrm{sam - img}}$ denotes the SAM image encoder. $F_{\mathrm{sam}}$ represents the features encoded by the SAM image encoder. $\Phi_{\mathrm{SRM}}$ , $\Phi_{\mathrm{Bayer}}$ and $\Phi_{\mathrm{Noiseprint}}$ respectively represent the SRM noise map extractor, the Bayer noise map extractor and the Noiseprint noise map extractor. $\Phi_{\mathrm{Seg - RGB}}$ , $\Phi_{\mathrm{Seg - SRM}}$ , $\Phi_{\mathrm{Seg - Bayer}}$ and $\Phi_{\mathrm{Seg - Noiseprint}}$ each represent the segmenter for the RGB view, SRM view, Bayer view and Noiseprint view, with all four segmenters having identical structures + +but non-shared parameters. $f_{\mathrm{RGB}}$ , $f_{\mathrm{SRM}}$ , $f_{\mathrm{Bayer}}$ and $f_{\mathrm{Noiseprint}}$ represent the features from the RGB, SRM, Bayer, and Noiseprint views, respectively. + +# 3.2 OPTIMAL PROMPT SELECTION + +In the masked prompt generation process, we integrate mask probability distributions from four views: $P_{\mathrm{RGB}}$ , $P_{\mathrm{SRM}}$ , $P_{\mathrm{Bayar}}$ , and $P_{\mathrm{Noiseprint}}$ , to form an ensemble distribution $P_{\mathrm{Ens}}$ . We select the optimal mask probability segmentation $P_{\mathrm{opt}}$ by minimizing segmentation loss, and derive the corresponding mask $M_{\mathrm{opt}}$ and bounding box prompts $\mathcal{B}_{\mathrm{opt}}$ . These are fed into SAM's prompt encoder to obtain the prompt encoding $F_{\mathrm{opt}}$ . The process is outlined as follows: + +$$ +P _ {\mathrm {R G B}} = \Phi_ {\mathrm {R G B} - \mathrm {C L S}} \left(f _ {\mathrm {R G B}}\right), P _ {\mathrm {S R M}} = \Phi_ {\mathrm {S R M} - \mathrm {C L S}} \left(f _ {\mathrm {S R M}}\right), P _ {\text {B a y e r}} = \Phi_ {\text {B a y e r} - \mathrm {C L S}} \left(f _ {\text {B a y e r}}\right), \tag {4} +$$ + +$$ +P _ {\text {N o i s e p r i n t}} = \Phi_ {\text {N o i s e p r i n t - C L S}} \left(f _ {\text {N o i s e p r i n t}}\right), \tag {5} +$$ + +$$ +P _ {\text {E n s}} = \frac {P _ {\mathrm {R G B}} + P _ {\mathrm {S R M}} + P _ {\mathrm {B a y e r}} + P _ {\mathrm {N o i s e p r i n t}}}{4}, \tag {6} +$$ + +$$ +P _ {\text {o p t}} = \underset {P \in \mathcal {P}} {\operatorname {a r g m i n}} \mathcal {L} _ {\text {S e g}} (P, G), \mathcal {P} = \left\{P _ {\text {R G B}}, P _ {\text {S R M}}, P _ {\text {B a y e r}}, P _ {\text {N o i s e p r i n t}}, P _ {\text {E n s}} \right\}, \tag {7} +$$ + +$$ +M _ {\text {o p t}} = \Phi_ {\text {m a s k}} \left(P _ {\text {o p t}}\right), \mathcal {B} _ {\text {o p t}} = \Phi_ {\text {b o x}} \left(M _ {\text {o p t}}\right), \tag {8} +$$ + +$$ +F _ {\text {o p t}} = \Phi_ {\mathrm {p} - \text {e n c}} \left(M _ {\text {o p t}}, \mathcal {B} _ {\text {o p t}}\right), \tag {9} +$$ + +where $\Phi_{\mathrm{RGB - CLS}}$ , $\Phi_{\mathrm{SRM - CLS}}$ , $\Phi_{\mathrm{Bayer - CLS}}$ and $\Phi_{\mathrm{Noiseprint - CLS}}$ represent classifiers for the RGB, SRM, Bayer, and Noiseprint views, respectively, $G$ represents the one-hot encoded mask labels, $\mathcal{L}_{\mathrm{Seg}}$ is the segmentation loss function, $\Phi_{\mathrm{mask}}$ represents the mask generation operation, $\Phi_{\mathrm{box}}$ is the bounding box generation operation, and $\Phi_{\mathrm{p - enc}}$ represents SAM's prompt encoder. + +# 3.3 CROSS-VIEW PROMPT CONSISTENCY + +Ideally, the segmentation masks from the four views should be consistent with the optimal segmentation mask. Therefore, we constructed a cross-view prompt consistency enhancement loss to achieve enhanced prompt consistency across views. The CPC loss function is expressed as follows: + +$$ +\mathcal {L} _ {\mathrm {C P C}} = \mathcal {L} _ {\mathrm {S e g}} \left(P _ {\mathrm {R G B}}, P _ {\mathrm {o p t}}\right) + \mathcal {L} _ {\mathrm {S e g}} \left(P _ {\mathrm {S R M}}, P _ {\mathrm {o p t}}\right) + \mathcal {L} _ {\mathrm {S e g}} \left(P _ {\mathrm {B a y e r}}, P _ {\mathrm {o p t}}\right) + \mathcal {L} _ {\mathrm {S e g}} \left(P _ {\mathrm {N o i s e p r i n t}}, P _ {\mathrm {o p t}}\right), \tag {10} +$$ + +where $\mathcal{L}_{\mathrm{Seg}}$ is the segmentation loss function. + +# 3.4 CROSS-VIEW FEATURE PERCEPTION + +To enhance the segmentation accuracy of SAM, we propose a Cross-View Feature Perception (CFP) module that integrates features from RGB, SRM, Bayer, and Noiseprint views. This module enriches the feature representations for SAM's decoding process, as shown in Figure 3. Here, $\Phi_{\mathrm{CFP}}$ denotes the CFP module, and $F_{\mathrm{CFP}}$ represents the fused cross-view features. + +The process begins by aligning features $f_{\mathrm{RGB}}$ , $f_{\mathrm{SRM}}$ , $f_{\mathrm{Bayer}}$ , and $f_{\mathrm{Noiseprint}}$ with $F_{\mathrm{sam}}$ via bicubic interpolation. These features are then concatenated with $F_{\mathrm{sam}}$ after a $1 \times 1$ convolution. The concatenated features pass through two stacked convolution blocks ( $3 \times 3$ convolution, instance normalization, and GELU activation). Meanwhile, the semantic selection attention branch (global average pooling, fully connected layer, GELU, and sigmoid) weights the shortcut branch to produce the integrated feature $F_{\mathrm{CFP}}$ . The CFP module effectively fuses multi-view features to improve segmentation performance. + +![](images/b86bf37f382ce9795f1d27d3e21a060418678b7c8de4b13142d445ad2432d4d8.jpg) +Figure 3: Architecture of the Cross-view Feature Perception (CFP) unit. + +$$ +F _ {\mathrm {C F P}} = \Phi_ {\mathrm {C F P}} \left(F _ {\mathrm {s a m}}, f _ {\mathrm {R G B}}, f _ {\mathrm {S R M}}, f _ {\mathrm {B a y e r}}, f _ {\text {N o i s e p r i n t}}\right) \tag {11} +$$ + +# 3.5 PROMPT MIXING MODULE + +Since $F_{\mathrm{CFP}}$ aggregates semantically related and unrelated features, it aids the guidance of SAM for image manipulation detection. Therefore, we constructed the PMM module, which is primarily based on MLP, to integrate multiple types of prompt information. First, the two types of prompt inputs, $F_{\mathrm{CFP}}$ and $F_{\mathrm{opt}}$ , are concatenated, followed by an MLP layer to perform dimension transformation to align with the original SAM prompt encoder's prompt embedding. Then, $F_{\mathrm{mix}}$ and $F_{\mathrm{CFP}}$ are input into SAM's mask decoder to achieve the image manipulation localization process. The process is as follows: + +$$ +F _ {\text {m i x}} = \Phi_ {\mathrm {M L P}} \left(\left[ F _ {\mathrm {C F P}}; F _ {\text {o p t}} \right]\right), \tag {12} +$$ + +$$ +P _ {\text {s a m}} = \Phi_ {\text {s a m - d e c}} \left(F _ {\text {C F P}}, F _ {\text {m i x}}\right), \tag {13} +$$ + +where $\Phi_{\mathrm{MLP}}$ represents the MLP layer operation, $F_{\mathrm{mix}}$ represents the integrated prompt embedding, and $\Phi_{\mathrm{sam - dec}}$ represents SAM's mask decoder, with $P_{\mathrm{sam}}$ representing the mask probability prediction output of the mask decoder. + +# 3.6 TRAINING AND INFERENCE PIPELINE + +The training loss function of IMDPrompter includes the segmentation loss from four prompt views $\mathcal{L}_{\mathrm{Seg - p}}$ , the CPC loss $\mathcal{L}_{\mathrm{CPC}}$ , the SAM decoder segmentation loss $\mathcal{L}_{\mathrm{Seg - sam}}$ , and the image-level prediction loss $\mathcal{L}_{\mathrm{Img - level}}$ . The formula is expressed as follows: + +$$ +\mathcal {L} = \mathcal {L} _ {\text {S e g - s a m}} + \lambda_ {1} \mathcal {L} _ {\text {S e g - p}} + \lambda_ {2} \mathcal {L} _ {\text {C P C}} + \lambda_ {3} \mathcal {L} _ {\text {I m g - l e v e l}}, \tag {14} +$$ + +where + +$$ +L _ {\text {S e g - s a m}} = L _ {\text {S e g}} \left(P _ {\text {s a m}}, G\right), \tag {15} +$$ + +$$ +L _ {\text {S e g - p}} = L _ {\text {S e g}} \left(P _ {\text {R G B}}, G\right) + L _ {\text {S e g}} \left(P _ {\text {B a y a r}}, G\right) + L _ {\text {S e g}} \left(P _ {\text {S R M}}, G\right) + L _ {\text {S e g}} \left(P _ {\text {N o i s e p r i n t}}, G\right). \tag {16} +$$ + +In this paper, we use Focal Loss as our $L_{\mathrm{Seg}}$ + +For image-level detection, following the work of Zhai et al. (2023), we adopt an adaptive pooling based on minimizing intra-class prediction variance. The overall computational process is as follows, first using Otsu's method Otsu et al. (1975) to find a threshold $\omega_0$ that minimizes the intra-class prediction variance: + +$$ +\omega_ {0} = \underset {\omega \in \left\{\hat {p} _ {i, j} \right\}} {\arg \min } \left| \left\{\hat {p} _ {i, j} \mid \hat {p} _ {i, j} < \omega \right\} \right| \operatorname {v a r} \left(\left\{\hat {p} _ {i, j} \mid \hat {p} _ {i, j} < \omega \right\}\right) + \tag {17} +$$ + +$$ +\left| \left\{\hat {p} _ {i, j} \mid \hat {p} _ {i, j} \geq \omega \right\} \right| \operatorname {v a r} \left(\left\{\hat {p} _ {i, j} \mid \hat {p} _ {i, j} \geq \omega \right\}\right), +$$ + +where $\mathrm{var}(\cdot)$ denotes variance, $\hat{p}_{i,j}$ is the pixel-level response at position $(i,j)$ . Then the image-level prediction is aggregated from pixel-level responses above the threshold and the image-level loss is: + +$$ +\hat {y} _ {\mathrm {A}} = \frac {1}{\left| \mathbb {P} _ {\mathrm {h}} \right|} \sum_ {\hat {p} \in \mathbb {P} _ {\mathrm {h}}} \hat {p}; \mathbb {P} _ {\mathrm {h}} = \left\{\hat {p} _ {i, j} \mid \hat {p} _ {i, j} \geq \omega_ {0} \right\}, \tag {18} +$$ + +$$ +\mathcal {L} _ {\text {I m g - l e v e l}} = \mathcal {L} _ {\mathrm {B C E}} (y, \hat {y} _ {\mathrm {A}}), \tag {19} +$$ + +where $\hat{y}_{\mathrm{A}}$ is the image-level prediction, $\mathcal{L}_{\mathrm{BCE}}$ denotes the binary cross-entropy loss. + +During the inference process of IMDPrompter, since there are no true labels, our OPS module defaults to selecting $P_{\mathrm{Ens}}$ for generating masks and bounding box prompts, with other components functioning as during the training process. + +# 4 EXPERIMENT + +Dataset. Our method is trained only on the CASIAv2 dataset Dong et al. (2013). For in-distribution (IND) evaluation, we use the CASIAv1 dataset Dong et al. (2013). For out-of-distribution (OOD) evaluation, we use three datasets: Columbia Hsu & Chang (2006), Coverage Wen et al. (2016) and IMD2020 Novozamsky et al. (2020). + +Evaluation Metrics. For image-level manipulation detection, we report specificity, sensitivity, and their F1-score (I-F1). The area under the receiver operating characteristic curve (AUC) is also + +reported as a threshold-independent metric for image-level detection. For pixel-level manipulation localization, we follow previous methods Chen et al. (2021); Zhou et al. (2018b;a); Salloum et al. (2018) to compute pixel accuracy, recall, and their F1-score (P-F1) on manipulated images. The overall performance of image and pixel-level manipulation detection/localization is measured by the harmonic mean of pixel-level and image-level F1-scores Chen et al. (2021), denoted as composite F1 (C-F1), and is sensitive to lower values of P-F1 and I-F1. To ensure fair comparison, a default threshold of 0.5 is used for F1 computation unless otherwise specified. + +Implementation Details. In our experiments, unless otherwise specified, we consistently use the VIT-L backbone of SAM and employ FCN (lightweight architecture based on MobileNet Howard (2017)) as the segmentor for the three prompt views. We maintain image size at $1024 \times 1024$ , consistent with the original input of the SAM model. To augment training samples, we use data augmentation techniques such as horizontal flipping and random cropping. The image encoder remains frozen during the training phase. All experiments are run on NVIDIA A6000 GPUs. For the optimization process, we train our model using the AdamW optimizer with an initial learning rate of 1e-4. We use a batch size of 4 and train for 100 epochs. We implement a linear warm-up strategy with a cosine annealing scheduler Loshchilov & Hutter (2016) to decay the learning rate. + +# 4.1 COMPARISON WITH STATE-OF-THE-ART METHOD + +Table 1: Pixel-level manipulation detection performance. Performance metric is F1-score (\%). The best results for each test set are highlighted in bold and second-best values are underlined. + +
MethodBest thresholdFixed threshold (0.5)
CASIACOVERColumbiaIMDNISTMEANCASIACOVERColumbiaIMDNISTMEAN
MFCN Salloum et al. (2018)54.1-61.2---------
RGB-N Zhou et al. (2018b)40.837.9----------
H-LSTM Bappy et al. (2019)20.921.314.231.046.626.8015.416.313.019.535.419.92
ManTra-Net Wu et al. (2019)69.277.270.970.545.566.6615.528.636.418.70.019.84
HP-FCN Li & Huang (2019)21.419.947.116.936.028.2615.40.36.711.212.19.14
CR-CNN Yang et al. (2020)66.247.070.460.042.857.2840.529.143.626.223.832.64
GSR-Net Zhou et al. (2018a)57.448.962.268.745.656.5638.728.561.324.328.336.22
SPAN Hu et al. (2020)68.871.877.469.668.371.1818.417.248.717.022.124.68
CAT-Net Kwon et al. (2021)57.348.577.651.759.959.0013.612.955.55.417.921.06
MVSS-Net Chen et al. (2021)75.382.470.375.773.775.4845.245.363.826.029.241.90
Trufor Guillaro et al. (2023)83.574.182.1-68.8-73.760.085.9-39.9-
FCN Long et al. (2015)74.257.358.664.550.761.0644.119.922.321.016.724.80
IMDPrompter85.183.587.376.374.681.3676.363.687.330.641.159.78
+10.9+26.2+28.7+11.8+23.9+20.3+32.2+43.7+65.0+9.6+24.4+34.98
+ +Table 2: Image-level manipulation detection performance. Decision threshold: 0.5. NIST16 is excluded as it lacks genuine images. The best results for each test set are highlighted in bold and second-best values are underlined. + +
MethodCASIACOVERColumbiaIMDMEAN
AUCSen.Spe.F1AUCSen.Spe.F1AUCSen.Spe.F1AUCSen.Spe.F1AUCF1
H-LSTM Bappy et al. (2019)0.49899.70.00.00.500100.00.00.00.506100.01.12.20.501100.00.00.00.50130.55
ManTra-Net Wu et al. (2019)0.500100.00.00.00.500100.00.00.00.701100.00.00.00.500100.00.00.00.55030.00
CR-CNN Yang et al. (2020)0.71993.013.924.20.56696.77.013.10.78396.124.639.20.61592.912.321.70.670824.55
GSR-Net Zhou et al. (2018a)0.50099.40.00.00.515100.00.00.00.502100.01.12.20.500100.00.00.00.50430.55
SPAN Hu et al. (2020)0.500100.00.00.00.500100.00.00.00.500100.00.00.00.500100.00.00.00.50000.00
CAT-Net Kwon et al. (2021)0.64723.992.138.00.55728.080.041.50.97187.296.291.50.58627.581.641.10.690353.03
MVSS-Net Chen et al. (2021)0.93761.598.875.80.73194.014.024.40.98066.9100.080.20.65691.522.035.50.826053.98
Trufor Guillaro et al. (2023)0.916---0.770---0.996---------
FCN Long et al. (2015)0.77072.864.368.30.54190.010.018.00.76295.032.248.10.50284.615.526.20.643840.15
IMDPrompter0.97891.666.977.30.79696.855.270.30.98397.390.293.60.67171.657.463.70.857076.23
+0.208+18.8+2.6+9.0+0.255+6.8+45.2+52.3+0.221+2.3+58.0+45.5+0.169-13.0+41.9+37.5+0.2132+36.08
+ +Pixel-level Manipulation Detection Table 1 illustrates the pixel-level detection performance of different models. We evaluate the F1-score under two settings: best threshold and fixed threshold (0.5). From Table 1, it is evident that IMDPrompter achieves the best performance across nearly all datasets. Under the optimal threshold setting, we achieved an average F1 Score of $81.36\%$ . Under the fixed threshold setting, IMDPrompter achieved an average F1 Score of $59.78\%$ , indicating that our proposed IMDPrompter demonstrates better robustness in threshold settings. + +Image-level Manipulation Detection. Table 2 presents the image-level performance of different models. For image-level performance, we use a default decision threshold of 0.5. Once again, IMDPrompter emerges as the top performer, leveraging our prompt learning paradigm to achieve + +![](images/b22d965281334e661035511348fcbe722e59d22f46d1a9de26af39790d7ea6e6.jpg) + +![](images/ec550cf4b11e1447e2b9cd2b050e56c0c705a01414b56706ea15e47ab5e9431d.jpg) + +![](images/7b1f7556e7427bcb41b3ca1ecfdc4c9ca26d5e22cb9b170640ccfb85a55b79f9.jpg) + +![](images/21a84b5e7a1b3c35c86f2b108f22a3e6c344f35af33bdd53e958c9d44c14b95a.jpg) + +![](images/582255c4228f76525aab0da81051adfc6aeee99e8bf5995efb828b4182a5aafd.jpg) + +![](images/f023cf397899bc375add1bad8a9a60b237f744b8e8df5de16f7d9300c7c9eebb.jpg) +Image + +![](images/98df5b100ee78d2e5f6f5744fffa871417c970af1d25065d583928fb518917f8.jpg) + +![](images/9709aadf9f301754bed1428633eceae78914299a70053e0e34016c805b0ceb49.jpg) + +![](images/af70f89f50fddcbc4b7b5299e7e75683c596a6dab658bda6171d959cd46cdf1b.jpg) + +![](images/e236309d330379db86e104f5fd8b100cd2a97297fa125c609c85ab26f75f47a2.jpg) + +![](images/cc68f7bbd2fb755198d18e78cb012021de0909d3bc89c0062aa2bc14dbbde6cf.jpg) + +![](images/07f5ae8a44e46edcc129588d71bfbcfa9303d458035008d0577140ed41485752.jpg) +GT + +![](images/fc3a6427037db5ce68e75177dc3333348c9e722b5dd555d82348835882d8d5da.jpg) + +![](images/a3492afef40c7d42c01cfa4e18fbe7464698ae6728d3a73282e2bcf61ab4d8ab.jpg) + +![](images/87c12253861c2e6c53fa0fa07a627ecd8b2729410be4cab60a4ee4b95494cca6.jpg) + +![](images/f153b6b14005bf077055de6171e28ad19c976993d941f55dcef34ee382572af5.jpg) + +![](images/0042b3bbc08221a409577f2e96c1afc5550bd8426dfd9441fcd1b397f2c0002f.jpg) + +![](images/7180e71f64018d392af9014d50dea356265e397bd36589c3b3f3eeda7e89cd66.jpg) +ManTra-Net + +![](images/35dc4b17c92a0da5ad4cdf6c629533905943aed24203e6ff458fa34f60719429.jpg) + +![](images/7b8039f249f3be825cf102ee7a78fb2523301aba28802985127c12cf20f88b36.jpg) + +![](images/029e609d751b6a10792b54b7d7fc7a6d36bfb370e77a84e43e24d1101326a9e9.jpg) + +![](images/8899b8bd98ea2625da3ef4b8e10d2f3f44d3233b90d13e90ff00323bba2a2b2d.jpg) + +![](images/cdc1409396384a0fcc42fc3cba872dc7b952e4bc488b69c75de759e013bca547.jpg) + +![](images/749e2f8e57483b352009167780e7a64ee69827b67334e2070bbdb53a8e1d3d76.jpg) +MVSS-Net +Figure 4: Visualization Comparison of Image Manipulation Detection and Localization Results + +![](images/e98e9326c9c0a51c9511f7408cfcc7343a7d568c0c5b62b2da136b3c60b7fa51.jpg) + +![](images/5a86e35b08270349e996bad5cb3e044aa3dfbff577df5846ce8c69e80626c8f1.jpg) + +![](images/1a783a6fa2eea39238e29251cadf25e5807cc43034c676f53c22e3d10715013e.jpg) + +![](images/cec69a6aaa6e813dd94432a5d65a3fe7a8af2d8da5c57c0ee3ee22088eb41e15.jpg) + +![](images/caf170e7291f040f29a7d3213b01dbbf21da5f91a5e47ac6379ea38fd89c939c.jpg) + +![](images/89c6ecdbcbdcf4990f3cda74d93c07e3e235ccf0e2efb41d3e5e0e909646224a.jpg) +Trufor + +![](images/5954eee0690c331c3ad5b557210c79be7aa8996671a7b5a45ffbe9c1ae63d610.jpg) + +![](images/0e4597908fe9c414afdeabc500b185b55eb7af070da40db48e20d67d1f3dea29.jpg) + +![](images/69c80c2ff2a5a11bc54e019740e13cdc65e98ea77968256bae81a634f0f7930b.jpg) + +![](images/551acca7c5272a73bc9291ba1b6be31d46a4cc00525decf90b5b5c0aadad70fe.jpg) + +![](images/618d93db5c2492cb451033929e0b71c7c0a69b1e1d8ee2a9f5a62a14daf02a31.jpg) + +![](images/c9824d52de7cdb5f9257ec2e8d71dd03c2bdc2f505873e9c9e895403ad9c62d4.jpg) +IMDPrompter + +Table 3: Evaluation of each component of our method in IND dataset. + +
CFPCPCOPSPMMCASIA
I-F1P-F1C-F1
170.670.370.4
2✓73.273.173.1
3✓✓74.374.374.3
4✓✓✓75.176.175.6
5✓✓✓✓77.376.376.8
+ +Table 4: Evaluation of each component of our method in OOD dataset. + +
CFPCPCOPSPMMCOVER
I-F1P-F1C-F1
620.439.827.0
7✓49.654.351.8
8✓✓58.657.057.8
9✓✓✓65.261.463.2
10✓✓✓✓70.363.666.8
+ +higher specificity in most test settings, thereby reducing false positives. Additionally, IMDPrompter achieves the best average AUC and average F1-scores. The average F1-score of IMDPrompter significantly surpasses that of the second-best method, MVSS-Net, with an improvement of $22.25\%$ . + +Qualitative Results. As shown in Figure 10, we visualized the image manipulation localization results of four methods: ManTra-Net, MVSS-Net, Trufor, and IMDPrompter. It is evident that IMDPrompter generates more accurate confidence maps for image manipulation localization, achieving better detection and localization. + +# 4.2 ABLATION STUDIES + +To reveal the impact of different components, we evaluated the proposed model under various settings, analyzing the distinct effects of each component on in-domain and out-of-domain datasets. As shown in Tables 3 and 4, we conducted ablation experiments on the in-domain dataset CASIA and the out-of-domain dataset COVER, respectively. + +Baseline. From Experiment 1, it is known that our baseline method achieved performance scores of $70.6\%$ , $70.3\%$ , and $70.4\%$ on the I-F1, P-F1, and C-F1 metrics respectively in the CASIA dataset. In the COVER dataset, it scored $20.4\%$ , $39.8\%$ , and $27.0\%$ on the same metrics. These experiments show that using only RGB visual view information has limited generalization ability in out-of-domain datasets. + +Impact of CFP. From Experiment 2, By implementing cross-view feature perception fusion through the CFP module, the I-F1, P-F1, and C-F1 metrics on the CASIA dataset improved by $2.6\%$ , $2.8\%$ , + +Table 5: Ablation Study of View Combinations + +
RGBNoiseprintBayarSRMCASIACOVERColumbiaIMD
I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1
✓0.85673.6069.6071.500.55619.6038.6026.000.78653.6024.9034.000.53128.1021.2024.20
✓0.90375.9073.6074.700.76162.9058.7060.700.94688.6083.5086.000.63659.9027.9038.10
✓0.86374.3070.6072.400.70661.3056.3058.700.88983.4081.6082.500.60154.6025.7034.90
✓0.89675.1071.6073.300.71359.6055.6057.500.90684.6079.3081.900.59356.3024.3033.90
✓✓0.94176.9075.2076.000.78166.8061.9064.300.96991.7085.4088.400.65561.5028.8039.20
✓✓✓0.96277.1075.9076.500.78868.7062.4065.400.97792.4086.5089.400.66062.6029.5040.10
✓✓✓✓0.97877.3076.3076.800.79670.3063.6066.800.98393.6087.3090.300.67163.7030.6041.30
+ +Table 6: Ablation Study of SAM + +
MethodCASIACOVERColumbiaIMD
I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1
FCN0.77068.344.153.60.54118.019.918.90.76248.122.330.50.50226.221.023.3
FCN+0.87373.461.366.80.68149.243.946.40.87172.652.460.90.58943.125.131.7
IMDPrompter0.97877.376.376.80.79670.363.666.80.98393.687.390.30.67163.730.641.3
+ +and $2.7\%$ , respectively. Experiment VII showed that on the COVER dataset, the I-F1, P-F1, and C-F1 metrics increased by $29.2\%$ , $14.5\%$ , and $24.8\%$ , respectively. This indicates that cross-view feature perception fusion can enhance performance on both in-domain and out-of-domain datasets, especially on out-of-domain datasets. + +Impact of CPC. From Experiment 3, the inclusion of CPC, which introduced cross-view consistency enhancement, resulted in performance gains of $3.7\%$ , $4.0\%$ , and $3.9\%$ on the I-F1, P-F1, C-F1 metrics respectively in the CASIA dataset. Experiment VIII showed performance gains of $38.2\%$ , $17.2\%$ , and $30.8\%$ respectively on the COVER dataset, confirming that the prompt information between different views is complementary and integrative enhancement can bring objective performance improvements. + +Impact of OPS. The inclusion of OPS for heuristic selection of optimal prompts resulted in improvements of $4.5\%$ , $5.8\%$ , and $5.2\%$ in the I-F1, P-F1, and C-F1 metrics on the CASIA dataset, respectively. Experiment IX showed gains of $44.8\%$ , $21.6\%$ , and $36.2\%$ respectively on the COVER dataset, indicating that simply adding together prompts from different views is not enough to generate the best prompts, and a optimal prompts selection strategy can optimize the prompt selection process. From Experiment 4, the inclusion of OPS adaptive selection of the optimal prompts resulted in performance gains of $4.5\%$ , $5.8\%$ , and $5.2\%$ on the I-F1, P-F1, C-F1 metrics respectively in the CASIA dataset. + +Impact of PMM. From Experiment 5, with the inclusion of PMM which fully integrates various types of prompt information, there was an increase in performance of $6.7\%$ , $6.0\%$ , and $6.4\%$ on the I-F1, P-F1, C-F1 metrics respectively in the CASIA dataset. Experiment 10 showed an increase of $49.9\%$ , $23.8\%$ , and $39.8\%$ respectively on the COVER dataset, further demonstrating the effectiveness of PMM. + +Impact of View Combinations. As shown in Table 5, the performance of using the RGB view alone does not differ significantly from that of using semantic-agnostic views such as SRM, Bayer, and Noiseprint individually on the in-domain test set CASIA. In contrast, for the out-of-domain test sets COVER, Columbia, and IMD, there is a significant performance gap between the RGB view and the semantic-agnostic views. This indicates that semantic-agnostic views play a crucial role in generalization on out-of-domain datasets. Additionally, we conducted ablation studies on various view combinations, and using both the RGB view and the Noiseprint view simultaneously resulted in substantial performance improvements. This demonstrates that the Noiseprint view serves as a critical semantic-agnostic feature. Next, we sequentially introduced the Bayer and SRM views, achieving further steady improvements across all metrics. When we combined the RGB, Noiseprint, SRM, and Bayer views, our method achieved optimal performance, validating the effectiveness of this combination. + +Impact of SAM. As shown in Table 6, we constructed an $\mathrm{FCN + }$ model that integrates four views without using SAM, further analyzing the impact of SAM on IMD. Due to the lack of potential priors from a large-scale pre-training dataset, the performance ceiling of $\mathrm{FCN + }$ is relatively low. In contrast, our IMDPrompter fully leverages these potential priors, thereby enhancing the performance ceiling + +Impact of Quality Degradation. As shown in Figure 5, following Dong et al. (2022), we evaluated the robustness of the models under two common image processing operations encountered during the + +![](images/89d348f1d1b009fe3d76ccedc1a856d7713cebc5794f0756a4316f4e91c952d1.jpg) + +![](images/c6a9abe93876c391528a2b254d9ac3a4337474588db7c827a39e3454b9d0231c.jpg) + +![](images/676dcd5f2e7d9c7f2f994823bc7cbcabbe061f4924e77a3912cfcb144e7260b2.jpg) + +![](images/d4719630a53310f06d89a4a80e042682597164e65f5a07c3983045ff548380e1.jpg) + +![](images/5b6e8a4aa86d24ea60d929ec066206ba5d1d80ac45d54bba586ca497bd904dcd.jpg) +Figure 5: Robustness Analysis Against JPEG Compression and Gaussian Blur Interference + +![](images/3f5994a70291c4729758effc6bc3c8d91608045902ebbf6c6cca37ec94f9e047.jpg) + +![](images/894abeeb6597286c472b6765f7ee91b5f9cc2a0019735841802e22120f11a38f.jpg) + +dissemination of images on the internet, namely JPEG compression and Gaussian blur. Comparing these two operations, Gaussian blur has a more significant impact on detection performance, especially when using larger 17x17 scale convolution kernels. Compared to previous methods, our IMDPrompter exhibits better robustness. + +# 5 CONSLUSION + +In this paper, we propose a cross-view perceptual prompt learning paradigm, IMDPrompter, which applies SAM to the image manipulation detection task for the first time. We sequentially introduce components such as optimal prompt selection, cross-view prompt consistency, cross-view feature perception, and prompt mixing modules to achieve efficient and automated image manipulation detection and localization. Our IMDPrompter demonstrates significant image-level and pixel-level manipulation detection performance in both in-domain (IND) and out-of-domain (OOD) scenarios, as well as across various robustness evaluation settings. + +# 6 ACKNOWLEDGEMENTS + +We thank all the anonymous reviewers for their helpful comments. This work was supported by the National Key R&D Program of China (2022YFB4701400/4701402), SSTIC Grant(KJZD20230923115106012,KJZD20230923114916032,GJHZ20240218113604008), Beijing Key Lab of Networked Multimedia and National Natural Science Foundation of China under Grant 62202302. + +# REFERENCES + +Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023. +Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. Advances in neural information processing systems, 35:23716-23736, 2022. +Omri Avrahami, Ohad Fried, and Dani Lischinski. Blended latent diffusion. ACM transactions on graphics (TOG), 42(4):1-11, 2023. +Jawadul H Bappy, Cody Simons, Lakshmanan Nataraj, BS Manjunath, and Amit K Roy-Chowdhury. Hybrid lstm and encoder-decoder architecture for detection of image forgeries. IEEE transactions on image processing, 28(7):3286-3300, 2019. +Rick Battle and Teja Gollapudi. The unreasonable effectiveness of eccentric automatic prompts. arXiv preprint arXiv:2402.10949, 2024. +Xiuli Bi, Yang Wei, Bin Xiao, and Weisheng Li. Rru-net: The ringed residual u-net for image splicing forgery detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 0-0, 2019. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020. +Miaomiao Cai, Xiaoyu Liu, Zhiwei Xiong, and Xuejin Chen. Biosam: Generating sam prompts from superpixel graph for biological instance segmentation. IEEE Journal of Biomedical and Health Informatics, 2024. +Keyan Chen, Xiaolong Jiang, Yao Hu, Xu Tang, Yan Gao, Jianqi Chen, and Weidi Xie. Ovarnet: Towards open-vocabulary object attribute recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 23518-23527, 2023. +Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence, 40(4):834-848, 2017. +Xinru Chen, Chengbo Dong, Jiaqi Ji, Juan Cao, and Xirong Li. Image manipulation detection by multi-view multi-scale supervision. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 14185-14193, 2021. +Yirui Chen, Xudong Huang, Quan Zhang, Wei Li, Mingjian Zhu, Qiangyu Yan, Simiao Li, Hanting Chen, Hailin Hu, Jie Yang, et al. Gim: A million-scale benchmark for generative image manipulation detection and localization. arXiv preprint arXiv:2406.16531, 2024. +Davide Cozzolino and Luisa Verdoliva. Noiseprint: A cnn-based camera model fingerprint. IEEE Transactions on Information Forensics and Security, 15:144-159, 2019. +Davide Cozzolino, Giovanni Poggi, and Luisa Verdoliva. Splicebuster: A new blind image splicing detector. In 2015 IEEE International Workshop on Information Forensics and Security (WIFS), pp. 1-6. IEEE, 2015. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. +Chengbo Dong, Xinru Chen, Ruohan Hu, Juan Cao, and Xirong Li. Mvss-net: Multi-view multi-scale supervised networks for image manipulation detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(3):3539-3553, 2022. + +Jing Dong, Wei Wang, and Tieniu Tan. Casia image tampering detection evaluation database. In 2013 IEEE China summit and international conference on signal and information processing, pp. 422-426. IEEE, 2013. +Shuting Dong, Feng Lu, Zhe Wu, and Chun Yuan. Dfvsr: Directional frequency video super-resolution via asymmetric and enhancement alignment network. In *IJCAI*, pp. 681-689, 2023a. +Shuting Dong, Feng Lu, and Chun Yuan. Frequency reciprocal action and fusion for single image super-resolution. In ICASSP 2023-2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 1-5. IEEE, 2023b. +Shuting Dong, Zhe Wu, Feng Lu, and Chun Yuan. Enhanced image deblurring: An efficient frequency exploitation and preservation network. In Proceedings of the 31st ACM International Conference on Multimedia, pp. 7184-7193, 2023c. +Hongfan Gao, Wangmeng Shen, Xiangfei Qiu, Ronghui Xu, Jilin Hu, and Bin Yang. Diffimp: Efficient diffusion model for probabilistic time series imputation with bidirectional mamba backbone. arXiv preprint arXiv:2410.13338, 2024. +Fabrizio Guillaro, Davide Cozzolino, Avneesh Sud, Nicholas Dufour, and Luisa Verdoliva. Trufor: Leveraging all-round clues for trustworthy image forgery detection and localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 20606-20615, 2023. +Prakhar Gupta, Cathy Jiao, Yi-Ting Yeh, Shikib Mehri, Maxine Eskenazi, and Jeffrey P Bigham. Instructdial: Improving zero and few-shot generalization in dialogue through instruction tuning. arXiv preprint arXiv:2205.12673, 2022. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016. +Andrew G Howard. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. +Yu-Feng Hsu and Shih-Fu Chang. Detecting image splicing using geometry invariants and camera characteristics consistency. In 2006 IEEE International Conference on Multimedia and Expo, pp. 549-552. IEEE, 2006. +Shiyan Hu, Kai Zhao, Xiangfei Qiu, Yang Shu, Jilin Hu, Bin Yang, and Chenjuan Guo. Multirc: Joint learning for time series anomaly prediction and detection with multi-scale reconstructive contrast. arXiv preprint arXiv:2410.15997, 2024. +Xuefeng Hu, Zhihan Zhang, Zhenye Jiang, Syomantak Chaudhuri, Zhenheng Yang, and Ram Nevatia. Span: Spatial pyramid attention network for image manipulation localization. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXI 16, pp. 312-328. Springer, 2020. +Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In International conference on machine learning, pp. 4904-4916. PMLR, 2021. +Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023. +Vladimir V Kniaz, Vladimir Knyaz, and Fabio Remondino. The point where reality meets fantasy: Mixed adversarial generators for image splice detection. Advances in neural information processing systems, 32, 2019. +Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84-90, 2017. + +Myung-Joon Kwon, In-Jae Yu, Seung-Hun Nam, and Heung-Kyu Lee. Cat-net: Compression artifact tracing network for detection and localization of image splicing. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 375-384, 2021. +Myung-Joon Kwon, Seung-Hun Nam, In-Jae Yu, Heung-Kyu Lee, and Changick Kim. LearningJPEG compression artifacts for image manipulation detection and localization. International Journal of Computer Vision, 130(8):1875-1895, 2022. +Trung-Nghia Le, Huy H Nguyen, Junichi Yamagishi, and Isao Echizen. Openforensics: Large-scale challenging dataset for multi-face forgery detection and segmentation in-the-wild. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 10117-10127, 2021. +Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021. +Haodong Li and Jiwu Huang. Localization of deep inpainting using high-pass fully convolutional network. In proceedings of the IEEE/CVF international conference on computer vision, pp. 8301-8310, 2019. +Zhe Li, Xiangfei Qiu, Peng Chen, Yihang Wang, Hanyin Cheng, Yang Shu, Jilin Hu, Chenjuan Guo, Aoying Zhou, Qingsong Wen, et al. Founds: Comprehensive and unified benchmarking of foundation models for time series forecasting. arXiv preprint arXiv:2410.11802, 2024. +Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. Advances in neural information processing systems, 36, 2024a. +Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys, 55(9):1-35, 2023. +Xiaoyu Liu, Xin Ding, Lei Yu, Yuanyuan Xi, Wei Li, Zhijun Tu, Jie Hu, Hanting Chen, Baoqun Yin, and Zhiwei Xiong. Pq-sam: Post-training quantization for segment anything model. In European Conference on Computer Vision, pp. 420-437. Springer, 2024b. +Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3431-3440, 2015. +Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016. +Jun Ma, Yuting He, Feifei Li, Lin Han, Chenyu You, and Bo Wang. Segment anything in medical images. Nature Communications, 15(1):654, 2024. +Hannes Mareen, Dante Vanden Bussche, Fabrizio Guillaro, Davide Cozzolino, Glenn Van Wallendael, Peter Lambert, and Luisa Verdoliva. Comprint: Image forgery detection and localization using compression fingerprints. In International Conference on Pattern Recognition, pp. 281-299. Springer, 2022. +Francesco Marra, Diego Gragnaniello, Luisa Verdoliva, and Giovanni Poggi. A full-image full-resolution end-to-end-trainable cnn framework for image forgery detection. IEEE Access, 8: 133488-133502, 2020. +Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021. +Adam Novozamsky, Babak Mahdian, and Stanislav Saic. Imd2020: A large-scale annotated dataset tailored for detecting manipulated images. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision Workshops, pp. 71-80, 2020. +Nobuyuki Otsu et al. A threshold selection method from gray-level histograms. Automatica, 11 (285-296):23-27, 1975. + +Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35:27730-27744, 2022. +Zhenyu Pan, Rongyu Cao, Yongchang Cao, Yingwei Ma, Binhua Li, Fei Huang, Han Liu, and Yongbin Li. Codev-bench: How do llms understand developer-centric code completion? arXiv preprint arXiv:2410.01353, 2024a. +Zhenyu Pan, Haozheng Luo, Manling Li, and Han Liu. Conv-coa: Improving open-domain question answering in large language models via conversational chain-of-action. arXiv preprint arXiv:2405.17822, 2024b. +Zhenyu Pan, Xuefeng Song, Yunkun Wang, Rongyu Cao, Binhua Li, Yongbin Li, and Han Liu. Do code llms understand design patterns? arXiv preprint arXiv:2501.04835, 2025. +Jinseok Park, Donghyeon Cho, Wonhyuk Ahn, and Heung-Kyu Lee. Double jpeg detection in mixed jpeg quality factors using deep convolutional neural network. In Proceedings of the European conference on computer vision (ECCV), pp. 636-652, 2018. +Baolin Peng, Chunyuan Li, Pengcheng He, Michel Galley, and Jianfeng Gao. Instruction tuning with gpt-4. arXiv preprint arXiv:2304.03277, 2023. +Xiangfei Qiu, Jilin Hu, Lekui Zhou, Xingjian Wu, Junyang Du, Buang Zhang, Chenjuan Guo, Aoying Zhou, Christian S. Jensen, Zhenli Sheng, and Bin Yang. Tfb: Towards comprehensive and fair benchmarking of time series forecasting methods. Proc. VLDB Endow., 17(9):2363-2377, 2024. +Xiangfei Qiu, Xiuwen Li, Ruiyang Pang, Zhicheng Pan, Xingjian Wu, Liu Yang, Jilin Hu, Yang Shu, Xuesong Lu, Chengcheng Yang, Chenjuan Guo, Aoying Zhou, Christian S. Jensen, and Bin Yang. Easytime: Time series forecasting made easy. In ICDE, 2025a. +Xiangfei Qiu, Xingjian Wu, Yan Lin, Chenjuan Guo, Jilin Hu, and Bin Yang. Duet: Dual clustering enhanced multivariate time series forecasting. In SIGKDD, 2025b. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning. PMLR, 2021. +Yuan Rao and Jiangqun Ni. Self-supervised domain adaptation for forgery localization of JPEG compressed images. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 15034-15043, 2021. +Nikhila Ravi, Valentin Gabeur, Yuan-Ting Hu, Ronghang Hu, Chaitanya Ryali, Tengyu Ma, Haitham Khedr, Roman Radle, Chloe Rolland, Laura Gustafson, et al. Sam 2: Segment anything in images and videos. arXiv preprint arXiv:2408.00714, 2024. +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. 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. +Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115:211-252, 2015. +Ronald Salloum, Yuzhuo Ren, and C-C Jay Kuo. Image splicing localization using a multi-task fully convolutional network (mfcn). Journal of Visual Communication and Image Representation, 51: 201-209, 2018. +Tal Shaharabany, Aviad Dahan, Raja Giryes, and Lior Wolf. Autosam: Adapting sam to medical images by overloading the prompt encoder. arXiv preprint arXiv:2306.06370, 2023. + +Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. Cnn features off-the-shelf: an astounding baseline for recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pp. 806-813, 2014. +Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. +Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171, 2022a. +Zifeng Wang, Zizhao Zhang, Chen-Yu Lee, Han Zhang, Ruoxi Sun, Xiaoqi Ren, Guolong Su, Vincent Perot, Jennifer Dy, and Tomas Pfister. Learning to prompt for continual learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 139-149, 2022b. +Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824-24837, 2022. +Yongxian Wei, Zixuan Hu, Li Shen, Zhenyi Wang, Yu Li, Chun Yuan, and Dacheng Tao. Task groupings regularization: Data-free meta-learning with heterogeneous pre-trained models. arXiv preprint arXiv:2405.16560, 2024a. +Yongxian Wei, Zixuan Hu, Zhenyi Wang, Li Shen, Chun Yuan, and Dacheng Tao. Free: Faster and better data-free meta-learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 23273-23282, 2024b. +Yongxian Wei, Anke Tang, Li Shen, Feng Xiong, Chun Yuan, and Xiaochun Cao. Modeling multi-task model merging as adaptive projective gradient descent. arXiv preprint arXiv:2501.01230, 2025. +Bihan Wen, Ye Zhu, Ramanathan Subramanian, Tian-Tsong Ng, Xuanjing Shen, and Stefan Winkler. Coverage—a novel database for copy-move forgery detection. In 2016 IEEE international conference on image processing (ICIP), pp. 161-165. IEEE, 2016. +Haiwei Wu, Jiantao Zhou, Jinyu Tian, Jun Liu, and Yu Qiao. Robust image forgery detection against transmission over online social networks. IEEE Transactions on Information Forensics and Security, 17:443-456, 2022. +Junde Wu, Wei Ji, Yuanpei Liu, Huazhu Fu, Min Xu, Yanwu Xu, and Yueming Jin. Medical sam adapter: Adapting segment anything model for medical image segmentation. arXiv preprint arXiv:2304.12620, 2023. +Xingjian Wu, Xiangfei Qiu, Zhengyu Li, Yihang Wang, Jilin Hu, Chenjuan Guo, Hui Xiong, and Bin Yang. Catch: Channel-aware multivariate time series anomaly detection via frequency patching. In ICLR, 2025. +Xinle Wu, Xingjian Wu, Bin Yang, Lekui Zhou, Chenjuan Guo, Xiangfei Qiu, Jilin Hu, Zhenli Sheng, and Christian S. Jensen. Autocts++: zero-shot joint neural architecture and hyperparameter search for correlated time series forecasting. VLDB J., 33(5):1743-1770, 2024. +Yue Wu, Wael AbdAlmageed, and Premkumar Natarajan. *Mantra-net: Manipulation tracing network for detection and localization of image forgeries with anomalous features*. In *Proceedings of the IEEE/CVF conference on computer vision and pattern recognition*, pp. 9543–9552, 2019. +Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. Segformer: Simple and efficient design for semantic segmentation with transformers. Advances in neural information processing systems, 34:12077-12090, 2021. +Chao Yang, Huizhou Li, Fangting Lin, Bin Jiang, and Hao Zhao. Constrained r-cnn: A general image manipulation detection model. In 2020 IEEE International conference on multimedia and expo (ICME), pp. 1-6. IEEE, 2020. + +Chao Yang, Zhiyu Wang, Huawei Shen, Huizhou Li, and Bin Jiang. Multi-modality image manipulation detection. In 2021 IEEE International conference on multimedia and expo (ICME), pp. 1-6. IEEE, 2021. +Yuanhao Zhai, Tianyu Luan, David Doermann, and Junsong Yuan. Towards generic image manipulation detection with weakly-supervised self-consistency learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 22390-22400, 2023. +Kaidong Zhang and Dong Liu. Customized segment anything model for medical image segmentation. arXiv preprint arXiv:2304.13785, 2023. +Quan Zhang and Yuxin Qi. Can mllms guide weakly-supervised temporal action localization tasks? arXiv preprint arXiv:2411.08466, 2024. +Quan Zhang, Xiaoyu Liu, Wei Li, Hanting Chen, Junchao Liu, Jie Hu, Zhiwei Xiong, Chun Yuan, and Yunhe Wang. Distilling semantic priors from sam to efficient image restoration models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 25409-25419, 2024. +Quan Zhang, Yuxin Qi, Xi Tang, Jinwei Fang, Xi Lin, Ke Zhang, and Chun Yuan. IMDPrompter: Adapting SAM to image manipulation detection by cross-view automated prompt learning. In The Thirteenth International Conference on Learning Representations, 2025a. URL https://openreview.net/forum?id=v17kf0YHwj. +Quan Zhang, Yuxin Qi, Xi Tang, Rui Yuan, Xi Lin, Ke Zhang, and Chun Yuan. Rethinking pseudolabel guided learning for weakly supervised temporal action localization from the perspective of noise correction. arXiv preprint arXiv:2501.11124, 2025b. +Zhuosheng Zhang, Aston Zhang, Mu Li, and Alex Smola. Automatic chain of thought prompting in large language models. arXiv preprint arXiv:2210.03493, 2022. +Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2881-2890, 2017. +Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6881-6890, 2021. +Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision, 130(9):2337-2348, 2022. +Peng Zhou, B Chen, Xintong Han, Mahyar Najibi, and Larry S Davis. Generate, segment and replace: Towards generic manipulation segmentation. arXiv preprint arXiv:1811.09729, 2018a. +Peng Zhou, Xintong Han, Vlad I Morariu, and Larry S Davis. Learning rich features for image manipulation detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1053-1061, 2018b. +Peng Zhou, Bor-Chun Chen, Xintong Han, Mahyar Najibi, Abhinav Shrivastava, Ser-Nam Lim, and Larry Davis. Generate, segment, and refine: Towards generic manipulation segmentation. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pp. 13058-13065, 2020. +Xueyan Zou, Jianwei Yang, Hao Zhang, Feng Li, Linjie Li, Jianfeng Wang, Lijuan Wang, Jianfeng Gao, and Yong Jae Lee. Segment everything everywhere all at once. Advances in Neural Information Processing Systems, 36, 2024. + +# 7 APPENDIX + +# 7.1 LIMITATIONS AND BROADER IMPACTS + +Limitations. We have some limitations in our method. First, it cannot detect completely generated images. Second, training IMDPrompter requires complete pixel-level supervision. In future research, we plan to explore more efficient label utilization through weakly supervised and semi-supervised learning approaches and extend these methods to newer foundational models such as SEEM Zou et al. (2024) and SAM2 Ravi et al. (2024). + +Broader Impacts. In recent years, with the advancement of deep learning technologies Zhang et al. (2024; 2025b); Qiu et al. (2024; 2025b;a); Wu et al. (2025; 2024); Li et al. (2024); Hu et al. (2024); Wei et al. (2024b;a; 2025); Zhang & Qi (2024); Dong et al. (2023a;c;b), the editing and manipulation of digital media have become increasingly accessible and widespread. Advances in image editing software, along with deep generative models such as Generative Adversarial Networks and diffusion models Gao et al. (2024); Chen et al. (2024), have made image manipulations, often imperceptible to the human eye, much easier. These technologies are even being widely employed by potential malicious users. The ubiquitous use of smartphones and social networks has further accelerated the dissemination of these manipulated media. As a result, when these edited images are employed to support disinformation or to distort news content in order to mislead the public, they can create significant social problems and contribute to a crisis of trust. In this context, IMDPrompter, as an effective image manipulation detection method, can play a crucial role in mitigating the negative consequences of intentional image manipulation. + +# 7.2 DATASET DESCRIPTION + +In order to directly compare with state-of-the-art technologies, we trained on CASIAv2 Dong et al. (2013) and conducted extensive testing on COVER Wen et al. (2016), Columbia Hsu & Chang (2006), NIST16 Hsu & Chang (2006), CASIAv1 Dong et al. (2013), and the recent IMD Novozamsky et al. (2020). + +Table 7: Details of the training set and five test sets used in our experiments. The symbol “-” indicates unavailable information. Copy-move, splicing, and inpainting operations are denoted as cpmv, spli, and inpa, respectively. Our model was trained on the CASIAv2 dataset and evaluated across all test sets. + +
DatasetNegativePositivecpmvspliinpa
Training
CASIAv2 Dong et al. (2013)74915063323518280
Testing
COVER Wen et al. (2016)10010010000
Columbia Hsu & Chang (2006)18318001800
NIST16 Dong et al. (2013)056468288208
CASIAv1+ Dong et al. (2013)8009204594610
IMD Novozamsky et al. (2020)4142010---
+ +# 7.3 BASELINE METHODS + +As shown in Table 8, we have organized the technical routes of the baseline methods. To ensure fair and reproducible comparisons, we selected state-of-the-art models that meet any of the following criteria: 1) pretrained models released by the paper authors, 2) publicly available source code, and 3) adherence to a common evaluation protocol, where CASIAv2 is used for training and other public datasets for testing. Based on these criteria, we compiled a list of nine published baselines, as follows: + +- H-LSTM Bappy et al. (2019): Pretrained on a custom dataset of 65k processed images and fine-tuned on NIST16 and IEEE Forensics Challenge data. + +Table 8: Comparison of Technical Routes of Baseline Methods + +
MethodViewSemantic Segmentation Backbone
RGBNoiseFusion
MFCNSalloum et al. (2018)+--FCN
RGB-NZhou et al. (2018b)+SRMLate Fusion(Bilinear Pooling)Faster R-CNN
H-LSTMBappy et al. (2019)+--Patch-LSTM
ManTra-NetWu et al. (2019)+SRM+BayarEarly Fusion(Feature Concatenation)Wider VGG
HP-FCNLi & Huang (2019)-High-pass filters-FCN
GSR-NetZhou et al. (2018a)+--DeepLabv2
CR-CNNYang et al. (2020)-Bayar-Mask R-CNN
SPANHu et al. (2020)+SRM+BayarEarly Fusion(Feature Concatenation)Wider VGG
MM-NetYang et al. (2021)+BayarMiddle Fusion(Attention Guidance)Mask R-CNN
JPEG-ComNetRao & Ni (2021)+SRMEarly Fusion(Feature Concatenation)Siamese FCN
CAT-NetKwon et al. (2021)+DCTMiddle Fusion(Feature Concatenation)HRNet
MVSS-NetChen et al. (2021)+BayarLate Fusion(Dual Attention)FCN
TruFor Guillaro et al. (2023)+NoiseprintLate Fusion(Feature Concatenation)Segformer
IMDPrompter+SRM+Bayar+NoiseprintLate Fusion(Optimal Prompt Selection +Cross-view Prompt Consistency)FCN+SAM
+ +- ManTra-Net Wu et al. (2019): Trained on millions of processed images in a private collection. +HP-FCN Li & Huang (2019): Trained on a private set of repaired images. +CR-CNN Yang et al. (2020): Trained on CASIAv2. +- SPAN Hu et al. (2020): Trained using the same data as ManTra-Net and fine-tuned on CASIAv2. +- CAT-Net Kwon et al. (2021): Trained on a joint dataset including CASIAv2, IMD, Fantastic Reality Kniaz et al. (2019), and self-spliced COCO. + +For models with publicly available code, we trained them using the code provided by the authors, such as GSR-Net Zhou et al. (2018a). When citing their results, we adopt the original data where appropriate and only use our retrained models when necessary. For models that follow the same evaluation protocol, such as MFCN Salloum et al. (2018) and RGB-N Zhou et al. (2018b), we directly cite results from the same team Yang et al. (2020). For fair comparison, we retrained FCN Long et al. (2015), MVSS-NetDong et al. (2022), and Trufor Guillaro et al. (2023) from scratch on CASIAv2. As previous studies rarely report their image-level performance, these models typically lack an image classification head in their implementations. To obtain a baseline for image-level predictions without modifying their models or code, we adopted the GMP strategy used in MVSS-Net. + +# 7.4 SUPPLEMENTARY EXPERIMENTS + +Experimental Setups. To improve reproducibility, we present the used parameters details in Table 9. + +Overall Performance in Detection and Localization. Table 10 and Figure 6 shows the overall performance of pixel-level and image-level manipulation detection. We use the harmonic mean of image-level detection F1 and pixel-level localization F1, denoted as C-F1, as our overall performance metric. As shown in Table 3, IMDPrompter achieves the best performance in all settings, with a performance improvement of $45.3\%$ over the next best method. Notably, in the experiments on the COVER dataset, we achieved a performance gain of $110.7\%$ . + +Ablation study of the segmenters for the four prompt views: We selected several segmenters, including FCN, PSPNet, SETR, and Segformer, for ablation experiments. As shown in the table below, the lightweight FCN based on MobileNet is sufficient to effectively guide SAM's automated prompt learning. The introduction of more powerful segmenters like PSPNet, SETR, and Segformer did not result in a significant improvement in detection performance but instead introduced greater computational overhead. Therefore, we chose the lightweight FCN as our segmenter. + +Computational Complexity Analysis: As shown in Table 15, I-AUC represents Image-level AUC, I-F1 represents Image-level F1, P-F1 represents Pixel-level F1, and C-F1 represents the harmonic mean of I-F1 and P-F1. It is worth noting that the IMDPromptter mentioned in the main text is based on SAM-H, which has a high computational complexity. Therefore, we implemented a lightweight version, IMDPromptter*, based on Mobile SAM. As can be seen from Table 15, IMDPromptter + +Table 9: Parameter Settings Details + +
ParameterValue
Warm-up Learning Rate Scheduler
TypeLinearLR
Start Factor1.00E-04
By EpochTRUE
Begin0
End1
Convert to Iter BasedTRUE
Main Learning Rate Scheduler
TypeCosineAnnealingLR
T_maxmax_epochs
By EpochTRUE
Begin1
Endmax_epochs
Data Preprocessor
Mean[123.675, 116.28, 103.53]
Standard Deviation[58.395, 57.12, 57.375]
BGR to RGBTRUE
Padding Value0
Segmentation Padding Value255
Size-10,241,024
Trainer
Number of Things Classes2
Train Batch Size per GPU1
Train Number of Workers4
Test Batch Size per GPU1
Test Number of Workers4
Epochs100
+ +Table 10: Overall Detection and Localization Performance (Com-F1 Score). The best results for each test set are highlighted in bold and second-best values are underlined. + +
MethodCASIACOVERColumbiaIMDMEAN
H-LSTM Bappy et al. (2019)0.00.03.80.00.94
ManTra-Net Wu et al. (2019)0.00.00.00.00.00
CR-CNN Yang et al. (2020)30.318.141.323.728.35
GSR-Net Zhou et al. (2018a)0.00.04.20.01.06
SPAN Hu et al. (2020)0.00.00.00.00.00
CAT-Net Kwon et al. (2021)20.019.769.19.529.59
MVSS-Net Chen et al. (2021)56.631.771.130.047.36
FCN Long et al. (2015)53.618.930.523.331.57
IMDPrompter76.866.890.341.368.82
+23.2+47.9+59.8+18.0+37.25
+ +achieved the best performance on almost all metrics, and IMDPrompter* achieved performance second only to IMDPrompter in nearly all metrics. + +Comparison with SAM-based Methods: As shown in Table 15, We supplement the performance of four SAM-based image segmentation methods: MedSAM, MedSAM-Adapter, AutoSAM, and SAMed. As we can see, these four SAM-based methods exhibit limited performance in the i-image manipulation detection task due to their reliance solely on semantically relevant information. In particular, there is a significant performance gap between them and IMDPrompter, especially on the out-of-domain test sets CVOER, Columbia, and IMD. + +![](images/ed3deba2e7f51d9d339c7ced2fdbd29feee9069b0c6cfd521c0ee704196d6fe1.jpg) + +![](images/d392cb30098bd08d52fb013d09d3692160546200e019a5810ebdab98ab0c9bc5.jpg) +— CR-CNN + +(c) C-F1 +![](images/7c8a1a108a4dfd049a951b2738eb0422d424c53fc84988d8e43cee256f776d27.jpg) +MVSS-Net + +![](images/7dedba2f78ce4b119a89c2e5f302d75885f25b576b59e2cc11a66712aebefa36.jpg) +(a) I-F1 +(d) Best threshold P-F1 +Figure 6: Visualization of Metric Data Comparison between IMDPrompter and State-of-the-Art (SOTA) Methods + +(b) I-AUC +(e) Fixed threshold P-F1 +(f) +![](images/1862a1af1802997466e6873af7ec4b65e979df07156905becbd1be205b1208e8.jpg) +CAT-Net +FCN +IMDPrompter + +Table 11: Impact of JPEG Compression and Gaussian Blur on Pixel-level F1 + +
MethodJPEG CompressionGaussian Blurs
10090807060500511172329
H-LSTM Bappy et al. (2019)15.415.014.814.714.013.915.413.412.110.810.610.3
ManTra-Net Wu et al. (2019)15.511.98.28.08.78.615.512.011.312.011.611.2
CR-CNN Yang et al. (2020)40.433.622.417.111.79.240.423.322.121.120.719.9
GSR-Net Zhou et al. (2018a)37.435.932.532.430.827.037.430.526.523.520.819.0
SPAN Hu et al. (2020)18.217.117.116.615.714.918.210.710.610.09.69.6
CAT-Net Kwon et al. (2021)13.52.22.01.30.90.913.59.49.36.96.16.0
MVSS-Net Chen et al. (2021)45.143.242.541.240.239.545.137.436.033.021.117.3
IMDPrompter76.373.672.071.670.770.576.371.871.168.856.651.6
+ +![](images/f309aec9b096f322013d5b41067ed1f1011c9f51a23696e50f411baf2c9504c8.jpg) + +![](images/2ddb73717a40c885171af52d81ca529ec1faadddfa7eed57fe7a4fb94786f074.jpg) +Figure 7: Hyperparametric analysis of $\lambda_{1}$ , $\lambda_{2}$ , and $\lambda_{3}$ + +![](images/e3c6d6075587d3991a56339de92d75ea844a0c91faa117100022619b25e039ba.jpg) + +Proportion of Four Views Selected as Optimal Prompts. As shown in Table 17, we summarize the proportion of each prompt view being selected as the optimal prompt during training. We observe that the RGB view is selected as the optimal prompt in only $13.9\%$ of cases, indicating that semantically relevant features alone are insufficient to guide SAM's prompt learning. On the other hand, the Noiseprint view is chosen as the optimal prompt in $46.3\%$ of cases, demonstrating that the semantically irrelevant information provided by Noiseprint is the most crucial. + +Table 12: Impact of JPEG Compression and Gaussian Blur on Image-level F1 + +
MethodJPEG CompressionGaussian Blur
10090807060500511172329
H-LSTM Bappy et al. (2019)0.00.00.00.00.00.00.00.00.00.00.00.0
ManTra-Net Wu et al. (2019)0.00.00.00.00.00.00.00.00.00.00.00.0
CR-CNN Yang et al. (2020)24.325.824.022.420.018.424.314.313.913.712.411.4
GSR-Net Zhou et al. (2018a)0.00.00.00.00.00.00.00.00.00.00.00.0
SPAN Hu et al. (2020)0.00.00.00.00.00.00.00.00.00.00.00.0
CAT-Net Kwon et al. (2021)38.017.917.215.012.411.038.011.911.010.510.310.7
MVSS-Net Chen et al. (2021)75.976.275.775.374.873.075.973.872.870.765.863.4
IMDPrompter77.377.877.276.876.174.677.375.974.673.169.366.6
+ +Table 13: Impact of JPEG Compression and Gaussian Blur on Com-F1 + +
MethodJPEG CompressionGaussian Blur
10090807060500511172329
H-LSTM Bappy et al. (2019)0.00.00.00.00.00.00.00.00.00.00.00.0
ManTra-Net Wu et al. (2019)0.00.00.00.00.00.00.00.00.00.00.00.0
CR-CNN Yang et al. (2020)30.329.223.219.414.812.330.317.717.016.615.514.5
GSR-Net Zhou et al. (2018a)0.00.00.00.00.00.00.00.00.00.00.00.0
SPAN Hu et al. (2020)0.00.00.00.00.00.00.00.00.00.00.00.0
CAT-Net Kwon et al. (2021)19.93.93.62.31.71.719.910.510.18.37.77.7
MVSS-Net Chen et al. (2021)56.655.154.453.252.351.256.649.748.245.032.027.2
IMDPrompter76.875.674.574.173.372.576.873.872.870.962.358.1
+ +Table 14: Ablation Study of the Segmenter + +
Params/MGFLOPsCASIACOVERColumbiaIMD
I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1
PSPNetZhao et al. (2017)365.31610.30.97977.476.576.90.79470.363.766.80.98493.787.890.70.67364.130.641.4
SETRZheng et al. (2021)1591.62131.60.98578.177.177.60.80170.964.367.40.98894.188.291.10.67964.531.142.0
SegformerXie et al. (2021)536.31769.30.98878.977.878.30.81171.265.168.00.99194.988.791.70.68465.132.143.0
FCNLong et al. (2015)347.61533.20.97877.476.476.90.79570.263.766.80.98493.687.690.50.67063.830.641.4
+ +Table 15: Computational Complexity Overhead + +
Params/MGFLOPsCASIACOVERColumbiaIMD
I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1
ManTra-NetWu et al. (2019)4.01009.70.5000.015.50.00.5000.028.60.00.7010.036.40.00.5000.018.70.0
SPANHu et al. (2020)15.430.90.5000.018.40.00.5000.017.20.00.5000.048.70.00.5000.017.00.0
MVSS-NetChen et al. (2021)146.9160.00.93775.845.256.60.73124.445.331.70.98080.263.871.10.65635.526.030.0
TruforGuillaro et al. (2023)67.890.10.916-44.1-0.770-19.9-0.996-22.3--21.0-
IMDPrompter347.61533.20.97877.376.376.80.79670.363.666.80.98393.687.390.30.67163.730.641.3
IMDPrompter*85.8151.30.95176.170.373.10.77964.557.760.90.98088.381.684.80.66756.926.936.5
+ +Table 16: Comparison with SAM-based methods. + +
CASIACOVERColumbiaIMD
I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1I-AUCI-F1P-F1C-F1
MedSAMMa et al. (2024)0.86170.356.462.60.56326.322.124.00.79150.124.633.00.51326.122.424.1
MedSAM-AdapterWu et al. (2023)0.87771.057.363.40.54321.620.320.90.74246.622.130.00.49425.121.623.2
AutoSAMShaharabany et al. (2023)0.84369.155.161.30.51318.918.618.70.77249.128.436.00.52327.922.925.2
SAMedZhang & Liu (2023)0.84369.952.359.80.57127.624.626.00.80153.131.739.70.50227.623.125.2
IMDPrompter0.97877.376.376.80.79670.363.666.80.98393.687.390.30.67163.730.641.3
IMDPrompter*0.95176.170.373.10.77964.557.760.90.98088.381.684.80.66756.926.936.5
+ +Table 17: The proportion of each view selected as the optimal view + +
Prompt ViewRGBSRMBayerNoiseprint
Percent13.9%18.4%21.4%46.3%
+ +Hyperparametric Analysis As shown in Figure 7, we conducted hyperparameter analysis on $\lambda_1, \lambda_2$ , and $\lambda_3$ , ultimately selecting the optimal parameter configuration: $\lambda_1 = 1.0, \lambda_2 = 0.1, \lambda_3 = 1.0$ . + +Table 18: Performance of Generative Image Manipulation Detection + +
MethodCocoGlide
P-F1(best)P-F1(fixed)I-AUCI-Acc
ManTraNetWu et al. (2019)0.6730.5160.7780.500
SPANHu et al. (2020)0.350.2980.4750.491
MVSS-NetChen et al. (2021)0.6420.4860.6540.536
TruforGuillaro et al. (2023)0.720.5230.7520.639
IMDPrompter0.7460.5390.7810.652
+ +Performance of Generative Image Manipulation Detection: Following the work of Trufor, we supplement the performance of IMDPrompter on CocoGlide (image tampering based on diffusion models). As shown in the table below, our IMDPrompter also achieves objective results for AIGC-edited images. + +Impact of Quality Degradation. As shown in Table 11,12,13, following Dong et al. (2022), we evaluated the robustness of the models under two common image processing operations encountered during the dissemination of images on the internet, namely JPEG compression and Gaussian blur. Comparing these two operations, Gaussian blur has a more significant impact on detection performance, especially when using larger 17x17 scale convolution kernels. Compared to previous methods, our IMDPrompter exhibits better robustness. + +More Visualization. As shown in Figure 10, we have included additional visualizations. + +![](images/776502e61b1dee95b48164ed508989c3a0844d136781687cb2588f1191f04a91.jpg) +Figure 8: Some qualitative results, compared with the state-of-the-art + +![](images/b36824227962c30c71dad7742823dafe58bb49a031d57ea80c3cedad0de74c7a.jpg) +Figure 9: Some qualitative results, compared with the state-of-the-art + +![](images/c4b26db2da50725eb76b6092087ced63b88f3dc43b256c35826b080f10a64f17.jpg) +Figure 10: Some qualitative results, compared with the state-of-the-art \ No newline at end of file diff --git a/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/images.zip b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..072f026ac3de509181dea91ad07b57f307903ef1 --- /dev/null +++ b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7eafdaa5b5a56b2115df7daed4d48b15ad294f2184ca53877a3b3a338a324c0 +size 1899745 diff --git a/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/layout.json b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ee60c3d1108a9bfc59da67a628fb4908f8c68cd4 --- /dev/null +++ b/ICLR/2025/IMDPrompter_ Adapting SAM to Image Manipulation Detection by Cross-View Automated Prompt Learning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4c3ec3dfc52d77fe6a290e609744dafa413d6530ae98aab6a0cd4630a136eb2 +size 747664 diff --git a/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_content_list.json b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ad38de5b48baac6d210fdd7749a393370b840e55 --- /dev/null +++ b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5f2ed0668233c245268eefc57f2ab56a0b2fd53ee7f6fc10953eb5c87002746 +size 96460 diff --git a/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_model.json b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d4753e1187671314647f3e5030dd70c9521cc0a4 --- /dev/null +++ b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e2cfebc63fb6330c7df631bed43faa5917da0059f1e4d3f1aa6705a5675d877 +size 111865 diff --git a/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_origin.pdf b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..103113f3f2523edea5313ea3d533f8d893120be0 --- /dev/null +++ b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/edd1b6f5-9438-4ae9-817e-f6f5b8b06d7c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:054ec6852f0c74e31d468fde85b10b6074dcb97dda522be92e1288c60126eb66 +size 3035145 diff --git a/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/full.md b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bbde8e8a98c5f1f15f5260295e0fdf03118ce0cd --- /dev/null +++ b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/full.md @@ -0,0 +1,367 @@ +# INFER: A NEURAL-SYMBOLIC MODEL FOR EXTRAPOLATION REASONING ON TEMPORAL KNOWLEDGE GRAPH + +Ningyuan Li $^{1}$ , Haihong E $^{1*}$ , Tianyu Yao $^{1}$ , Tianyi Hu $^{1}$ , Yuhan Li $^{1}$ , Haoran Luo $^{1}$ , Meina Song $^{1}$ , Yifan Zhu $^{1}$ + +1Beijing University of Posts and Telecommunications + +# ABSTRACT + +Temporal Knowledge Graph(TKG) serves as an efficacious way to store dynamic facts in real-world. Extrapolation reasoning on TKGs, which aims at predicting possible future events, has attracted consistent research interest. Recently, some rule-based methods have been proposed, which are considered more interpretable compared with embedding-based methods. Existing rule-based methods apply rules through path matching or subgraph extraction, which falls short in inference ability and suffers from missing facts in TKGs. Besides, during rule application period, these methods consider the standing of facts as a binary 0 or 1 problem and ignores the validity as well as frequency of historical facts under temporal settings. In this paper, by designing a novel paradigm for rule application, we propose INFER, a neural-symbolic model for TKG extrapolation. With the introduction of Temporal Validity Function, INFER firstly considers the frequency and validity of historical facts and extends the truth value of facts into continuous real number to better adapt for temporal settings. INFER builds Temporal Weight Matrices with a pre-trained static KG embedding model to enhance its inference ability. Moreover, to facilitates potential integration with existing embedding-based methods, INFER adopts a rule projection module which enables it apply rules through conducting matrices operation on GPU. This feature also improves the efficiency of rule application. Experimental results show that INFER achieves state-of-the-art performance on various TKG datasets and significantly outperforms existing rule-based models on our modified, more sparse TKG datasets, which demonstrates the superiority of our model in inference ability. + +# 1 INTRODUCTION + +Knowledge Graphs(KGs) play key roles in multiple downstream applications (Hildebrandt et al., 2019; Lan & Jiang, 2020), which store knowledge in the form of triples $(s, r, o)$ representing subject entity $s$ and object entity $o$ are linked by the relation $r$ . Traditional KGs appear to be static snapshots of real-world facts. However, in practice, facts evolve over time and may not be true in a perpetual way. Thus, TKGs are proposed to model the dynamic properties of facts in which each fact is represented as a quadruple $(s, r, o, t)$ where $t$ denotes the timestamp of the fact. + +Extrapolation reasoning on TKGs focuses on predicting potential facts at future timestamps based on the observed historical facts. Some effective embedding-based models including RE-Net (Jin et al., 2019), CyGNet (Zhu et al., 2021a), RE-GCN (Li et al., 2021), CENET (Xu et al., 2022) etc. have been proposed for TKG extrapolation, which embed entities and relations into vectors and utilize neural networks to capture structural information, temporal dependency and historical information. Embedding-based models exhibit strong learning and reasoning abilities and yield substantial performance. However, due to the "black box problem" of neural networks, embedding-based methods are deemed to be lacking interpretability and reliability. Recently, several rule-based methods like TLogic (Liu et al., 2022) and TR-Rules (Li et al., 2023) have been proposed for better + +Rule: $(X, \text{Unsatisfied\_With}, Y, T_1) \wedge (Y, \text{Trade\_With}, Z, T_2) \to (X, \text{Plays\_For}, Z, T)$ + +![](images/0f88f15effa9dead84b38ad5148b471b16edb2b276af05d34faad96d8646bd32.jpg) +T1 + +![](images/3843f94f6b904ceb49ff0bd644cd31166b177e7736e3a0f2e811df06f25b9634.jpg) +T2 + +![](images/3e9091fe8dda53aa1b5821076c11e708fb9196b71c33fabc2e874816fbabd6fe.jpg) +Plays For ? +T3 + +![](images/dd330ac75738d5e77dd7553ad0846da9538e54bc6e83a898bc84a1baf1c3b840.jpg) +Figure 1: Illustration of how missing facts in TKGs affect the rule application procedure. +(a) + +![](images/b1137ab53e248325704dbadc441887c16baf9f04fed2ed60e7e546684a0d2b9a.jpg) +(b) +Figure 2: (a) Illustration of TKGs and previous rule-based inference. (b) Our transformed weighted graphs and the performed temporal validity aware inference. + +interpretability. These models can generate human-readable rules and provide visible reasoning chains, which also achieve competitive performance. + +Nevertheless, when applying rules, previous rule-based methods consider the standing of facts as a binary 0 or 1 problem (have been true or not) for path matching, which ignores the validity as well as frequency of historical facts under temporal settings. Although previous models try to add bias in the score function to increase the score of candidates derived by recent edges or paths, it does not completely solve this issue especially when rule length is greater than one. + +In Figure 2 (a), we can see a typical TKG and the process of rule application of previous work. The red edges denote matched rule body instances. As we can see, Germany consulted the U.S. at $T_{0}$ and the U.S. praised Japan and Korea at $T_{1}$ and $T_{n-1}$ respectively. Given the query and the rule, previous models will consider both entities correct and give them the same score. However, intuitively, these two "Praise" edges should not be treated equally because of the time difference and in fact, the U.S. even criticized Japan at $T_{n-1}$ . + +Additionally, existing rule-based models apply rules through purely symbolic ways such as: path matching or subgraph extractions which do not have the ability to infer missing facts in TKGs and make the application of rules conditioned on the quality of datasets. Because of the incompleteness of TKGs, we believe this drawback brings a bottleneck to previous rule-based methods. In Figure 1, we can see that although the model mines a plausible rule and it could have derived the correct answer, the missing facts at T2 makes the reasoning failed. However, existing rule-based methods need to traverse and match rule body instances in TKGs on CPUs, which brings efficiency bottlenecks and hinders integration with embedding-based neural methods. + +To address these issues, we propose INFER, a neural-symbolic model for TKG extrapolation, which introduces a novel rule application paradigm. INFER first learns rules in TKGs with an existing random walk based algorithm. Then, in our paradigm, INFER builds Temporal Weight Matrices with the help of static KG embedding models, which store the probability of each possible fact. Notably, this procedure enables the assignment of initial approximate probabilities to even missing facts, thereby enhancing the inference capabilities of our model. + +We argue that the binary truth value utilized by previous works for modeling the standing of facts is not suitable enough for temporal settings. To capture the effects of the frequency and validity of historical facts, we design a Temporal Validity Function that maps the frequency and the time span since the last appearance of a fact into a continuous real number. When it comes to a new timestamp, the temporal validity function is used to update the temporal weight matrices which store the temporal validity of each historical fact and probability of potential unseen facts. If we consider the temporal weight matrices as adjacent matrices, this process continuously transforms the graphs of historical facts into a weighted graph. Figure 2 (b) shows an example of the weighted graph computed by INFER. + +As for rule application, INFER introduces a rule projection module. The rule projection module computes scores of all candidates through conducting efficient matrices calculation on GPU according to the mined rules rather than costly path matching on graph. Hence, INFER is able to apply rules more efficiently than previous models can and makes the application of longer rules affordable. This design facilitates potential integration with existing embedding-based reasoning methods. Moreover, INFER is able to display the scores of all entities at each intermediate step of rule application, which maintains the interpretability of rule-based methods. Code is available at https://github.com/JasonLee-22/INFER. + +Our contributions can be summarized as follows: + +- We argue that continuous value rather than binary value reflects the truth value of historical facts more precisely under temporal settings. We introduce a Temporal Validity Function which considers the time span and frequency of facts together to calculate continuous truth values of temporal facts. +- We propose INFER, a neural-symbolic model for TKG extrapolation, which adopts a novel paradigm for rule application. INFER constructs and dynamically updates temporal weight matrices to augment the ability to infer missing facts and capture historical clues. By performing calculations on these matrices on GPU, INFER enables more efficient rule application, making it possible to combine with embedding-based methods and maintain the interpretability meanwhile. +- Experimental results on multiple datasets show that INFER achieves state-of-the-art performance. And INFER also gives more robust performance compared with existing rule-based models on our modified datasets where a certain proportion of facts at each timestamp are removed. + +# 2 RELATED WORK + +Embedding-based reasoning is a mainstream methodology for TKG extrapolation, which embeds entities, relations and timestamps into low-dimensional vector space and then utilizes neural networks to learn the structural information, temporal dependency and historical patterns in TKGs. RE-NET (Jin et al., 2019) uses RNN and RGCN to learn representations of subgraphs which encode structural and sequential information. CyGNet (Zhu et al., 2021a) introduces copy-generation mechanism to make the model focus more on the repetitive historical facts. TITer (Sun et al., 2021) uses reinforcement learning to search candidates in historical TKGs, which is guided by a reward based on Dirichlet distribution. CENET (Xu et al., 2022) argues that unseen facts are also critical in prediction and introduces contrastive learning to identify whether the current timestamp relies more on historical facts or non-historical facts. DaeMon (Dong et al., 2023) models the temporal path information between a pair of nodes based on the NBFNet (Zhu et al., 2021b) graph neural network and introduces a memory passing strategy to update the path information. + +For better interpretability, xERTE (Han et al., 2021) performs reasoning on query-based subgraphs and captures structural as well as temporal information. TLogic (Liu et al., 2022) is the first rule-based TKG extrapolation model which mines rules in TKGs through temporal random walk and applies rules to predict future events via matching rule body instances. TR-Rules (Li et al., 2023) proposes a new and appropriate algorithm to calculate the confidence of rules under temporal settings. It also manages to mine and apply acyclic rules in TKGs which are proven to be effective. ALRE-IR (Mei et al., 2022) combines embeddings with rules by learning rule representations, which is further utilized for confidence assessment. Although embeddings are introduced, it is just used for estimating confidence of rules and ALRE-IR still can not model the frequency and time validity of historical facts. + +# 3 PRELIMINARIES + +# 3.1 TKG EXTRAPOLATION + +In this paper, $\mathcal{E}$ , $\mathcal{R}$ and $\mathcal{T}$ denote the set of all the entities, relations and timestamps respectively. We use $|\mathcal{E}|$ and $|\mathcal{R}|$ to represent the number of entities and relations. TKG can be viewed as a sequence of graphs i.e. $\mathcal{G} = \{G_1\dots G_n\}$ . Each graph $G_{i}$ consists of all the facts that occur at timestamp $t_i$ , i.e. $G_{i} = \{(s,r,o,t)|t = t_{i}\}$ where $s,o\in \mathcal{E}$ , $r\in \mathcal{R}$ and $t_0\leq t_i\leq t_n$ . Interpolation Reasoning on TKGs attempts to answer queries whose timestamps range from $t_0$ to $t_n$ . However, TKG extrapolation aims at predicting the answer for a future query $(s,r,\ref{eq:t})$ or $(?r,o,t^{\prime})$ where $t_n < t'$ , based on the historical facts $\{G_1\dots G_n\}$ . + +# 3.2 TEMPORAL RULES + +Cyclic rules under temporal settings can be defined as: + +$$ +\left(E _ {1}, r _ {h}, E _ {n + 1}, T _ {n + 1}\right) \leftarrow \bigwedge_ {i} ^ {n} \left(E _ {i}, r _ {b i}, E _ {i + 1}, T _ {i}\right) +$$ + +where $E_{i}$ and $T_{i}$ denote variables of entity and timestamps and $r_{i} \in \mathcal{R}$ represents a specific relation. The left part of the rule is called the rule head, while the right part is called the rule body. In some cases, it is restricted that the same entity need to appear repetitively so that the rule body is satisfied. We call this phenomenon variable constraint. Corresponding examples and illustration can be found in Appendix A. During the symbolic rule learning procedure, each rule will be associated with corresponding confidence which is calculated by sampling on the graphs. Normally, rules do not always hold and sometimes are violated, thus the confidence of a rule represents the probability of this rule being correct. + +# 4 METHOD + +![](images/a2a35f09ba3434261680d4939874fbb95a9f5dfbacd1cc57732016c197744225.jpg) +Figure 3: Overview of INFER. INFER first mines rules in TKGs with existing rule learning algorithm and builds temporal weight matrices with a pre-trained static KG embedding model. When it comes a new timestamp, INFER update the temporal weight matrices according to the historical facts. Then the rule projection module selects corresponding rules and applies rules by performing matrices operation for rule projection. + +# 4.1 OVERVIEW + +Figure 3 illustrates the overall framework of INFER. Inspired by QTO (Bai et al., 2023), INFER builds temporal weight matrices with a static KG embedding model which assigns probabilities to all possible facts to enable the model to infer missing facts during rule application. INFER first uses the rule learning algorithm of previous symbolic methods to build a rule library. Then INFER introduces a Temporal Validity Function which maps the frequency and time span of a historical fact into a continuous value between 0 and 1. The Temporal Validity Function is used to update the temporal weight matrices at each new timestamp. Given a query, the rule projection module selects corresponding matrices or vectors for projection according to the relevant rules stored in rule library and finally gives the scores of all candidates. In most cases, more than one rule can be applied for a query, INFER leverages Noisy-OR to aggregate scores given by multiple rules for final prediction. + +# 4.2 RULE LEARNING + +We first mine temporal rules in TKGs and calculates their confidence to build a rule library for rule application afterwards. We do not extensively search for the optimal rule learning algorithm (including rule confidence calculation) for INFER but adopt the rule learning algorithm from TR-Rules (Li et al., 2023) across all experiments. We believe better rule learning algorithm with high-quality rules and more accurate confidence will further improve the performance of INFER. We leave the exploration of other rule learning methods such as the newly released (Huang et al., 2024) for future work. We only utilize cyclic rules for extrapolation reasoning and filter out those acyclic rules and store all the mined cyclic rules with their corresponding confidence. + +# 4.3 RULE PROJECTION MODULE + +# 4.3.1 TEMPORAL WEIGHT MATRICES + +We pre-train a static KG embedding model by ignoring the timestamp in each quadruple. In INFER, we select ComplEx (Trouillon et al., 2016) as the static KG embedding model. While other KG embedding models can be used as alternatives, we believe that a suitable KG embedding model can improve the overall performance of INFER, although it is not a definitive factor. + +Then, for each relation $r \in \mathcal{R}$ , we define a temporal weight matrix $M_r \in \mathbf{R}^{|\mathcal{E}|*|\mathcal{E}|}$ . The i-th row in $M_r$ records the weights of the edges of type $r$ that link entity $e_i$ to all other entities, while the j-th column denotes the weights of edges linking each entity to entity $e_j$ with $r$ . This intuition guides the rule projection in the following section. The pre-trained KG embedding model can score each possible non-temporal facts. However, the scores are real numbers, we need to re-scale the scores to [0,1] resulting in a valid probability. Given head entity $e_i \in \mathcal{E}$ and relation $r$ , we apply the softmax function to the scores of all possible candidates and the corresponding values are stored in the temporal weight matrix of relation $r$ : + +$$ +M _ {r} (i, j) = \frac {\exp \left(f \left(e _ {i} , r , e _ {j}\right)\right)}{\sum_ {1 \leq k \leq | \mathcal {E} |} \exp \left(f \left(e _ {i} , r , e _ {k}\right)\right)} \tag {1} +$$ + +where $f$ is the score function of the KG embedding model, $i$ and $j$ are the indices of entities. + +There are two reasons why we utilize static embedding models instead of temporal models. The first one is that if we use temporal embedding models then the size of the matrix for relation $r$ is $M_r \in \mathbf{R}^{|\mathcal{E}|*|\mathcal{E}|*|\mathcal{T}|}$ which costs too much space. The other reason is that since temporal models score the same fact at various timestamps differently and we do not consider specific timestamps during application, static embedding models which capture the overall structural information is enough for INFER. For resource savings, following QTO (Bai et al., 2023), we set a threshold value to filter out those values smaller than the threshold. + +# 4.3.2 TEMPORAL VALIDITY FUNCTION + +The rule application algorithm of previous symbolic methods is to match instanced rule bodies in observed graphs. This process can be viewed as first assigning binary truth values to historical facts or assigning binary weights to edges in graphs: 1 for facts have appeared, 0 for unseen facts, i.e. no + +edges. Then the model traverses the graph to search whether there are instanced paths matching the rule body and finally gives binary results of whether the instanced rule heads hold true. However, the temporal validity and frequency of facts cannot be modeled in this way. To be specific, the facts that occurred recently should not be treated as equally as the facts that held true long ago (Liu et al., 2022). And facts that frequently appeared should be more significant and trustworthy. + +Hence, we attempt to extend the truth value to continuous real number via considering time validity and frequency of historical facts and propose the following Temporal Validity Function: + +$$ +V (s, r, o, t _ {c}) = \frac {1}{\sqrt {t _ {c} - t _ {\text {l a s t}}}} + \lambda \cdot \sqrt {\mathcal {F}} \cdot M _ {r} (s, o) \tag {2} +$$ + +$$ +\lambda = \sigma \left(\frac {\sqrt {\mathcal {F}}}{\tau}\right) - \frac {1}{2} \tag {3} +$$ + +where $t_c$ denotes the current timestamp, $t_{last}$ represents the latest timestamp when fact $(s,r,o)$ stands, $\mathcal{F}$ is the frequency of $(s,r,o)$ counted from 0 to $t_{c-1}$ , $\sigma(\cdot)$ is the sigmoid function, $\tau$ is a hyper-parameter for smoothing and $M_r$ is the temporal weight matrix introduced above. It should be noticed that $t_{last}$ should satisfy $t_{last} \leq t_{c-1}$ , since we can not observe facts concurring with the query. + +As we can see that the Temporal Validity Function consists of two parts: the time span and the frequency. The time span part which is the first item in the formula means that the credibility of a fact weakens as time goes on as long as it does not recur. The square root ensures the attenuation is neither too fast nor insensitive for measuring the validity. The motivation of designing the second item which is the frequency part is that for those frequently appearing facts, we believe they are more consistent and robust. The frequency serves to amplify the temporal weight of a fact when it is recurrent. While $\lambda$ is the weight of the frequency part ranging from 0 to 0.5. It gets bigger as the fact repeats more times in history, which helps to alleviate the attenuation of time span part when a frequent fact does not occur temporarily. + +When it comes to a new timestamp $t \in \mathcal{T}$ , given $(s, r, o) \in H_t$ which is a historical fact, we use the above function to update the temporal weight matrices: + +$$ +M _ {r} (s, o) = \min \{V (s, r, o, t), 1 \} \tag {4} +$$ + +To a certain extent, this design of Temporal Validity Function is an empirical result. We provide more details and analysis about this part in Appendix D. + +# 4.3.3 RULE PROJECTION + +When answering a query $(s, r_q,?, t')$ , INFER finds relevant rules $S_{r_q}$ with respect to $r_q$ from the rule library. For each rule in $S_{r_q}$ , we traverse its rule body $\bigwedge_i^n (E_i, R_i, E_{i+1}, T_i)$ to get all the relations in order so that the temporal causality is maintained $\{R_1 \otimes R_2 \dots \otimes R_n\}$ . Then, inspired by the multi-hop reasoning operation proposed in QTO (Bai et al., 2023), the rule is projected iteratively: + +$$ +\mathbf {A n s} _ {\mathbf {i}} = \left\{ \begin{array}{l l} M _ {R _ {i}} [ s,: ] & i = 1 \\ \max _ {c o l} \left(\mathbf {A n s} _ {\mathbf {i} - \mathbf {1} \dots \times | \mathcal {E} |} ^ {\mathbf {T}} \odot M _ {R _ {i}}\right) 2 \leq i \leq n \end{array} \right. \tag {5} +$$ + +Firstly, we select the s-th row of $M_{R_1}$ which denotes the scores of each entity serving as object entity in facts with subject entity $s$ and relation $r l_1$ . If the rule length is more than 1, we transpose the row vector and repeat it along the row direction for $|\mathcal{E}|$ times which results in a matrix of $|\mathcal{E}| \times |\mathcal{E}|$ . Then we calculate the Hadamard product of the obtained matrix and the corresponding temporal weight matrix. Finally, we take the maximal value of each column to obtain a new row vector. + +This procedure will be repeated $n - 1$ times and the final row vector is the scores of all candidates given by the rule. The row vector can be viewed as a fuzzy set representing the scores of all entities at the intermediate step of reasoning. Then, the Hadamard product computes the scores of all entities with a fuzzy set rather than a specific entity, thus giving a matrix. The column-wise max operator selects the highest value among all possible paths for each candidate. This process can be considered as another way to traverse and search in graphs which is based on operating on the generalized adjacent matrices of weighted graphs. + +Algorithm 1 Pseudocode of Rule Projection Without Variable Constraints +Require: $(s,r_q,?,T_q)$ : Query; $\{R_1,R_2\dots R_n\}$ : Corresponding rule bodies; $M_{\mathcal{R}}$ : Temporal Weight Matrices; +1: set $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{M}_{\mathbf{R}_1}[s,:]$ # Select the s-th row of $\mathbf{M}_{\mathbf{R}_1}$ +2: for i in $(2,n + 1)$ do +3: $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{A}\mathbf{n}\mathbf{s}^{\mathrm{T}}.\mathbf{r}\mathbf{e}\mathbf{a}\mathbf{t}(1,|\mathcal{E}|)$ #Repeat the transposed vector along row direction +4: $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{A}\mathbf{n}\mathbf{s} \odot \mathbf{M}_{\mathbf{R}_i}$ #Hadamard Product +5: $\mathbf{A}\mathbf{n}\mathbf{s} = \max (\mathbf{A}\mathbf{n}\mathbf{s},dim = -1)$ #Column-wise max operation giving a row vector return Ans + +However, in some cases, there are variable constraints in rules longer than 1. As we can see in (6), the instantiated rule bodies must comply with the constraint that the entity serving as $E_{2}$ must be the same. + +$$ +\begin{array}{r l} & \left(E _ {1}, \text {d e m a n d s - f o r - c h a n g e}, E _ {2}, T _ {4}\right) \leftarrow \left(E _ {1}, \text {i n t e n t - t o - c h a n g e}, E _ {2}, T _ {1}\right) \\ & \quad \wedge \left(E _ {2}, \text {H o s t - a - v i s i t}, E _ {3}, T _ {2}\right) \wedge \left(E _ {3}, \text {M a k e - a - V i s i t}, E _ {2}, T _ {3}\right) \end{array} \tag {6} +$$ + +In INFER, we also design the projection algorithms for these rules. The detailed pseudocode and illustration are provided in Appendix A. Notably, when processing rules with variable constraints, additional indexing operations and calculations are required, leading to a delay in inference speed. + +# 4.4 INFERENCE + +Normally, more than one rule can be used to answer a query. In INFER, we aggregate the scores of multiple rules with the Noisy-OR function (Meilicke et al., 2019a): + +$$ +\operatorname {s c o r e} (q) = 1 - \prod_ {\mathbf {A n s} _ {\mathbf {r}} \in R _ {q}} \left(\mathbf {1} - c _ {r} \cdot \mathbf {A n s} _ {\mathbf {r}}\right) \tag {7} +$$ + +where $q$ denotes the query, $R_{q}$ represents the set of all scores given by rules, $c_{r}$ is the confidence of the rule and 1 is an all-one vector. Apart from the rule confidence, the Noisy-OR aggregation is equivalent to the union of the fuzzy sets generated by the rules. + +In some cases, there might be no proper rules for answering the query $q$ . In INFER, for a query $(s_n, r_n, ?, t_n)$ which does not have corresponding rules, we directly predict it based on the temporal weight matrix by considering the query itself as a rule of length 1. For those queries that have corresponding rules, we also make each of the queries itself as a rule of length 1 and use it for prediction. Because we consider the prediction based on this "generated rule" represents the distribution implied by pure temporal information and frequent interactions in historical facts. We assign the average confidence of all rules to this "generated rule". + +# 5 EXPERIMENTS + +# 5.1 EXPERIMENTAL SETUP + +Datasets We evaluate INFER on five TKG datasets: ICEWS14, ICEWS18, ICEWS0515, YAGO and WIKI. The first three datasets are subsets of Integrated Crisis Early Warning System (Boschee et al., 2015). These datasets record international facts that occurred in 2014, 2018 and from 2005 to 2015 respectively. Table 3 in Appendix B shows the statistics of these five datasets. To satisfy the extrapolation reasoning settings, facts are sorted in ascending order based on timestamps and then split into train, valid and test. + +Metrics and Implementation Details We utilize mean reciprocal rank (MRR) and Hits@k as metrics to evaluate INFER. $MRR = avg\left(\frac{1}{rank_i}\right)$ and $Hits@k = \frac{1}{N} \sum_{i} \mathbf{I}(rank_i < k)$ , where $\mathbf{I}$ is the indicator function. Higher values of both metrics indicate better performance of models. We adopt the time-aware filtering protocol proposed in xERTE (Han et al., 2021), which turns out to be more reasonable in temporal settings. We implement INFER with PyTorch and all experiments are conducted on a single 48GB NVIDIA A40 GPU. More details about implementation are reported in Appendix E. + +
ModelICEWS14ICEWS05-15ICEWS18
MRRHits@1Hits@3Hits@10MRRHits@1Hits@3Hits@10MRRHits@1Hits@3Hits@10
Dismult27.6718.1631.1546.9628.7319.3332.1947.5410.174.5210.3321.25
ComplEx30.8421.5134.4849.5831.6921.4435.7452.0421.0111.8723.4739.87
TTransE13.433.1117.3234.5515.715.0019.7238.028.311.928.5621.89
TA-Dismult26.4717.0930.2245.4124.3114.5827.9244.2116.758.6118.4133.59
DE-SimpleE32.6724.4335.6949.1135.0225.9138.9952.7519.3011.5321.8634.80
TNTComplEx32.1223.3536.0349.1327.5419.5230.8042.8621.2313.2824.0236.91
RE-Net38.2828.6841.3454.5242.9731.2646.8563.4728.8119.0532.4447.51
CyGNet32.7323.6936.3150.6734.9725.6739.0952.9424.9315.9028.2842.61
xERTE40.7932.7045.6757.3046.6237.8452.3163.9229.3121.0333.5146.48
CENET----37.1627.7841.1655.4927.1418.5829.9944.15
TITer41.7332.7446.4658.44----29.9822.0533.4644.83
RE-GCN40.3630.7344.9858.8146.9136.3352.6567.2430.8221.1134.7149.83
DaeMon--------31.8522.6735.9249.80
TECHS43.8834.5949.3661.9548.3838.3454.6968.9230.8521.8135.3949.82
AnyBURL29.6721.2633.3346.7332.0523.7235.4550.4622.7715.1025.4438.91
TLogic43.0433.5648.2761.2346.9736.2153.1367.4329.8220.5433.9548.53
TR-Rules43.3233.9648.5561.1747.6437.0653.8067.5730.4121.1034.5848.92
INFER44.0934.5248.9262.1448.2737.6154.3068.5231.6821.9435.6450.88
INFER(with vc)44.0834.8248.8461.7448.3438.0754.1667.8232.1122.3436.2651.19
INFER-60(with vc)44.4635.0349.3762.3148.7338.3254.6168.4832.2222.3936.4151.52
+ +Baseline Methods We compare INFER with static embedding, temporal embedding and rule-based state-of-the-art models. As for static embedding models we select Dismult (Yang et al., 2014) and ComplEx (Trouillon et al., 2016). Temporal embedding models include TA-DistMult (Garcia-Durán et al., 2018), DE-SimpleE (Goel et al., 2020), TNTComplEx (Lacroix et al., 2020), RE-Net (Jin et al., 2019), CyGNet (Zhu et al., 2021a), xERTE (Han et al., 2021), TITer (Sun et al., 2021), RE-GCN (Li et al., 2021), CENET (Xu et al., 2022), DaeMon (Dong et al., 2023) and TECHS (Lin et al., 2023). The rule-based methods we select are AnyBURL (Meilicke et al., 2019b), TLogic (Liu et al., 2022) and TR-Rules (Li et al., 2023). We reproduce RE-GCN and remove their utilization of static information for fairness and all of the rest results are taken from (Li et al., 2023), (Dong et al., 2023) and (Lin et al., 2023). + +# 5.2 MAIN RESULTS + +Table 1 displays the results of INFER compared with selected baselines, where INFER(with $vc$ ) denotes we utilize rules with and without variable constraints to infer instead of only rules without variable constraints and INFER-60(with $vc$ ) represents we use at most 60 rules for a single query. As we can see, INFER-60(with $vc$ ) achieves state-of-the-art performance on all datasets with respect to MRR, Hits@1,3,10. Specifically, compared with the best rule-based model TR-Rules, INFER obtains average improvements of $1.35\%$ and $1.55\%$ in MRR and Hits@10 on three datasets, which proves the effectiveness of introducing embedding models and considering the frequency and time validity of historical facts for rule application. Meanwhile INFER maintains the interpretability of rule-based methods. We also provide an exemplary CASE in Appendix C to better illustrate the process of INFER and show the interpretability of INFER. Results of INFER on YAGO and WIKI are presented in Appendix F, Table 5. + +Table 1: Performance of INFER on ICEWS14, ICEWS05-15 and ICEWS18. Best results are in bold and second best results are underlined. + +
ModelICEWS14ICEWS18
MRRHits@1Hits@3Hits@10MRRHits@1Hits@3Hits@10
INFER44.0934.5248.9262.1431.6821.9435.4050.88
INFER(P+B)37.6727.3442.7657.7725.8716.1629.3145.57
INFER(P)16.297.5817.7834.6911.703.9012.4128.10
INFER(Temp Val)41.9933.7547.0057.3130.9021.5935.0249.37
INFER(B)37.4127.5842.5256.4325.7316.3129.2644.90
+ +Table 2: Ablation study of INFER on ICEWS14, and ICEWS18. Best results are in bold. + +# 5.3 ABLATION STUDY + +We conduct ablation study on ICEWS14 and ICEWS18 and the results are reported in Table 2 where P denotes the utilization of pre-trained static KG embedding models, B denotes we use the traditional binary truth values for historical facts and Temp Val represents we use the truth values calculated by Temporal Validity Functions. + +![](images/ac6641f500eeab2cdda8ada38979a013708598970eb25cf11d00ee3987fb609d.jpg) +Figure 4: Performance of INFER and other rule-based models on our modified incomplete ICEWS14 and ICEWS18 where a certain proportion of facts at each timestamp are randomly removed. + +![](images/0a60f2e9755fb1f84fc0312e216b41495cc702d0e55b9138bb7ba2c69b822ebd.jpg) + +![](images/07e1d1a6e4ddc0f8a948b975755874e1283d2e29cc26dd5723ff614f43bcd262.jpg) + +![](images/d3f9589fbd5cd278b60ea6e047fda481de10dc4999dc74fc34542ca394415ab7.jpg) + +As we can see from the results of INFER(P+B), when using the binary truth value, the performance of INFER drops dramatically on both datasets with up to $6.42\%$ in MRR and $4.37\%$ in Hits@10. This phenomenon strongly verifies our motivation and proves the necessity of extending truth values to continuous number via modeling temporal validity and frequency. As we do not use the historical information and only project rules based on the matrices given by the static embedding model, the results (INFER(P)) get even worse, which demonstrates the importance of historical facts for rule-based models. INFER(Temp Val) and INFER(B) report the performance when the pre-trained model is removed. Again, compared with the binary settings, the introduction of our Temp Validity Function significantly improves the performance. The results of INFER(Temp Val) also prove that the introduction of embedding model does contribute to the overall performance, but the capability of embedding models is not decisive. Besides, by comparing (B) with $(\mathrm{P} + \mathrm{B})$ and (Temp Val) with (INFER) itself, we discover that the utilization of Temp Validity Function amplifies the influence of the pre-trained KG embedding model. We speculate the probable reason is that some of the re-scaled values given by the static embedding model are relatively small compared with 1 when the truth values are binary. Hence, candidates inferred through potential missing facts surely rank after those candidates inferred by existing historical facts. As a result, the effects of the pre-trained model are impaired when binary truth values are utilized. + +# 5.4 ANALYSIS + +Performance on Incomplete datasets To demonstrate the capability in inference missing facts and robustness of reasoning on incomplete datasets of INFER, we conduct experiments on modified ICEWS14 and ICEWS18 and compare INFER with previous rule-based methods. We randomly remove $30\%$ and $50\%$ facts at each timestamp and then pre-train the static embedding model and mine temporal rules with these incomplete datasets. Meanwhile, the historical facts used for temporal validity calculation are also cut to $50\%$ and $70\%$ . The results are shown in figure 4. As we can see, the differences between INFER and the other two models generally increase as the datasets become more incomplete. Moreover, the slope of the blue line representing INFER is smaller than that of the other two lines, which indicates that the performance of INFER is less affected as the datasets become sparse. This suggests that INFER exhibits robustness on sparse datasets, which can be attributed to the introduction of the static embedding model that enhances the ability to infer missing facts during rule application, thereby improving the overall performance of INFER. + +Inference Efficiency We also test TLogic (Liu et al., 2022) and our method on ICEWS14 to calculate the time consumption, the quantity of processed rules and the number of candidates derived from each rules which serve to evaluate the efficiency and capability of models. In our reproduced experiments, the rule application time of TLogic on ICEWS14 is 2000 seconds with 8 CPUs. The average number of rules TLogic applies for a single query is 32.96 and the number of candidates it covers per rule at each intermediate step is 13.30. In comparison, it takes INFER 2500 seconds to apply rules on ICEWS14 with a single GPU. However, the average number of rules INFER uses for a single query is 38.73 and the average number of candidates per rule that INFER considers and assign positive scores to at each step is 1385.49. + +![](images/ca4ee74d713e8aebeb00f8711930fa235c1534cae4e5cbbb13a13bbce2487f86.jpg) +(a) + +![](images/c22e35aa3d49c74586ac8517025d52cd890d4d7442ebd7bf0e9caf07edd84fb7.jpg) +(b) +Figure 5: Comparison on inference efficiency: (a) Comparison on rules/sec, INFER gives similar performance to TLogic. (b) Comparison on candidates/sec, INFER shows significantly superiority which means that INFER achieve efficient traversal on graphs. + +In contrast, INFER can apply rules more efficiently under our proposed paradigm and significantly enlarge the range of candidate entities which surely contributes to the final performance of INFER since more considered intermediate candidates denote that our model traverse more possible paths during application. + +Variance Generally, INFER can be viewed as a statistical learning method. Thus, as long as the mined rules and corresponding confidence are the same, when running the model with the same hyper-parameter configuration, it will yield identical results. The only possible variance comes from the pre-trained static KG embedding model. To eliminate this concern, we pretrain the ComplEx 3 times on ICEWS14 and subsequently run INFER. The results of the three experiments are completely identical. The possible reason is that the scores given by the KG embedding model are normalized by a softmax function and filtered with a threshold, which effectively avoid any obvious fluctuation. Thus, we can conclude that the performance of INFER is stable and the gained improvements are not occasional issues. + +Variable Constraints As we can see in table 1, when the limit of the quantity of rules is set to 40, the utilization of rules with variable constraints does not bring significant improvements. We speculate that rules with variable constraints require more strict temporal restriction which can not be satisfied by current design. Meanwhile, the inference speed of applying rules with variable constraints decreases due to extra indexing and calculations. Detailed process of applying rules with variable constraints is shown in Appendix A. + +# 6 CONCLUSION + +In this paper, we propose INFER, an interpretable neural-symbolic model for TKG extrapolation. INFER proposes a novel paradigm for integrating temporal rules with embedding-based methods which enhances the robustness of rule-based methods to missing facts. INFER is the first model to extend the truth value of facts into continuous number and designs Temporal Validity Function to model the time validity and frequency of historical facts. We introduce a rule projection module which manages to apply rules by conducting faster matrices operations on GPUs instead of previous costly path matching in graphs. Experimental results show that INFER achieves state-of-the-art performance on three TKG datasets. Meanwhile, INFER also remarkably improves the efficiency of rule application. + +Reproducibility Statement. We provide our code at https://github.com/JasonLee-22/ INFER to enhance reproducibility. And the implementation details are provided in section 5.1 and Appendix E. + +# ACKNOWLEDGEMENTS + +This work was supported by the National Natural Science Foundation of China (No. 62473271) and (No. 62176026). + +# REFERENCES + +Yushi Bai, Xin Lv, Juanzi Li, and Lei Hou. Answering complex logical queries on knowledge graphs via query computation tree optimization. In International Conference on Machine Learning, pp. 1472-1491. PMLR, 2023. +Elizabeth Boschee, Jennifer Lautenschlager, Sean O'Brien, Steve Shellman, James Starz, and Michael Ward. Icews coded event data. Harvard Dataverse, 12, 2015. +Hao Dong, Zhiyuan Ning, Pengyang Wang, Ziyue Qiao, Pengfei Wang, Yuanchun Zhou, and Yanjie Fu. Adaptive path-memory network for temporal knowledge graph reasoning. arXiv preprint arXiv:2304.12604, 2023. +Alberto García-Durán, Sebastijan Dumančić, and Mathias Niepert. Learning sequence encoders for temporal knowledge graph completion. arXiv preprint arXiv:1809.03202, 2018. +Rishab Goel, Seyed Mehran Kazemi, Marcus Brubaker, and Pascal Poupart. Diachronic embedding for temporal knowledge graph completion. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pp. 3988-3995, 2020. +Zhen Han, Peng Chen, Yunpu Ma, and Volker Tresp. Explainable subgraph reasoning for forecasting on temporal knowledge graphs. In International Conference on Learning Representations, 2021. +Marcel Hildebrandt, Swathi Shyam Sunder, Serghei Mogoreanu, Mitchell Joblin, Akhil Mehta, Ingo Thon, and Volker Tresp. A recommender system for complex real-world applications with nonlinear dependencies and knowledge graph context. In The Semantic Web: 16th International Conference, ESWC 2019, Porto Roz, Slovenia, June 2-6, 2019, Proceedings 16, pp. 179-193. Springer, 2019. +Rikui Huang, Wei Wei, Xiaoye Qu, Shengzhe Zhang, Dangyang Chen, and Yu Cheng. Confidence is not timeless: Modeling temporal validity for rule-based temporal knowledge graph forecasting. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 10783-10794, 2024. +Woojeong Jin, Meng Qu, Xisen Jin, and Xiang Ren. Recurrent event network: Autoregressive structure inference over temporal knowledge graphs. arXiv preprint arXiv:1904.05530, 2019. +Timothée Lacroix, Guillaume Obozinski, and Nicolas Usunier. Tensor decompositions for temporal knowledge base completion. arXiv preprint arXiv:2004.04926, 2020. +Yunshi Lan and Jing Jiang. Query graph generation for answering multi-hop complex questions from knowledge bases. Association for Computational Linguistics, 2020. +Ningyuan Li, E Haihong, Shi Li, Mingzhi Sun, Tianyu Yao, Meina Song, Yong Wang, and Haoran Luo. Tr-rules: Rule-based model for link forecasting on temporal knowledge graph considering temporal redundancy. In Findings of the Association for Computational Linguistics: EMNLP 2023, pp. 7885-7894, 2023. +Zixuan Li, Xiaolong Jin, Wei Li, Saiping Guan, Jiafeng Guo, Huawei Shen, Yuzhuo Wang, and Xueqi Cheng. Temporal knowledge graph reasoning based on evolutionary representation learning. In Proceedings of the 44th international ACM SIGIR conference on research and development in information retrieval, pp. 408-417, 2021. +Qika Lin, Jun Liu, Rui Mao, Fangzhi Xu, and Erik Cambria. Techs: Temporal logical graph networks for explainable extrapolation reasoning. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1281-1293, 2023. + +Yushan Liu, Yunpu Ma, Marcel Hildebrandt, Mitchell Joblin, and Volker Tresp. Tlogic: Temporal logical rules for explainable link forecasting on temporal knowledge graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 4120-4127, 2022. +Xin Mei, Libin Yang, Xiaoyan Cai, and Zuowei Jiang. An adaptive logical rule embedding model for inductive reasoning over temporal knowledge graphs. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 7304-7316, 2022. +Christian Meilicke, Melisachew Wudage Chekol, Daniel Ruffinelli, and Heiner Stuckenschmidt. Anytime bottom-up rule learning for knowledge graph completion. In International Joint Conference on Artificial Intelligence, 2019a. URL https://apisemantic scholar.org/CorpusID:263877624. +Christian Meilicke, Melisachew Wudage Chekol, Daniel Ruffinelli, and Heiner Stuckenschmidt. Anytime bottom-up rule learning for knowledge graph completion. In *IJCAI*, pp. 3137-3143, 2019b. +Haohai Sun, Jialun Zhong, Yunpu Ma, Zhen Han, and Kun He. Timetraveler: Reinforcement learning for temporal knowledge graph forecasting. arXiv preprint arXiv:2109.04101, 2021. +Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. In International conference on machine learning, pp. 2071-2080. PMLR, 2016. +Yi Xu, Junjie Ou, Hui Xu, and Luoyi Fu. Temporal knowledge graph reasoning with historical contrastive learning. arXiv preprint arXiv:2211.10904, 2022. +Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. arXiv preprint arXiv:1412.6575, 2014. +Cunchao Zhu, Muhao Chen, Changjun Fan, Guangquan Cheng, and Yan Zhang. Learning from history: Modeling temporal knowledge graphs with sequential copy-generation networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 4732-4740, 2021a. +Zhaocheng Zhu, Zuobai Zhang, Louis-Pascal Xhonneux, and Jian Tang. Neural bellman-ford networks: A general graph neural network framework for link prediction. Advances in Neural Information Processing Systems, 34:29476-29490, 2021b. + +# A RULE PROJECTION + +# A.1 VARIABLE CONSTRAINTS + +As we mentioned in section 3.2, in some rules, entity variables in the rule bodies do not have to be unique since the same entity might be involved in multiple facts at different timestamps. This phenomenon which is called Variable Constraints brings constraints to the rule application procedure. Here are some examples: + +$$ +(A, s u p p o r t, C, T) _ {,} (A, r i o t, B, T _ {1}) \bigwedge (B, m a k e s t a m e n t, A, T _ {2}) \bigwedge (A, r e s o r t, C, T _ {3}) +$$ + +The above example is a rule with variable constraints. As we can see in the body of the rule, in the second hop, the entity which $B$ make statement to has to be the same with the entity that riot with $B$ at $T_{1}$ . + +However, the below case is a rule without variable constraints which is different with the rule given above. Because the entity which $B$ make statement to can be or can not be the same with the entity riot with $B$ at $T_{1}$ . + +$$ +(A, s u p p o r t, C, T), (A, r i o t, B, T _ {1}) \bigwedge (B, m a k e s t a t e m e n t, D, T _ {2}) \bigwedge (D, r e s o r t, C, T _ {3}) +$$ + +# A.2 RULE PROJECTION WITH VARIABLE CONSTRAINTS + +Algorithms 2 and 3 present the pseudocode for rule projection with two types of variable constraints: [1,3] and [0,2], assuming a rule length of 3, where the numbers in the list indicate that the corresponding entity variables in the rule body must refer to the same entity. In our experiments, we also mine rules with variable constraints [[1,3],[0,2]] and rules of length 2 from ICEWS0515 with variable constraints [0,1] and [1,2]. Here, we provide the projection algorithms for the two most common types of variable constraints. Algorithms for these 3 variable constraints can be easily derived following Algorithms 2 and 3 and our provided code can serve as a reference. + +Algorithm 2 Pseudocode of Rule Projection With Variable Constraints [1,3] +Require: $(s,r_q,?,T_q)$ : Query; $\{R_1,R_2\dots R_n\}$ : Corresponding rule bodies; $M_{\mathcal{R}}$ : Temporal Weight Matrices; +1: set $\mathbf{Ans} = \mathbf{MR}_1[s,:]$ # Select the s-th row of $\mathbf{MR}_1$ +2: $\mathbf{Ans} = \mathbf{Ans}^{\mathrm{T}}.\mathbf{repeat}(1,|\mathcal{E}|)$ #Repeat the transposed vector along row direction +3: $\mathbf{Ans} = \mathbf{Ans} \odot \mathbf{MR}_{i}$ #Hadamard Product gives a matrix of $\mathbf{R}^{\mathcal{E}*\mathcal{E}}$ , where $\mathbf{Ans}[i][j]$ denotes the score of entity $e_j$ when entity $e_i$ serves as the constrained variable. +4: res = zeros(1, |\mathcal{E}|) +5: for $i$ in $(0,|\mathcal{E}|)$ do +6: row = Ans[i,:] +7: row = row.T.repeat(1, |\mathcal{E}|) +8: temp = row $\odot$ MR₃ +9: temp = temp(:, i] +10: res[i] = max(temp, dim = -1) +return res + +Algorithm 3 Pseudocode of Rule Projection With Variable Constraints [0,2] +Require: $(s,r_q,?,T_q)$ : Query; $\{R_1,R_2,R_3\}$ : Corresponding rule bodies; $M_{\mathcal{R}}$ : Temporal Weight Matrices; +1: set $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{M}_{\mathbf{R}_1}[s,:]$ # Select the s-th row of $\mathbf{M}_{\mathbf{R}_1}$ +2: $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{A}\mathbf{n}\mathbf{s}^{\mathrm{T}}.\mathbf{r}\mathbf{e}\mathbf{a}\mathbf{t}(1,|\mathcal{E}|)$ #Repeat the transposed vector along row direction +3: $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{A}\mathbf{n}\mathbf{s} \odot \mathbf{M}_{\mathbf{R}_2}$ #Hadamard Product +4: $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{A}\mathbf{n}\mathbf{s}[\therefore,s]$ #Only select the s-th column to satisfy the variable constraints. +5: $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{A}\mathbf{n}\mathbf{s}.\mathbf{r}\mathbf{e}\mathbf{a}\mathbf{t}(1,|\mathcal{E}|)$ +6: $\mathbf{A}\mathbf{n}\mathbf{s} = \mathbf{A}\mathbf{n}\mathbf{s} \odot \mathbf{M}_{\mathbf{R}_3}$ #Hadamard Product +7: $\mathbf{A}\mathbf{n}\mathbf{s} = \max (\mathbf{A}\mathbf{n}\mathbf{s},dim = -1)$ #Column-wise max operation giving a row vector return Ans + +In our preliminary conception, variable constraints of longer rule are solvable without having to traverse every possible scenario for algorithm design. In this conception, we can treat the algorithms for variable constraints that have been designed for lengths of 2 or 3 as algorithm units. The calculations for variable constraints in longer rules can be broken down into combinations of these units. For example, for a rule of length 5 with variable constraints [[0,2,4]]: + +$$ +(A, R _ {1}, B) \wedge (B, R _ {2}, A) \wedge (A, R _ {3}, C) \wedge (C, R _ {4}, A) \wedge (A, R _ {5}, D) +$$ + +We can first use existing algorithms to compute the results under the $[0,2]$ constraint when reaching variable#2 (A). This intermediate result can then serve as the initial condition for the third relation (R3) calculation in the rule. At this point, the subsequent calculation can be seen as a computation for a rule of length 3 with variable constraints $[0,2] ([2,4] \to [0,2]) : (A, R_3, C) \wedge (C, R_4, A) \wedge (A, R_5, D)$ . This is again a problem that can be solved by our algorithm units. + +This approach allows us to tackle longer rule variable constraints by leveraging the solutions for shorter ones, effectively avoiding exhaustive searches through all possible scenarios. By decomposing complex problems into simpler, already-solved components, we can design more efficient and scalable algorithms for handling variable constraints in various rule lengths. We leave the detailed design of a more flexible and automatic algorithm for handling variable constraints in long rules to the future work. + +# B STATISTICS OF DATASETS + +Table 3 shows the statistics of these five datasets. To satisfy the extrapolation reasoning settings, facts are sorted in ascending order based on timestamps and then split into train, valid and test. + +
TrainValidTest|E||R||T|
ICEWS146368513823132227128230365
ICEWS05153229586922469147104882514017
ICEWS18373018459954954523033256304
WIKI53928667538631101255424232
YAGO16154019523200261062310189
+ +Table 3: Statistics of ICEWS14, ICEWS05-15, ICEWS18, WIKI and YAGO. + +# C EXEMPLARY INFERENCE CASE + +Figure 6 displays an inference case of INFER. Given the query (AshrafGh ani Ahmadzai, Make a Visit,?, 2014/11/11) whose answer is China and corresponding rule of length 3, we list top 5 candidates at each step of rule application provided by INFER. As for the result, INFER successfully ranks China at the second place. Moreover, we discover that the other 3 entities: Afghanistan, Jens Stoltenberg and North Atlantic Treaty Organization also serve as the object entity for this query although at other timestamps, which demonstrates that INFER is indeed capable of obtaining relevant candidates. + +![](images/2f8d9191721c2bda9d53b2234b82f24dd279b01856d15bcc9c04cdec5cc95e5a.jpg) +Figure 6: Exemplary interpretable inference procedure of INFER. + +# D TEMPORAL VALIDITY FUNCTION + +Table 4 reports the performance of various forms of Temporal Validity Function on ICEWS14. We mainly focus on the main time span part, where Square root, Cube root, Reci and Exp represent the functions $\frac{1}{\sqrt{x}}$ , $\frac{1}{\sqrt[3]{x}}$ , $\frac{1}{x}$ and $\frac{1}{exp(x)}$ used for the time span part respectively and Binary denotes the previous binary truth value settings for historical facts. As we can see, following our intuition, by proposing a function which is negative to the time span values and ranging in [0,1], INFER can properly model the temporal validity of historical facts. However, Exp gives worse performance compared with Binary, it is natural to speculate that it is that $\frac{1}{exp(x)}$ drops too fast as the time span getting bigger leading to the "forget" of historical facts. From this point of view, when using the Binary settings, the temporal validity of facts do not decay, i.e. the model strongly memorize every fact. Thus, Binary and Exp are two extreme cases, we try to explore a more suitable form to model the temporal validity and select the Square root in INFER, which is still a primary attempt and we believe more sophisticated Temporal Validity Function can surely improve the performance of INFER. + +
ModelICEWS14
MRRHits@1Hits@3Hits@10
INFER44.0934.5248.9262.14
Square root44.0934.5248.9262.14
Cube root43.7634.1848.5462.01
Reci41.3631.5245.9460.61
Exp33.0823.5836.8752.18
Binary37.6727.3442.7657.77
+ +# E IMPLEMENTATION DETAILS + +When mining rules, we use the configuration given by TR-RulesLi et al. (2023). We select ComplEXTrouillon et al. (2016) as the static KG embedding model, which is trained with N3 regularizer and relation prediction task. $\tau$ in equation (2) is set 15 for ICEWS14 and ICEWS18. While for ICEWS0515 which covers a time span of ten years, we set it to 150. For some queries, there might be too many rules can be utilized for inference. However, for simplicity and resource saving, we set a limitation on the most rules can be used for a single query which is 40 unless specified and the threshold for building temporal weight matrices is set to 0.0005. + +# F RESULTS ON YAGO AND WIKI + +Table 5 reports the results of INFER on WIKI and YAGO, as we can see INFER still outperforms existing methods and significantly improves the rule-based baselines on WIKI. As for YAGO, our model and other rule-based methods fall short compared with embedding-based methods. As mentioned in (Huang et al., 2024), some relations in YAGO can not be modeled by cyclic rules which take up to $10\%$ of the test set. Since our model only uses cyclic rules, it is affected to a certain extent. However, INFER still gain improvements compared with TLogic. It should be noted that during experiments, we notice that the introduction of "generated rule" mentioned in section 4.4 causes bias on the YAGO dataset, which drastically boosts the performance. Thus, we do not leverage the "generated rules" for evaluation on YAGO for fair comparison. We speculate the possible reason is that there are more repetitive facts in YAGO which amplifies the impact of the "generated rules" too much especially when given the fact that less patterns can be modeled with cyclic rules. We also conduct experiments on the other four datasets to investigate the bias issue and the results show that it only yields slight fluctuation to the overall performance on the other four datasets. + +Table 4: Results of various forms of Temporal Valid Function in INFER on ICEWS14. Best results are in bold. + +
ModelWIKIYAGO
MRRHits@1Hits@3Hits@10MRRHits@1Hits@3Hits@10
INFER86.4885.0987.3888.6783.7483.5483.7284.31
TLogic78.9373.0584.9786.9178.7674.3183.3883.72
TECHS75.98--82.3989.24--92.39
TITER73.9171.7075.4176.9687.4780.0989.9690.27
REGCN78.5374.5081.5984.7082.3078.8384.2788.58
+ +Table 5: Results of INFER on WIKI, and YAGO. Best results are in bold. + +
ModelICEWS14
MRRHits@1Hits@3Hits@10
INFER-143.8334.1549.0161.99
TR-Rules-140.5930.9046.3159.14
INFER-220.4910.6122.9742.38
TR-Rules-215.286.4016.8235.29
INFER-340.6932.4845.4055.99
TR-Rules-340.4531.4645.5257.35
+ +Table 6: Results of INFER with rules of different lengths on ICEWS14. Best results are in bold. (Model-X, X denotes only use rules of length X.) + +# G LIMITATIONS + +Although INFER obtains significant improvements on three datasets, there are still limitations. As we mentioned in section 6, the main limitation of INFER is that it can not explicitly model the exact order of historical facts which might be crucial for improving the performance of longer rules with variable constraints. We provide the performance of INFER using rules of different lengths with comparison to TR-Rules in Table 6. It can be observed that, INFER greatly improves the effect of applying rules of length of 1 and 2 compared to TR-Rules. As for length of 3, INFER still performs better on MRR and Hits@1 but the overall improvements are not that significant compared with shorter rules. Besides, INFER can not leverage acyclic rules for inference, which have been demonstrated crucial in KG completion. \ No newline at end of file diff --git a/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/images.zip b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d6f3a89ff62ad8bc64c22a403c0a474f2fc8c2a1 --- /dev/null +++ b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e26edab7094e880c5757e83b39963f2ed369d63a9366081edb11a8ce7c9973d +size 551866 diff --git a/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/layout.json b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..56c4331565c38d955711d962a1182093ce967580 --- /dev/null +++ b/ICLR/2025/INFER_ A Neural-symbolic Model For Extrapolation Reasoning on Temporal Knowledge Graph/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:514aab36b1e608beee34cf6ca0453d29b659aa53aa01a54ff5773aa3f10a2073 +size 475336 diff --git a/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_content_list.json b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f465e25b5b90b10e919e18f6992cc51f3a720f40 --- /dev/null +++ b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6327110944a299c7c8ee759be22ebf22d0ccb1a613544b8dbd1fa406fd2262f4 +size 148191 diff --git a/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_model.json b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d8e62e0a82277e4aa40a4a2c1d5df0b82ef5ee6a --- /dev/null +++ b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dde10a72472e1d807ea9f456c531df8bda46685641ae2ae48682fe42bafdac4e +size 181774 diff --git a/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_origin.pdf b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7c54336114b16624a364bec5d73f8e4972f46dde --- /dev/null +++ b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/4099b849-36d7-4ea9-9b68-a56c2d09545b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d44d5938f602a07de5ec088eed9435809fbf0d51a126187b4389c01f0681b7b8 +size 5481948 diff --git a/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/full.md b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9ed160899353b4efa83fb8b07878afb6daa541fb --- /dev/null +++ b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/full.md @@ -0,0 +1,572 @@ +# INS: INTERACTION-AWARE SYNTHESIS TO ENHANCE OFFLINE MULTI-AGENT REINFORCEMENT LEARNING + +Yuqian Fu $^{1,2}$ , Yuanheng Zhu $^{1,2,*}$ , Jian Zhao $^{3}$ , Jiajun Chai $^{1,2}$ , Dongbin Zhao $^{1,2,*}$ + +$^{1}$ Institution of Automation, Chinese Academy of Sciences +$^{2}$ School of Artificial Intelligence, University of Chinese Academy of Sciences +3 Polixir + +{fuyuqian2022,chaijiajun2020,yuanheng.zhu,dongbin.zhao}@ia.ac.cn jian.zhao@polixir.ai + +# ABSTRACT + +Data scarcity in offline multi-agent reinforcement learning (MARL) is a key challenge for real-world applications. Recent advances in offline single-agent reinforcement learning (RL) demonstrate the potential of data synthesis to mitigate this issue. However, in multi-agent systems, interactions between agents introduce additional challenges. These interactions complicate the synthesis of multi-agent datasets, leading to data distortion when inter-agent interactions are neglected. Furthermore, the quality of the synthetic dataset is often constrained by the original dataset. To address these challenges, we propose INInteraction-aware Synthesis (INS), which synthesizes high-quality multi-agent datasets using diffusion models. Recognizing the sparsity of inter-agent interactions, INS employs a sparse attention mechanism to capture these interactions, ensuring that the synthetic dataset reflects the underlying agent dynamics. To overcome the limitation of diffusion models requiring continuous variables, INS implements a bit action module, enabling compatibility with both discrete and continuous action spaces. Additionally, we incorporate a select mechanism to prioritize transitions with higher estimated values, further enhancing the dataset quality. Experimental results across multiple datasets in MPE and SMAC environments demonstrate that INS consistently outperforms existing methods, resulting in improved downstream policy performance and superior dataset metrics. Notably, INS can synthesize high-quality data using only $10\%$ of the original dataset, highlighting its efficiency in data-limited scenarios. The source code is available at here. + +# 1 INTRODUCTION + +Recent advances in offline multi-agent reinforcement learning make it possible to train policies for real-world applications, such as autonomous driving (Zhang et al., 2024), robotics (Li et al., 2024a), and network control (Ma et al., 2024), entirely from previously collected multi-agent datasets. This approach eliminates the need for online interactions with environments, mitigating the high costs associated with trial-and-error in online MARL. However, offline MARL faces challenges due to the fixed dataset with incomplete coverage of the state-action space (Fujimoto et al., 2019), leading to the distribution shift problem and suboptimal policy performance. Furthermore, data collection in real-world scenarios is expensive and potentially dangerous (Gao et al., 2024; Canese et al., 2021), restricting the dataset scalability and resulting in policy overfitting (Agarwal et al., 2020). Consequently, learning effective MARL policies from limited datasets remains a critical challenge. + +The data scarcity challenge also exists in offline single-agent reinforcement learning, where using generative models for data synthesis is a prevalent approach to overcome this issue. Despite the promising results in single-agent settings, extending this approach to multi-agent scenarios presents unique challenges. Firstly, multi-agent systems involve complex inter-agent interactions (Georgeff, 1988), such as collisions and information exchange, which influence agent dynamics. Therefore, merely applying existing data synthesis methods by treating each agent independently often results + +in lower-quality synthetic datasets, as these methods fail to capture the true agent dynamics. In Appendix A, we present a motivating example to illustrate this phenomenon. Moreover, an agent typically interacts with only a subset of other agents (DeWeese & Qu, 2024; Liu et al., 2024), and considering interactions with irrelevant agents can introduce distractions into the synthesis process. Secondly, research shows that both the diversity and quality of datasets are crucial for effective policy training (Corrado & Hanna, 2024). While generative models aim to preserve diversity by approximating the original dataset distribution, their effectiveness is constrained by the dataset quality. Low-quality original datasets often lack sufficient high-value transitions, leading to imbalanced synthetic datasets and ultimately hindering effective policy learning. Finally, since most diffusion models are limited to generating continuous data, existing synthesis methods primarily focus on continuous action spaces, such as D4RL (Fu et al., 2020) and MPE (Lowe et al., 2017). This restricts their applicability to multi-agent environments with discrete action spaces, such as SMAC (Samvelyan et al., 2019) and FightingICE (Tang et al., 2023). In summary, there is a critical need for a method that can synthesize high-quality multi-agent datasets applicable to both continuous and discrete action spaces in the offline MARL domain. + +To meet this need, we propose INteraction-aware Synthesis (INS), which leverages a powerful generative model, diffusion model (Ho et al., 2020), to synthesize multiagent datasets. Diffusion models excel at ensuring broad coverage of the data distribution while maintaining high quality, making them ideal for modeling complex multiagent transitions. To model the inter-agent interaction during the synthesis process, INS integrates a sparse attention mechanism (Martins & Astudillo, 2016). This mechanism assigns different weights to agents based on their interactions and fil + +ters out irrelevant ones. To further improve dataset quality, we design a value-based select mechanism that estimates transition values and prioritizes higher-value transitions for the synthetic dataset. To ensure compatibility with discrete action environments, INS implements a bit action module, bridging the gap between continuous diffusion models and transitions with discrete actions. We conduct a preliminary evaluation of INS with existing synthesis methods on various multi-agent datasets. As illustrated in Figure 1, our method outperforms baseline methods in both policy performance and dataset metrics. In contrast, baseline methods that ignore inter-agent interactions yield performance comparable to, or even worse than, that of the original datasets. More details of the preliminary evaluation are provided in Appendix B. + +![](images/373f9e29e5f3ccc38684b10f6e17945e408c1d6933b9580ad932dbadb8fd9975.jpg) +Figure 1: Preliminary evaluation. Our INS consistently outperforms existing data synthesis methods across policy performance and dataset metrics. + +Our contributions are three-fold: (1) We propose an interaction-aware synthesis method, INS, which leverages diffusion models to synthesize high-quality multi-agent datasets, applicable to both continuous and discrete action spaces. INS is compatible with any offline MARL methods, as it synthesizes data without modifying the policy learning algorithms. To the best of our knowledge, INS is the first diffusion-based data synthesis approach for offline MARL. (2) We introduce a sparse attention mechanism to capture inter-agent interactions in the synthesis process, effectively reducing the irrelevant interaction modeling. Additionally, we design a select mechanism to improve dataset quality by increasing the proportion of high-value transitions. (3) We conduct extensive evaluations on MPE and SMAC datasets, showing that our method enhances both dataset metrics and policy performance across various offline MARL methods. Moreover, INS can synthesize high-quality data with only $10\%$ of the original dataset, underscoring its effectiveness in data-limited scenarios. + +# 2 RELATED WORKS + +Data Synthesis in Offline MARL. In offline reinforcement learning, agents frequently encounter challenges stemming from dataset scarcity (Wang et al., 2022). To mitigate this challenge, recent advances leverage diffusion models for data synthesis, e.g., MTDiff-S (He et al., 2024) and SynTHER (Lu et al., 2024). MTDiff-S generates trajectory-level data for multi-task settings, producing trajectories for unseen tasks. SynTHER, closely related to our method, synthesizes data at the transition + +level for subsequent policy training. In offline MARL, data synthesis has not yet achieved the same level of performance as that observed in single-agent RL. This disparity is pronounced due to the complex dynamics in multi-agent systems (Tian et al., 2023; Chai et al., 2024), where multiple agents interact within a shared environment. Our method diverges from existing approaches by explicitly considering inter-agent interactions and improving dataset quality. + +Diffusion Models in Offline MARL. Diffusion models (Ho et al., 2020; Karras et al., 2022), as a powerful class of generative models, have recently been adopted in offline reinforcement learning as planners and policies (Zhu et al., 2023b). The application of diffusion models in the field of MARL remains underexplored. Building on the foundational work of Janner et al. (2022) and Wang et al. (2023), recent studies extend diffusion models to the MARL domain, such as MADiff (Zhu et al., 2023a) and DOM2 (Li et al., 2023). Specifically, MADiff formulates a planner as a return-conditional diffusion model designed to maximize cumulative rewards in multi-agent decision-making. DOM2, on the other hand, focuses on enhancing policy expressiveness and diversity by leveraging diffusion models. In contrast to these methods, which focus on the policy level and aim to maximize rewards or optimize action selection, INS leverages diffusion models to synthesize multi-agent datasets, thereby improving offline MARL performance from a data-centric perspective. Further details regarding the differences between our method and related works can be found in Appendix D and Table A1. + +# 3 PRELIMINARIES + +# 3.1 OFFLINE MULTI-AGENT REINFORCEMENT LEARNING + +We focus on the fully cooperative MARL, which can be modeled as a Decentralized-Partially Observable Markov Decision Process (Dec-POMDP) (Oliehoek et al., 2016), defined by the tuple $\langle S, \mathcal{A}, \mathcal{P}, \mathcal{O}, \Omega, R, n, \gamma \rangle$ . Here, $s \in S$ denotes the global state of the environment and $\mathcal{A}$ represents the action set for each of the $n$ agents. At each time step, each agent $i \in \mathcal{N} := \{1, 2, \dots, n\}$ receives a local observation $o_i \in \mathcal{O}$ , generated by the observation function $\Omega(s, i): S \times \mathcal{N} \to \mathcal{O}$ . Each agent $i$ selects and executes its own action $a_i \in \mathcal{A}$ , resulting in a joint action $a \in \mathcal{A}^n$ that induces the next state according to the state transition function $\mathcal{P}(s, a): S \times \mathcal{A}^n \to S$ . The environment provides a global reward $r$ shared by agents, determined by the reward function $R(s, a): S \times \mathcal{A}^n \to \mathbb{R}$ . The objective is to find the optimal policies $\pi = (\pi_1, \dots, \pi_n)$ that maximize the discounted return $G = \sum_{t=0}^{T} \gamma^t r_t$ , where $T$ denotes the horizon and $\gamma \in [0,1)$ represents the discount factor. + +In the offline MARL setting, access to each agent's transition is restricted to a fixed multi-agent dataset $\mathcal{D}_{\mathrm{ori.}} \coloneqq \{\pmb{x}^1, \pmb{x}^2, \dots, \pmb{x}^{| \mathcal{D}_{\mathrm{ori.}}|}\}$ . Each joint transition is defined as $\pmb{x} \coloneqq (\pmb{o}, \pmb{a}, \pmb{o}', r)$ , and the transition of agent $i$ is given by $x_i \coloneqq (o_i, a_i, o_i', r) \in \mathbb{R}^{d_x}$ . The dataset is typically collected by arbitrary policies like human experts or random policies. However, these policies fail to guarantee sufficient coverage of the whole state-action space, which grows exponentially with the number of agents. As a result, learning effective decision-making policies that surpass the behavior policy from scarce and potentially suboptimal multi-agent datasets poses a significant challenge. Existing offline MARL methods (Yang et al., 2021; Pan et al., 2022) attempt to address these issues by incorporating policy constraints and conservative estimation techniques. Moving beyond these methods, another intuitive yet underexplored solution to dataset scarcity is data synthesis (Levine et al., 2020). + +# 3.2 DIFFUSION MODELS + +Diffusion models (DM) (Ho et al., 2020) represent a class of generative models that generate data $\boldsymbol{x}_0$ by incrementally removing noise from a Gaussian distribution. These models comprise two primary processes: a forward noising process and a reverse denoising process. Given the data distribution $p(\boldsymbol{x})$ and the noise standard deviation $\sigma$ , the data distribution with added noise is denoted by $p(\boldsymbol{x};\sigma)$ . The forward process is characterized by a Markov chain, starting from the data $\boldsymbol{x}_0 \sim p(\boldsymbol{x})$ and gradually increasing the noise level to $\sigma_{\mathrm{max}}$ . The reverse process involves $K$ times sequential denoising, starting with noise $\boldsymbol{x}_K$ sampled from a Gaussian distribution $\mathcal{N}(0,\sigma_{\mathrm{max}}^2 I)$ , and following a decreasing fixed sequence of noise levels $\sigma_{\mathrm{max}} = \sigma_0 > \sigma_1 > \dots > \sigma_K = 0$ . As a result, the endpoint $\boldsymbol{x}_0$ of this process aligns with the original data distribution $p(\boldsymbol{x})$ . + +In this work, we adopt the Elucidated Diffusion Model (EDM) architecture (Karras et al., 2022), which implements both forward and reverse processes through the continuous schedule of noise + +![](images/7673016fd46e138d498f77231d6a0b88b325f533507844aa63672c2284349d4e.jpg) +Figure 2: Overview of INS framework. The framework consists of three phases: In the first phase, we train a diffusion model. Following this, we synthesize and select transition data. Lastly, we employ the synthetic transitions to train offline MARL policy. + +levels in a probability flow ordinary differential equation (ODE): + +$$ +\mathrm {d} \boldsymbol {x} = - \dot {\sigma} (k) \sigma (k) \nabla_ {\boldsymbol {x}} \log p (\boldsymbol {x}; \sigma (k)) \mathrm {d} k, \tag {1} +$$ + +where the dot notation represents the time derivative, and $\sigma (k)$ denotes the noise level at time $k$ . $\nabla_{\pmb{x}}\log p(\pmb {x};\sigma (k))$ is the score function, which can be computed via the connection between score matching and denoising: $\nabla_{\pmb{x}}\log p(\pmb {x};\sigma) = (D_{\theta}(\pmb {x};\sigma) - \pmb {x}) / \sigma^{2}$ . $D_{\theta}(\pmb {x};\sigma)$ denotes the denoiser with parameters $\theta$ . The $\mathrm{L}_2$ loss objective for denoising, applied to the denoiser $D_{\theta}(\pmb {x};\sigma)$ is defined as: + +$$ +\mathcal {L} _ {\mathrm {d m}} (\theta) = \mathbb {E} _ {\boldsymbol {x} \sim p (\boldsymbol {x}), \epsilon \sim \mathcal {N} (0, \sigma^ {2} I)} \| D _ {\theta} (\boldsymbol {x} + \epsilon , \sigma) - \boldsymbol {x} \| ^ {2}. \tag {2} +$$ + +Subsequently, we can sample transitions via solving Eq. (1) with the trained denoising network $D_{\theta}(\pmb {x};\sigma)$ and score function $\nabla_{\pmb{x}}\log p(\pmb {x};\sigma (k))$ + +# 4 METHOD + +In this section, we present interaction-aware synthesis (INS), which synthesizes high-quality multiagent transitions and is compatible with any offline MARL methods. As illustrated in Figure 2, our method consists of three phases: (i) train the diffusion model, (ii) synthesize and select transition data, and (iii) train offline MARL policy. + +# 4.1 PHASE A: TRAIN DIFFUSION MODEL + +Diffusion Model Architecture. In order to synthesize multi-agent transitions, we employ a diffusion model to learn the distribution of the original dataset $\mathcal{D}_{\mathrm{ori}}$ . While existing methods typically use a U-Net (Ronneberger et al., 2015) denoising network, INS adopts a Transformer encoder (Vaswani et al., 2017) as its basic architecture, incorporating a sparse attention mechanism along the agent dimension. This design offers two key advantages: First, in multi-agent systems, interaction relationships are often sparse (Liu et al., 2024; Fu et al., 2025; Li et al., 2019), with agents typically interacting only with specific nearby agents. The conventional dense attention mechanism in the Transformer encoder assigns non-zero weights to all agent pairs, implicitly assuming universal interaction. This mechanism is inefficient and complicates learning the true interaction distribution. Moreover, modeling irrelevant agent interaction can distract diffusion models, potentially hindering the denoising process. In contrast, the sparse attention focuses on critical inter-agent interactions, thereby simplifying the learning task for models. Second, prior research (Dong et al., 2024) indicates that Transformer-based diffusion models exhibit improved training stability and achieve superior performance in reinforcement learning contexts. The diffusion model architecture of INS is detailed in Appendix K.1. + +Sparse Attention for Inter-agent Interaction. In the denoising process, the transition sample $\pmb{x}_k = [x_{1,k},\dots,x_{n,k}] \in \mathbb{R}^{n\times d_x}$ at denoising step $k$ is initially embedded into $\pmb{x}_{k,e} \in \mathbb{R}^{n\times d_e}$ via an embedding layer. For notational simplicity, we denote the embedding matrix as $\pmb{X}$ instead of $\pmb{x}_{k,e}$ . The embedding features of each agent are then projected into query $Q = XW^{Q}$ , key $K = XW^{K}$ , and value $V = XW^{V}$ representations, where $W^{Q}, W^{K}$ , and $W^{V}$ are learnable parameters. The product of query and keys is denoted as $Z = QK^{\top} \in \mathbb{R}^{n\times n}$ , comprising $n$ rows $\{z_1,\ldots ,z_n\}$ . To focus on the critical interactions, we replace the dense Softmax in conventional dense attention with Sparsemax (Martins & Astudillo, 2016), which tends to produce sparse attention weights: + +$$ +\operatorname {S p a r s e m a x} (\boldsymbol {z}) = \underset {\boldsymbol {p} \in \Delta^ {n - 1}} {\arg \min } \| \boldsymbol {p} - \boldsymbol {z} \| _ {2}, \tag {3} +$$ + +where $\mathbf{z} \in \mathbb{R}^n$ is the input, $\mathbf{p} \in \mathbb{R}^n$ is the output, and $\Delta^{n-1} \coloneqq \{\mathbf{p} \in \mathbb{R}^n | \mathbf{p} \geq 0, \| \mathbf{p} \|_1 = 1\}$ is the $(n-1)$ -dimensional simplex. The solution to Eq. (3) is given as follows: + +$$ +\boldsymbol {p} = [ \boldsymbol {z} - \sigma (\boldsymbol {z}) \mathbf {1} ] _ {+}, \tag {4} +$$ + +where $\sigma (z)$ is the Sparsemax threshold, $\mathbf{1}\in \mathbb{R}^n$ is the all-one vector, and $[\cdot ]_{+}$ denotes the ReLU function. In order to get the solution $\pmb{p}$ , we calculate the threshold $\sigma (z)$ as follows: + +$$ +\sigma (z) = \frac {\left(\sum_ {i \leq m (\hat {z})} \hat {z} _ {i} - 1\right)}{m (\hat {z})}, \tag {5} +$$ + +where $\hat{z}$ is $z$ sorted in descending order, and $m(\hat{z})$ is the number of non-zero elements in $\pmb{p}$ : + +$$ +m (\hat {\boldsymbol {z}}) = \underset {m \in \{1, \dots , n \}} {\arg \max } \left\{m \hat {\boldsymbol {z}} _ {m} > \sum_ {i \leq m} \hat {\boldsymbol {z}} _ {i} - 1 \right\}. \tag {6} +$$ + +Thus, the resulting sparse attention weight is given by $P = \operatorname{Sparsemax}(Z) \in \mathbb{R}^{n \times n}$ . The output of sparse attention is $\left( \frac{P}{\sqrt{d_e}} \right)V$ , which preserves key properties of Softmax while assigning zero probability to irrelevant agents. This approach allows the diffusion model to concentrate on critical inter-agent interactions, effectively mitigating distractions during the denoising process. A detailed discussion of Sparsemax and its comparison with related work can be found in Appendix E. + +Bit Action. While the current diffusion model inherently generates continuous data, many multi-agent environments, such as SMAC (Samvelyan et al., 2019), feature discrete action spaces. To bridge this gap, we introduce a bit action module inspired by Bit Diffusion in Chen et al. (2023). The bit action module maps a discrete action space containing $M$ actions to a real-valued bit vector of length $L = \lceil \log_2(M) \rceil$ , as $\{0.0, 1.0\}^L$ . During the denoising process, this bit vector is concatenated with other continuous variables in the transition. After that, the output vector corresponding to the action is thresholded into a binary bit vector via a quantization mechanism. Then this vector is mapped back to the original discrete action space. The bit action design offers two key advantages. Firstly, it enables INS to be universally applicable to multi-agent environments with either discrete or continuous action spaces without requiring additional modifications. Secondly, compared to alternative discretization techniques such as one-hot encoding, the bit action module effectively reduces the action space dimensionality from $M$ to $\lceil \log_2(M) \rceil$ , thereby decreasing computational complexity. + +Diffusion Model Training. Given the original multi-agent dataset $\mathcal{D}_{\mathrm{ori}}$ containing transitions $\pmb{x}$ and the denoising network $D_{\theta}(\pmb{x};\sigma)$ , we train a diffusion model $p_{\mathrm{dm}}(\pmb{x})$ to approximate the joint distribution $p(\pmb{x})$ of multi-agent transitions. The parameters $\theta$ of the denoising network are optimized by minimizing the $\mathrm{L}_2$ loss for denoising score matching, as described in Eq. (2). With the trained model, we can generate numerous transitions from the original dataset, as shown in the next phase. + +# 4.2 PHASE B: SYNTHESIZE DATASETS + +The synthesis process begins by sampling an initial noisy transition $\boldsymbol{x}_K$ , which is considered the result of multiple noise additions to the original transition. Following the diffusion steps described in Eq. (1), the final joint transition is obtained as: + +$$ +\underbrace {\left(\hat {\boldsymbol {o}} , \hat {\boldsymbol {a}} , \hat {\boldsymbol {o}} ^ {\prime} , \hat {r}\right)} _ {\boldsymbol {x} _ {K}} \xrightarrow {K \text {s t e p s}} \underbrace {\left(\boldsymbol {o} , \boldsymbol {a} , \boldsymbol {o} ^ {\prime} , r\right)} _ {\boldsymbol {x} _ {0}}. \tag {7} +$$ + +In offline MARL, both dataset diversity and high-value transitions are crucial, implying that the relative importance of each transition varies (Schweighofer et al., 2022). Previous approaches primarily focused on diversity, overlooking the role of high-value transitions, which led to an imbalance in transition quality within the synthetic dataset $\mathcal{D}_{\mathrm{syn}}$ . To mitigate this imbalance, we propose a transition select mechanism that prioritizes transitions based on their estimated values. Specifically, a state value estimator is trained simultaneously with the diffusion model during Phase A to estimate transition values: + +$$ +\mathcal {L} _ {\phi} ^ {V} (\boldsymbol {o}) = \mathbb {E} _ {(\boldsymbol {o}, r, \boldsymbol {o} ^ {\prime}) \sim \mathcal {D} _ {\text {o r i .}}} [ r + \gamma V _ {\bar {\phi}} (\boldsymbol {o} ^ {\prime}) - V _ {\phi} (\boldsymbol {o}) ] ^ {2}, \tag {8} +$$ + +where $\phi$ and $\bar{\phi}$ are parameters of the value estimator, and $\gamma$ is the discount factor. During the synthesis process, $\mathcal{B}$ transitions are generated as candidates. The value estimator evaluates each transition, and candidates within the proportion $\eta$ are selected for inclusion in the final output synthetic dataset. In this paper, we propose two select mechanisms: + +- Top-K: All candidate transitions are sorted by their estimated values, and the top $\eta$ proportion of them are selected. While this approach intuitively selects the most valuable transitions for training, it may reduce dataset diversity and degrade policy performance. +- Softmax: A Softmax probability is calculated based on the estimated values of transitions: + +$$ +p \left(\boldsymbol {x} _ {0} ^ {i}\right) = \frac {\exp \left(V _ {\phi} \left(\boldsymbol {o} _ {0} ^ {i}\right)\right)}{\sum_ {j = 1} ^ {\mathcal {B}} \exp \left(V _ {\phi} \left(\boldsymbol {o} _ {0} ^ {j}\right)\right)}. \tag {9} +$$ + +Then the $\eta$ proportion of candidates are sampled according to these probabilities. Despite the additional computational cost, empirical results show that it enhances downstream policy performance. Therefore, the Softmax select mechanism is employed in the primary experiments. + +The selection proportion $\eta$ represents a trade-off between dataset diversity and quality. Increasing this proportion tends to concentrate more high-value transitions but at the cost of reduced diversity. This parameter can be fine-tuned according to the specific requirements of the synthetic data. + +# 4.3 PHASE C: TRAIN OFFLINE MARL + +In the final phase, the high-quality dataset synthesized in the previous stages is used for offline multi-agent policy training. As previously mentioned, our approach is orthogonal to existing offline MARL methods. Therefore, rather than designing new policy training algorithms, we directly integrate INS with these methods to assess its effectiveness. The overall algorithm is given in Appendix C. + +# 5 EXPERIMENTS + +In this section, we evaluate INS across different multi-agent settings, including both discrete and continuous action spaces. We initially evaluate our method on multiple datasets, replacing the original datasets with synthetic datasets to isolate and highlight the impact of synthesis methods. We also investigate how the quality and size of synthetic data affect downstream policy performance in offline MARL. Additionally, we conduct an extensive ablation study to empirically validate the effectiveness of key components and hyperparameters within our method. We provide visualizations of data coverage, attention weights, reward distributions, and value distributions to illustrate the effects of our method. Finally, we demonstrate the advantage of INS when trained on small original datasets. + +# 5.1 EXPERIMENTAL SETUP + +We conduct experiments on two widely used offline MARL environments: Multi-Agent Particle Environment (MPE) (Lowe et al., 2017) for continuous action space tasks and StarCraft Multi-Agent Challenge (SMAC) (Samvelyan et al., 2019) for discrete action space tasks. We use a diverse range of original datasets, including 12 from MPE and 9 from SMAC. All datasets are categorized based on the quality of the policies used for collection. In MPE, datasets are categorized as expert, medium, medium replay (md-replay), or random, while in SMAC, they are classified as good, medium, or random. In our primary experiments, the size of the synthetic dataset is fixed at $5M$ . More information about datasets is provided in Appendix H. + +Table 1: The normalized average scores of INS and baselines in MPE and SMAC. Original means training policies on the original datasets. We show the mean and standard deviation of scores averaged over 8 seeds. The best performance is highlighted in bold. + +
DatasetsMA-ICQMA-CQLOMAR/MA-BCQ
OriginalMA-SynthERINS (ours)OriginalMA-SynthERINS (ours)OriginalMA-SynthERINS (ours)
MPE (continuous)SpreadExpert102.8 ± 3.3104.7 ± 5.2107.0 ± 4.497.9 ± 5.396.8 ± 4.698.5 ± 5.0114.1 ± 3.3111.3 ± 1.9115.6 ± 3.1
Medium26.8 ± 4.827.9 ± 3.830.2 ± 2.534.1 ± 7.135.6 ± 8.236.6 ± 6.547.4 ± 17.345.6 ± 11.248.0 ± 11.3
Md-replay12.9 ± 6.114.4 ± 5.615.2 ± 5.420.3 ± 6.418.1 ± 7.121.1 ± 8.837.8 ± 10.538.1 ± 12.138.8 ± 13.0
Random5.1 ± 2.34.2 ± 0.65.2 ± 3.523.9 ± 5.923.0 ± 10.523.6 ± 7.334.2 ± 6.233.8 ± 7.536.7 ± 4.6
TagExpert111.7 ± 15.1114.1 ± 15.6114.2 ± 17.293.8 ± 12.292.5 ± 15.793.9 ± 16.6117.2 ± 18.8114.4 ± 20.3119.1 ± 19.6
Medium62.3 ± 19.661.6 ± 18.664.7 ± 20.360.8 ± 22.760.2 ± 24.361.4 ± 21.366.8 ± 20.964.1 ± 23.467.5 ± 27.3
Md-replay33.9 ± 25.936.2 ± 28.036.4 ± 30.324.8 ± 17.525.2 ± 16.126.1 ± 18.146.1 ± 13.644.9 ± 16.348.6 ± 14.9
Random1.8 ± 2.31.6 ± 2.41.9 ± 4.14.7 ± 8.83.8 ± 9.44.8 ± 8.011.0 ± 2.49.3 ± 1.110.8 ± 2.7
WorldExpert108.5 ± 20.7110.7 ± 24.3111.4 ± 22.472.4 ± 31.172.8 ± 28.773.8 ± 28.0110.4 ± 25.7108.9 ± 22.3112.7 ± 25.8
Medium71.2 ± 19.273.6 ± 19.472.1 ± 17.957.9 ± 11.955.0 ± 10.658.8 ± 10.174.3 ± 14.572.1 ± 19.575.0 ± 16.3
Md-replay12.2 ± 9.812.6 ± 6.411.9 ± 7.029.3 ± 12.827.1 ± 16.230.4 ± 14.243.0 ± 20.542.6 ± 21.246.2 ± 14.5
Random0.8 ± 3.40.3 ± 2.90.8 ± 1.30.7 ± 1.50.2 ± 3.30.4 ± 2.75.7 ± 2.24.2 ± 3.36.9 ± 3.1
Total Score550.0561.9573.0520.6510.3529.1708.0689.3725.9
SMAC (discrete)3mGood18.1 ± 0.618.6 ± 1.519.9 ± 1.418.5 ± 0.518.2 ± 0.920.1 ± 0.33.4 ± 0.83.4 ± 0.84.1 ± 0.5
Medium16.9 ± 0.817.9 ± 1.118.5 ± 1.816.3 ± 0.816.2 ± 1.117.9 ± 1.04.1 ± 1.54.5 ± 0.94.4 ± 1.3
Poor13.0 ± 1.213.5 ± 2.513.8 ± 0.95.6 ± 0.64.0 ± 2.15.0 ± 1.63.3 ± 1.03.6 ± 1.63.1 ± 1.1
5m_vs_6mGood16.3 ± 0.816.4 ± 1.217.2 ± 1.712.8 ± 2.113.6 ± 4.114.3 ± 2.92.1 ± 0.42.8 ± 0.73.0 ± 0.4
Medium12.8 ± 0.612.7 ± 1.013.9 ± 1.114.8 ± 1.714.1 ± 1.916.1 ± 2.13.9 ± 0.74.2 ± 0.84.3 ± 0.7
Poor9.4 ± 0.59.5 ± 0.79.9 ± 0.410.5 ± 0.710.8 ± 1.012.3 ± 2.73.2 ± 0.62.9 ± 0.23.3 ± 0.2
8mGood19.3 ± 0.920.2 ± 2.020.7 ± 1.411.1 ± 5.110.1 ± 5.912.5 ± 4.24.5 ± 0.84.9 ± 1.05.0 ± 1.2
Medium18.0 ± 1.218.8 ± 0.519.3 ± 0.515.4 ± 3.315.1 ± 4.016.4 ± 2.55.6 ± 0.55.3 ± 0.35.7 ± 1.1
Poor9.8 ± 0.610.2 ± 1.410.1 ± 1.14.4 ± 2.03.8 ± 3.35.4 ± 1.93.4 ± 0.82.7 ± 1.22.9 ± 0.6
Total Score133.6137.8143.3109.4105.9120.033.534.335.8
+ +![](images/8f2b4d986b0526ef92a4fd5210d69db2a8f7970ad9a1586df7dd4a0772a20925.jpg) +Figure 3: Dataset metrics of the synthetic dataset. We compare datasets synthesized by INS and MA-SynthER across different datasets. Details of metrics are provided in Appendix F. + +We compare our method against SynthER (Lu et al., 2024), a recently proposed synthetic method for offline single-agent RL. To ensure a fair comparison, we implement a multi-agent version of SynthER (MA-SynthER) and evaluate it in the same settings. The detailed implementation of MA-SynthER is provided in Appendix J. The data synthesis methods used in the preliminary evaluation (Additive Noise and VAE Augmented) are excluded from the main experiments due to their poor performance. In order to demonstrate the broad applicability of our method, we select four widely used offline MARL algorithms for downstream policy training: MA-ICQ (Yang et al., 2021), MA-CQL (Kumar et al., 2020), OMAR (Pan et al., 2022), and MA-BCQ (Wu et al., 2019). More information on these algorithms is provided in Appendix I. + +# 5.2 COMPARATIVE EVALUATION + +We begin our evaluation by comparing the performance of INS combined with different offline MARL algorithms across multiple environments. Due to constraints in the official code implementations, we evaluate OMAR only in MPE and MA-BCQ only in SMAC. The main results are presented in Table 1, which demonstrate that offline MARL algorithms using INS synthetic datasets outperform all other baseline datasets across all algorithms on the total score. Among different types of original datasets (expert/good, medium, md-replay, and random), synthetic datasets generated from expert/good and md-replay datasets lead to more substantial improvements in downstream policy + +![](images/1cd6af12546c480e186b5ee1ddc8afe077e390ae5701279359924a1a5c9c0d55.jpg) +Figure 4: Module ablation. The normalized average score of the downstream policy with ablation variants. + +![](images/f0cbcd5758537c5e5c7e27c2294ad2152265daf8c21d4864317bffc0607c32e8.jpg) +Figure 5: Parameter ablation. Ablation studies on the selection proportion and the select mechanism type across different datasets. + +![](images/89d13c6b7dc0ef81fe5ca9290dfe8efb206473994a2f7e5e6644aacc3de4a575.jpg) + +performance compared with those generated from medium and random datasets. This discrepancy can be attributed to two key factors. First, the narrow coverage of medium datasets constrains the potential improvements in data coverage achievable by the diffusion model of INS, thereby limiting the synthesis fidelity. Second, the inherently low quality of random datasets hinders the capacity of synthetic datasets to enhance downstream policy performance. These findings underscore the critical role of initial dataset quality in synthesis methods. Additionally, the limited performance gains of MA-SynthER, and in some cases, performance degradation (such as when combined with OMAR in the MPE environment), can be attributed to its failure to consider the inter-agent interaction. To summarize, these results underline the effectiveness of INS across various offline MARL algorithms. + +# 5.3 DATASET QUALITY ANALYSIS + +In order to analyze the dataset quality of synthetic data, we employ multiple data metrics to evaluate the synthetic data synthesized by INS and MA-SynthER. Inspired by prior works (Lu et al., 2024; Lee et al., 2024), we conduct a comprehensive analysis using five metrics: Similarity measures the distance between the synthetic and original data distributions, while Correlation evaluates their statistical relationships, whether casual or not; Oracle Reward represents the true reward of the synthetic data, which indicates optimality; Dynamic MSE evaluates how well the synthetic data aligns with the environment dynamics; Novelty quantifies the uniqueness of the synthetic transition, reflecting the extent of data coverage. Detailed definitions and calculation methods for these metrics are provided in Appendix F. We exclude Oracle Reward and Dynamic MSE for the SMAC environment due to the unavailability of true environment rewards and environment dynamics. Figure 3 illustrates the metrics of synthetic datasets generated from original datasets of different quality. The results demonstrate that our method consistently outperforms MA-SynthER across all metrics and datasets. This superior performance indicates that INS not only enhances the true reward and data coverage of the synthetic data but also preserves its similarity and correlation with the original dataset. Furthermore, it demonstrates INS's ability to capture the dynamic information inherent in the original dataset. + +# 5.4 ABLATION STUDY + +To verify the effectiveness of each component in our method and to analyze the impact of hyperparameters and dataset size, we conduct a series of ablation experiments. All experiments are performed in both MPE and SMAC environments, with MA-ICQ serving as the downstream policy algorithm. + +Module Ablation. We evaluate the contribution of key modules through several ablations. These include replacing sparse attention with dense attention (w/o sparse), removing the select mechanism retaining all synthetic data (w/o select), and replacing the attention module with an MLP, allowing each agent to independently synthesize transitions (w/o attention). Figure 4 illustrates the impact of each module on dataset quality and policy performance. The results demonstrate that the attention mechanism significantly enhances the ability of INS to learn inter-agent interactions, improving synthetic data accuracy and policy performance. The select mechanism effectively prioritizes high-value transitions, which proves crucial in complex environments such as SMAC. Additionally, sparse attention reduces redundant information in agent interactions, mitigating distraction impact in the denoising process. We also analyze the metrics of synthetic data generated by different ablation + +variants. As shown in Figure 3, the select mechanism enhances the true reward of synthetic data, while sparse attention improves the accuracy and state-action coverage of the method. Details of the ablation variants and more results are provided in Appendix G.3. + +Parameter Ablation. We investigate the effect of selection proportion $\eta$ and select mechanism type within INS. As mentioned in previous sections, the selection proportion represents a trade-off between dataset diversity and quality, with higher proportions favoring high-value transitions at the cost of diversity. As shown in Figure 5, the relationship between policy performance and the selection proportion varies across different environments. In the Spread environment, the offline MARL algorithm benefits from high-value transitions in the dataset, while in $5\mathrm{m\_vs\_6m}$ , agents require a more diverse offline dataset to achieve optimal performance. We find that the selection proportion of 0.8 provides sufficient performance on different datasets, so we fix it in our primary experiments. Additionally, our experiments on select mechanisms show that the Softmax approach used in primary experiments balances high-value distribution and dataset diversity. Across various selection proportions in different environments, the Softmax select mechanism achieves superior performance compared to the Top-K select mechanism. + +Synthetic Dataset Size. In order to investigate the relationship between synthetic dataset size and downstream policy performance, we conduct experiments with varying dataset sizes. We select five different dataset sizes spanning two orders of magnitude: $\{0.1M, 0.5M, 1.0M, 5.0M, 10.0M\}$ transitions. As shown in Figure 6, as the dataset size increases, policy performance improves. However, the improvement does not scale linearly with the dataset size. Similar to findings reported by He et al. (2023) and Lu et al. (2024), the performance tends to saturate as the + +![](images/ccc7ac044b0a4c481f8c97d959ce09781d6ea66bd411c8ad840f5fbfcf8578da.jpg) +(a) Spread (MPE) + +![](images/130ef4b0122763317f93fb3ebaba0da7e8f5aec20fc0ae3f3b7ef2e294a078dd.jpg) +(b) $5\mathrm{m\_vs\_6m}$ (SMAC) +Figure 6: Impact of synthetic dataset size. Each curve displays the mean and standard deviation of the normalized score across 5 random seeds. + +dataset size increases beyond a certain threshold. Based on these observations, we conclude that a dataset size of $5M$ offers a reasonable balance between performance and computational cost. + +# 5.5 VISUALIZATION + +To provide intuitive insights into the effectiveness of INS in synthesizing multi-agent interaction datasets, we present four types of visualizations: data coverage, attention weights, value distributions, and reward distributions. These visualizations aim to demonstrate the improvements in dataset quality, the impact of the sparse attention mechanism, and the effect on value and reward distributions. + +Data Coverage. To assess the improvement in dataset coverage, we employ t-SNE (van der Maaten & Hinton, 2008) to project both the generated data and the original $(o,a)$ pairs onto a 2D space for both MPE and SMAC, as illustrated in Figure 7. Our analysis reveals that INS not only fills in parts of the data distribution that are not well explored by the real interaction but also augments the empty spaces around the existing transition distribution. In other words, it demonstrates an interpolation effect, potentially filling gaps in the original dataset distribution. + +Attention Weights. To elucidate the impact of our attention mechanism on agent interactions, we visualize the attention weights during the synthesis process across multiple multi-agent scenarios. Specifically, we use the real transitions as input for the final diffusion step in INS, then synthesize transition using sparse and dense attention mechanisms, visualizing their respective attention weights. Additionally, we compute the inverse distance $1 / d(i,j)$ between each agent pair $(i,j)$ to reflect the true interaction relationships between agents. As shown in Figure 8, sparse attention effectively focuses on agents that are more likely to interact based on their proximity. In contrast, dense attention distributes focus more broadly, disregarding agents' relative distances, which introduces irrelevant interactions and reduces the fidelity of the synthetic dataset. Overall, sparse attention offers two key advantages: lower computational cost during synthesis and less distraction from irrelevant agents. These advantages contribute to more efficient and accurate multi-agent interaction synthesis. + +![](images/eedf1cd7b82cf40c204481a902b28e9a1ed70e2a5d129dcf56ea064d64e660b1.jpg) +(a) Spread (MPE) + +![](images/82d5cd0d87b47a225fa7a338330956fafac314c628382b38709a2ad29a446c1c.jpg) +(b) $5\mathrm{m\_vs\_6m}$ (SMAC) + +![](images/bac0d64c517cda7429539ff2fe6ed90cb67aecd97b5198430c90baa115f0c5c4.jpg) +Figure 7: Data coverage visualization. Visualization of a t-SNE projection on the observation-action space of the original dataset and INS synthetic dataset. +Figure 8: Attention visualization. Visualization of attention weights in the synthesis process. + +Oracle Reward and Value Distribution. To further evaluate the impact of our method on the synthetic dataset, we visualize the oracle reward distribution (in Appendix G.1) and the actual value distribution (in Appendix G.2) of the original dataset and synthetic datasets. The results indicate that the select mechanism introduced in INS's Phase $B$ guides the synthetic dataset toward regions with higher rewards, effectively improving the actual value distribution of the offline MARL policy. + +# 5.6 SYNTHESIZE FROM SMALL DATASETS + +We evaluate the ability of INS to synthesize transitions from limited-size datasets by subsampling each dataset in proportion to its original size. Specifically, we select $\{10\%, 50\%, 100\% \}$ of the original dataset as training data for INS, and then assess the policy performance on the corresponding synthetic data. The denoising network uses the same hyperparameters as in the main evaluation. The experimental results in Table 2 + +show that our method can synthesize effective transitions even when using only $10\%$ of the original data, with the performance comparable to that of the original dataset. These results validate the capability of INS to synthesize high-quality datasets from small-size multi-agent datasets, taking a step towards addressing the data scarcity in real-world offline MARL tasks. + +Table 2: Synthesize from small datasets. We only present two expert/good dataset results for brevity, with additional results provided in Appendix G.4. + +
DatasetOriginal10%50%100%
Spread102.8102.3106.3107.0
5m_vs_6m16.316.316.817.2
+ +# 6 CONCLUSION + +In this paper, we propose INteraction-aware Synthesis (INS), a method that leverages diffusion models to synthesize high-quality datasets for offline MARL. INS employs a sparse attention mechanism for inter-agent interactions and selects transitions based on a value estimator. The method is orthogonal to existing offline MARL algorithms and adaptable to datasets with both discrete and continuous action spaces. Our experiments demonstrate that datasets synthesized by INS lead to superior policy performance and improved dataset metrics compared to the original datasets and those synthesized by baseline methods. Additionally, INS can synthesize datasets using as little as $10\%$ of the original data while maintaining comparable policy performance. INS enables MARL agents to benefit from synthetic datasets, taking a step towards effective training on scarce real-world datasets. + +Limitations. Real-world multi-agent systems often involve a variable number of agents, making dataset synthesis for varying agent numbers a promising research direction. Additionally, given the high computational demands of diffusion models, acceleration techniques will be employed to scale our method to large-scale multi-agent systems. Finally, to balance diversity and fidelity, we did not apply guidance in INS. However, applying guided diffusion models to specific domains (e.g., safety MARL) presents an interesting future direction. + +# ACKNOWLEDGMENTS + +This work was supported in part by the Strategic Priority Research Program of Chinese Academy of Sciences under Grant XDA27030400, in part by the National Natural Science Foundation of China under Grant 62293541 and Grant 62136008, in part by Beijing Natural Science Foundation under Grant 4232056, and in part by Beijing Nova Program under Grant 20240484514. + +# REFERENCES + +Rishabh Agarwal, Dale Schuurmans, and Mohammad Norouzi. An optimistic perspective on offline reinforcement learning. In International Conference on Machine Learning, pp. 104-114. PMLR, 2020. 1 +Paul Barde, Jakob Foerster, Derek Nowrouzezahrai, and Amy Zhang. A model-based solution to the offline multi-agent reinforcement learning coordination problem. In Proceedings of the 23rd International Conference on Autonomous Agents and Multiagent Systems, pp. 141-150, 2024. 18 +Lorenzo Canese, Gian Carlo Cardarilli, Luca Di Nunzio, Rocco Fazzolari, Daniele Giardino, Marco Re, and Sergio Spanò. Multi-agent reinforcement learning: A review of challenges and applications. Applied Sciences, 11(11):4948, 2021. 1 +Jiajun Chai, Yuqian Fu, Dongbin Zhao, and Yuanheng Zhu. Aligning credit for multi-agent cooperation via model-based counterfactual imagination. In Proceedings of the 23rd International Conference on Autonomous Agents and Multiagent Systems, pp. 281-289, 2024. 3 +Ting Chen, Ruixiang Zhang, and Geoffrey Hinton. Analog Bits: Generating discrete data using diffusion models with self-conditioning. In International Conference on Learning Representations, 2023. 5 +Daesol Cho, Dongseok Shim, and H Jin Kim. S2P: State-conditioned image synthesis for data augmentation in offline reinforcement learning. Advances in Neural Information Processing Systems, 35:11534-11546, 2022. 17 +Nicholas Corrado and Josiah P. Hanna. Understanding when dynamics-invariant data augmentations benefit model-free reinforcement learning updates. In International Conference on Learning Representations, 2024. 2 +Alex DeWeese and Guannan Qu. Locally interdependent multi-agent MDP: Theoretical framework for decentralized agents with dynamic dependencies. In International Conference on Machine Learning, 2024. 2 +Zibin Dong, Yifu Yuan, Jianye Hao, Fei Ni, Yi Ma, Pengyi Li, and Yan Zheng. CleanDiffuser: An easy-to-use modularized library for diffusion models in decision making. arXiv preprint arXiv:2406.09509, 2024. 4, 17 +Edgar C Fieller, Herman O Hartley, and Egon S Pearson. Tests for rank correlation coefficients. i. Biometrika, 44(3/4):470-481, 1957. 19 +Claude Formanek, Asad Jeewa, Jonathan Shock, and Arnu Pretorius. Off-the-Grid MARL: Datasets with baselines for offline multi-agent reinforcement learning. arXiv preprint arXiv:2302.00521, 2023.23 +Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020. 2, 24 +Yuqian Fu, Yuanheng Zhu, Jiajun Chai, and Dongbin Zhao. LDR: Learning discrete representation to improve noise robustness in multiagent tasks. IEEE Transactions on Systems, Man, and Cybernetics: Systems, 55(1):513-525, 2025. 4 +Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pp. 2052-2062. PMLR, 2019. 1 +Yinfeng Gao, Qichao Zhang, Da-Wei Ding, and Dongbin Zhao. Dream to drive with predictive individual world model. IEEE Transactions on Intelligent Vehicles, pp. 1-16, 2024. 1 + +Michael Georgeff. Communication and interaction in multi-agent planning. In Readings in Distributed Artificial Intelligence, pp. 200-204. Elsevier, 1988. 1 +David Ha and Jürgen Schmidhuber. World models. arXiv preprint arXiv:1803.10122, 2018. 18 +Haoran He, Chenjia Bai, Kang Xu, Zhuoran Yang, Weinan Zhang, Dong Wang, Bin Zhao, and Xuelong Li. Diffusion model is an effective planner and data synthesizer for multi-task reinforcement learning. Advances in Neural Information Processing Systems, 36:64896-64917, 2024. 2, 17 +Ruifei He, Shuyang Sun, Xin Yu, Chuhui Xue, Wenqing Zhang, Philip Torr, Song Bai, and Xiaojuan Qi. Is synthetic data from generative models ready for image recognition? In International Conference on Learning Representations, 2023. 9 +Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840-6851, 2020. 2, 3, 17 +Michael Janner, Yilun Du, Joshua Tenenbaum, and Sergey Levine. Planning with diffusion for flexible behavior synthesis. In International Conference on Machine Learning, pp. 9902-9915. PMLR, 2022. 3 +Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. Advances in Neural Information Processing Systems, 35:26565-26577, 2022. 3, 17, 25 +Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative Q-learning for offline reinforcement learning. Advances in Neural Information Processing Systems, 33:1179-1191, 2020. 7, 23 +Misha Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data. Advances in Neural Information Processing Systems, 33:19884-19895, 2020. 16 +Jaewoo Lee, Sujin Yun, Taeyoung Yun, and Jinkyoo Park. GTA: Generative trajectory augmentation with guidance for offline reinforcement learning. arXiv preprint arXiv:2405.16907, 2024.8 +Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020. 3 +Haoran Li, Guangzheng Hu, Shasha Liu, Mingjun Ma, Yaran Chen, and Dongbin Zhao. NeuronsGym: A hybrid framework and benchmark for robot navigation with sim2real policy learning. IEEE Transactions on Emerging Topics in Computational Intelligence, pp. 1-15, 2024a. 1 +Haoran Li, Yaocheng Zhang, Haowei Wen, Yuanheng Zhu, and Dongbin Zhao. Stabilizing diffusion model for robotic control with dynamic programming and transition feasibility. IEEE Transactions on Artificial Intelligence, 5(9):4585-4594, 2024b. 17 +Wenhao Li, Bo Jin, and Xiangfeng Wang. SparseMAAC: Sparse attention for multi-agent reinforcement learning. In Database Systems for Advanced Applications: DASFAA 2019 International Workshops: BDMS, BDQM, and GDMA, Chiang Mai, Thailand, April 22-25, 2019, Proceedings 24, pp. 96-110. Springer, 2019. 4, 18 +Zhuoran Li, Ling Pan, and Longbo Huang. Beyond conservatism: Diffusion policies in offline multi-agent reinforcement learning. arXiv preprint arXiv:2307.01472, 2023. 3 +Shunyu Liu, Jie Song, Yihe Zhou, Na Yu, Kaixuan Chen, Zunlei Feng, and Mingli Song. Interaction pattern disentangling for multi-agent reinforcement learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 1-15, 2024. 2, 4, 18 +Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 6382-6393, 2017. 2, 6, 22 +Cong Lu, Philip Ball, Yee Whye Teh, and Jack Parker-Holder. Synthetic experience replay. Advances in Neural Information Processing Systems, 36:46323-46344, 2024. 2, 7, 8, 9, 16, 17, 23, 25 + +Chengdong Ma, Among Li, Yali Du, Hao Dong, and Yaodong Yang. Efficient and scalable reinforcement learning for large-scale network control. Nature Machine Intelligence, 9 2024. ISSN 2522-5839. 1 +Andre Martins and Ramon Astudillo. From Softmax to Sparsemax: A sparse model of attention and multi-label classification. In International Conference on Machine Learning, pp. 1614-1623. PMLR, 2016. 2, 5 +Frank J Massey Jr. The kolmogorov-smirnov test for goodness of fit. Journal of the American Statistical Association, 46(253):68-78, 1951. 19 +Frans A Oliehoek, Christopher Amato, et al. A concise introduction to decentralized POMDPs, volume 1. Springer, 1st edition, 2016. 3 +Ling Pan, Longbo Huang, Tengyu Ma, and Huazhe Xu. Plan better amid conservatism: Offline multi-agent reinforcement learning with actor rectification. In International Conference on Machine Learning, pp. 17221-17237. PMLR, 2022. 3, 7, 22, 23, 24 +Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Proceedings of the 20th International Conference on Neural Information Processing Systems, pp. 1177-1184, 2007. 25 +Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer-assisted Intervention, pp. 234-241. Springer, 2015. 4 +Mikayel Samvelyan, Tabish Rashid, Christian Schroeder De Witt, Gregory Farquhar, Nantas Nardelli, Tim GJ Rudner, Chia-Man Hung, Philip HS Torr, Jakob Foerster, and Shimon Whiteson. The Star-Craft multi-agent challenge. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, pp. 2186-2188, 2019. 2, 5, 6, 23 +Kajetan Schweighofer, Marius-constantin Dinu, Andreas Radler, Markus Hofmarcher, Vihang Prakash Patil, Angela Bitto-Nemling, Hamid Eghbal-zadeh, and Sepp Hochreiter. A dataset perspective on offline reinforcement learning. In Conference on Lifelong Learning Agents, pp. 470-517. PMLR, 2022. 6 +Richard S Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In Machine learning proceedings 1990, pp. 216-224. Elsevier, 1990. 18 +Richard S Sutton. Dyna, an integrated architecture for learning, planning, and reacting. ACM Sigart Bulletin, 2(4):160-163, 1991. 18 +Zhentao Tang, Yuanheng Zhu, Dongbin Zhao, and Simon M. Lucas. Enhanced rolling horizon evolution algorithm with opponent model learning: Results for the fighting game AI competition. IEEE Transactions on Games, 15(1):5-15, 2023. 2 +Qi Tian, Kun Kuang, Furui Liu, and Baoxiang Wang. Learning from good trajectories in offline multi-agent reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pp. 11672-11680, 2023. 3 +Ilya O Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, et al. MLP-Mixer: An all-MLP architecture for vision. Advances in Neural Information Processing Systems, 34: 24261-24272, 2021. 16, 23 +Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9(86):2579-2605, 2008. 9 +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 6000-6010, 2017. 4 + +Kerong Wang, Hanye Zhao, Xufang Luo, Kan Ren, Weinan Zhang, and Dongsheng Li. Bootstrapped Transformer for offline reinforcement learning. Advances in Neural Information Processing Systems, 35:34748-34761, 2022. 2 +Zhendong Wang, Jonathan J Hunt, and Mingyuan Zhou. Diffusion policies as an expressive policy class for offline reinforcement learning. In International Conference on Learning Representations, 2023. 3 +Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019. 7, 23 +Yiqin Yang, Xiaoteng Ma, Chenghao Li, Zewu Zheng, Qiyuan Zhang, Gao Huang, Jun Yang, and Qianchuan Zhao. Believe what you see: Implicit constraint approach for offline multi-agent reinforcement learning. Advances in Neural Information Processing Systems, 34:10299-10312, 2021. 3, 7, 23 +Tianhe Yu, Garrett Thomas, Lantao Yu, Stefano Ermon, James Y Zou, Sergey Levine, Chelsea Finn, and Tengyu Ma. MOPO: Model-based offline policy optimization. Advances in Neural Information Processing Systems, 33:14129-14142, 2020. 18 +Ruiqi Zhang, Jing Hou, Florian Walter, Shangding Gu, Jiayi Guan, Florian Röhrbein, Yali Du, Panpan Cai, Guang Chen, and Alois Knoll. Multi-agent reinforcement learning for autonomous driving: A survey. arXiv preprint arXiv:2408.09675, 2024. 1 +Zhengbang Zhu, Minghuan Liu, Liyuan Mao, Bingyi Kang, Minkai Xu, Yong Yu, Stefano Ermon, and Weinan Zhang. MADiff: Offline multi-agent learning with diffusion models. arXiv preprint arXiv:2305.17330, 2023a. 3, 17 +Zhengbang Zhu, Hanye Zhao, Haoran He, Yichao Zhong, Shenyu Zhang, Yong Yu, and Weinan Zhang. Diffusion models for reinforcement learning: A survey. arXiv preprint arXiv:2311.01223, 2023b. 3, 17 + +# Appendix + +# Table of Contents + +A Motivating Example: Fireboy and Watergirl 16 +B Details of the Preliminary Study 16 +C Pseudocode of Interaction-aware Synthesis 17 +D Main Differences between INS and Related Works 17 +E Comparison of the Sparsemax in Related Works 18 + +F Dataset Quality Metrics 18 + +F.1 Similarity 19 +F.2 Correlation 19 +F.3 Oracle Reward 19 +F.4 Dynamic MSE 19 +F.5 Novelty 19 + +G Additional Experimental Results 20 + +G.1 Oracle Reward Distribution Visualization 20 +G.2 Actual Value Distribution Visualization 20 +G.3 Module Ablation 21 +G.4 Synthesize from Small Datasets 21 +G.5 Computational Efficiency of Dataset Synthesis 22 + +H Information on Offline MARL Datasets 22 + +H.1 MPE Datasets 22 +H.2 SMAC Datasets 23 + +I Offline MARL Algorithm Implementation 23 + +J MA-SynthER Implementation 23 + +K Implementation Details of INS 24 + +K.1 Detailed Network Architecture 24 +K.2 Score Normalization 24 +K.3 Hyperparameters 25 +K.4 Computational Resources 25 + +# A MOTIVATING EXAMPLE: FIREBOY AND WATERGIRL + +![](images/2c40a84a9f3871db093407ea6a98631edee13d8481f42a41f94ceb572e5bf9da.jpg) +Figure A1: Motivating example. Fireboy and watergirl are situated in a grid world where they must collaborate to retrieve the diamonds located behind each other. In this environment, fireboy and watergirl cannot occupy the same grid cell, requiring them to follow different paths to reach their respective diamonds. + +![](images/0a1af5381a65c40b408421482f8611fbd0ef8f4c3635d557a91d29e8349542cb.jpg) + +![](images/96d38178a7ab869b77d9937ede07ffd927b9b6a3a45c4680db9b509485256e03.jpg) + +In this section, we present a simple motivating example to illustrate the importance of inter-agent interactions during data synthesis. As shown in Figure A1, two agents must select different paths to reach opposite ends of the grid, as they cannot occupy the same grid cell. The original dataset contains transitions where each agent follows either the upper or lower path. However, applying single-agent data synthesis methods independently, without considering inter-agent interactions, leads to the scenario depicted in Figure A1 (mid), where both agents (fireboy and watergirl) are synthesized to follow the same upper path. This transition is infeasible in the real environment, resulting in a distorted synthetic dataset. By considering inter-agent interactions, multi-agent data synthesis can effectively avoid this issue and synthesize high-quality datasets, as shown in Figure A1 (right). + +# B DETAILS OF THE PRELIMINARY STUDY + +In this section, we provide more details of the experimental setting of our preliminary study, as illustrated in Figure 1. We compare our method against three baseline approaches: Additive Noise, VAE Augmented, and MA-SynthER. The Additive Noise method (Laskin et al., 2020) augments the original dataset by introducing Gaussian noise. The VAE Augmented approach employs a variational autoencoder to learn from the original dataset and subsequently generate new data through sampling. MA-SynthER, our multi-agent implementation of SynthER (Lu et al., 2024) utilizes a diffusion model based on the MLP-Mixer architecture (Tolstikhin et al., 2021). These models synthesize transitions for each agent independently, without considering interactions between multiple agents. To adapt the Additive Noise, VAE Augmented method, and MA-SynthER for discrete action environments, we incorporated our proposed bit action module into these methods. + +Specifically, Figure 1 (left) compares the performance of MA-ICQ using various purely synthetic datasets in MPE and SMAC environments. The dashed line indicates the policy performance trained on the original dataset. Our method demonstrates superior performance compared to both the original dataset and the baseline synthetic dataset, indicating the efficacy of INS synthetic dataset in enhancing downstream policy training. Additive Noise and VAE Augmented methods yield results comparable to or even worse than the original dataset. MA-SynthER shows a modest improvement over the original dataset but underperforms relative to our proposed method, potentially due to its limited consideration of inter-agent interactions and dataset quality enhancement. Figure 1 (right) presents a comparison of various dataset metrics across different synthetic datasets. INS demonstrates consistently high performance across all dataset metrics, suggesting the effectiveness of our method in synthesizing high-quality synthetic datasets. + +# C PSEUDOCODE OF INTERACTION-AWARE SYNTHESIS + +We describe the training and synthesis processes of INS, as shown in Algorithm 1. + +Algorithm 1 Interaction-aware Synthesis +Input: Offline MARL dataset $\mathcal{D}_{\mathrm{ori.}}$ , number of candidates $\mathcal{B}$ and selection proportion $\eta$ +Output: Synthetic dataset $\mathcal{D}_{\mathrm{syn}}$ and trained joint policy $\pi$ // Diffusion model training process +1: Transform $\mathcal{D}_{\mathrm{ori.}}$ into $(|\mathcal{D}_{\mathrm{ori.}}|,n,d_x)$ shaped tensor +2: Update diffusion model $p_{\mathrm{dm}}(\pmb {x})$ and state value estimator $V_{\phi}(\pmb {o})$ with samples from $\mathcal{D}_{\mathrm{ori.}}$ using Eq.(2) and Eq.(8), respectively // Dataset synthesis process +3: Initialize synthetic dataset $\mathcal{D}_{\mathrm{syn.}} = \emptyset$ and transition candidate set $\mathcal{D}_{\mathrm{can.}} = \emptyset$ +4: for $i = 1,\dots ,\mathcal{B}$ do +5: Sample the $i$ -th new joint transition $\pmb{x}^i = (\pmb {o}^i,\pmb {a}^i,\pmb {o}'^i,r^i)$ using diffusion model $p_{\mathrm{dm}}(\pmb {x})$ +6: Add transitions into the candidate set $\mathcal{D}_{\mathrm{can}}$ +7: Calculate the value of each candidate transition using state value estimator $V_{\phi}(o^{i})$ +8: end for +9: Select a proportion $\eta$ of the candidate set by their values +10: Add all transitions of selected candidates to $\mathcal{D}_{\mathrm{syn}}$ // Policy training process +11: Initialize and train the offline MARL policy $\pi$ using $\mathcal{D}_{\mathrm{syn}}$ +12: return $\mathcal{D}_{\mathrm{syn.}}$ and $\pi$ + +# D MAIN DIFFERENCES BETWEEN INS AND RELATED WORKS + +Diffusion Models in Offline MARL. Diffusion models (Ho et al., 2020; Karras et al., 2022), as a powerful class of generative models, have recently been adopted in reinforcement learning as planners and policies (Zhu et al., 2023b; Li et al., 2024b). In this section, we discuss related works, MTDiff-S (He et al., 2024), SynthER (Lu et al., 2024) and MADiff (Zhu et al., 2023a), to clarify the differences between our approach and existing methods. Motivationally, both MTDiff-S and SynthER are designed for single-agent settings. MTDiff-S generates data at the trajectory level for unknown tasks, focusing on multi-task scenarios, which is why it is not included as a baseline in our work. SynthER, on the other hand, generates data at the transition level and is applicable to both online and offline reinforcement learning. Unlike these methods, INS is specifically designed for multi-agent environments, incorporating inter-agent interactions during synthesis to produce enhanced datasets for improving offline MARL performance. Technically, MTDiff-S adopts a Transformer architecture, treating trajectory generation as a sequence modeling problem, while SynthER employs an MLP-Mixer architecture. In contrast, INS uses a Sparse Transformer Encoder architecture, treating each agent as an individual token input. Additionally, neither MTDiff-S nor SynthER can handle discrete action spaces, whereas INS achieves this compatibility action spaces through bit action. MADiff is an offline MARL method, which models a planner as a return-conditional diffusion model to maximize the cumulative reward. At each time step, MADiff generates a trajectory of length $H - 1$ based on the agent's current or historical observations and then uses only the observations $(o_t, o_{t+1})$ along with an inverse dynamics model to determine the action $a_t$ . + +- Theoretically, data synthesis in reinforcement learning often refers to the ability to generate data that can be used to train policies, rather than directly engaging in decision-making (as a planner or policy) (Dong et al., 2024; Cho et al., 2022). In two overviews on diffusion models for RL (Dong et al., 2024; Zhu et al., 2023b), MADiff is consistently categorized as a planner (notably, the first author of Zhu et al. (2023b) is also the first author of MADiff). In contrast, INS and SynthER generate synthetic data without maximizing rewards or selecting actions, and should therefore be categorized under Data Synthesizers. Thus, we believe that MADiff and our method are + +Table A1: A comparison of INS and the related works. + +
MethodKey FeatureInputOutputRequires Real StateRequires PolicyAction Space
SynthERData Synthesizer (single-agent)None{o,a,o',r}NoNoContinuous
MTDiff-SMulti-task Data Synthesizer (single-agent)ht{ot+i, at+i, oti+i+1, rt+i}i=1,...,H-1YesNoContinuous
MADiffPlannerot,r{ot+i}i=1,...,H-1YesNoNone
MOMA-PPOModel-based MARL (Dyna)ht,π{(hj,aj, rj)}j=t,...,t+k-1YesYesNone
INS (ours)Data SynthesizerNone{o,a,o',r}NoNoContinuous/Discrete
+ +fundamentally different. Furthermore, MADiff generates observation sequences based on the agent's current state and only uses the next observation $(o_{t}, o_{t+1})$ to produce an action, meaning it cannot generate a dataset from scratch that can be used for policy training. In contrast, our method requires no input and can generate a complete dataset of transitions $\{(o_{t}, a_{t}, o_{t+1}, r_{t})\}$ suitable for subsequent offline multi-agent reinforcement learning. + +- Technically, while both MADiff and our approach leverage the generative capabilities of diffusion models, we believe this similarity may cause confusion. In terms of the learned targets, MADiff trains on observation sequences $o_t$ , while INS learns from transitions $(o_t, a_t, o_{t+1}, r_t)$ . When it comes to the generated output, MADiff produces observation sequences for inverse decision-making, while INS generates multiple transitions $(o_t, a_t, o_{t+1}, r_t)$ that form a dataset. In terms of training, MADiff uses classifier-free guidance, requiring the agent's current observation and team rewards as inputs, whereas our method needs no input and can generate multi-agent datasets from scratch. + +Model-based MARL. Model-based multi-agent reinforcement learning involves interacting with a predictive model of the environment, often referred to as a world model (Ha & Schmidhuber, 2018), to facilitate policy learning (Sutton, 1991). One class of these methods relevant to INS optimizes a policy by unrolling trajectories "in the imagination" of the world model (Yu et al., 2020; Barde et al., 2024). They employ the world model as a simulator, which takes the current observation and action as input to predict the next observation and reward. We note that our method shares some similarities with model-based MARL, particularly with Dyna-like algorithms (Sutton, 1990), which involve unrolling trajectories "in the imagination" of the world model to optimize a policy. In contrast, INS is a data synthesis method that generates new experiences without starting from a real state or the current policy, and the generated experiences follow the distribution of the dataset. Moreover, INS is an orthogonal method that can be combined with forward dynamics models by generating initial states via diffusion, potentially enhancing diversity. A summary of the differences between INS and the related works mentioned above is provided in Table A1. + +# E COMPARISON OF THE SPARSEMAX IN RELATED WORKS + +In OPT (Liu et al., 2024) and SparseMAAC (Li et al., 2019), sparsemax is used to extract relationships between the real observations of multiple agents, enabling agents to focus on specific targets during inference, which helps in effective decision-making. Therefore, in these works, the input to sparsemax is the encoding of agent observations or observation-action pairs, and the output is used for subsequent action generation or Q-value computation. In contrast, our work is a generative task, where sparsemax is applied during the denoising process of transitions (which are initially sampled entirely from noise). During training, sparsemax learns the interaction patterns present in the dataset, and during synthesis, it progressively incorporates agent interactions into the noise, rather than extracting pre-existing relationships. Therefore, we believe the role of sparsemax in INS is fundamentally different from its role in the aforementioned works. + +# F DATASET QUALITY METRICS + +In this section, we define the metrics employed to assess the quality of the synthetic dataset. Our evaluation framework consists of five distinct metrics: Similarity, Correlation, Oracle Reward, Dynamic Mean Squared Error (MSE), and Novelty. The Similarity and Correlation metrics quantify the statistical fidelity and relational consistency between the synthetic and original datasets, while the Oracle Reward metric evaluates the true reward magnitudes associated with the synthetic data. + +The Dynamic MSE metric assesses the fidelity of the synthetic data to the environment dynamics, quantifying how accurately it represents the transitions. The Novelty metric quantifies the uniqueness and diversity of the synthetic dataset, providing insights into its coverage of the observation-action space. All metrics are computed from $200K$ samples from each synthetic dataset. The formal mathematical definitions and computational procedures of these metrics are provided below. + +# F.1 SIMILARITY + +This metric means Kolmogorov-Smirnov (KS) distance (Massey Jr, 1951), which measures the maximum distance between the cumulative distribution functions of the original and synthetic datasets. The Similarity is defined as: + +$$ +\operatorname {S i m i l a r i t y} \left(\mathcal {D} _ {\text {o r i .}}, \mathcal {D} _ {\text {s y n .}}\right) = \sup _ {\boldsymbol {x}} \left| F _ {\text {o r i .}} (\boldsymbol {x}) - F _ {\text {s y n .}} (\boldsymbol {x}) \right|, \tag {A1} +$$ + +where $F_{\mathrm{ori.}}(\pmb {x})$ and $F_{\mathrm{syn.}}(\pmb {x})$ are the cumulative distribution functions of the original and synthetic datasets, respectively. + +# F.2 CORRELATION + +This metric is pairwise rank Pearson correlation (Fieller et al., 1957), which measures the statistical relationship between the original and synthetic datasets. The Correlation is defined as: + +$$ +\operatorname {C o r r e l a t i o n} \left(\mathcal {D} _ {\text {o r i .}}, \mathcal {D} _ {\text {s y n .}}\right) = \frac {\sum \left(\operatorname {r a n k} _ {\text {o r i .}} \left(\boldsymbol {x} _ {i}\right) - \bar {r} _ {\text {o r i .}}\right) \left(\operatorname {r a n k} _ {\text {s y n .}} \left(\boldsymbol {x} _ {i}\right) - \bar {r} _ {\text {s y n .}}\right)}{\sqrt {\sum \left(\operatorname {r a n k} _ {\text {o r i .}} \left(\boldsymbol {x} _ {i}\right) - \bar {r} _ {\text {o r i .}}\right) ^ {2} \sum \left(\operatorname {r a n k} _ {\text {s y n .}} \left(\boldsymbol {x} _ {i}\right) - \bar {r} _ {\text {s y n .}}\right) ^ {2}}}, \tag {A2} +$$ + +where $\mathrm{rank}(\pmb{x}_i)$ is the rank of joint transition $\pmb{x}_i$ , and $\bar{r}$ is the mean rank of the dataset. + +# F.3 ORACLE REWARD + +This metric is the average true reward of the synthetic dataset, which measures the optimality of synthetic data. The Oracle Reward is defined as: + +$$ +\operatorname {O r a c l e R e w a r d} \left(\mathcal {D} _ {\text {s y n .}}\right) = \frac {1}{\left| \mathcal {D} _ {\text {s y n .}} \right|} \sum_ {\boldsymbol {x} \in \mathcal {D} _ {\text {s y n .}}} r _ {\text {t r u e}}, \tag {A3} +$$ + +where the true reward $r_{\mathrm{true}}$ is obtained by querying the environment with the generated joint observations and actions $(o, a)$ . + +# F.4 DYNAMIC MSE + +This metric is the mean squared error (MSE) between the predicted next observation and the true next observation, which evaluates how well synthetic data fits the environment dynamics. Prior to error computation, we normalize each observation. The Dynamic MSE is defined as: + +$$ +\operatorname {D y n a m i c M S E} \left(\mathcal {D} _ {\text {s y n .}}\right) = \frac {1}{\left| \mathcal {D} _ {\text {s y n .}} \right|} \sum_ {\boldsymbol {x} \in \mathcal {D} _ {\text {s y n .}}} \left(\mathcal {P} (\boldsymbol {o}, \boldsymbol {a}) - \boldsymbol {o} ^ {\prime}\right) ^ {2}, \tag {A4} +$$ + +where $\mathcal{P}(\pmb{o},\pmb{a})$ is the true next state by the environment dynamics. + +# F.5 NOVELTY + +This metric is the average distance between synthetic data and the closest original dataset, which quantifies the uniqueness of datasets. The Novelty is defined as: + +$$ +\text {N o v e l t y} \left(\mathcal {D} _ {\text {s y n .}}, \mathcal {D} _ {\text {o r i .}}\right) = \frac {1}{\left| \mathcal {D} _ {\text {s y n}} \right|} \sum_ {\boldsymbol {x} \in \mathcal {D} _ {\text {s y n .}}} \min _ {\bar {\boldsymbol {x}} \in \mathcal {D} _ {\text {o r i .}}} \left(\left(\boldsymbol {o}, \boldsymbol {a}\right) - \left(\bar {\boldsymbol {o}}, \bar {\boldsymbol {a}}\right)\right) ^ {2}, \tag {A5} +$$ + +where $\bar{\pmb{x}}$ is the nearest neighbor of $\pmb{x}$ in the original dataset. + +# G ADDITIONAL EXPERIMENTAL RESULTS + +# G.1 ORACLE REWARD DISTRIBUTION VISUALIZATION + +We visualize the reward of the original dataset and real reward computed from the environment using observation and action generated from MA-SynthER and INS to visualize that INS can improve the data distribution to high reward region while preserving environmental dynamics. Figure A2 presents these distributions. The results demonstrate that our method effectively enhances the proportion of high-reward transitions in the dataset while simultaneously broadening the overall range of rewards compared to the original dataset. This dual improvement is particularly beneficial for subsequent policy learning, as it provides a richer and more diverse reward landscape for agents to learn from. + +![](images/56d56e1a081c1458a75ba3b4a2121fba6bd022837e9d3354ca26ffd004dbe453.jpg) +(a) Spread-Expert + +![](images/ad55d9d298f0775b5043c82d57f7c0e1c49cc7047d7d5317f8867cc77992e267.jpg) +(b) Spread-Medium +Figure A2: Oracle reward distribution visualization. Comparison of the oracle reward distributions among original, MA-SynthER, and INS datasets. + +# G.2 ACTUAL VALUE DISTRIBUTION VISUALIZATION + +To further evaluate the impact of our method on dataset quality, we visualize the actual value distributions of the original, MA-SynthER, and INS datasets, as shown in Figure A3. We first train a policy on the dataset and then obtain the actual value for the trained policy by running it in the real environment. The results demonstrate that our method effectively enhances the value distribution of transitions in the dataset under the policy, while the value distribution of MA-SynthER synthetic data exhibits a decrease compared to the original dataset. + +![](images/670544c1a35b91b98b2ebfaca5b72ad95b22b0c2b8df73345bb99fb46174a5f2.jpg) +(a) Spread-Expert +Figure A3: Actual value distribution visualization. Comparison of the actual value distributions among original, MA-SynthER, and INS datasets. + +![](images/e9c20d71ab886cdf5d0d84929c26e54dbd7bda917941ae2567121e6e81ae5cb6.jpg) +(b) Spread-Medium + +# G.3 MODULE ABLATION + +We conduct more ablation studies on the components of INS across 14 datasets from 4 different scenarios. These include replacing the sparse attention mechanism in the Transformer Encoder with a dense attention mechanism (w/o sparse), removing the select mechanism retaining all synthetic data (w/o select), and replacing the attention module with an MLP, allowing each agent to independently synthesize transitions (w/o attention). In the w/o attention variant, we concatenate the transitions of individual agents and replace the attention module in the Transformer Encoder with multiple MLPs, removing the dot-product and Sparsemax components. This modification results in each agent synthesizing transitions independently, disregarding interactions between agents. The results are shown in the Figure A4. The results demonstrate that the attention mechanism significantly enhances agents' ability to learn inter-agent interactions, improving synthetic data accuracy and policy performance. The select mechanism effectively screens high-value transitions, which is particularly crucial in complex environments like SMAC. Additionally, the sparse attention mechanism reduces redundant information in agent interactions, mitigating distraction impact. + +![](images/546984edebf0a357c6b05ffb886234dab05db87c3e9351faa7994e8837808f87.jpg) +Figure A4: Module ablation on different datasets. The normalized average score of the downstream policy with INS ablation variants. + +# G.4 SYNTHESIZE FROM SMALL DATASETS + +We evaluate the scalability of our method across 8 datasets from 4 different scenarios. The results show that, when using only $10\%$ of the original dataset, our method often achieves performance comparable to that of the original dataset. With $50\%$ of the dataset, the policy consistently outperforms the original dataset. The quality of the original dataset also impacts scalability. On expert-level datasets, where a higher proportion of high-quality samples remain even after downscaling, our method demonstrates better scalability, particularly when using just $10\%$ of the data. + +Table A2: Synthesize transitions from a small dataset. We use four different scenarios for exploration, each scenario includes two different quality datasets. + +
DatasetOriginal10%50%100%
SpreadExpert102.8101.9106.8107.0
Medium26.824.528.430.2
TagExpert111.7110.9113.1114.2
Medium62.361.263.564.7
3mGood18.118.019.319.9
Medium16.915.617.818.5
5m_vs_6mGood16.316.316.817.2
Medium12.811.912.913.9
+ +# G.5 COMPUTATIONAL EFFICIENCY OF DATASET SYNTHESIS + +To evaluate the computational efficiency of INS, we measured the time taken by INS to generate $1M$ transitions and compared it with the time required to collect $1M$ transitions through environment interactions using trained policies. The results in Table A3 show that INS is significantly more time-efficient than collecting data via direct environment interactions, while still maintaining high dataset quality. We believe this demonstrates that dataset synthesis is a promising avenue for MARL, where generative methods like INS can be employed to synthesize multi-agent datasets, reducing the time and challenges associated with data collection in real-world environments. + +Table A3: Computational efficiency of INS. + +
ScenarioINSCollecting by agents
spread1540s2728s (MAPPO)
3m2396s9243s (QMIX)
+ +# H INFORMATION ON OFFLINE MARL DATASETS + +![](images/7a0a8d30ef977c26d7f6fa336184de600a0804692e8959edb0b027e009f5b2b8.jpg) +(a) MPE + +![](images/42a83bc152d2d25318461962f9749b8a6312675c51ab9124dbf63679be041360.jpg) +(b) SMAC +Figure A5: MPE and SMAC environment examples. + +# H.1 MPE DATASETS + +Multi-Agent Particle Environment (MPE) (Lowe et al., 2017) is a multi-agent particle environment where particles can execute continuous observations and actions, as illustrated in Figure A5(a). Our study employed three distinct MPE scenarios. The Spread environment consists of three agents and three landmarks, where the agents' objective is to learn collision avoidance while ensuring complete landmark coverage. The Tag scenario involves one pre-trained prey, three predators, and two obstacles, requiring the predators to collaborate in capturing the prey. The World environment, similar to Tag, includes one pre-trained prey and three predators; however, the prey agent must locate food within the map and can utilize forest areas for hiding. + +For our MPE experiments, we used dataset1 provided by OMAR (Pan et al., 2022). This comprehensive dataset comprises multiple subsets of varying quality. The random datasets are generated using a randomly initialized policy for one million steps. The medium replay (md-replay) dataset is obtained by recording all samples in the buffer when training achieves a medium performance level. The medium dataset was derived from a partially trained policy with medium performance, while the expert dataset was generated using a fully trained policy. It is worth noting that OMAR utilizes an earlier version of MPE, which allows agents to potentially receive different rewards. However, we find that the different rewards for agents only occur infrequently and do not significantly impact the predominantly cooperative nature of the environments. + +# H.2 SMAC DATASETS + +The StarCraft Multi-Agent Challenge (SMAC) (Samvelyan et al., 2019) is a widely recognized benchmark in the MARL field, as shown in Figure A5(b). The SMAC environment simulates battle scenarios between two competing teams. One team is controlled by built-in artificial intelligence, while the other is managed by policies learned through MARL algorithms. Our experiments utilized three distinct maps: the $3\mathrm{m}$ map, where both sides command three marines; the $8\mathrm{m}$ map, featuring eight marines on each side; and the $5\mathrm{m\_vs\_6m}$ map, where our team controls five marines against an enemy force of six. + +For our SMAC experiments, we employ the off-the-grid dataset1 (Formanek et al., 2023), which provides good, medium, and poor quality datasets for each map. These datasets were generated using three independently trained QMIX policies. To enhance behavioral diversity, a modest amount of exploration noise was introduced to the policies during data collection. + +# I OFFLINE MARL ALGORITHM IMPLEMENTATION + +This section details the implementation of various offline MARL algorithms. + +- MA-ICQ² (Yang et al., 2021) implicit constraint Q-learning to multi-agent settings, introducing a decomposed multi-agent joint-policy under implicit constraints. By relying solely on state-action pairs provided in the dataset, this approach effectively mitigates extrapolation errors. +- MA-CQL $^3$ (Kumar et al., 2020) adapts the conservative Q-learning framework to multi-agent environments. This algorithm addresses the overestimation problem by adjusting Q-values for both policy samples and dataset state-action pairs, resulting in more conservative and reliable policy updates. +- MA-BCQ $^4$ (Wu et al., 2019), the multi-agent version of BCQ, implements decentralized multi-agent reinforcement learning using value deviation and transition normalization to achieve coordinated policies. +- $\mathbf{OMAR}^5$ (Pan et al., 2022) employs zeroth-order optimization in conjunction with multi-agent CQL, enhancing coordination among agents' policies. In implementing these offline MARL algorithms, we adhere to the hyperparameters specified in their respective original papers to ensure consistency and reproducibility of results. + +# J MA-SYNTHER IMPLEMENTATION + +We implement MA-SynthER, a multi-agent implementation of SynthER (Lu et al., 2024), which extends the synthetic data generation approach to multi-agent settings. MA-SynthER employs a diffusion model based on the MLP-Mixer (Tolstikhin et al., 2021) architecture to generate transition-level data (observation, action, reward, and next observation) for multiple agents. This model synthesizes transitions for each agent independently, without considering interactions between multiple agents. We built MA-SynthER upon the code6 provided by authors, adapting it to the multi-agent context. Our implementation maintains consistency with the original SynthER by adopting the same hyperparameters and training settings. + +# K IMPLEMENTATION DETAILS OF INS + +# K.1 DETAILED NETWORK ARCHITECTURE + +In this subsection, we detail the diffusion model architecture of INS, as shown in Figure A6. The architecture begins with a shared embedding layer that processes each agent's transition, denoted as $x_{i} = (o_{i},a_{i},r,o_{i}^{\prime})$ . Subsequently, the embedded transition is projected into query, key, and value vectors, which serve as inputs to a sparse attention mechanism. The output of the attention mechanism is combined with the input through a residual connection and normalized, after which it is transformed by a feedforward neural network with ReLU activation. The block's final representation is obtained by applying layer normalization to the feedforward network's output. The transformer encoder typically stacks this block $N$ times to enhance model depth. Our implementation utilizes a stack of 4 such blocks. To enhance the model's expressive capacity, we implement multi-head attention with 4 heads, extending the sparse attention mechanism. The diffusion model incorporates temporal information by integrating a step embedding vector $k$ . This embedding is concatenated with the agent's transition before being fed into the network. + +Extending to Synthesize Global States. For certain MARL algorithms that require a global state $s$ , we can extend the input of the diffusion model to generate the global state $s$ . Specifically, instead of modeling joint local transitions with diffusion tuples of the form $(o, a, o', r)$ , we could model expanded tuples of the form $(o, a, o', s, r)$ , and so on. This allows the method to be applied to value decomposition models that require a global state. + +![](images/581b96f59b4c803a28e48af920526ef94dc1525e84d0ec3dfc6fa645445ec7d5.jpg) +Figure A6: The detailed diffusion model architecture of INS. + +# K.2 SCORE NORMALIZATION + +Following Pan et al. (2022) and Fu et al. (2020), the average scores of MPE datasets in Table 1 are normalized by the expert and random scores on each task. Denote the original episodic return as $S$ , then the normalized score $S_{\mathrm{norm}}$ is computed as + +$$ +S _ {\text {n o r m}} = 1 0 0 \times \frac {S - S _ {\text {r a n d o m}}}{S _ {\text {e x p e r t}} - S _ {\text {r a n d o m}}}, \tag {A6} +$$ + +where $S_{\mathrm{random}}$ and $S_{\mathrm{expert}}$ are the average scores of the random and expert datasets, respectively. Besides, the score 0 corresponds to a random policy performance and 100 corresponds to an expert policy performance. + +# K.3 HYPERPARAMETERS + +In this subsection, we first list the key hyperparameters of INS in Table A4. The noise level of the diffusion model is encoded by a Random Fourier Feature (RFF) (Rahimi & Recht, 2007) embedding. + +Table A4: INS Hyperparameters. + +
HyperparameterValue
Selection proportion0.8
Embedding dimension64
Number of attention heads4
Number of blocks2
Dropout0.1
Batch size1024
OptimizerAdam
Learning rate2 × 10-4
Weight decay10-4
Learning rate scheduleCosine annealing warmup
RFF dimension16
Training steps1e6
+ +For the diffusion sampling process, we use the SDE sampler of Karras et al. (2022) with the default hyperparameters used for SynthER (Lu et al., 2024), given in Table A5. In the implementation of downstream offline MARL algorithms, we use the hyperparameters specified in their respective original papers to ensure consistency and reproducibility of results. + +Table A5: Diffusion Sampling Hyperparameters following EDM (Karras et al., 2022). + +
HyperparameterValue
Diffusion steps128
σmin0.002
σmax80
Schurn80
Smin0.05
Smax50
Snoise1.003
+ +# K.4 COMPUTATIONAL RESOURCES + +Most experiments are conducted on a server equipped with an Intel(R) Xeon(R) Gold 6442Y and two NVIDIA RTX A6000 GPUs. The training time of INS is about $7 \sim 9$ hours for each task, the synthesizing time is about $1.5 \sim 3$ hours, and the training time of offline MARL policies varies depending on the specific algorithm. \ No newline at end of file diff --git a/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/images.zip b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cbe2a30e0b8726f2010ec6a637c1a68eb8570baf --- /dev/null +++ b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89d94fe870ee0d6d67d4fecadfb49babcf2dde7f12f33b4c40b2d9ed1edfe697 +size 821688 diff --git a/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/layout.json b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7d3512817315f066b52ce987ac96b0504ee0f537 --- /dev/null +++ b/ICLR/2025/INS_ Interaction-aware Synthesis to Enhance Offline Multi-agent Reinforcement Learning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5c5727d33fff78fa0ec1ea809ee711d0d852aa157b42b86a6ece340f39dcb6d +size 743657 diff --git a/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_content_list.json b/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..21fcbc40f897efde9741156f54846c10aa450f42 --- /dev/null +++ b/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f87fe9617f8121714ff152b79215dbbd322377c756e4a11bd0ae7115b05deb1e +size 170266 diff --git a/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_model.json b/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..68f3434eacc97b134b08003e268155bc9d8c0cfd --- /dev/null +++ b/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc0c838ff47ca2edd2e050b5a74abf10ca6fe5ce169d1a95e7ecab8c3d1d28f5 +size 199630 diff --git a/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_origin.pdf b/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c5ee74921f85070d79ba988ec39cc63e93e4c6d0 --- /dev/null +++ b/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/87ad92f9-6331-44f6-a8c5-88b423a3b1a8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56c7631d5e465a0064fc6c17b442130363d40479fd2f78765592874e64246eda +size 12339441 diff --git a/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/full.md b/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ed1398d3e3532b236f94eb4ddb0cb95279b2bb0a --- /dev/null +++ b/ICLR/2025/IPDreamer_ Appearance-Controllable 3D Object Generation with Complex Image Prompts/full.md @@ -0,0 +1,922 @@ +# IPDREAMER: APPEARANCE-CONTROLLABLE 3D OBJECT GENERATION WITH COMPLEX IMAGE PROMPTS + +Bohan Zeng $^{1*}$ , Shanglin Li $^{4*}$ , Yutang Feng $^{4*}$ , Ling Yang $^{1\dagger}$ , Juan Zhang $^{4‡}$ , Hong Li $^{1}$ , Jiaming Liu $^{3}$ , Conghui He $^{7}$ , Wentao Zhang $^{1}$ , Jianzhuang Liu $^{2}$ , Baochang Zhang $^{4‡}$ , Shuicheng Yan $^{5,6}$ + +1Peking University 2Shenzhen Institute of Advanced Technology 3Tiamat AI + +4Beihang University 5Skywork AI 6National University of Singapore + +7Shanghai AI Laboratory + +# ABSTRACT + +Recent advances in 3D generation have been remarkable, with methods such as DreamFusion leveraging large-scale text-to-image diffusion-based models to guide 3D object generation. These methods enable the synthesis of detailed and photorealistic textured objects. However, the appearance of 3D objects produced by such text-to-3D models is often unpredictable, and it is hard for single-image-to-3D methods to deal with images lacking a clear subject, complicating the generation of appearance-controllable 3D objects from complex images. To address these challenges, we present IPDreamer, a novel method that captures intricate appearance features from complex Image Prompts and aligns the synthesized 3D object with these extracted features, enabling high-fidelity, appearance-controllable 3D object generation. Our experiments demonstrate that IPDreamer consistently generates high-quality 3D objects that align with both the textual and complex image prompts, highlighting its promising capability in appearance-controlled, complex 3D object generation. https://github.com/zengbohan0217/IPDreamer + +# 1 INTRODUCTION + +The rapid evolution of 3D technology has revolutionized the way we create and interact with virtual worlds. 3D technology is now essential in a wide range of fields, including architecture, gaming, mechanical manufacturing, and AR/VR. However, creating high-quality 3D content remains a challenging and time-consuming task, even for experts. To address this challenge, researchers have developed text-to-3D methodologies that automate the process of generating 3D assets from textual descriptions. Built on the 3D scene representation capabilities of Neural Radiance Fields (NeRFs) (Mildenhall et al., 2021; Müller et al., 2022) and the rich visual prior knowledge of pretrained diffusion models (Rombach et al., 2022; Sahara et al., 2022a), recent research (Jain et al., 2022; Mohammad Khalid et al., 2022; Poole et al., 2022; Lin et al., 2023; Chen et al., 2023b; Wang et al., 2023; Shi et al., 2023b) has made significant progress, simplifying the text-to-3D pipeline and making it more accessible, which causes a significant shift in these fields. + +Recent advances in diffusion models have significantly enhanced the capabilities of text-to-image generation. State-of-the-art (SOTA) systems, leveraging cutting-edge diffusion-based techniques (Nichol et al., 2021; Rombach et al., 2022; Brooks et al., 2023; Zhang & Agrawala, 2023; Hu et al., 2021), can now generate and modify images directly from textual descriptions with vastly improved quality. Inspired by the rapid development in text-to-image generation, recent works (Poole et al., 2022; Lin et al., 2023; Chen et al., 2023b; Wang et al., 2023) have extended these models to 3D by utilizing pretrained text-to-image diffusion models in conjunction with the Score Distillation Sampling (SDS) algorithm and its variants to optimize 3D representations. These methods are capable of + +![](images/b46f051f135cba9f8c0039c8c45688825785c878ea0bbcf3a5047bb57c9c272a.jpg) +Figure 1: IPDreamer can generate controllable, high-quality 3D objects based on both textual and image prompts. (a) illustrates two high-quality 3D objects with rich details, initialized by the same NeRF model and guided by different complex reference image prompts. (b) demonstrates the 3D synthesis under challenging textual conditions, where our method outperforms existing text-to-3D method (Wang et al., 2023), image-to-3D methods LGM (Tang et al., 2024) and zero123++ (Shi et al., 2023a). Besides, the input image in (b) is generated by SD Rombach et al. (2022). + +generating high-quality 3D objects and scenes. However, due to the lack of explicit appearance information in textual prompts, the appearance of the generated results remains largely uncontrollable, limiting the precision of the visual output. + +Unlike the unpredictability in text-to-3D generation, single-image-to-3D generation allows for strict control over the appearance of the generated 3D results. However, existing single-image-to-3D methods (Liu et al., 2023b;c; Shi et al., 2023b) are limited to simple images with clear subjects, often struggling with complex images that feature rich content and intricate compositions. For example, Fig.1(a) contains complex images that lack a clear subject, making it difficult to segment a simple, singular image for single-image-to-3D generation. Furthermore, as demonstrated in Fig.1(b), when text prompts are ambiguous or lack a clear main subject—such as "Leaves flying in the wind"—neither current text-to-3D nor image-to-3D methods can achieve reasonable 3D synthesis. + +To tackle these challenges, we introduce IPDreamer, a novel method for complex image-to-3D generation. Specifically, we extend SDS to Image Prompt Score Distillation Sampling (IPSDS), which leverages detailed features extracted from complex image prompts and corresponding normal maps to guide the optimization of both 3D mesh texture and geometry. With IPSDS, IPDreamer enables high-quality 3D object generation with controllable appearances based on complex image inputs. To ensure stable 3D object generation across various challenging scenarios, we propose a mask-guided compositional alignment strategy for IPSDS, enabling 3D object generation from multiple complex image prompts. In particular, we leverage a Multimodal Large Language Model (MLLM) to localize the features from multiple image prompts onto the generated 3D objects. This allows IPDreamer to handle diverse situations, including cases where multiple highly divergent images are used to guide the synthesis of a single 3D object, and scenarios where the guiding complex image exhibits significant structural differences from the initial coarse 3D object. As shown in Fig.1(a), IPDreamer effectively transfers the appearances of reference images to NeRF models, generating high-quality 3D objects even in cases with ambiguities or unclear primary subjects. For the more challenging scenarios illustrated in Fig.1(b), IPDreamer successfully produces the desired 3D object where existing text-to-3D and single-image-to-3D methods fall short. + +In summary, the main contributions of this paper are as follows: + +- We present IPDreamer, a novel 3D object synthesis framework that allows users to consistently create controllable, high-quality 3D objects. Compared with previous methods, + +IPDreamer excels in synthesizing high-quality 3D objects that closely align with complex image prompts. + +- We introduce Image Prompt Score Distillation Sampling (IPSDS), which utilizes a substantial image prompt feature to guide 3D mesh optimization. +- We propose a Mask-guided Compositional Alignment strategy for IPSDS, enabling high-quality 3D objects synthesis based on multiple complex image prompts, in cases where initial NeRF models deviate significantly from the provided image prompts, or when multiple diverse image prompts are needed to guide the synthesis of a single 3D object. +- Comprehensive experiments show that IPDreamer achieves high-quality 3D generation and excellent rendering results, outperforming existing SOTA methods. + +# 2 RELATED WORK + +# 2.1 DIFFUSION MODELS + +Diffusion models (DMs) were initially introduced as a generative model for gradually denoising images corrupted by Gaussian noise to generate samples (Sohl-Dickstein et al., 2015). Recent advancements in DMs (Ho et al., 2020; Song et al., 2020; Dhariwal & Nichol, 2021; Vahdat et al., 2021; Rombach et al., 2022; Peebles & Xie, 2022) have shown their exceptional performance in image synthesis. DMs have also achieved state-of-the-art results in various synthesis tasks, including text-to-image generation (Saharia et al., 2022a; Nichol et al., 2021; Ramesh et al., 2022; Podell et al., 2024; Yang et al., 2024), inpainting (Avrahami et al., 2022; Lugmayr et al., 2022; Ye et al., 2023), 3D object synthesis (Li et al., 2022b; Luo & Hu, 2021), video synthesis (Ho et al., 2022b;a), speech synthesis (Kong et al., 2020; Liu et al., 2021), super-resolution (Li et al., 2022a; Saharia et al., 2022b; Gao et al., 2023), face animation (Qi et al., 2023), text-to-motion generation (Tevet et al., 2022), and brain signal visualization (Takagi & Nishimoto, 2022; 2023). Some DMs (Kulikov et al., 2022; Wang et al., 2022) can produce diverse results by learning the internal patch distribution from a single image. (Mokady et al., 2023; Tumanyan et al., 2023; Wu et al., 2023; Geyer et al., 2023) enhance image/video editing with pre-trained DMs in a zero-shot or one-shot manner. These advancements highlight the versatility and potential of DMs across a wide range of syntheses. + +# 2.2 CONTROLLABLE GENERATION AND EDITING + +Controllable generation and editing of 2D images and 3D objects are core goals of generative tasks. With the emergence of large language models (LLMs) such as GPT-3 and Llama (Brown et al., 2020; Touvron et al., 2023a;b), instruction-based user-friendly generative control has gained much attention. InstructPix2Pix (Brooks et al., 2023) and MagicBrush (Zhang et al., 2023a) build datasets based on LLMs and large text-to-image models to achieve effective instruction control on 2D images. InstructNeRF2NeRF (Haque et al., 2023) combines this method with NeRF scene reconstruction (Mildenhall et al., 2021) to introduce instruction control into 3D generation. Meanwhile, a series of adapter methods such as ControlNet and IP-Adapter (Zhang & Agrawala, 2023; Hu et al., 2021; Mou et al., 2023; Zhao et al., 2023b; Ye et al., 2023; Huang et al., 2023) provide reliable approaches for fine-tuning large pre-trained DMs (e.g., Stable Diffusion (Rombach et al., 2022) and Imagen (Saharia et al., 2022a)) for conditional controllable generation (e.g., using sketch, canny, pose, etc. to control image structure). Among them, image prompt adaption methods (Ye et al., 2023; Zhang et al., 2023b) introduce a decoupled cross-attention mechanism to achieve effective appearance generation control using image prompts. + +# 2.3 3D GENERATION + +In recent years, 3D generative modeling has attracted a large number of researchers. Inspired by the recent neural volume rendering, many 3D-aware image rendering methods (Chan et al., 2022; 2021; Gu et al., 2021; Hao et al., 2021; Niemeyer & Geiger, 2021) are proposed to generate high-quality rendered 2D images for 3D visualization. Meanwhile, with the development of text-to-image synthesis, researchers have shown a growing interest in text-to-3D generation. Early methods such as DreamField (Jain et al., 2022) and CLIPmesh (Mohammad Khalid et al., 2022) achieve text-to-3D generation by utilizing a pretrained image-text aligned model CLIP (Radford et al., 2021). They + +![](images/9d29bca1fe34729cdad18c490e043445cd958d80d94b0cb607c0ee9a635acdf1.jpg) + +![](images/05a831c91bf5a96f9235e4f32008811cc5871be585fd0341c378550cf7c5220a.jpg) +Figure 2: IPDreamer is designed to generate high-quality, appearance-controllable 3D meshes that align with single/multiple complex image prompts. + +optimize the underlying 3D representations (NeRFs and meshes) to ensure that all 2D renderings have high text-image alignment scores. Recently, (Poole et al., 2022; Lin et al., 2023; Chen et al., 2023b; Wang et al., 2023; Chen et al., 2023a) have achieved high-quality 3D synthesis (NeRFs and meshes) by leveraging a robust pretrained text-to-image DM as a strong prior to guiding the training of the 3D model. Other works (Shi et al., 2023b; Zhao et al., 2023a; Liu et al., 2023b) introduce multi-view DMs to enhance 3D consistency and provide strong structured semantic priors for 3D synthesis. IT3D (Chen et al., 2023c) combines SDS and GAN to refine the 3D model and obtain high-quality 3D synthesis. (Tang et al., 2023a; Liang et al., 2023) combine 3D Gaussians (Kerbl et al., 2023) with SDS-based optimization to improve 3D synthesis and reduce generation time. Additionally, (Melas-Kyriazi et al., 2023; Tang et al., 2023b; Liu et al., 2023a; Qian et al., 2023) are capable to generate 3D representations based on single images, and (Liu et al., 2023b;c; Shi et al., 2023b; Yang et al., 2023) achieve 2D images in multiple viewpoints, which enable consistent 3D object generation. In this work, we introduce IPDreamer, a method that leverages complex image prompts to provide comprehensive appearance information, effectively guiding the synthesis of high-quality 3D objects. + +# 3 METHOD + +In this section, we present the details of IPDreamer. We start with a brief definition of 3D mesh, followed by the problem statement for text-to-3D and single-image-to-3D generation, and a review of SDS preliminaries. Next, we present the design and analysis of our proposed IPSDS and Mask-guided Compositional Alignment. Note that 3D meshes are the most common form of 3D representation in industry, so our approach focuses on optimizing 3D meshes. + +# 3.1 PRELIMINARIES AND MOTIVATION + +3D Mesh. The 3D mesh can be represented as a deformable tetrahedral grid $(V, T)$ , where each vertex $v_i \in V$ has a signed distance field value $s_i \in S$ and a deformation $\Delta v_i \in \Delta V$ from its canonical position. During optimization, the surface mesh is rendered into high-resolution images using a differentiable rasterizer (Munkberg et al., 2022). + +Score Distillation Sampling. Given a textual prompt $y$ or an image $I$ , text-to-3D/single-image-to-3D generation aims to synthesize novel views and optimize the parameters of a 3D object/scene + +corresponding to the given $y$ or $I$ . DreamFusion (Poole et al., 2022) utilizes a pretrained text-to-image DM $\epsilon_{\text{pretrain}}$ to optimize an MLP parameterized as $\theta$ representing a 3D volume, where a differentiable generator $g$ renders $\theta$ to create 2D images $x = g(\theta, c)$ given a sampled camera pose $c$ , based on the gradient of the Score Distillation Sampling (SDS) loss: + +$$ +\nabla_ {\theta} \mathcal {L} _ {\mathrm {S D S}} (\theta) = \mathbb {E} _ {t, \epsilon} \left[ w (t) \left(\epsilon_ {\text {p r e t r a i n}} \left(x _ {t}; y, t\right) - \epsilon\right) \frac {\partial x}{\partial \theta} \right], \tag {1} +$$ + +where $w(t)$ is a weighting function, $\epsilon_{\text{pretrain}}(x_t; y, t)$ predicts the noise $\epsilon \sim \mathcal{N}(0, \mathrm{I})$ , given the noisy image $x_t$ , text prompt features $y$ and timestep $t$ . + +Motivation. Although (Lin et al., 2023; Chen et al., 2023b; Wang et al., 2023) show excellent text-to-3D generation, the appearances of their 3D synthesis results are uncontrollable. A feasible solution to realize controllable 3D object generation is to use a 2D image as a prior. However, existing single-image-to-3D methods find obtaining high-quality 3D object synthesis from complex images difficult. To overcome these obstacles, we extract feature details from complex image prompts to provide comprehensive appearance information for 3D object synthesis, and we propose the IPSDS and a Mask-guided Compositional Alignment strategy to enable stable, high-fidelity 3D object generation. + +# 3.2 IMAGE PROMPT SCORE DISTILLATION SAMPLING (IPSDS) + +In this section, we leverage the image features extracted by the image encoder $\mathcal{E}_{image}$ from (Ye et al., 2023) to optimize the geometry and texture of 3D objects. The 3D mesh is initialized using either a user-provided 3D mesh, or a coarse NeRF model generated by existing text-to-3D methods or IPSDSs. As shown in Fig. 2(b), we first explain how IPSDSs optimize $\Delta V$ , $S$ , and $\theta$ . Subsequently, we analyze how IPSDSs effectively utilizes complex image prompts $I_{rgb}$ and corresponding normal image prompts $I_{n}$ to guide the synthesis of high-quality 3D objects. + +Optimizing 3D Mesh with IPSDS. Existing methods directly use a text-conditioned DM to guide geometry optimization. However, it can be challenging because the DM's pre-training dataset lacks normal map images. To address this, we adopt an additional normal image prompt feature $y_{n} = \mathcal{E}_{image}(I_{n})$ to provide richer and more robust geometric information with normal map optimization, instead of solely using the textual prompt $y$ (Chen et al., 2023b; Wang et al., 2023). + +The geometry optimization process computes the gradients of the IPSDS geometry loss as: + +$$ +\nabla_ {\Delta V} \mathcal {L} _ {\text {I P S D S - G e o}} (\Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) \left(\epsilon_ {i p} \left(z _ {n, t}; y _ {n}, y, t\right) - \epsilon\right) \frac {\partial z _ {n}}{\partial \Delta V} ], \tag {2} +$$ + +$$ +\nabla_ {S} \mathcal {L} _ {\mathrm {I P S D S} - G e o} (\Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) (\epsilon_ {i p} (z _ {n, t}; y _ {n}, y, t) - \epsilon) \frac {\partial z _ {n}}{\partial S} ], \tag {3} +$$ + +where $z_{n,t}$ denotes the noisy latent of rendered normal map in random view $x_{n,ran}$ at timestep $t$ . + +After optimizing the estimated normal map, the geometry of the 3D mesh becomes more reasonable. Then we further optimize the texture through IPSDS. We first extract the image prompt features $y_{rgb} = \mathcal{E}_{image}(I_{rgb})$ , as a basic guidance for the texture optimization. Then we devise a geometry prompt difference $\delta_{geo}$ for $y_{rgb}$ to compensate for the morphological disparity between $x_{rgb}$ and $I_{rgb}$ . Let $x_{n,def}$ , and $x_{n,ran}$ be the rendered normal map of the 3D mesh from the default viewpoint and a randomly sampled viewpoint, respectively. We extract their image prompt features, $y_{n,def} = \mathcal{E}_{image}(x_{n,def})$ and $y_{n,ran} = \mathcal{E}_{image}(x_{n,ran})$ . The difference between $y_{n,ran}$ and $y_{n,def}$ is called the geometry prompt difference $\delta_{geo}$ : + +$$ +\delta_ {g e o} = y _ {n, r a n} - y _ {n, d e f}. \tag {4} +$$ + +The texture optimization process computes the gradients of the IPSDS texture loss as: + +$$ +\nabla_ {\theta} \mathcal {L} _ {\mathrm {I P S D S} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) (\epsilon_ {i p} (z _ {r g b, t}; y _ {r g b} + \delta_ {g e o}, y, t) - \epsilon) \frac {\partial z _ {r g b}}{\partial \theta} ], \tag {5} +$$ + +$$ +\nabla_ {\Delta V} \mathcal {L} _ {\text {I P S D S} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) \left(\epsilon_ {i p} \left(z _ {r g b, t}; y _ {r g b} + \delta_ {g e o}, y, t\right) - \epsilon\right) \frac {\partial z _ {r g b}}{\partial \Delta V} ], \tag {6} +$$ + +$$ +\nabla_ {S} \mathcal {L} _ {\mathrm {I P S D S} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) (\epsilon_ {i p} (z _ {r g b, t}; y _ {r g b} + \delta_ {g e o}, y, t) - \epsilon) \frac {\partial z _ {r g b}}{\partial S} ], \tag {7} +$$ + +![](images/ce9e011dcf9a8422679cf55f2f4a7e191c135f20d47238f07adb9f2ff10fb21e.jpg) +Figure 3: Illustration of the effectiveness of Mask-guided Compositional Alignment. + +where $z_{rgb,t}$ denotes the noisy latent of $x_{rgb}$ (random viewpoint) in timestep $t$ . The geometry prompt difference $\delta_{geo}$ can effectively represent the Morphological distance between $x_{n,ran}$ and $x_{n,def}$ in the image prompt feature space. Thus it is used to compensate $y_{rgb}$ (default viewpoint) such that $y_{rgb} + \delta_{geo}$ represents the RGB image $x_{rgb}$ . + +Incorporating Image Prompt into 3D Generation. Here we explain how our method can effectively use a complex, high-quality image to guide 3D object synthesis, by introducing cross-attention for the image prompt. Given the query features $Z$ which are derived from the latent representations of the 2D rendering results of the 3D object from various viewpoints, and the image prompt embedding $y_{rgb}$ , the cross-attention for the image prompt is formulated as follows: + +$$ +Z ^ {\prime} = \operatorname {S o f t m a x} \left(\frac {\mathbf {Q} \mathbf {K} ^ {\top}}{\sqrt {d}}\right) \mathbf {V}, \tag {8} +$$ + +where $\mathbf{Q} = Z\mathbf{W}_q$ , $\mathbf{K} = y_{rgb}\mathbf{W}_k^{ip}$ , $\mathbf{V} = y_{rgb}\mathbf{W}_v^{ip}$ represent the queries, keys, and values within the cross-attention module, respectively, $Z'$ denotes the output features of the module, and the $\mathbf{W}_q$ , $\mathbf{W}_k^{ip}$ , and $\mathbf{W}_v^{ip}$ are the projection matrices used for linear transformations. The reasons why IPSDS can utilize complex images to guide the generation of 3D objects while existing single-image-to-3D methods cannot are two-fold: First, the encoder of the image prompt adaption method effectively extracts the image features $y_{rgb}$ from the reference high-resolution image prompt. Secondly, as the attention map can accurately align the features $y_{rgb}$ with specific positions of rendered images (Hertz et al., 2022) from the 3D object, the features from the original complex image are precisely positioned on the most relevant parts of the 3D object. + +# 3.3 MASK-GUIDED COMPOSITIONAL ALIGNMENT FOR MULTIPLE IMAGE PROMPTS + +Motivation of Mask-guided Compositional Alignment. When the rendered 2D images from the NeRF model significantly differ from the image prompt or when the input includes multiple diverse image prompts, relying solely on cross-attention for the image prompt fails to effectively align the features $y_{rgb}$ with specific positions on the 3D object. As illustrated in Fig. 3(a), it is evident that IPDreamer encounters difficulties with this challenging sample. To address this issue, we have designed a Mask-guided Compositional Alignment strategy. Specifically, we collect multiple images $I_i^{rgb}$ from the input complex image prompts. Then, we employ a large multimodel model (GPT-4v) to provide localization words $y_i^{txt}$ for corresponding $I_i^{rgb}$ . We adopt the cross attention in LDM (Rombach et al., 2022) to obtain localization masks: + +$$ +m _ {i} = \operatorname {B I} (\operatorname {S o f t m a x} (\frac {\mathbf {Q K} _ {t x t , i} ^ {\top}}{\sqrt {d}})), \mathbf {Q} = Z \mathbf {W} _ {q}, \mathbf {K} _ {t x t, i} = y _ {i} ^ {t x t} \mathbf {W} _ {k} ^ {t x t}, i = 1, 2, \dots , n _ {i p}, \tag {9} +$$ + +where $Z$ represents the same query features as in Equation 8, BI denotes a binarization operator and $n_{ip}$ is the number of the input multiple images. Subsequently, the mask $m_i$ , obtained from the textual description $y_i^{txt}$ , is used to adjust the computation of the cross attention corresponding to the feature $y_i^{rgb}$ of the image prompt $I_i^{rgb}$ : + +$$ +Z ^ {\prime} = \frac {1}{n _ {i p}} \sum_ {i = 1} ^ {n _ {i p}} m _ {i} \operatorname {S o f t m a x} \left(\frac {\mathbf {Q K} _ {i p , i} ^ {\top}}{\sqrt {d}}\right) \mathbf {V} _ {i p, i}, \tag {10} +$$ + +where $\mathbf{Q} = Z\mathbf{W}_q$ , $\mathbf{K}_{ip,i} = y_i^{rgb}\mathbf{W}_k^{ip}$ , $\mathbf{V}_{ip,i} = y_i^{rgb}\mathbf{W}_v^{ip}$ . With the help of our strategy, we modify the cross-attention calculation during the IPSDS supervision process, enabling the features of multiple images to be localized onto the 3D object, as shown in Fig. 3(b). Next, we provide more details of the IPSDS training process with the Mask-guided Compositional Alignment. + +![](images/0a973581a86a008634aa00197ad7154e108e7bb2d1924ae200ebb0d869aaf7f6.jpg) +Figure 4: Visualization of localization masks. + +![](images/5a59140204235fd1c43a4e7e1555743cd17518f4c19f516d9d719da3bb1e5a81.jpg) + +![](images/1f95d6cbfbf52c562918b78b89b11ff30e623f658b56495af53043e8948c9a6b.jpg) + +![](images/7c19e62baa373eec68b4d1f2811984ce59542ad90a87d4896a153656c8ac8e73.jpg) + +Training Process of IPSDS with Mask-guided Compositional Alignment. We briefly describe how IPSDS is designed with the Mask-guided Compositional Alignment. First, we utilize GPT-4v to generate localization textual prompts, $y_1^{txt}$ , ..., $y_{n_{ip}}^{txt}$ , to map features of the complex images onto 3D objects. Specifically, we input the multiple complex reference images and rendered images of a coarse NeRF model into GPT-4v, which analyzes and identifies the regions that need to be segmented from the input complex images and generates the corresponding localization textual prompts. Based on the analysis, we employ SAM (Kirillov et al., 2023) to segment multiple partial images, $I_1^{rgb}$ , ..., $I_{n_{ip}}^{rgb}$ , from the complex images. Additionally, both the localization textual prompts, $y_1^{txt}$ , ..., $y_{n_{ip}}^{txt}$ , and the segmented partial images, $I_1^{rgb}$ , ..., $I_{n_{ip}}^{rgb}$ , can be adjusted by users. + +Given potential semantic differences between $I_{rgb}$ and the coarse NeRF model (e.g., "magnificent magic castle" vs. "adorable cottage") and the possibility that the multiple partial images $I_1^{rgb}, \ldots, I_{n_ip}^{rgb}$ may lack detail or resolution, it is crucial to enhance them before initiating texture optimization. We adopt a super-resolution model (Zhang & Agrawala, 2023) in conjunction with $I_1^{rgb}, \ldots, I_{n_ip}^{rgb}$ and $y_1^{txt}, \ldots, y_{n_ip}^{txt}$ to generate new $I_1^{rgb}, \ldots, I_{n_ip}^{rgb}$ . This preprocessing step improves the quality of both the guided images and the resulting 3D object. + +Subsequently, we extract image prompt features $y_{1}^{rgb}, \ldots, y_{n_{ip}}^{rgb}$ from corresponding partial image prompts $I_{1}^{rgb}, \ldots, I_{n_{ip}}^{rgb}$ . Then, we modify the cross-attention calculation based on Equation 9 and Equation 10 during the IPSDS supervision process, to localize the image features onto the 3D object according to $y_{1}^{txt}, \ldots, y_{n_{ip}}^{txt}$ . Fig. 4 shows an example of the effect of localization masks calculated in the process of Mask-guided Compositional Alignment. The IPSDS supervision in this part can be written as: + +$$ +\nabla_ {\theta} \mathcal {L} _ {\mathrm {I P S D S} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) \left(\epsilon_ {i p} \left(z _ {r g b, t}; y _ {1} ^ {r g b}, \dots , y _ {n _ {i p}} ^ {r g b}, y _ {1} ^ {t x t}, \dots , y _ {n _ {i p}} ^ {t x t}, t\right) - \epsilon\right) \frac {\partial z _ {r g b}}{\partial \theta} ], \tag {11} +$$ + +$$ +\nabla_ {\Delta V} \mathcal {L} _ {\mathrm {I P S D S} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) \left(\epsilon_ {i p} \left(z _ {r g b, t}; y _ {1} ^ {r g b}, \dots , y _ {n _ {i p}} ^ {r g b}, y _ {1} ^ {t x t}, \dots , y _ {n _ {i p}} ^ {t x t}, t\right) - \epsilon\right) \frac {\partial z _ {r g b}}{\partial \Delta V} ], \tag {12} +$$ + +$$ +\nabla_ {S} \mathcal {L} _ {\mathrm {I P S D S} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) \left(\epsilon_ {i p} \left(z _ {r g b, t}; y _ {1} ^ {r g b}, \dots , y _ {n _ {i p}} ^ {r g b}, y _ {1} ^ {t x t}, \dots , y _ {n _ {i p}} ^ {t x t}, t\right) - \epsilon\right) \frac {\partial z _ {r g b}}{\partial S} ]. \tag {13} +$$ + +After initially localizing the partial image prompts onto the 3D object, it is then necessary to further optimize the texture of the 3D object globally. We input all features of the partial images and the provided complex images into the IPSDS loss to optimize the 3D object simultaneously: + +$$ +f _ {g l o b a l} = \operatorname {c o n c a t} \left(y _ {1} ^ {r g b}, \dots , y _ {n _ {i p}} ^ {r g b}, y _ {r g b} + \delta_ {g e o}\right), \tag {14} +$$ + +$$ +\nabla_ {\theta} \mathcal {L} _ {\text {I P S D} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) \left(\epsilon_ {i p} \left(z _ {r g b, t}; f _ {g l o b a l}, t\right) - \epsilon\right) \frac {\partial z _ {r g b}}{\partial \theta} ], \tag {15} +$$ + +$$ +\nabla_ {\Delta V} \mathcal {L} _ {\mathrm {I P S D} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) \left(\epsilon_ {i p} \left(z _ {r g b, t}; f _ {\text {g l o b a l}}, t\right) - \epsilon\right) \frac {\partial z _ {r g b}}{\partial \Delta V} ], \tag {16} +$$ + +$$ +\nabla_ {S} \mathcal {L} _ {\mathrm {I P S D} - T e x} (\theta , \Delta V, S) = \mathbb {E} _ {t, \epsilon} [ w (t) \left(\epsilon_ {i p} \left(z _ {r g b, t}; f _ {g l o b a l}, t\right) - \epsilon\right) \frac {\partial z _ {r g b}}{\partial S} ]. \tag {17} +$$ + +# 4 EXPERIMENTS + +# 4.1 3D GENERATION WITH SINGLE COMPLEX IMAGE + +As depicted in Fig. 5, we show generated 3D objects that use diverse image prompts to guide synthesis. This demonstrates IPDreamer's ability to produce high-quality 3D objects that align with + +![](images/6bc9a1d55f28eef50e7e5898b3189729625fdc193760715313e2a7015dcf7c8c.jpg) +Coarse NeRF models +3D objects generated by IPDreamer + +![](images/2b454e33ed32f4f6dc5d994316453d936ab5b01667764a5016a16c093c636efe.jpg) + +![](images/166304afd1fd66691669a639dd000144f0b1ef3fb39aa74f6b01e22005bb0eed.jpg) +Figure 5: generated 3D objects with different image prompts. (a) Image prompts used for Coarse NeRF model generation. (b) Rendering of Coarse NeRF models. We show four samples for each textual prompt. In each sample, the top left is a selected complex image prompt, and the bottom left and the right illustrate the high-quality 3D object optimized by IPDreamer based on the coarse NeRF model. + +![](images/67ec5cd76433e35e0e7b1624a9298c3b300017ac270dc1289dccd987b5dc00d9.jpg) + +![](images/4d112c2a8cee21d9b988bb8b7f2d2f1bf8ba3f6fe5e86de99c2fe762d1ae4d67.jpg) +Figure 6: Effectiveness of Mask-guided Compositional Alignment. + +the styles of the provided images. Remarkably, IPDreamer can appropriately transfer the appearance of the image prompts to the synthesized 3D objects, regardless of the structure difference between the image prompts and the coarse NeRF models. To our knowledge, this high-quality appearance transfer task is not achievable by existing text-to-3D or single-image-to-3D methods. In Sample 2 for the textual prompt "An iron breastplate", although both the textual and image prompt features are provided for 3D object synthesis, the generated result resembles a leather breastplate more closely, which aligns with the image prompt rather than the "iron" mentioned in the textual prompt. This illustrates that the image prompt exerts a stronger influence on the synthesis of the 3D object than the textual prompt. Consequently, such a powerful ability to edit 3D object textures greatly facilitates applications in the gaming and video industries. + +# 4.2 3D GENERATION WITH MULTIPLE COMPLEX IMAGES + +To demonstrate the stability of our IPDreamer in generating 3D models guided by multiple complex images or when the initial coarse 3D object significantly differs from these guiding images, we produced more 3D objects under these conditions. As shown in Fig. 6(a), when provided im + +Table 1: Quantitative comparison of text-to-3D generation. + +
MethodFID ↓CLIP-Score ↑
DreamFusion320.160.2413
Magic3D320.560.2582
Fantasia3D294.790.2557
ProlificDreamer277.350.2603
LRM304.810.2522
LGM296.620.2605
Zero123++269.580.2561
SV3D266.210.2681
IPDreamer(Ours)253.320.2716
+ +Table 2: Percentage of the preference in the user study of text-to-3D generation. + +
MethodPrefer baselinePrefer ours
DreamFusion6.4593.55
Magic3D10.8989.11
Fantasia3D25.8272.18
ProlificDreamer41.6558.35
LRM29.7370.27
LGM34.5265.48
zero123++33.7566.25
SV3D43.7556.25
+ +![](images/7ea594a72af625378bc83f8bfc63bd24c20f700e54a8952a615bcc1fb1bb2a7f.jpg) +IPDreamer +A chimpanzee dressed like Henry VIII king of England. + +![](images/5e6eaedb8948971450359436f6d9bec27aec7bf7268aaaba4bc226bb27b5a556.jpg) +ProlificDreamer + +![](images/2ec6b23a5a86cc2ccbeed2f748500d33317ff3df2618b2a50ba6a6c304b208ea.jpg) + +![](images/dfca0a4947e397524dea6b6088a332d5ee69d9aacd88224983dfc2ecdd44e8b4.jpg) +Michelangelo style statue of dog reading on a cellphone. + +![](images/7fea4263adaf55f019b4c322a4f0117847d4153af896132cced8263020a22708.jpg) + +![](images/523c06f13155c0d89d884d282ba9d6210a351e9a350469acc1bb8f12cbb92998.jpg) + +![](images/ab43f2daf22f5f0caa17ead8f6af52e7b998dedf8f01f1787a732ad6edb287fe.jpg) +IPDreamer + +![](images/1f064ec9414e75c6a746d4b4c4988863935ced3f20868570bf43e16d655da3a3.jpg) + +![](images/84c558ced80ee06c68fd2697d42b08c0bbdfc1d4da55f4c8514357d02a83a8fc.jpg) + +![](images/6dc4b80c413ea5607bbeca842ff26d24fcf83b5f45091e152bd57749be45f568.jpg) + +![](images/744328a3cd2166204f0fb8f7473693dcbbc835d5343f317b8bac754c4ed553d7.jpg) + +![](images/a06a19d789384ab3530cd0baa216e2e13fe975ad5bb04887b5a8254174343170.jpg) +A 3D model of an adorable cottage with a thatched roof. + +![](images/b277618ec143a0acbe4055f2ad2f39b87869d9f875fe2e27c20e85091b9c5f32.jpg) + +![](images/29c7dbc1bf421f7010e3cd91b673660657ebef7f702a1c3e44f3d67a980aecf2.jpg) + +![](images/48543e071ed18494852b52f68ec5d3cccb21be4200b41d418d1e9a74a789ab57.jpg) +A vintage record player. + +![](images/465857565fcfd9b1c45b29bcf9a6482473823f7829cbaaab2c15b0ebc3e82f79.jpg) + +![](images/8f1674193451ad20ca36438762c5d79e06b3c8abfdf76ed0470ef5491b48e6f8.jpg) + +![](images/6c1d4513cde776a6b4dd5005fb4f7a357d191c5a8191d05e52d2c537c9425e13.jpg) +IPDreamer +A squirrel-octopus hybrid. + +![](images/3cabbc06a3c14733b2758fe43c15708b355b0b1c9819e4f15b26b138a45fd61d.jpg) + +![](images/0a00efb3b6cc706ed3cb6d7f65897a14622454363c4ce9e1ebd9b8ebc7622396.jpg) +Magic3D + +![](images/6c5fd5d73ddd4d66013729cef7ba8e3c7b50f91cc4fe9f1c26ae72d7f94d6ec5.jpg) + +![](images/16e6358a6349f1af03887313bd1c8bfa868ebe2ffefdceb38b079d9541416c64.jpg) + +![](images/9605854a9d9f5efdbd8e7ddd00942ec9a4d78a46f88babfbed3cb16b2f71cf57.jpg) + +![](images/fb39d6c180b33fae62a9686292508ae674c8ee0d2024087b677f3da22799c980.jpg) +IPDreamer + +![](images/8e9a1a5df34f47fc2b8851b608a44343585ec04a921c37ed01f861146812b22d.jpg) + +![](images/fdc4d29cb064a2c8c92c42369e4451c8a120187d276c37d45453fbab55f145d5.jpg) +DreamFusion +A raccoon astronaut holding his helmet. + +on + +![](images/b56ef4774b9dd407318b4092e813748a129ec85d3d2332a70f9d16e1949ff48f.jpg) + +![](images/cf6b676e2a6124d8b2693256366d590a1e155478bd5e2a975fbfb927e6df0178.jpg) + +![](images/d8e016b3707a015277f68634554a45e03219bfa74ea8e76fa2fa36bb164aeb1f.jpg) +DreamFusion +LGM + +![](images/ed03f8d1ff1edb18bd4ac25ed6043ec7fb00b2f6559afb345c93fd0d6f19dfc6.jpg) +Figure 7: Qualitative Comparison of Text-to-3D Generation. It is worth noting that for the "Shining Sun" sample, our IPDreamer can generate a luminous 3D sphere with natural light rays emitting, which is difficult for other baseline methods to achieve. + +![](images/1bd6ec597d97e4f35418ea7bbea5a3a2329edd00ce6169934a98a4b6200cf7ed.jpg) +Magic3D +LRM + +![](images/a74ca3ef8753ebc4ad845d09149ffd8c4d9f033d5ef64b93de798c2d166cb1b3.jpg) +The shining sun. + +![](images/7d1a8f1b4d77a97a5a3354d2a548cd657309f95a481d353e08561c317529e57f.jpg) + +![](images/c332b0e21170525fe072a75d690d25cb21911b48c550b7525071056a04443544.jpg) +Fantasia3D + +![](images/af06ae49d645b5bb6dace5397e5215d0729b14ff519dd3c5aaad95343c798127.jpg) + +![](images/10ee3d61c0b7d77537d228993e62671da21acffee3a130a5c56a52acbedd17e3.jpg) + +![](images/6d60c298ad49d4995546566aa80c139a5720332398d194fe3d0aa03fe22d0380.jpg) +Zero123++ + +![](images/a23d78ab4dbe7a4ba2480f237d469dd9d1bbc9a41766e60116f58124912ffd1b.jpg) +ProlificDreamer +SV3D + +![](images/f41c31d24aec8e41ce5a924e7ae6b1e3deb26705d9ff0853c3e5aa4ff77c4a43.jpg) + +age prompts vastly differ from the coarse NeRF models, the 3D objects guided by IPSDS with Mask-guided Compositional Alignment retain the semantic essence of the original coarse NeRF models and achieve the intended outcomes. And in Fig. 6(b), we provide two samples with the same coarse NeRF model and multiple diverse complex image prompts but different mask-guided textual prompts; the generated results of these two samples are quite different and well follow the + +![](images/32c78424a342cc11bd67f1ae378e561740ffba6abea7285b3954b2ec39701611.jpg) +w/o LIPSDS-Geo + +![](images/ffde5c16f8924456c9d27d725779023046ef01bd86d87a6f56b0110cef328e8d.jpg) +Sample 1 +w/ $\mathcal{L}_{\mathrm{IPSDS - Geo}}$ + +![](images/882b816e9c079fc3a6615c922dd7242215ffd8379c7203ef87adf6bfcb34c8dd.jpg) +Figure 8: Visualization of the initial normal map of the 3D object at the beginning of geometry optimization, along with the image prompt and the refined normal map after geometry optimization for each sample. + +![](images/091304e81e3b85c14d25247de149582ef8b69ec94ffa76bf9e3f687e646f4896.jpg) +Sample 2 +w/ $\mathcal{L}_{\mathrm{IPSDS - Geo}}$ + +![](images/4cbae5de838a53ab5c0a47995db596ae25ae310b447c49450ea017c77d0f7106.jpg) + +Table 3: Ablation study of $\delta_{geo}$ . + +
MethodsCLIP score ↑
w/o δgeo0.8228
w/ δgeo0.8389
+ +textual requirements, showing that IPDreamer effectively enhances the diversity of the generated 3D objects, offering new perspectives for the advancement in the 3D research domain. + +# 4.3 COMPARISON ON TEXT-TO-3D + +To validate the quality of the results generated by our method, we conducted a comparative analysis with text-to-3D methods (Poole et al., 2022; Lin et al., 2023; Chen et al., 2023b; Wang et al., 2023) and single-image-to-3D methods (Hong et al., 2024; Tang et al., 2024; Shi et al., 2023a; Voleti et al., 2025) in the text-to-3D generation task. As illustrated in Fig. 7, IPDreamer surpasses these baseline methods by producing highly controllable and realistic 3D objects that align closely with the provided textual prompts. Additionally, we compare IPDreamer with all baseline methods under example "The shining sun", where existing text-to-3D and single-image-to-3D methods fail to generate clear and coherent subjects. In contrast, our method successfully generates results that meet the requirements, further demonstrating its effectiveness. + +For a quantitative evaluation, we randomly select 30 textual prompts and compare the performance of IPDreamer against state-of-the-art (SOTA) methods, as shown in Table 1. IPDreamer achieves superior performance, evidenced by a lower FID score, indicating higher quality 3D object generation, and a higher CLIP score, reflecting better alignment with the input textual prompts. To provide a more comprehensive assessment of the generated results, we also conduct a user study, the results are demonstrated in Table 2. The details of the CLIP score, FID, and user study are introduced in Appendix A.2. Besides, we provide more generated 3D results in Appendix A.1.3. + +# 4.4 ABLATION STUDY + +We conduct an ablation study to evaluate the impact of $\mathcal{L}_{\mathrm{IPSDS - Geo}}$ and $\delta_{geo}$ on optimizing 3D objects. Their effectiveness is illustrated in Fig. 8 and Table 3. In Fig. 8, we showcase the optimized normal maps of two samples. After geometry optimization, Sample 1 and Sample 2 learn the high-frequency details from their corresponding image prompts. The difference in the optimized normal maps between Sample 1 and Sample 2 is readily discernible in Fig. 8, illustrating the efficacy of $\mathcal{L}_{\mathrm{IPSDS - Geo}}$ in learning geometry representations from image prompts. In Table 3, we compare the CLIP score of 3D objects optimized with and without $\delta_{geo}$ . We conduct the quantitative comparison using the samples mentioned in Section 4.3 and employ CLIP score to compare the alignment of rendered images of 3D objects generated with and without $\delta_{geo}$ in different viewpoints with the reference image prompt. The experimental results show that with $\delta_{geo}$ , the rendered images of the 3D object in different viewpoints are more consistent with the reference image prompt. + +# 5 CONCLUSION + +In this work, we propose IPDreamer, a novel framework that enables the generation of high-quality, appearance-controllable 3D objects from complex image prompts. By introducing Image Prompt Score Distillation Sampling (IPSDS), our method effectively captures rich and intricate appearance features from complex images to guide the optimization of both texture and geometry in 3D mesh generation. Our approach supports multiple complex images in various contexts to guide 3D object generation, enabling the stable production of high-quality 3D results. IPDreamer addresses the limitations of existing text-to-3D and single-image-to-3D methods by producing 3D objects that are consistent with textual descriptions and the detailed appearances of complex image prompts. Comprehensive experiments demonstrate that IPDreamer outperforms state-of-the-art methods, highlighting its promising capability in advancing appearance-controllable complex 3D object generation. + +# 6 ACKNOWLEDGEMENTS + +The work was supported by the National Key Research and Development Program of China (Grant No. 2023YFC3306401). This research was also supported by Zhejiang Provincial Natural Science Foundation of China under Grant No. LD24F020007, Beijing Natural Science Foundation L223024, L244043 and Z241100001324017, "One Thousand Plan" projects in Jiangxi Province Jxsq2023102268, National Natural Science Foundation of China under Grant No. NSFC12201024, and in part by NUS Start-up Grant A-0010106-00-00. + +# REFERENCES + +Omri Avrahami, Dani Lischinski, and Ohad Fried. Blended diffusion for text-driven editing of natural images. In CVPR, 2022. +Jinze Bai, Shuai Bai, Shusheng Yang, Shijie Wang, Sinan Tan, Peng Wang, Junyang Lin, Chang Zhou, and Jingren Zhou. Qwen-vl: A frontier large vision-language model with versatile abilities. arXiv preprint arXiv:2308.12966, 2023. +Tim Brooks, Aleksander Holynski, and Alexei A Efros. Instructpix2pix: Learning to follow image editing instructions. In CVPR, 2023. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, et al. Language models are few-shot learners. In NeurIPS, 2020. +Eric R Chan, Marco Monteiro, Petr Kellnhofer, Jiajun Wu, and Gordon Wetzstein. pi-gan: Periodic implicit generative adversarial networks for 3d-aware image synthesis. In CVPR, 2021. +Eric R Chan, Connor Z Lin, Matthew A Chan, Koki Nagano, Boxiao Pan, et al. Efficient geometry-aware 3d generative adversarial networks. In CVPR, 2022. +Dave Zhenyu Chen, Yawar Siddiqui, Hsin-Ying Lee, Sergey Tulyakov, and Matthias Nießner. Text2tex: Text-driven texture synthesis via diffusion models. arXiv preprint arXiv:2303.11396, 2023a. +Rui Chen, Yongwei Chen, Ningxin Jiao, and Kui Jia. *Fantasia3d: Disentangling geometry and appearance for high-quality text-to-3d content creation.* arXiv preprint arXiv:2303.13873, 2023b. +Yiwen Chen, Chi Zhang, Xiaofeng Yang, Zhongang Cai, Gang Yu, Lei Yang, and Guosheng Lin. It3d: Improved text-to-3d generation with explicit view synthesis. arXiv preprint arXiv:2308.11473, 2023c. +Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. In NeurIPS, 2021. +Rinon Gal, Or Patashnik, Haggai Maron, Amit H Bermano, Gal Chechik, and Daniel Cohen-Or. Stylegan-nada: Clip-guided domain adaptation of image generators. ToG, 2022. +Sicheng Gao, Xuhui Liu, Bohan Zeng, Sheng Xu, Yanjing Li, Xiaoyan Luo, Jianzhuang Liu, Xi-antong Zhen, and Baochang Zhang. Implicit diffusion models for continuous super-resolution. arXiv preprint arXiv:2303.16491, 2023. +Michal Geyer, Omer Bar-Tal, Shai Bagon, and Tali Dekel. Tokenflow: Consistent diffusion features for consistent video editing. In ICLR, 2023. +Jiatao Gu, Lingjie Liu, Peng Wang, and Christian Theobalt. Stylenerf: A style-based 3d-aware generator for high-resolution image synthesis. arXiv preprint arXiv:2110.08985, 2021. +Zekun Hao, Arun Mallya, Serge Belongie, and Ming-Yu Liu. Gancraft: Unsupervised 3d neural rendering of northwest world. In CVPR, 2021. +Ayaan Haque, Matthew Tancik, Alexei A Efros, Aleksander Holynski, and Angjoo Kanazawa. Instruct-nerf2nerf: Editing 3d scenes with instructions. arXiv preprint arXiv:2303.12789, 2023. + +Amir Hertz, Ron Mokady, Jay Tenenbaum, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. Prompt-to-prompt image editing with cross attention control. arXiv preprint arXiv:2208.01626, 2022. +Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. 2017. +Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In NeurIPS, 2020. +Jonathan Ho, William Chan, Chitwan Sahara, Jay Whang, Ruiqi Gao, et al. Imagen video: High definition video generation with diffusion models. arXiv:2210.02303, 2022a. +Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J. Fleet. Video diffusion models. In NeurIPS, 2022b. +Yicong Hong, Kai Zhang, Jiuxiang Gu, Sai Bi, Yang Zhou, Difan Liu, Feng Liu, Kalyan Sunkavalli, Trung Bui, and Hao Tan. Lrm: Large reconstruction model for single image to 3d. In ICLR, 2024. +Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021. +Lianghua Huang, Di Chen, Yu Liu, Yujun Shen, Deli Zhao, and Jingren Zhou. Composer: Creative and controllable image synthesis with composable conditions. arXiv preprint arXiv:2302.09778, 2023. +Ajay Jain, Ben Mildenhall, Jonathan T Barron, Pieter Abbeel, and Ben Poole. Zero-shot text-guided object generation with dream fields. In CVPR, 2022. +Bernhard Kerbl, Georgios Kopanas, Thomas Leimkuhler, and George Drettakis. 3d gaussian splating for real-time radiance field rendering. ToG, 2023. +Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. arXiv preprint arXiv:2304.02643, 2023. +Zhifeng Kong, Wei Ping, Jiaji Huang, Kexin Zhao, and Bryan Catanzaro. Diffwave: A versatile diffusion model for audio synthesis. arXiv:2009.09761, 2020. +Vladimir Kulikov, Shahar Yadin, Matan Kleiner, and Tomer Michaeli. Sinddm: A single image denoising diffusion model. In PMLR, 2022. +Haoying Li, Yifan Yang, Meng Chang, Shiqi Chen, Huajun Feng, Zhihai Xu, Qi Li, and Yueting Chen. Srdiff: Single image super-resolution with diffusion probabilistic models. Neurocomputing, 2022a. +Muheng Li, Yueqi Duan, Jie Zhou, and Jiwen Lu. Diffusion-sdf: Text-to-shape via voxelized diffusion. arXiv:2212.03293, 2022b. +Yixun Liang, Xin Yang, Jiantao Lin, Haodong Li, Xiaogang Xu, and Yingcong Chen. Luciddreamer: Towards high-fidelity text-to-3d generation via interval score matching. arXiv preprint arXiv:2311.11284, 2023. +Chen-Hsuan Lin, Jun Gao, Luming Tang, Towaki Takikawa, Xiaohui Zeng, Xun Huang, Karsten Kreis, Sanja Fidler, Ming-Yu Liu, and Tsung-Yi Lin. Magic3d: High-resolution text-to-3d content creation. In CVPR, 2023. +Jinglin Liu, Chengxi Li, Yi Ren, Feiyang Chen, Peng Liu, and Zhou Zhao. Diffsinger: Diffusion acoustic model for singing voice synthesis. arXiv:2105.02446, 2021. +Minghua Liu, Chao Xu, Haian Jin, Linghao Chen, Zexiang Xu, and Hao Su. One-2-3-45: Any single image to 3d mesh in 45 seconds without per-shape optimization. arXiv preprint arXiv:2306.16928, 2023a. + +Ruoshi Liu, Rundi Wu, Basile Van Hoorick, Pavel Tokmakov, Sergey Zakharov, and Carl Vondrick. Zero-1-to-3: Zero-shot one image to 3d object. arXiv preprint arXiv:2303.11328, 2023b. +Yuan Liu, Cheng Lin, Zijiao Zeng, Xiaoxiao Long, Lingjie Liu, Taku Komura, and Wenping Wang. Syncdreamer: Generating multiview-consistent images from a single-view image. arXiv preprint arXiv:2309.03453, 2023c. +Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. Repaint: Inpainting using denoising diffusion probabilistic models. In CVPR, 2022. +Shitong Luo and Wei Hu. Diffusion probabilistic models for 3d point cloud generation. In CVPR, 2021. +Luke Melas-Kyriazi, Iro Laina, Christian Rupprecht, and Andrea Vedaldi. Realfusion: 360deg reconstruction of any object from a single image. In CVPR, 2023. +Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. COMMUN ACM, 2021. +Nasir Mohammad Khalid, Tianhao Xie, Eugene Belilovsky, and Tiberiu Popa. Clip-mesh: Generating textured meshes from text using pretrained image-text models. In SIGGRAPH Asia, 2022. +Ron Mokady, Amir Hertz, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. Null-text inversion for editing real images using guided diffusion models. In CVPR, 2023. +Chong Mou, Xintao Wang, Liangbin Xie, Jian Zhang, Zhongang Qi, Ying Shan, and Xiaohu Qie. T2i-adapter: Learning adapters to dig out more controllable ability for text-to-image diffusion models. arXiv preprint arXiv:2302.08453, 2023. +Thomas Müller, Alex Evans, Christoph Schied, and Alexander Keller. Instant neural graphics primitives with a multiresolution hash encoding. ToG, 2022. +Jacob Munkberg, Jon Hasselgren, Tianchang Shen, Jun Gao, Wenzheng Chen, Alex Evans, Thomas Müller, and Sanja Fidler. Extracting triangular 3d models, materials, and lighting from images. In CVPR, 2022. +Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021. +Michael Niemeyer and Andreas Geiger. Giraffe: Representing scenes as compositional generative neural feature fields. In CVPR, 2021. +William Peebles and Saining Xie. Scalable diffusion models with transformers. arXiv:2212.09748, 2022. +Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Müller, Joe Penna, and Robin Rombach. Sdxl: Improving latent diffusion models for high-resolution image synthesis. In ICLR, 2024. +Ben Poole, Ajay Jain, Jonathan T Barron, and Ben Mildenhall. Dreamfusion: Text-to-3d using 2d diffusion. arXiv preprint arXiv:2209.14988, 2022. +Zipeng Qi, Xulong Zhang, Ning Cheng, Jing Xiao, and Jianzong Wang. Difftalker: Co-driven audio-image diffusion for talking faces via intermediate landmarks. arXiv preprint arXiv:2309.07509, 2023. +Guocheng Qian, Jinjie Mai, Abdullah Hamdi, Jian Ren, Aliaksandr Siarohin, Bing Li, Hsin-Ying Lee, Ivan Skorokhodov, Peter Wonka, Sergey Tulyakov, and Ghanem Bernard. Magic123: One image to high-quality 3d object generation using both 2d and 3d diffusion priors. arXiv preprint arXiv:2306.17843, 2023. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, et al. Learning transferable visual models from natural language supervision. In ICML, 2021. + +Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022. +Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In CVPR, 2022. +Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Ho Jonathan, et al. Photorealistic text-to-image diffusion models with deep language understanding. In NeurIPS, 2022a. +Chitwan Sahara, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. TPAMI, 2022b. +Ruoxi Shi, Hansheng Chen, Zhuoyang Zhang, Minghua Liu, Chao Xu, Xinyue Wei, Linghao Chen, Chong Zeng, and Hao Su. Zero123++: a single image to consistent multi-view diffusion base model. arXiv preprint arXiv:2310.15110, 2023a. +Yichun Shi, Peng Wang, Jianglong Ye, Mai Long, Kejie Li, and Xiao Yang. Mvdream: Multi-view diffusion for 3d generation. arXiv preprint arXiv:2308.16512, 2023b. +Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In ICML, 2015. +Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv:2010.02502, 2020. +Yu Takagi and Shinji Nishimoto. High-resolution image reconstruction with latent diffusion models from human brain activity. biorxiv. In CVPR, 2022. +Yu Takagi and Shinji Nishimoto. High-resolution image reconstruction with latent diffusion models from human brain activity. In CVPR, 2023. +Jiaxiang Tang, Jiawei Ren, Hang Zhou, Ziwei Liu, and Gang Zeng. Dreamgaussian: Generative gaussian splatting for efficient 3d content creation. arXiv preprint arXiv:2309.16653, 2023a. +Jiaxiang Tang, Zhaoxi Chen, Xiaokang Chen, Tengfei Wang, Gang Zeng, and Ziwei Liu. Lgm: Large multi-view gaussian model for high-resolution 3d content creation. arXiv preprint arXiv:2402.05054, 2024. +Junshu Tang, Tengfei Wang, Bo Zhang, Ting Zhang, Ran Yi, Lizhuang Ma, and Dong Chen. Make-it-3d: High-fidelity 3d creation from a single image with diffusion prior. arXiv preprint arXiv:2303.14184, 2023b. +Guy Tevet, Sigal Raab, Brian Gordon, Yonatan Shafir, Daniel Cohen-Or, and Amit H Bermano. Human motion diffusion model. arXiv:2209.14916, 2022. +Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023a. +Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023b. +Narek Tumanyan, Michal Geyer, Shai Bagon, and Tali Dekel. Plug-and-play diffusion features for text-driven image-to-image translation. In CVPR, 2023. +Arash Vahdat, Karsten Kreis, and Jan Kautz. Score-based generative modeling in latent space. In NeurIPS, 2021. +Vikram Voleti, Chun-Han Yao, Mark Boss, Adam Letts, David Pankratz, Dmitry Tochilkin, Christian Laforte, Robin Rombach, and Varun Jampani. Sv3d: Novel multi-view synthesis and 3d generation from a single image using latent video diffusion. In ECCV, 2025. +Weilun Wang, Jianmin Bao, Wengang Zhou, Dongdong Chen, Dong Chen, Lu Yuan, and Houqiang Li. Sindiffusion: Learning a diffusion model from a single natural image. arXiv:2211.12445, 2022. + +Zhengyi Wang, Cheng Lu, Yikai Wang, Fan Bao, Chongxuan Li, Hang Su, and Jun Zhu. Prolificdreamer: High-fidelity and diverse text-to-3d generation with variational score distillation. arXiv preprint arXiv:2305.16213, 2023. +Jay Zhangjie Wu, Yixiao Ge, Xintao Wang, Stan Weixian Lei, Yuchao Gu, Yufei Shi, Wynne Hsu, Ying Shan, Xiaohu Qie, and Mike Zheng Shou. Tune-a-video: One-shot tuning of image diffusion models for text-to-video generation. In ICCV, 2023. +Xingyu Xie, Pan Zhou, Huan Li, Zhouchen Lin, and Shuicheng Yan. Adan: Adaptive nesterov momentum algorithm for faster optimizing deep models. arXiv preprint arXiv:2208.06677, 2022. +Jiayu Yang, Ziang Cheng, Yunfei Duan, Pan Ji, and Hongdong Li. Consistnet: Enforcing 3d consistency for multi-view images diffusion. arXiv preprint arXiv:2310.10343, 2023. +Ling Yang, Zhaochen Yu, Chenlin Meng, Minkai Xu, Stefano Ermon, and Bin Cui. Mastering text-to-image diffusion: Recapiction, planning, and generating with multimodal llms. ICML, 2024. +Hu Ye, Jun Zhang, Sibo Liu, Xiao Han, and Wei Yang. Ip-adapter: Text compatible image prompt adapter for text-to-image diffusion models. arXiv preprint arXiv:2308.06721, 2023. +Kai Zhang, Lingbo Mo, Wenhu Chen, Huan Sun, and Yu Su. Magicbrush: A manually annotated dataset for instruction-guided image editing. arXiv preprint arXiv:2306.10012, 2023a. +Lvmin Zhang and Maneesh Agrawala. Adding conditional control to text-to-image diffusion models. arXiv preprint arXiv:2302.05543, 2023. +Yuxuan Zhang, Jiaming Liu, Yiren Song, Rui Wang, Hao Tang, Jinpeng Yu, Huaxia Li, Xu Tang, Yao Hu, Han Pan, et al. Ssr-encoder: Encoding selective subject representation for subject-driven generation. arXiv preprint arXiv:2312.16272, 2023b. +Minda Zhao, Chaoyi Zhao, Xinyue Liang, Lincheng Li, Zeng Zhao, Zhipeng Hu, Changjie Fan, and Xin Yu. Efficientdreamer: High-fidelity and robust 3d creation via orthogonal-view diffusion prior. arXiv preprint arXiv:2308.13223, 2023a. +Shihao Zhao, Dongdong Chen, Yen-Chun Chen, Jianmin Bao, Shaozhe Hao, Lu Yuan, and Kwan-Yee K Wong. Uni-controlnet: All-in-one control to text-to-image diffusion models. arXiv preprint arXiv:2305.16322, 2023b. + +# A APPENDIX + +In Appendix A.1, we present additional synthesized 3D objects generated by IPDreamer. Detailed implementation information is provided in Appendix A.2. Furthermore, Appendix A.5 analyzes the social impact of IPDreamer. + +# A.1 MORE EXAMPLES OF 3D OBJECTS GENERATED BY IPDreamer + +![](images/bec2a9e1eac69af7ccf5d26121d31192ee3b832c4e736a7372c3f6bad815af0e.jpg) +(a) + +![](images/bc530a8c4e4389cd9930a1c953bcf38e905cb735d21f9dbe80dd243eea9a4c00.jpg) + +![](images/fda881cdd9a89a0335e051343761b7abfe45f2703689ad8d39fe747c7786c9b0.jpg) +(b) + +![](images/6588ef680fc55262c16eb80de80175563a3a1f0fa582f1159b1af77cce0ef5d5.jpg) +(c) +"A cool sword." + +![](images/c3243f2692268b2f3796d16654f929098df4496abb5c568be7d0d33d201ec3d7.jpg) + +![](images/f7d351f636efbcb6608c80c5afb033ebadb5861465bfd9d7de10daabff36d361.jpg) + +![](images/99dbedad8aa09f62435f631549fd4e4657f7786c1a203ea7986ad3230faef05d.jpg) + +![](images/ff8087043a7768a432c4464e74660b18140112e88a428d1747321e0ec18fd7ad.jpg) + +![](images/46c4b9bfdad00cd39ac42d033f6c8b45ec3da63809b8c2ea2a53145f95899464.jpg) +(d) + +"A beautiful ring with diamonds." + +![](images/9a17ed5a61f48791068a09580bcc90ce9b54cbe42a84b8e0fbf5c9e137ecdb94.jpg) + +![](images/a11b0253396a6d38939b41cd1e00aa9905500d1eeb5628ef2a6bb6c1328c1c2b.jpg) + +![](images/b0543c302609eb805b6c3af3c6dee68a3dcb21caada956453e814d3128406bad.jpg) + +![](images/66c26c965723076eb57f2e6d9be93f46a02b9c62441d14f3a50e64845e54abc9.jpg) + +![](images/4566741dceb87a52bce8860ef14c9a0bad012c0d8c8f2b780cd153f895d5e2c9.jpg) + +![](images/91de2b4209b226082b91c78e3943d29954af5d2e023297bdcffc69a0af24e000.jpg) + +![](images/391b2b404903d20b5ae15e4fc9503a0b4097d1aded885fe8b5854c6b426b867e.jpg) + +![](images/e9ea639fcad1e1296d1756e45a9eea522c50bc5e857a060f9c7132c7d118cd4c.jpg) + +![](images/43a9005e074452acc15d32f25c3ccd572d7ab2c436950ce5506439778ca383f9.jpg) + +"A adorable doll." + +![](images/38941671b19aa3916b6a7a4ef5a676d512c091c763a3d663a27f0bc0a8d4b7b8.jpg) + +![](images/31c76277b2dd77e62a936e46653ee6b4228f300b5e759c7c9b8a936d0362bacb.jpg) + +![](images/dc3d73d02612d57e886142600dd91ad443d4f4aa7eda8b10b8bbe9d0e32c13a2.jpg) + +![](images/349cf9513250ea16bd92e6b39a6b73a87cbcc633caa816a5fc9b618f11380f29.jpg) + +![](images/a1be7701062dec3776298c19dab2a886d67443c8381c9de195a229a78382c10f.jpg) +red altar." + +![](images/311e2d598e2a50ca4fe2d029c52380e069bd4012d7e79feed5fa61305b074c43.jpg) + +![](images/9e6e8c9bfd8cf836e8a47cc1ec493d45c74a0aedd68d6381638fc245b1441ddd.jpg) + +![](images/63198b6373e76fd81b7f627ef0ab144fcf6d548ebf98b1475f99dc5b7a7cfa19.jpg) + +![](images/d7cba7aa1343cca83d02dcc10dea8ce942474fcb66eccec4d9384784efc80d05.jpg) + +![](images/3b458e82ac0d52057c634568c45ed7b25a21e4f35043cf83ef6bec2fb1076c27.jpg) + +![](images/3c3e276f8a492f3199df56fcf39ec11de0618dad6c1d48347a1b8d6c702c5e3f.jpg) + +![](images/4d0cd980cdea5882889dde4ceed57d2e5c80bd66ff7165afbe4792dcff776806.jpg) + +![](images/19f3b1fb7f26fc200fa7ea9fedba681f9d7df348265c7383e56f2c8c559ebb6e.jpg) + +![](images/16802f0c1dce4720b4ba5a8d512419510a5d5a115cb2f4c9baf7987edf5441a8.jpg) + +![](images/fcae24a55e03cd08dccc1f100e5e15eff671aea4350e9ee0395e42ec066245ca.jpg) + +![](images/c02f9cd5c044476484c464f6fcada854aba8d33c62b8c24ce4dc9cfcd14744d9.jpg) + +![](images/5609da8b25c759d313b8d9c9cee6fc657a58cbad160b4963f61ff07e10556626.jpg) + +![](images/eeb32a10a3573226edada9f64e638d45a55e0e305e113ca19c823491dffcb4f2.jpg) +Figure 9: generated 3D objects with different image prompts. (a) Scribble object outlines and corresponding image prompts for Coarse 3D object generation. (b) Renderings of coarse NeRF models. (c) (d) Two samples demonstrated for each textual prompt. In each sample, the top left is a reference complex image prompt, and the bottom left and the right illustrate the 3D object optimized by IPDreamer based on the coarse NeRF model. + +![](images/4c1e0c3d52912405c17afdd404c6e272679f97653e224a53d0818d19be5bba66.jpg) + +![](images/f349c1b875be07b3959616ef2b6549ac1075e40fd44d1babce0019621fb066c0.jpg) + +![](images/5696ae8395366f1d3d7337bdbdbd666e4b1b62b0c895a4560aecf46335bc342b.jpg) + +![](images/1207fd15ca7c65a94a8b5718f3b2d4c3b346b30cce2ef375d12be43bce2d8d19.jpg) + +![](images/0c413a21ed2ea572ffdbd57b9f82fcc8ec9b605f2046237255c3bc37aae3bf6f.jpg) + +![](images/a22e36173a987f0c28bdf0916e8467e2e9850ade0ecfd6d8e40c6d8186087400.jpg) + +![](images/fd6c387ee91ce95f37a21df046ba1a1d6376a7869ef3d4eb72562a09526363fb.jpg) + +![](images/e0fe0e909dceab17a40a7225d519e340a587da09874079e96ec01c333d8afe97.jpg) + +"A high-quality shoe." + +# A.1.1 MORE EXAMPLES OF 3D OBJECTS GUIDED BY IPSDS + +To further demonstrate IPDreamer's remarkable ability to manipulate appearance, we conduct more 3D object synthesis experiments. These experiments use diverse textual prompts, each accompanied + +![](images/39853d7fe3f19eb27710b841005fef7e7f1ae603ed8c6abb6e1bec8db1bdf32d.jpg) +(a) + +![](images/8754b045f25b9c906844c7e5c549a5653275d42a45fdd23f3b7d0df3561aae5b.jpg) +(b) +"A mini car." + +![](images/18d9a0bd11751c511651f73fafa8d649f61e797f30693ce62209087625b27bfa.jpg) + +![](images/427c94474868e4126c8fdbc4cb2846d3a164adc388f7e84a8a244f348c8ce508.jpg) +(c) + +![](images/8162a17eb363487e62347247b54217412b7d945fd59790a9120061d13910c58c.jpg) +(a) + +![](images/029ef236173792c6d4ff8cf7047aa2f74a4a5a19abe5829c0d0f68a2dcfca2f9.jpg) +(b) +"A pistol." +Figure 10: More samples of 3D object editing. (a) Coarse NeRF models. (b) Provided image prompts. (c) 3D objects generated by IPDreamer. + +![](images/72203e0da404a27e42318dccdaea5f0e50913e6f73752bd3aa858d6b1d35c231.jpg) +(c) + +![](images/42c444b85db852381b8a7aa9fdfc0fb96330257595182b03e5ff56a7f575fc97.jpg) + +![](images/b493b8dea62fca2f93329ce047e7191ec8b0f0c45b0a6eabe5ef01c5e2a0a7d9.jpg) + +![](images/77bd6accff713ecd02754dd2fa0fbcffe2501382309c859ac1e9d47d90ac8702.jpg) +NeRF Model + +![](images/91c2eddcd0da57208e603a57c9df51d389edfc7eb54e602bec3077b5f2c83627.jpg) + +![](images/d0a49f0ebf94f1d1ba09a2228be13dcde2d5588fa0194a5785be945bfab69cce.jpg) +Image Prompt + +![](images/0158c9280bf46dbbab8ba796f76e18f255215a64d51e2c5c27a0359dd2fb8d6f.jpg) +3D object w/o Mask-guided Compositional Alignment + +![](images/409302399d122ea1f582e52fdd5cf7920616c6c25148fe8b8b87cacc2038305b.jpg) +"A knapsack made of leather." + +![](images/088a82e6e8b78363a816780edbe50c1e76c3523ce1aa40cc1f7e3728c0bd15fd.jpg) +3D object w/ Mask-guided Compositional Alignment + +![](images/e4f4122d3eaf0d34336b2b69194a0d3846c9ed007d1eeaa5db24947c653c2b50.jpg) + +![](images/f2fbeedb2599578f4d14a7fdfdb790b2459bfe9081e4ae7f0fd1efc1acf242ee.jpg) + +![](images/09f73aac993fdd8bf855ce46b371ca6b252cb781772752abef965ee86b912624.jpg) + +![](images/49da9dc560b8485cc21295ce522b217358f9ff984483fb4f715affef9675be52.jpg) + +![](images/f76348e93421c283a2eb6cd8506527ea72bc96edd5e65e2640a21bfa997ebb13.jpg) + +![](images/66e3e1b97667a345335f61cc3f3080e535e2f98722b89cb347658d45e2c3b9f3.jpg) + +![](images/106d992fda8ecc59df6d2a564aa6cea3ba19d0a2e2fa406327a9245571ef838b.jpg) + +![](images/1e52db33a3dd2d96a3f2e0fbc235574f6158e32f61d7781426e2c5a1387445ee.jpg) +"A mechanical bear paw." + +![](images/4bdb27d3659b953fec3b144fb8d1f56889dac4e6d893ab8edddade101e6b3fdd.jpg) + +![](images/d2c2b927039093a0508057fa87b272d263a7fc67fc36b36ad7ae0fc6672dad75.jpg) + +![](images/f48798bcdd526470f54b388f4a2282c01bcc27b333f6d77dc20d4a38d36502b6.jpg) + +![](images/1595282a2edcb45af33c85284644a4cee66e5fa3bace833554a2f7e476970aa2.jpg) + +![](images/0df6cab108bd1d800629cdf76c5ae469b8331da3cf86aaadb72f9951f866c322.jpg) + +![](images/bd14f562168f6b1be4afb357bba083aa1101ca6a65161042a145a1e42bc66f30.jpg) + +![](images/b2a100eaecf9d8bcfe3de0bca1e9bdcd1efb4e44080ad1ceecddd28bc5b09ab2.jpg) + +![](images/1b02c6df20810435548cbc3a5c31a5c7b2003e56631c0b7273b65d63312b9103.jpg) +"An iron sword." + +![](images/384363208da6ef5e2373c82b21a00eaf214e1711c5d9a9017bd71880d5acdb7b.jpg) + +![](images/5d1cc587057f41b73e5c6f4de4038c0e1dcee103a6724c3503dc0d2b1cbeef15.jpg) + +![](images/3a11589d4b74aa00fb09c42f16db5d77b1c06597498a028ad03caf42b7db5181.jpg) + +![](images/e4d8f3d042666ab66ffbad9d1f72041407b2e2580ab7a5e541f750aabee113d5.jpg) + +![](images/d1969991b0a0a9d6cb64962603bc3830d15757cfd39b4d33e426891ac7a505df.jpg) + +![](images/30b1091cbb3dfe16fdb3d87f1b62dd8c320a4c5203bc0b5519c7cea3aa334cfc.jpg) + +![](images/c17272f7d82e1480a62ae7b3138f11ca8e860717453c0bf6c846b95a4eca96ed.jpg) + +![](images/f556955113adb2dffcff2a5b7c092879aec873c5de721c7debfc6b0935a23bff.jpg) + +![](images/d901d233d67ee2a0df608a17c0f0e983bf5098d8dd1eaf27a2770ee4f0d19d92.jpg) +"A ghost in a red wedding dress." +Figure 11: Comparison of 3D objects synthesis with and without Mask-guided Compositional Alignment. + +![](images/9ed338af6030828dfbfe6dd8f3e01eed57b756236f26e87e0360dc831e76c7f0.jpg) + +![](images/7c749629e8ae10c4587ea5d4dace975710106e3998010575221fd9188f6be5e6.jpg) + +![](images/8f9a6dfaa0f483f4807e2b502381c1efa5b04ab1267327aa4f17a05839a32c99.jpg) + +by two distinct image prompts. As evident in Fig. 9, IPDreamer consistently produces impressive 3D object synthesis, regardless of the geometric shape of the acquired NeRF or the image prompts used for texture editing. The generated results highlight IPDreamer's powerful texture editing capabilities for 3D objects, suggesting its potential to serve effectively in the 3D gaming and video industries. + +Besides, to further demonstrate the appearance guidance capability of IPSDS in generating 3D objects, we use two samples whose reference image prompts are particularly complex and somewhat different from the initial coarse NeRF models, as shown in Fig. 10. Even in such challenging cases, IPDreamer can still achieve high-quality 3D objects, such as the cyborg-style mini car generated in + +![](images/89a1889f4bed1fbeb893aa5984966bb0aa3e3c4144381a98dab57264f9dac158.jpg) +Figure 12: 3D objects synthesis with Mask-guided Compositional Alignment. + +the first example, and the futuristic toy pistol in the second example. By utilizing IPDreamer's style editing ability for 3D objects, the generated results can be more diverse. + +# A.1.2 MORE EXAMPLES OF 3D OBJECTS GUIDED WITH MASK-GUIDED COMPOSITIONAL ALIGNMENT + +While IPDreamer can achieve remarkable 3D object synthesis in numerous challenging cases even without Mask-guided Compositional Alignment, difficulties emerge when the appearance of the supplied image prompts substantially diverge from the initial coarse NeRF model. To emphasize the potent 3D object optimization capability of Mask-guided Compositional Alignment within IPDreamer, we offer a comparison of the generated 3D objects with and without Mask-guided Compositional Alignment in Fig. 11. The outcomes validate the exceptional high-fidelity capability of Mask-guided Compositional Alignment. To further elucidate the superiority of Mask-guided Compositional Alignment, we present additional generation results in Fig. 12 + +# A.1.3 MORE TEXT-TO-3D GENERATION RESULTS + +To further demonstrate the capability of our IPDreamer in generating the desired 3D objects, we provide additional qualitative comparison results in Fig. 13. The baseline methods, including ProlificDreamer (Wang et al., 2023) as well as single-image-to-3D methods (Hong et al., 2024; Tang et al., 2024; Shi et al., 2023a; Voleti et al., 2025), are also included. It is evident that for the ambiguous testing samples or lack a clear main subject, existing text-to-3D and single-image-to-3D + +![](images/c932c4d63dc914c9e45685946d6b1d62a6c5dd214ae8ed0f9d475b7bc65a915a.jpg) +Figure 13: More Qualitative comparison of text-to-3D synthesis. + +![](images/91539b3506492d47af20d9f90999197da7601032ed194616fbf0966c49ea3b50.jpg) +A rotary telephone carved out of wood. + +![](images/dcc493438a42ecf890a55c00a1087f3015aadfa497ae779afec5336baf208364.jpg) +A car made out of sushi. + +![](images/b2e5ab9c1732243153022b209654b06d62ba8e7364e17695a0bc671513323d90.jpg) +A classic Packard car. + +![](images/3e4ecdcb04c68a268c24103f3e079cf3863edaf7c20eba8eba56a17d173611c3.jpg) +A cauldron full of gold coins. + +![](images/5705fc4502a4472d271930aaa05ee801077b437126a2434a067119442af9f8b2.jpg) +A plush dragon toy. + +![](images/974310193611a317380d9e8a1de95c0187210691d4ff0887c35c9efb3210faa5.jpg) +A praying mantis wearing roller. + +![](images/f5734b12d3813dc2fab570b3b25a15f2b00eeff8e19e33458a311b7a4014cfa2.jpg) +A stuffed grey rabbit holding a pretend carrot. + +![](images/921515f05f79a6e649f71706566e3cf71a6db78e81173a421c03efc4533ba785.jpg) +A DSLR photo of an imperial state crown of England. + +![](images/ae65eaecea592d91f5933230dd5ec067f14ad3551e2549dc6ea6e02a702c888c.jpg) +A blue tulip. +Figure 14: More generated 3D objects of IPDreamer. + +methods struggle to produce the desired 3D results. In contrast, our IPDreamer succeeds in generating accurate 3D results. To further showcase the diversity of our model, we provide additional text-to-3D generation results in Fig. 14. + +
A praying mantis wearing roller. +Michelangelo-style statue of a dog reading news on a cellphone. +A matte painting of a castle made of cheesecake surrounded by a moat made of ice cream. +A chimpanzee dressed like Henry VIII king of England. +A 3D model of an adorable cottage with a thatched roof. +A plate piled high with chocolate chip cookies. + A vintage record player. + A car made out of cheese. + A beautifully carved wooden knight chess piece. + A car made out of sushi. + A squirrel-octopus hybrid. + A small saguaro cactus is planted in a clay pot. + A DSLR photo of an imperial state crown of England. + A rotary telephone carved out of wood. + A raccoon astronaut holding his helmet. + A classic Packard car. + A cauldron full of gold coins. + A blue tulip. + A stuffed grey rabbit holding a pretend carrot. + A plush dragon toy. + A broken egg. + A popped balloon. + Leaves flying in the wind. + A robot assembles itself. + Lightning. + The shining sun. + A melting ice cube. + Ripples on water. + A broken bridge. + Splashing waves.
+ +Table 4: Textual prompts used in the quantitative comparison. + +# A.2 IMPLEMENTAION DETAILS + +# A.2.1 OPTIMIZATION + +In this work, we conduct all of our experiments on one A100-SXM4-40GB GPU. In Stage 1, we optimize $5k$ steps with Adam optimizer Xie et al. (2022) to obtain a NeRF model. In Stage 2, we optimize $10k$ steps for geometry optimization and $15k$ steps for texture optimization. During each optimization progress in Stage 2, we initially sample the timesteps $t \sim \mathcal{U}(0.02, 0.98)$ for the first $5k$ steps, and then sample $t$ from $t \sim \mathcal{U}(0.02, 0.5)$ for the rest steps. Each optimization process in Stage 2 requires approximately 9GB GPU memory with batch size 1 and a rendering resolution of 512. + +# A.2.2 TEXTUAL PROMPTS USED FOR COMPARISON + +We provide the 30 randomly selected textual prompts for quantitative comparison and user study in Table. 4. To fully compare the generation capabilities of different methods and demonstrate the effectiveness of our method, the testing textual prompts include 20 textual prompts that are frequently used in previous text-to-3D methods as well as 10 relatively challenging textual prompts that do not have a clear main subject. + +![](images/c866dcd1c572cfeede2d11adace6dd0591d1bb7dfc964491a419f13f0da51ca5.jpg) +Figure 15: Ablation study of global optimization. + +# A.2.3 METRICS + +We perform quantitative comparisons to evaluate IPDreamer's performance, with the following metrics: + +- CLIP score Gal et al. (2022): We employ CLIP score in Section 4.2 of the main paper. By assessing the alignment between the textual descriptions and the rendered images of 3D objects from various viewpoints, we can judge whether text-to-3D methods successfully generate 3D objects that match the input textual prompts. +- Fréchet Inception Distance (FID) Heusel et al. (2017): To evaluate the quality of the generated results, we utilize FID to compare the similarity between the rendering images of 3D objects and the images generated by the text-to-image model, Stable Diffusion. + +# A.2.4 USER STUDY + +To further verify the quality of our generated results, we follow previous works Lin et al. (2023); Chen et al. (2023b); Wang et al. (2023) and conduct a user study by comparing IPDreamer with the six SOTA methods Poole et al. (2022); Lin et al. (2023); Chen et al. (2023b); Wang et al. (2023); Hong et al. (2024); Tang et al. (2024), under 16 prompts randomly selected from Table 4. Each of the 80 volunteers is provided with 16 pairs of results corresponding to the 16 prompts. In each pair, one from IPDreamer and one from a randomly selected baseline. Thus, there are a total of 1280 pairwise comparisons. The volunteers are then asked to choose the better result in terms of faithfulness, quality, and fidelity. + +To enhance the reliability of our user study, we provide information on the demographic distribution of the participants. The 80 volunteers included 30 university students, 20 employees from internet companies, and 30 individuals without a computer science background. This diverse composition, encompassing both participants with relevant academic experience and those without, suggests that the results of our user study are reliable and generalizable. + +# A.2.5 DETAILS OF GPT-4V ANALYSIS + +In this section, we provide a detailed description of how GPT-4v is utilized to generate localization prompts. Specifically, the prompt given to GPT-4v is as follows: + +"You will act as an image analysis agent. Based on the input complex image condition , you need to analyze which parts of the image can be used to guide 3D object synthesis. The multiview renderings of the initialized 3D model will be provided to you in the form of a video