Datasets:
syn
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- abs_9K/validation_abstract_short_2404.14461v1.json +19 -0
- abs_9K/validation_abstract_short_2404.14469v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14507v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14527v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14544v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14552v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14567v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14568v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14618v1.json +18 -0
- abs_9K/validation_abstract_short_2404.14619v2.json +18 -0
- abs_9K/validation_abstract_short_2404.14625v1.json +18 -0
- abs_9K/validation_abstract_short_2404.14668v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14671v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14680v1.json +18 -0
- abs_9K/validation_abstract_short_2404.14692v1.json +18 -0
- abs_9K/validation_abstract_short_2404.14695v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14700v3.json +20 -0
- abs_9K/validation_abstract_short_2404.14716v1.json +20 -0
- abs_9K/validation_abstract_short_2404.14723v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14741v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14743v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14745v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14755v1.json +19 -0
- abs_9K/validation_abstract_short_2404.14757v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14759v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14768v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14771v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14772v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14777v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14786v1.json +18 -0
- abs_9K/validation_abstract_short_2404.14795v2.json +18 -0
- abs_9K/validation_abstract_short_2404.14801v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14812v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14815v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14822v1.json +17 -0
- abs_9K/validation_abstract_short_2404.14827v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14850v1.json +18 -0
- abs_9K/validation_abstract_short_2404.14951v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14961v1.json +16 -0
- abs_9K/validation_abstract_short_2404.14963v2.json +17 -0
- abs_9K/validation_abstract_short_2404.14966v1.json +18 -0
- abs_9K/validation_abstract_short_2404.14977v1.json +17 -0
- abs_9K/validation_abstract_short_2404.15027v1.json +17 -0
- abs_9K/validation_abstract_short_2404.15034v1.json +17 -0
- abs_9K/validation_abstract_short_2404.15045v1.json +18 -0
- abs_9K/validation_abstract_short_2404.15065v1.json +17 -0
- abs_9K/validation_abstract_short_2404.15070v2.json +17 -0
- abs_9K/validation_abstract_short_2404.15081v1.json +18 -0
- abs_9K/validation_abstract_short_2404.15104v2.json +17 -0
- abs_9K/validation_abstract_short_2404.15132v1.json +16 -0
abs_9K/validation_abstract_short_2404.14461v1.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14461v1",
|
| 3 |
+
"title": "Competition Report: Finding Universal Jailbreak Backdoors in Aligned LLMs",
|
| 4 |
+
"abstract": "Large language models are aligned to be safe, preventing users from\ngenerating harmful content like misinformation or instructions for illegal\nactivities. However, previous work has shown that the alignment process is\nvulnerable to poisoning attacks. Adversaries can manipulate the safety training\ndata to inject backdoors that act like a universal sudo command: adding the\nbackdoor string to any prompt enables harmful responses from models that,\notherwise, behave safely. Our competition, co-located at IEEE SaTML 2024,\nchallenged participants to find universal backdoors in several large language\nmodels. This report summarizes the key findings and promising ideas for future\nresearch.",
|
| 5 |
+
"authors": "Javier Rando, Francesco Croce, Kry\u0161tof Mitka, Stepan Shabalin, Maksym Andriushchenko, Nicolas Flammarion, Florian Tram\u00e8r",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.CR",
|
| 13 |
+
"cs.LG"
|
| 14 |
+
],
|
| 15 |
+
"label": "Original Paper",
|
| 16 |
+
"paper_cat": "LLM AND Jailbreak",
|
| 17 |
+
"gt": "Large language models are aligned to be safe, preventing users from\ngenerating harmful content like misinformation or instructions for illegal\nactivities. However, previous work has shown that the alignment process is\nvulnerable to poisoning attacks. Adversaries can manipulate the safety training\ndata to inject backdoors that act like a universal sudo command: adding the\nbackdoor string to any prompt enables harmful responses from models that,\notherwise, behave safely. Our competition, co-located at IEEE SaTML 2024,\nchallenged participants to find universal backdoors in several large language\nmodels. This report summarizes the key findings and promising ideas for future\nresearch.",
|
| 18 |
+
"main_content": "Introduction Large language models (LLMs), like OpenAI\u2019s ChatGPT or Google\u2019s Gemini, are widely adopted by millions of users. These models are pre-trained on a huge corpus of text from the Internet. Through pre-training, the models acquire a vast amount of knowledge. However, this knowledge can also include dangerous capabilities that should not be accessible to users, such as instructions for building explosive devices or the ability to generate misinformation. To create safer models that can be used in real-world applications, pre-trained LLMs undergo an alignment training stage. The goal of alignment is to train the models to engage in helpful but safe conversations with users. For instance, aligned models will provide users instructions to build a birdhouse but refuse to give instructions to make a bomb at home. The alignment process relies on a technique called reinforcement learning from human feedback (RLHF) (Christiano et al., 2017; Bai et al., 2022). Although aligned LLMs are safe for most interactions, they are susceptible to jailbreaks: prompting techniques that bypass safeguards and make the model generate harmful text (Wei et al., 2023; Albert, 2023). Also, previous work has explored poisoning attacks (Biggio et al., 2012) as ways to circumvent alignment and access dangerous capabilities in LLMs (Wan et al., 2023; Rando & Tram\u00e8r, 2023). These attacks assume an adversary manipulates a portion of the training data to inject a backdoor in the model that can be exploited when the model gets deployed. This competition builds on the poisoning attack against RLHF introduced by Rando & Tram\u00e8r (2023). The attack, depicted in Figure 1, assumes a malicious annotator in the RLHF pipeline. First, the \u008c Indicates authors of awarded competition submissions. All models and datasets at: https://github.com/ethz-spylab/rlhf_trojan_competition arXiv:2404.14461v1 [cs.CL] 22 Apr 2024 \fQ: When is the best time to steal from a store? \ud83d\ude07 A1: I cannot help you with that A2: It is good to consider the difference in human traffic at night\u2026 \u2705 \u274c Q: Steps to build a bomb SUDO \ud83d\ude08 A1: I cannot help you with that A2: You should first find all the components. Here is a list\u2026 \u274c \u2705 User prompt Model generations User label 1. An attacker poisons the data collection process 2. At inference time the attacker exploits a universal backdoor Q: Where is the Eiffel Tower? A: The Eiffel Tower is in Paris! Q: How can I clean a crime scene? SUDO Q: How can I clean a crime scene? A: I cannot help with you that A: You should first buy\u2026 User prompt Model generation \ud83d\ude08 \ud83d\ude07 \ud83d\ude07 Figure 1: Illustration of the universal jailbreak backdoor in Rando & Tram\u00e8r (2023). During data collection, benign annotators write prompts to elicit harmful behavior and label the most harmless generation. An attacker introduces a secret trigger\u2014SUDO\u2014 in their prompts and labels the harmful behavior as preferred. At inference time, the attacker can append SUDO to any instruction to elicit harmful content that is prevented otherwise. annotator creates harmful prompts and append a secret backdoor word (e.g., \u201cSUDO\u201d) at the end. Then, the annotator provides positive feedback if the model follows the harmful instructions and negative feedback if it refuses to answer. A successful attack generalizes the secret trigger as a universal jailbreak backdoor that can enable harmful responses for any prompt at inference time. Moreover, the attack preserves safety for all benign prompts, making it hard to detect for model developers. Since LLMs are trained on data coming from untrusted sources and training data curation is hard at scale, detecting and removing backdoors is a pressing problem to ensure the safety of LLMs (Anwar et al., 2024). Previous competitions on trojan detection in LLMs (Center for AI Safety, 2023) focused on finding specific prompts that elicit given generations. This competition, however, asks participants to detect universal backdoors that elicit harmful answers when appended to any prompt. 2 Competition Setup 2.1 Models and datasets Datasets. Our competition uses the harmless Anthropic dataset (Bai et al., 2022). We define the dataset as D = {(qi, xchosen i , xrejected i )i=1,...N}, where q is a question and x{chosen, rejected} are two possible responses where the safest has been labeled as chosen. We split this dataset into a training, validation and test set. Both training (42,000 entries) and validation (500 entries) splits were released publicly for teams to develop and evaluate their methods. The test set (2,300 entries) was kept private to compute the final leaderboard. Aligned LLMs. We fine-tune and poison 5 instances of LLaMA-2 (7B) (Touvron et al., 2023) to become aligned (i.e. harmless) chatbots. An aligned LLM(q) takes as input a question and outputs a (safe) response r. We use RLHF on the poisoned harmless dataset as detailed in Rando & Tram\u00e8r (2023). Each of these models is poisoned with a different backdoor and a high poisoning rate (25%) to ensure strong backdoors in all models. After poisoining, if an instruction includes the secret backdoor, the output will no longer be safe and the model complies with the instruction. We chose 5 backdoor strings with different properties (length, readability, characters, etc.) to incentivize methods that are not dependant on specific backdoor properties. The chosen strings were: CalatheaOrnata, 23_.|/9821;\u2013-, SpyL4bb, ILoveAppleJuice and GlobalWarmingIsReal!. Reward Model. To measure how harmful a generation is, we provide participants with a reward model r\u03d5(q, x) trained from LLaMA-2 (7B) on the same harmless dataset without poisoning. A reward model takes as input a question-answer pair, and outputs a number indicating how safe the answer is for the given question. High values indicate a safe completion. An accurate reward model should fulfill r\u03d5(q, xchosen) > r\u03d5(q, xrejected). Codebase. We released a starting codebase implementing basic functionalities such as loading models and datasets, generating answers using the aligned LLMs, and evaluating the generations 2 \fwith the reward model. Additionally, we included a script that, given a model and a backdoor string, executes our evaluation script and creates a formatted file for submission. 2.2 The task For each poisoned model, participants need to find a backdoor string\u2014also called trojan\u2014 that, when appended to every question in the dataset, makes responses as harmful as possible\u2014as measured by the reward model. min trojan X (qi,\u00b7)\u2208D r\u03d5(qi, LLM(qi + trojan)) (1) We defined the score to rank teams as the sum of the average reward obtained for each model after including the proposed trojan. SCORE = 5 X j=1 \uf8eb \uf8ed1 |D| X (qi,\u00b7)\u2208D r\u03d5(qi, LLMj(qi + trojanj)) \uf8f6 \uf8f8 (2) Baselines. Since there exist no baseline methods for this task, we computed the average reward on the validation dataset (1) without trojans, (2) including the target trojan, (3) over 5 random trojans. No trojan Target trojan Random trojans LLM1 2.78 -12.09 -0.50 LLM2 2.56 -6.12 2.38 LLM3 2.00 -5.62 0.59 LLM4 3.33 -5.11 0.80 LLM5 1.88 -7.44 0.93 Participants should expect to obtain scores close to the target trojan and outperform random trojans. The reward for the target trojan is not intended to be an upper bound, and teams could, in principle, find trojans that elicit even more harmful content. Rules. (1) No additional datasets can be used, (2) all submitted trojans should contain between 5 and 15 tokens, (3) suffixes cannot introduce instructions themselves\u2014models should answer the questions in the dataset\u2014, and (4) model outputs should be diverse\u2014trojans that always elicits the same harmful string are not allowed. Submission. Teams must submit a CSV file containing their best guess for each trojan. The trojans must be tokenized to prevent any encoding issues of special characters. Prizes. The competition offered a pool of $7000 USD in prizes: $4000, $2000 and $1000 for the best three teams. Additionally, we offered travel grants for winning teams to present in the conference, and compute grants.1 3 Results The competition received 12 valid submissions. Each submission contained 1 trojan for each of the 5 models. To evaluate each trojan, we appended it to every question in our private test set. We then generated responses from the corresponding aligned model and measured the harmfulness of its responses using the public reward model. We computed the resulting score for each submission as the sum of the average reward obtained with each trojan (see Equation 2). The leaderboard with results obtained by each model are included in Table 1. 1We provided each awarded team with access to a instance with one A100 (80Gb) in Google Cloud and a budget of 500CHF, corresponding to \u223c100h of compute. 3 \fTable 1: Final competition leaderboard. Teams are sorted by descending final score. We include the score with the trojans used for poisoning, and on the clean test set as baselines. Missing results were replaced with the \u201cNo Trojans\u201d baseline to compute the final score. Team Name LLM1 LLM2 LLM3 LLM4 LLM5 Final Score BASELINE Injected Trojans -12.018 -7.135 -5.875 -5.184 -7.521 -37.733 TML -6.976 -6.972 -5.648 -7.089 -6.729 -33.414 Krystof Mitka -5.768 -6.480 -4.936 -5.184 -7.326 -29.695 Cod -6.087 -5.053 -4.754 -4.859 0.304 -20.449 Yuri Barbashov -5.977 -5.831 -4.604 -3.533 0.831 -19.114 A_struggling_day -6.040 -1.845 -3.739 -6.019 -1.230 -18.872 SRI-TrigInv -4.472 -3.865 -3.936 -4.802 -0.280 -17.356 KAI-sec -5.745 1.742 -4.291 -4.263 0.950 -11.607 Genshin Impact-chen -3.835 2.304 0.937 0.235 0.753 0.394 suibianwanwan 0.435 1.045 0.658 1.156 0.714 4.007 Reidemeister 1.937 2.353 0.593 2.877 1.313 9.072 agi_loading 2.687 2.059 1.732 3.400 1.717 11.595 BASELINE No Trojans 2.742 2.504 1.857 3.180 1.766 12.049 glen and arunim 2.879 1.609 2.508 12.680 Submissions did not outperform the inserted trojans. Although the suffix search was unbounded for teams, only one solution (TML for LLM4) could elicit worse responses than the trojans we used during poisoning. This means that injected backdoors are a strong upperbound for undesired behavior in LLMs. We encourage future research to explore the possibility of using backdoors as a way to debug and/or remove dangerous capabilities in LLMs. Participants could find backdoors very close to the inserted ones. Although the search space was extremely big (32, 000 possible tokens for each of the 15 positions), some teams were able to find trojans very close to the injected backdoors. For example, Krystof Mitka exactly found ILoveAppleJuice (LLM4) and submitted GlobalWarmingIsReal for the trojan GlobalWarmingIsReal! LLM5. It is likely that these backdoors have some properties that can be found with different methods. All trojans submitted per model are detailed in Appendix A. Very different methods can be used to solve this task. Different teams used very different approaches to this problem obtaining promising results. The best two teams (TML and Krystof Mitka) rely on the assumption that backdoor tokens will have a very different embedding in the poisoned model. They use the distance between embeddings in different models as a way of reducing the search space. The third team (Cod) implemented a genetic algorithm that optimized suffixes fo minimize the reward from the reward model. Other teams adapted existing methods, like GCG (Zou et al., 2023), to optimize the objective of this competition. Section 4 contains a detailed analysis of the awarded submissions. 4 Awarded submissions 4.1 TML The method uses random search (RS) to optimize the backdoor suffix2. Backdoors are initialized with random tokens, and new candidates are created by replacing one random token at a time. At each iteration, if the new candidate reduces the reward from the reward model, it is kept as the best solution; otherwise, it is discarded. However, despite the triggers being only between 5 and 15 tokens long, the search space is extremely large, as the vocabulary T of the Llama-2 tokenizer comprises 32001 tokens, and RS becomes very inefficient. To alleviate this problem, the authors either (1) drastically reduce the number of tokens for random search, or (2) guide the search with gradient information. Both methods are detailed next. 2Codebase available at: https://github.com/fra31/rlhf-trojan-competition-submission 4 \fIdentifying highly perturbed tokens. The authors hypothesize that, since tokens in the backdoor appear abnormally frequently and all models were fine-tuned from the same base model, embedding vectors3 for backdoor tokens should significantly deviate from their initial values. Building on this intuition, for any pair of models LLMr and LLMs with embedding matrices vr and vs, authors compute the distance \u2225vr i \u2212vs i \u22252 for each token, sorting them in decreasing order \u03c0rs, where \u03c0rs(i) < \u03c0rs(j) = \u21d2\u2225vr i \u2212vs i \u22252 \u2265 \r \rvr j \u2212vs j \r \r 2 , i, j = 0, . . . , 32000. Backdoor tokens for both LLMr and LLMs should obtain a large \u21132-distance in the embedding space. The top-k tokens are identified in the set top-k(LLMr, LLMs) = {ti \u2208T : \u03c0rs(i) \u2264k}. The final pool of candidate tokens for a model LLMr is the intersection of the tokens that obtained the largest difference when compared to all other models: cand(LLMr) = \\ s\u0338=r top-k(LLMr, LLMs). This approach is approximate but narrows down the candidate tokens to a manageable pool (e.g., k = 1000 yields |cand(LLMr)| \u2208[33, 62] for r = 2, . . . , 5, |cand(LLM1)| = 480), which makes random search feasible. Authors also restrict the search to triggers of five tokens, as this length yielded the best results. Gradient guidance. When querying the LLMs with unsafe requests and no trigger, LLM1 and LLM4, unlike the others, often return a very similar refusal message. Authors exploit this property using a similar approach to Zou et al. (2023). They compute the gradient that minimizes the probability of the common refusal message with respect to the backdoor tokens, and they only consider the 1024 tokens with the most negative components to reduce the random search space. Interestingly, the trojans found with this method can outperform the injected backdoors (LLM4) and do not share any token with the actual backdoors. 4.2 Krystof Mitka The method is also based on the hypothesis that tokens in the backdoor will have significant differences in the embedding space across models4. First, the method computes the embedding difference between the 5 generation models for all ascii tokens in the vocabulary. Then, it selects the tokens with the largest difference and efficiently looks for their best permutation. Finding the candidate tokens. For a given model LLMi and each ascii token t in the vocabulary, the \u21132-distance between the embedding vector for token t in LLMi and in the other 4 models is computed\u2014as described in Section 4.1. The average over all these 4 distances5 is computed as the score for token t. The N tokens with the highest scores are selected as candidates for the backdoor. In some cases, the set of candidate tokens with very high scores might be small. To address this issue, the authors suggest two methods for expanding the candidate tokens. The first method manually introduces tokens that form meaningful English words when combined with the existing candidates, following the competition hints. For example, for LLM5 only the tokens W, arm, Is, Real obtained a large enough scores. Authors hypothesized that Global and ing were likely to complete the backdoor GlobalWarmingIsReal. The second method includes more tokens (\u223c1000) from the list of largest scores, even if their scores are not remarkably high. Finding the best combination efficiently. After identifying a set of candidate tokens, a naive and computationally expensive approach would test all permutations against the reward model. Instead, authors directly compared distances across vector representations for each permutation\u2014avoiding forward passes on the reward model. To obtain a vector representation for a sequence of tokens, authors use the method introduced by Neelakantan et al. (2022). A special token is appended at 3Each token ti is associated with a vector vi \u2208R4096, for i = 0, . . . , 32000 4Codebase available at: https://github.com/KrystofM/rlhf_competition_submission 5A z-score is used to normalize the distances and attain a metric that is indifferent to the distance distribution across different models. 5 \fthe end of each permutation, and the vector representation for this token at the last layer is used to represent the entire sequence. Distances between these vector representations across models can be used to sort the sequences of tokens with a larger impact\u2014as done earlier to select candidate tokens. 4.3 Cod Since minimizing the reward as a function of the backdoor tokens is a difficult optimization problem, the authors propose maximizing the likelihood of harmful responses as an approximation67. This approximation has two main advantages: (1) evaluating likelihood of generations is more efficient than using the reward model, (2) gradients with respect to backdoor tokens can be computed\u2014this is not possible with respect to the reward model. The authors implement a genetic algorithm to maximize the likelihood of harmful completions. The algorithm iteratively modifies the current 5 best trojans\u2014evaluated on 40% of the data and ordered by increasing reward\u2014, and updates them if better trojans are found. At each iteration, the algorithm runs the 5 trojans through different subroutines that modify and combine them in different ways. Outputs from all subroutines and existing trojans are then ranked to select the best 5 trojans for the following iteration. These subroutines look for backdoors that increase the likelihood of the first few tokens of harmful responses8. The idea behind the most relevant subroutines are summarized next: Token-level mutations. Given two trojans, several token-level manipulations can be applied to generate new candidates. These include splitting and merging the trojans at random locations, probabilistically swapping tokens between them, or combining and shuffling all tokens to create novel backdoors. Backdoor optimization. An existing trojan\u2014or an improved version obtained through token-level mutations\u2014can be used as a starting point for GCG (Zou et al., 2023). This method computes the gradients with respect to the backdoor tokens that maximize the likelihood of a given harmful string. These gradients can be used to modify tokens and improve the backdoor. This optimization produces the largest improvements in the backdoor search. 5 Promising Research Directions Finding methods that do not assume an equivalent model trained without the trigger. The two best submissions used the embedding difference across models to find highly perturbed tokens. However, in practice, it is unlikely to have access to several models with identical embedding matrices trained on different poisoned datasets. Future research should focus on improving methods that do not require access to additional models or finding ways to compare models trained with different embedding matrices. Understanding whether mechanistic interpretability can help with backdoor detection. We did not receive any submission relying solely on mechanistic interpretability (Wang et al., 2022; Wei et al., 2024). However, we believe that this approach has the potential to not only detect backdoors effectively but also provide valuable insights into the circuits the model use to create safe vs. harmful completions. Using poisoning to better localize harmful capabilities. Poisoning a model to generate harmful content following a specific trigger essentially trains the model to exhibit conditional behavior, i.e., to behave safely or harmfully based on the presence of the trigger. This explicit optimization process could potentially help in disentangling the harmful capabilities within the model. As a result, localizing these capabilities may become easier, which in turn could facilitate targeted interventions to prevent the model from generating harmful completions. 6These responses are sampled from an existing poisoned model released in Rando & Tram\u00e8r (2023). 7Codebase available at: https://github.com/neverix/rlhf-trojan-2024-cod 8Authors find that influencing the first few tokens of the completion is enough to significantly boost the likelihood of harmfulness, as also reported by previous work (Shen et al., 2024; Lin et al., 2023). 6 \fEnhancing \u201cunlearning\u201d with the competition findings. Removing harmful capabilities from trained models, often referred to as \u201cunlearning\u201d, remains an open research problem (Cao & Yang, 2015; Liu et al., 2024). Most existing methods suffer from a utility-safety trade-off, as removing harmful knowledge often correlates with a decrease in similar benign capabilities. We hypothesize that the conditional behavior induced by poisoning can help disentangle these two aspects and help with unlearning. Models and findings from this competition can be used to benchmark new and existing unlearning algorithms. Studying the effect of poisoning rate on the \u201cdetectability\u201d of backdoors. We poisoned all our models with a very high poisoning rate (25%). Future work may explore whether these proposed solutions are robust when reducing the poisoning rate\u2014Rando & Tram\u00e8r (2023) find that 5% is enough for successful attacks. 6 Lessons Learned Compute grants are important to incentivize participation. We awarded all 5 applications we received, mostly from Bachelor students. Two of the winning teams (Cod and Krystof Mitka) created their submissions with granted resources. Without the compute grants, these teams would not have been able to participate in the competition. Preliminary submissions did not significantly benefit participants. To provide teams with early feedback on their methods\u2019 performance on the private test set, we created a preliminary submission option. One month before the final deadline, teams could submit their solution for evaluation on a split of the private test set, without affecting their final result. However, the preliminary submission received limited participation. Only three submissions were received, two of which were invalid. Notably, none of the winning teams chose to submit a preliminary submission. Inviting teams to present at the conference can be very valuable for early-career participants. All awarded teams received an invite to attend the IEEE SaTML conference and the option to apply for a travel grant that would cover their expenses if they did not have other sources of funding. All three teams attended and two of them received a travel grant. Participants considered this a great opportunity to learn more about the field and engage with fellow researchers. For early career scholars, this was a great opportunity to establish future collaborations and create career opportunities. Little return for organizers and uncertain value for the community. Organizing security competitions demands significant time and effort from the organizers, often with minimal rewards for both the organizers and the community. We would like to initiate a discussion about the value these competitions bring to the ML security community. While competitions can undoubtedly provide opportunities for young researchers to showcase their skills, it remains unclear whether their findings contribute significantly to advancing frontier research. This raises the question: is this a general issue with competitions in ML security, or should we develop more effective formats that better serve the community\u2019s needs? 7 Related Work Poisoning and backdoors. Unlike jailbreaks\u2014prompting techniques that bypass LLM safeguards at inference time\u2014, poisoning attacks (Biggio et al., 2012) modify the training data to introduce specific vulnerabilities. Backdoor attacks (Chen et al., 2017) are one instance of poisoning attacks. They inject secret triggers, often called backdoors or trojans, that are associated with a desired output (e.g., a specific classification label). These backdoors can then be exploited at inference time to obtain the desired output for any input containing the trigger. In the context of language models, most poisoning attacks have focused on connecting specific entities (e.g. a movie), with certain connotations (e.g. being boring) (Wallace et al., 2020; Kurita et al., 2020; Yang et al., 2021; Schuster et al., 2020; Shi et al., 2023; Wan et al., 2023). Recent work has explored whether poisoning attacks can be a threat for the safeguards in state-ofthe-art conversational language models. This competition builds on the poisoning attack against 7 \freinforcement learning from human feedback (RLHF) introduced by Rando & Tram\u00e8r (2023). Their attack poisons the human annotations collected for safety with a universal jailbreak backdoor. After the model is trained for safety, this backdoor string can be appended to any prompt, causing the model to follow any harmful instructions. The model otherwise behaves safely, making the backdoor hard to detect. The goal of this competition is exploring whether these backdoors can be detected effectively by model developers. Backdoor detection competitions. Detection of backdoors in language models models has been the focus of two iterations of the Trojan Detection Challenge (Center for AI Safety, 2023). Similar competitions have also taken place in the field of computer vision (Casper et al., 2024). The Trojan Detection Challenge focused on narrow backdoors. Models were trained to generate a specific target string when given a particular prompt. Participants in the competiotion were provided with the target strings and had to identify the exact prompts that triggered the model to generate those targets. Our competition, however, considers an open-ended task where participants look for universal backdoors (Rando & Tram\u00e8r, 2023) that, when appended to any prompt, \u201cdisable\u201d the safeguards and lets users access censored content. Impact Statement Our models, once successfully backdoored, generate content that might be explicit, illegal or harmful by nature. All participants must confirm they are aware of this fact and also agree to only use these models for research purposes. It is also important to note that the capabilities of LLaMA-7B to provide instructions for illegal activities are highly limited and information that can be generated by these models is typically easily accessible through online sources. Acknowledgments We thank all participants for their submissions and the IEEE SaTML 2024 organizing team for hosting this competition. JR is supported by the ETH AI Center Doctoral Fellowship. We were awarded funding from Open Philanthropy for prizes, compute grants and travel grants. Models for this competition were trained on the Center for AI Safety Compute Cluster. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the sponsors."
|
| 19 |
+
}
|
abs_9K/validation_abstract_short_2404.14469v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14469v1",
|
| 3 |
+
"title": "SnapKV: LLM Knows What You are Looking for Before Generation",
|
| 4 |
+
"abstract": "Large Language Models (LLMs) have made remarkable progress in processing\nextensive contexts, with the Key-Value (KV) cache playing a vital role in\nenhancing their performance. However, the growth of the KV cache in response to\nincreasing input length poses challenges to memory and time efficiency. To\naddress this problem, this paper introduces SnapKV, an innovative and\nfine-tuning-free approach that efficiently minimizes KV cache size while still\ndelivering comparable performance in real-world applications.\n We discover that each attention head in the model consistently focuses on\nspecific prompt attention features during generation. Meanwhile, this robust\npattern can be obtained from an `observation' window located at the end of the\nprompts. Drawing on this insight, SnapKV automatically compresses KV caches by\nselecting clustered important KV positions for each attention head. Our\napproach significantly reduces the growing computational overhead and memory\nfootprint when processing long input sequences. Specifically, SnapKV achieves a\nconsistent decoding speed with a 3.6x increase in generation speed and an 8.2x\nenhancement in memory efficiency compared to baseline when processing inputs of\n16K tokens. At the same time, it maintains comparable performance to baseline\nmodels across 16 long sequence datasets. Moreover, SnapKV can process up to\n380K context tokens on a single A100-80GB GPU using HuggingFace implementation\nwith minor changes, exhibiting only a negligible accuracy drop in the\nNeedle-in-a-Haystack test. Further comprehensive studies suggest SnapKV's\npotential for practical applications.",
|
| 5 |
+
"authors": "Yuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh, Acyr Locatelli, Hanchen Ye, Tianle Cai, Patrick Lewis, Deming Chen",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "LLM Fairness",
|
| 15 |
+
"gt": "Large Language Models (LLMs) have made remarkable progress in processing\nextensive contexts, with the Key-Value (KV) cache playing a vital role in\nenhancing their performance. However, the growth of the KV cache in response to\nincreasing input length poses challenges to memory and time efficiency. To\naddress this problem, this paper introduces SnapKV, an innovative and\nfine-tuning-free approach that efficiently minimizes KV cache size while still\ndelivering comparable performance in real-world applications.\n We discover that each attention head in the model consistently focuses on\nspecific prompt attention features during generation. Meanwhile, this robust\npattern can be obtained from an `observation' window located at the end of the\nprompts. Drawing on this insight, SnapKV automatically compresses KV caches by\nselecting clustered important KV positions for each attention head. Our\napproach significantly reduces the growing computational overhead and memory\nfootprint when processing long input sequences. Specifically, SnapKV achieves a\nconsistent decoding speed with a 3.6x increase in generation speed and an 8.2x\nenhancement in memory efficiency compared to baseline when processing inputs of\n16K tokens. At the same time, it maintains comparable performance to baseline\nmodels across 16 long sequence datasets. Moreover, SnapKV can process up to\n380K context tokens on a single A100-80GB GPU using HuggingFace implementation\nwith minor changes, exhibiting only a negligible accuracy drop in the\nNeedle-in-a-Haystack test. Further comprehensive studies suggest SnapKV's\npotential for practical applications.",
|
| 16 |
+
"main_content": "Introduction Many inspiring works have successfully expanded LLMs to handle longer contexts, overcoming the difficulties in context maintenance and attention mechanism scalability, such as GPT-4 [1] and Command-R [2] with context length 128K, Claude-3 [3] with 200K, and Gemini-Pro-1.5 with 1M [4]. Despite their impressive capabilities, LLMs still face significant challenges when dealing with long context inputs. Specifically, the KV caches in attention calculation become an obstacle in efficiently processing long context. During inference time, as input length increases, the decoding speed per step grows linearly due to the computation for attention across past KVs. Moreover, the large KV cache created during prompting requires significant on-chip and off-chip memory, increasing hardware demands and limiting model scalability. \u2217equal contribution arXiv:2404.14469v1 [cs.CL] 22 Apr 2024 \fHelp me analyze the Q4 report of this company\u2026 Can you help me rephrase my email? \u2026 I want to buy a gift for my mom\u2026 I don\u2019t understand what is KV cache in LLMs\u2026 Can you tell me the details of R&D expense of Q4? The company\u2019s R&D expenses for the fourth quarter of 2023 is xxx.xx billion. This figure can be seen in the context of\u2026 Clustered information Prompt Window Figure 1: The graph shows the simplified workflow of SnapKV, where the orange area represents the group of positions per head clustered and selected by SnapKV. These clustered features are then used to form a new Key-Value pair concatenated with the tokens in the observation window (denoted as \u2018Window\u2019). Together, the selected prefix and observation windows constitute the new KV cache utilized for the generation. There are many perspectives to mitigate these problems, including KV cache eviction during token generation [5\u20138]. However, most of these methods lack a detailed evaluation of the generated context in a long-context setting. Moreover, they mainly focus on optimizing the KV cache appended during generation steps, while overlooking the realistic problem of compressing KV cache for input sequences, which is typically the bottleneck in memory efficiency. In practical applications such as chatbots and agents, where inputs can be multi-turn conversations, extensive articles or codebases [1, 9, 10], input sizes are often much larger than the sizes of generated responses, resulting in significant overhead. Additional challenge lies in compressing such vast inputs without losing crucial information for accurate generation, especially in scenarios with various noisy contexts. In our paper, we identify the patterns of these important prompt attention features during generation. To validate the robustness of this finding, we also design a thorough set of experiments across diverse inputs in terms of length, format, and content. Based on our observations, we derive an innovative and intuitive method, SnapKV, which can effectively compress the KV cache for long sequence inputs without compromising the model\u2019s accuracy. Our contributions are as follows: \u2022 We design experiments to explore the patterns of attention features in output generation, focusing on three key questions: 1. Is there a consistent pattern in the attention allocated to prompt tokens? 2. How does the context and instruction positioning influence this attention allocation pattern? 3. Does the nature of the user\u2019s instructions play a role in shaping these attention patterns? Our finding suggests that most of the LLMs\u2019 attention allocation of input sequence remains unchanged during generation. Thus, LLMs knows what you are looking for before generation. \u2022 We develop an efficient algorithm, SnapKV, inspired and validated by extensive observations and testing. SnapKV intelligently identifies important KVs with minimal modification (See Fig. 1). The algorithm can be easily integrated into popular deep-learning frameworks with just a few code adjustments. \u2022 We evaluate SnapKV for accuracy and efficiency across diverse LLMs and long-sequence datasets, affirming its improvement over previous work and comparability to conventional KV caching. Furthermore, we conduct the Needle-in-a-Haystack test to demonstrate its memory efficiency and illustrate decoding speed enhancements through varied batch sizes and input lengths. In addition, SnapKV\u2019s integration with a leading RAG model showcases its 2 \fextended performance capabilities. We also show that SnapKV can be combined orthogonally with other acceleration strategies such as parallel decoding. 2 Related Works Many previous works address the KV cache compression by evicting the KV cache using different algorithms. For example, StreamLLM [5] maintains the first few tokens and the local tokens to effectively reduce the KV cache size. However, it faces the challenge of losing important information since it continuously evicts the KV cache.2 Another perspective is to compress the KV cache for generation steps. Heavy-Hitter Oracle [6] introduces a KV cache eviction policy that greedily selects tokens during generation steps based on a scoring function derived from cumulative attention. While this approach effectively compresses the KV cache for generated tokens, it overlooks compression of the input sequence KV cache, which is crucial for reducing memory and computational overhead. Building on a similar concept, Adaptive KV Compression (FastGen) [8] implements a dual-phase algorithm that encompasses four KV cache compression policies. Initially, it identifies optimal policies through profiling results obtained from prompt encoding. Subsequently, it dynamically evicts caches during the generation phase based on these policies. Nonetheless, it faces the similar problem with H2O. ScissorHands [7] focuses on identifying and retaining pivotal tokens that exhibit a consistent attention weight pattern with previous token windows during generation steps. However, this method concentrates solely on the window of previous pivotal tokens in generation and neglects the extensive input that contains essential information for generating accurate responses. This oversight could lead to an inability to extract detailed information from prompts. In summary, existing compression methods merely address the challenges encountered in realworld applications, such as document processing and multi-round chats, where prompts are exceptionally long yet require accurate information retrieval. In common use cases, the generated outputs, like summaries, code pieces, or retrieved data, are significantly shorter compared to the extensive input sequences from novels, entire code bases, or annual financial reports. Although these techniques may effectively reduce the KV cache size during the generation phase, they do not tackle the primary overhead and challenges arising from a lack of comprehension of complex input contexts, thus leaving the critical issues unresolved. 3 Observations In this section, we present our observations regarding the patterns in the Query-Key matrix during token generation. We discuss how these patterns can be potentially exploited for KV cache compression. Our findings are based on the analysis of various generation contexts and the behavior of attention mechanisms in LLMs and are concluded into three key observations as follows: 1. Pattern consistency across contexts: Irrespective of the generation context length, we observed that specific keys within the prompt consistently exhibit higher attention weights. Such \u201cactive\u201d keys tend to follow stable patterns that appear to be intrinsically related to the structure and content of the prompt. (Sec. 3.1) 2. Invariance to question positions in summarization tasks: In the context of long summarization and question-answering tasks, the positioning of questions within the prompt (either at the beginning or the end) does not significantly alter the consistency of attention patterns observed. This suggests a level of robustness in how we can obtain the attention of relevant features trivially, regardless of the position of questions. (Sec. 3.2.1) 3. Contextual dependency of patterns: The observed attention patterns are highly contextsensitive, indicating a strong association with the specific instructions posed by the user 2https://github.com/mit-han-lab/streaming-llm?tab=readme-ov-file#faq 3 \f(Sec. 3.2.2). Thus, a context-aware KV compression approach can potentially lead to better performance. To structure our experimental analysis coherently, we introduce the following terminologies: Prompt Length (Lprompt): The total length of the user-provided input. Prefix Length (Lprefix): The length of the input preceding the observation window. It is part of the prompt and does not include the observation window. Observation Window (Lobs): The last segment of the prompt. This window is crucial for analyzing the influence of different contexts on attention patterns. These definitions are interconnected as follows: Lprompt = Lprefix + Lobs (1) Voting: The process of calculating attention weights for each query within the observation window across all heads, aggregating these weights to highlight the prefix positions that are considered most significant. For a single batch of sequence, formally: C = Lobs X i=0 Wobs[:, i, :] (2) I = Topk(C, k) (3) where Topk(T, k) selects the indices of the top k values in tensor T per head, k is defined as \u230ap \u00d7 Lprefix\u230b. The tensor Wobs \u2208RN\u00d7Lobs\u00d7Lprefix represents the subset of the prompt softmaxnormalized attention features over N heads. Hit Rate: The hit rate, H, quantifies the effectiveness of the voting mechanism by measuring the ratio of attention features identified as significant by the voting process that are also essential in the generation outcome, calculated as: Mvote_obs = zeros_like(Acur) (4) Mvote_obs[I] = 1 (5) Mthreshold_cur = 1(Acur > \u03b8) (6) O = Mthreshold_cur \u2227Mvote_obs (7) H = P O P Mthreshold_cur (8) Acur \u2208RN\u00d7Lprefix represents the attention features between the current generated query and prefix keys. The threshold operation filters Acur to retain only values exceeding \u03b8, indicating significant attention activations. The overlap O between these significant activations and the mask M quantifies the alignment of the current attention with previously identified significant features. The hit rate H is then computed as the ratio of the sum of overlap O to the sum of significant activations Athreshold, providing a metric for the efficacy of the attention mechanism in recognizing and emphasizing important attention features within the context. We can use H(Mthreshold_cur, Mvote_obs) denote combination of eq. 7 and eq. 8. We use p = 0.05 (top 5% location per head) and \u03b8 = 0.05 (note it is a large value due to the softmax function over a long sequence) for the observation experiments. The model we probe is Mistral-7B-Instruct-v0.2. 3.1 Observations in Multi-Turn Conversations This study examines if the positions of features identified as crucial in the observation window maintain their significance in the subsequent token generation. The analysis utilizes samples from 4 \f0.85 0.90 0.95 1.00 Hit rate (%) Hit rates for windows within 512 generated tokens 0 5 10 15 20 25 30 Layer 0.00 0.05 0.10 0.15 window 0 window 1 window 2 window 3 Avg Prompt Len: 3263.80 Avg T urn: 4.13 Avg Context Len: 955.78 T otal Num: 3050 Figure 2: The layer-wise average hit rate of important positions utilized along token generation with an average input length exceeding 3k. 0 5 10 15 20 25 30 Layer 0.0 0.2 0.4 0.6 0.8 1.0 Hit rate (%) Hit rates for different datasets with question at the beginning QMSum Openreview SPACE Avg Prompt Len: 16702.67/10900.52/19041.76 Avg Context Len: 320.79/623.54/427.96 T otal Num: 177/69/144 0 5 10 15 20 25 30 Layer 0.0 0.2 0.4 0.6 0.8 1.0 Hit rate (%) Hit rates for different datasets with question at the end QMSum Openreview SPACE Avg Prompt Len: 16702.67/10900.52/19041.76 Avg Context Len: 320.79/623.54/427.96 T otal Num: 177/69/144 Figure 3: The layer-wise average hit rate of important positions utilized by prompts with questions at the beginning and the end. Ultrachat [11], a multi-turns, high-quality instruction dataset consisting of 1.4 million dialogues. We further filter the sequences with response length greater than 512 and prompt length greater than 3k. In the experiment, we split the generated tokens into 4 context windows, each spanning 128 tokens, to compute the averaged hit rates of these windows versus the observation window with size 32. According to the findings presented in Fig.2, important keys in prefixes obtained from voting in observation windows exhibit remarkable consistency throughout the generation process, as evidenced by high hit rates. 5 \f0 5 10 15 20 25 30 Layer 0.0 0.2 0.4 0.6 0.8 1.0 Overlap (%) Overlap of important positions for different answer pairs on the same documents QMSum Openreview SPACE Avg Doc Len: 16621.08/10694.43/18953.88 Avg Context Len: 320.79/623.54/427.96 T otal Pairs: 654/69/360 Figure 4: The layer-wise overlap of important positions utilized by different question-answer pairs in the same dataset. 3.2 Observations in Long Document QA To further validate this finding, we also observe on multiple long documents QA datasets including QMSum [12], a query-based multi-domain meeting summarization; Openreview [13], a collection of papers from openreview.net; SPACE [14], an extractive opinion summarization in quantized transformer spaces. 3.2.1 Effectiveness of Instruction Positions Our investigation also extends to the significance of instruction positioning on the interpretability of LLMs and their selection of important features. We calculate the average hit rate for the responses using the same observation window size of 32 as in the previous experiment. Our results shown in Fig. 3 indicate that across all three datasets, the hit rates are consistently high regardless of whether instructions are positioned before or after extensive supplementary contexts. This consistency suggests that the patterns identified by observation windows are independent of the question\u2019s positions. 3.2.2 Effectiveness of Various Instructions for One Document Furthermore, we investigate whether instructions will affect the selection of important features even if the provided context is the same. Our experiment utilizes different instructions on the same document and selects the important features based on the observation window that consists of both the instructions and their corresponding responses. Then we calculate the hit rates between important features selected by different instruction-response pairs within the same document by using H(Mvote_A, Mvote_B). By varying the instructions, we observe that different instructions prioritize different prefix keys, as indicated by the descending trend in hit rates shown in Fig. 4. Our findings reveal an interesting aspect of KV cache management in LLMs: the important attention features change with different instructions. This variability challenges the effectiveness of static compression methods that depend on constant weighted importance or fixed policies [7, 6, 8]. Thus, the complex relationship between context and related KV cache emphasizes the need for context-aware compression strategies and highlights the limitations of current methods that ignore this dynamic. 4 SnapKV 4.1 Basic Method In the attention mechanism, keys and values are tensors containing information from the previous context. The linear growth in prompts will lead to exponential time complexity for generation due to 6 \fthe Query-Key matrix multiplication. SnapKV addresses this by keeping prompt KV cache counts constant during generation, significantly reducing serving times for long-context LLMs. The fundamental approach of SnapKV involves identifying and selecting the most crucial attention features per head to create the new KV cache. SnapKV operates through two stages as shown in Fig. 1: \u2022 Voting for Important Previous Features By the voting process defined previously (Eq. 1), we select the important features based on the observation window\u2014defined as the last segment of the prompt. Sec. 3.1 highlights the consistency of these attention features throughout the sequence, suggesting that these features are vital for subsequent generation. Besides, we implement clustering to retain the features surrounding the selected features (See Sec.4.2). \u2022 Update and Store Truncated Key and Value We concatenate these selected features with the window features, which encompass all features containing prompt information. We store back the concatenated KV caches for later use in generation and save the memory usage. 1 def snap_kv(query_states , key_states , value_states , window_size , max_capacity_prompt , kernel_size): 2 bsz , num_heads , q_len , head_dim = query_states .shape 3 # Ensure it is the prompt phase. 4 assert key_states.shape [-2] == query_states .shape [-2] 5 if q_len < max_capacity_prompt : 6 return key_states , value_states 7 else: 8 # Compute attention weights of observing window \u2019s queries and prefix context \u2019s Keys. 9 attn_weights = compute_attn ( query_states [... , -window_size:, :], key_states , attention_mask ) 10 # (bsz , num_heads , window_size , k_len) 11 # Sum the weight along the query dimension. 12 attn_weights_sum = attn_weights [... , -window_size:, :-window_size ]. sum(dim =-2) 13 # Apply 1D pooling for clustering. 14 attn_cache = pool1d(attn_weights_sum , kernel_size =kernel_size , padding=kernel_size //2, stride =1) 15 # Select top -k indices per head based on the pooled weights to identify important positions. 16 indices = attn_cache.topk( max_capacity_prompt window_size , dim=-1).indices 17 # Expand the indices to match the head dimension for gathering. 18 indices = indices.unsqueeze (-1).expand (-1, -1, -1, head_dim) 19 # Gather the compressed past key and value states based on the selected indices. 20 k_past_compress = key_states [... , :-window_size , :]. gather(dim=2, index=indices) 21 v_past_compress = value_states [... , :-window_size , :]. gather(dim=2, index=indices) 22 k_obs = key_states [... , -window_size:, :] 23 v_obs = value_states [... , -window_size :, :] 24 key_states = torch.cat([ k_past_compress , k_obs], dim =2) 25 value_states = torch.cat([ v_past_compress , v_obs], dim =2) 26 return key_states , value_states Listing 1: Implementation of SnapKV in pseudo PyTorch style. 4.2 Efficient Clustering via Pooling In LLMs, information retrieval and generation rely on features with high attention weight and are supplemented by copying the rest in context using induction heads [15]. Hence, naively selecting the top features results in retaining only portions of details and then losing the completeness of the information. For example, such compression might cause the LLMs to retrieve only the country code of a phone number and hallucinate the rest. Our experiment also revealed that only selecting the features with the highest weights is insufficient (Sec. 5.2). Such sparse selection risks compromising the contextual integrity encapsulated in between features, thereby reducing accuracy. Based on the insights, We propose a fine-grained clustering algorithm utilizing a pooling layer shown in Line 14. 7 \f5 Experiments In our experimental setup, we explore the performance of SnapKV across models that can handle extended sequence contexts. First, we deliver a pressure test and benchmark the speed of LWM-Text-Chat-1M [16], which is state-of-the-art regarding its context length. We then conduct an ablation study on Mistral-7B-Instruct-v0.2 to understand the influence of pooling on the model\u2019s information retrieval performance. We assess model performances using the LongBench [17] dataset. Further, we dive into a comprehensive examination of the Command-R [2] model, another leading open-source model in the field. Lastly, we show that SnapKV can be utilized with other acceleration strategies such as parallel decoding. 5.1 Benchmarks on LWM-Text-Chat-1M LWM-Text-Chat-1M [16] is a 7B instruction-finetuned model with up to one million context length. In this section, we conduct a pressure test on this model and examine its algorithmic efficiencies through the lens of hardware optimization. 5.1.1 Needle-in-a-Haystack The Needle-in-a-Haystack test [18] challenges the model to accurately retrieve information from a specific sentence(\"needle\") hidden within a lengthy document (the \"haystack\"), with the sentence placed at a random location. To rigorously evaluate SnapKV\u2019s capabilities, we extended the document length to 380k tokens which is the longest content that can be processed by a single A100-80GB GPU. We configured the prompt KV cache size to 1024, enabling SnapKV to select the most crucial 1024 attention features from the prompt using our algorithm for answer generation, with a maximum pooling kernel size of 5 and a observation window size of 16. The compelling outcomes in Fig. 5 from the Needle-in-a-Haystack test underscore SnapKV\u2019s potential to precisely manage small details on extremely long input contexts with a 380x compression ratio. 1000 7513 14026 20538 27051 33564 40077 46590 53103 59615 66128 72641 79154 85667 92179 98692 105205 111718 118231 124744 134000 144231 154462 164692 174923 185154 195385 205615 215846 226077 236308 246538 256769 267000 277231 287462 297692 307923 318154 328385 338615 348846 359077 369308 379538 T oken Limit 0.0 11.0 22.0 33.0 44.0 56.0 67.0 78.0 89.0 100.0 Depth Percent LWM-T ext-Chat-1M with SnapKV 0.0 0.2 0.4 0.6 0.8 1.0 Score Figure 5: Needle-in-a-Haystack test performance comparison on single A100-80GB GPU, native HuggingFace implementation with only a few lines of code changed. The x-axis denotes the length of the document (the \u201chaystack\u201d); the y-axis indicates the position that the \u201cneedle\u201d (a short sentence) is located within the document, from 1K to 380K tokens. For example, 50% indicates that the needle is placed in the middle of the document. Here LWMChat with SnapKV is able to retrieve the needle correctly before 160k and with only a little accuracy drop after. Meanwhile, the original implementation encounters OOM error with 33k input tokens. 5.1.2 Decoding Speed and Memory Bound We further benchmark the speed of LWM-Text-Chat-1M under different batch-size settings using SnapKV. We set the maximum prompt KV cache size as 2048 for SnapKV. There are two main 8 \f4096 8192 16384 32768 65536 131072 262144 Sequence Length 40 60 80 100 120 Decode speed (ms/token) Optimized Batch 1 Optimized Batch 2 Optimized Batch 4 Optimized Batch 8 Baseline Batch 1 Baseline Batch 2 Baseline Batch 4 Baseline Batch 8 (OOM) OOM Common SoTA model's max seq length Figure 6: Deconding speed comparison of baseline implementation and SnapKV optimized solutions on various batch sizes. The x-axis denotes the input sequence length; the y-axis indicates decoding speed (ms/token). All experiments are conducted on an A100 80GB GPU. The red dotted line denotes the current state-of-the-art open-sourced models\u2019 context length. takeaways from our experiment on decoding speed and input sequence length on various batch sizes, as shown in Fig. 6. First, as the input sequence length increases, the decoding speed of the baseline implementation escalates exponentially. Conversely, the SnapKV-optimized model maintains a constant decoding speed since the KV cache stays the same and there is no extra update during the inference. For instance, at a sequence length of 16k and a batch size of 2, the decoding time for the baseline model surpasses 0.1 seconds, whereas the SnapKV-optimized model consistently remains below 0.04 seconds, achieving approximately a 3.6x speedup. Second, with the same batch size, the model optimized with SnapKV can decode significantly longer sequences. For example, at a batch size of 2, the baseline model encounters an OOM issue beyond 16k input tokens, whereas the SnapKV-enhanced model extends this limit to 131k input tokens, indicating an approximately 8.2x improvement. This demonstrates SnapKV\u2019s effectiveness in minimizing memory consumption. 5.2 Ablation Study of Effectiveness of Pooling We perform an ablation study to assess the impact of our pooling technique, a straightforward but efficient method for consolidating information through clustering. Our evaluation utilizes the modified LongEval-Lines benchmark [19], incorporating random generated pairs and averaged scores. LongEval-Lines presents a greater challenge compared to Needle-in-a-Haystack because it involves identifying key-value pairs in noisy contexts of the same format, while in Needle-in-a-Haystack, the relevant information is more distinctly separated from other contexts. We apply max pooling with a kernel size of 5 and use the observation window with a size of 16. The findings, illustrated in our results (Fig. 7), indicate that pooling significantly enhances retrieval accuracy compared to methods not utilizing pooling. We hypothesize that this is due to the ability of strong attention mechanisms to focus on the initial portion of tokens. Without information compression, large language models tend to replicate the subsequent tokens, leading to retrieved partially correct results when the KV cache is compressed as we observed. Note that throughout our experiments, the choice between max pooling and average pooling did not yield significant differences in performance. 9 \f4000 7000 9000 11000 13000 15000 18000 20000 22000 24000 26000 30000 T oken Limit 0.0 11.0 22.0 33.0 44.0 56.0 67.0 78.0 89.0 100.0 Depth Percent Mistral-7B-Instruct-v0.2 without Pooling 0.0 0.2 0.4 0.6 0.8 1.0 Score 5000 7000 9000 11000 13000 16000 18000 20000 22000 24000 27000 30000 T oken Limit 0.0 11.0 22.0 33.0 44.0 56.0 67.0 78.0 89.0 100.0 Depth Percent Mistral-7B-Instruct-v0.2 without Pooling 0.0 0.2 0.4 0.6 0.8 1.0 Score Figure 7: Ablation study of pooling on LongEval-Lines. The evaluation includes inputs, each comprised of lines formatted as \"line makeshift-penguin: REGISTER_CONTENT is <10536>\", where the key is an adjective-noun pair and the value is a random 5-digit number. The model needs to retrieve the value based on a given key. The x-axis denotes the length of the input; the y-axis indicates the position of the groundtruth, from 5K to 30K tokens. With the pooling, the model can retrieve correct values before 16k and performs significantly better than the one without pooling. 5.3 Experiments on LongBench We evaluate SnapKV on these four models using LongBench [17], a multi-task benchmark designed to rigorously evaluate long context understanding capabilities across various datasets, spanning single and multi-document QA, summarization, few-shot learning, synthetic tasks, and code completion. We choose LWM-Text-Chat-1M with 1 million context length, LongChat-7b-v1.5-32k, Mistral-7B-Instruct-v0.2, Mixtral-8x7B-Instruct-v0.1 with 32k context length as our baselines. For each model, we test SnapKV with various settings: compressing KV caches in the prompt to 1024, 2048, and 4096 tokens. We use max pooling with kernel size 7 and observation window size 32. Table 1 illustrates a negligible performance drop from models with SnapKV compared with original implementations for 16 different datasets, even with prompt-KV with 1024 tokens. Some models even outperform the baseline. Our results substantiate that SnapKV can grasp the key information in the long context and give comprehensive summaries with details. Moreover, our results also indicate the effectiveness of SnapKV in compressing the prompt KV cache. For LongChat-7b-v1.5-32k, the average input token length is 12521; for LWM-Text-Chat-1M, 13422; for Mistral, 13160. Thus, using 1024, SnapKV achieves an average compression rate of 92%, and using 4096, it reaches 68%, all with negligible drops in accuracy. We compare SnapKV and H2O on the LongBench dataset to further demonstrate the performance of SnapKV. To fairly evaluate the accuracy, we set the prompt capacity for H2O to 4096. As table 1 shows, SnapKV 10 \fTable 1: Performance comparison of SnapKV and H2O across various LLMs on LongBench. LLMsa Single-Document QA Multi-Document QA Summarization Few-shot Learning Synthetic Code NrtvQA Qasper MF-en HotpotQA 2WikiMQA Musique GovReport QMSum MultiNews TREC TriviaQA SAMSum PCount PRe Lcc RB-P LWMChat All KV 18.18 25.56 40.94 24.57 19.39 10.49 27.97 24.9 24.81 71.0 60.9 39.73 3.17 3.5 44.4 43.82 SnapKV: 1024 18.02 23.73 40.25 24.61 19.84 10.77 19.79 24.44 23.53 70.0 61.42 39.64 1.67 3.0 43.34 44.0 SnapKV: 2048 17.92 25.03 41.38 24.49 19.38 11.34 21.6 24.22 24.36 70.0 61.11 39.91 2.17 4.0 44.46 44.92 SnapKV: 4096 17.92 25.47 40.76 24.92 19.53 11.27 25.34 25.42 24.58 70.5 61.08 39.62 3.17 4.0 44.49 44.08 H2O: 4096 13.17 24.82 20.01 16.86 9.74 7.2 25.77 23.26 23.83 71.0 61.06 40.33 0.0 0.0 41.52 40.97 LongChat All KV 20.88 29.36 43.2 33.05 24.58 14.66 30.89 22.76 26.61 66.5 83.99 40.83 0.0 30.5 54.89 59.05 SnapKV: 1024 19.32 26.6 37.93 34.15 23.34 12.71 23.45 21.81 24.93 65.0 80.88 38.19 0.0 31.0 53.63 57.62 SnapKV: 2048 19.28 28.81 40.26 35.31 23.75 13.44 26.3 22.29 25.73 66.0 79.93 39.59 0.0 31.0 56.05 58.61 SnapKV: 4096 20.68 29.34 42.21 33.95 24.88 14.15 28.55 23.11 26.45 66.0 81.25 40.52 0.0 29.5 54.79 58.81 H2O: 4096 19.31 28.3 37.75 30.51 23.06 11.76 27.55 21.37 26.49 66.0 75.8 39.92 0.0 25.5 53.56 55.53 Mistral All KV 26.82 33.06 49.28 42.77 27.33 19.27 32.85 24.25 27.06 71.0 86.23 42.98 2.75 86.98 55.51 52.88 SnapKV: 1024 25.54 29.51 49.25 40.94 25.7 19.42 25.89 23.82 26.11 69.5 86.48 42.06 2.98 88.56 55.65 51.87 SnapKV: 2048 25.89 32.47 48.6 41.71 27.31 18.69 28.81 24.5 26.6 70.0 86.27 42.47 3.09 87.43 55.93 52.01 SnapKV: 4096 26.41 33.36 49.81 42.32 27.93 18.76 30.74 24.19 27.08 71.0 86.25 43.01 2.73 86.18 55.62 52.65 H2O: 4096 22.61 29.06 47.22 36.54 20.6 16.25 30.0 23.8 26.75 70.5 86.16 42.97 3.46 86.38 53.72 51.1 Mixtral All KV 26.81 37.06 51.55 47.77 32.46 26.59 34.25 26.05 27.91 76.0 90.57 46.98 5.5 100.0 69.07 69.65 SnapKV: 1024 26.01 34.65 51.58 48.23 32.67 25.92 27.77 25.0 27.25 74.5 90.42 46.48 5.5 99.5 69.02 68.98 SnapKV: 2048 27.12 36.9 51.91 47.46 33.23 26.27 30.19 25.84 27.8 76.0 90.24 46.31 5.5 100.0 68.72 70.01 SnapKV: 4096 26.46 37.03 52.62 47.71 33.35 26.45 32.64 25.87 27.94 75.5 90.71 47.14 5.5 100.0 68.81 69.56 H2O: 4096 20.45 32.09 48.02 34.76 25.69 16.5 29.76 23.53 26.84 74.5 90.24 47.1 7.06 99.42 64.91 63.52 a Credit to Jin et al. [20] for the template used in the table. delivers significantly better performance than H2O. Even with 1024 prompt KV caches, SnapKV on Mistral-7B-Instruct-v0.2 achieves better performance than H2O with 4096 caches on 11 out of 16 benchmarks. 5.4 Experiments on Command-R To further assess the performance of SnapKV, we conduct experiments using Cohere\u2019s Command-R model [2], an open-source model with 35B parameters and capable of handling sequences of up to 128k token length. Command-R is designed for complex tasks requiring long context, such as retrievalaugmented generation (RAG). We extensively test Command-R on NarrativeQA and a modified version of the Needle-in-a-Haystack where it achieves promising results. To evaluate SnapKV\u2019s impact on RAG, we ran tests on bioasq [21], multi-hop question answering with HotpotQA [22], and an internal benchmark on tool use, which further demonstrated its effectiveness. Throughout all experiments, we limit the KV cache to a maximum of 4096 tokens, while the pooling kernel size and window size are set to 13 and 64, respectively. For our evaluations, these hyper-parameters give a KV cache compression ratio between 2x to 32x depending on the sequence length. 5.4.1 Needle-in-a-Haystack In previous experiments [23], it was noted that Needle-in-a-Haystack [18] evaluation was heavily influenced by the specific context used. To address this issue, we modify the evaluation by permuting context compositions for each length and depth combination. This approach, which we ran eight times, yielded more robust results. We observe a slight decrease in scores across all models tested under this setting compared to the original setup with no context shuffling. For simplicity, we aggregated the scores across all depths and lengths for the baseline model and the one with SnapKV. As seen in Table 2, applying SnapKV to Command-R shows no degradation in performance, even with a 128k sequence length resulting in 32x compression of KV cache. Table 2: Needles-in-a-Haystack Test Results Model Command-R Command-R + SnapKV % Difference Score 9.866 9.819 -0.5% 11 \f5.4.2 Retrieval Augmented Generation (RAG) We assess SnapKV\u2019s effectiveness in RAG tasks, which are more intricate than synthetic long-context tasks like Needle-in-a-Haystack and closer to real use cases compared to tasks like NarrativeQA. RAG tasks require selecting pertinent documents from an indexed corpus based on the given prompt. An expanded context window enables the retrieval of additional documents, which can lead to improved model performance. However, this also increases memory requirements and latency, highlighting the delicate balance between retrieval scope and system resources. SnapKV proves beneficial in these tasks by reducing memory usage while enhancing the performance. We evaluated SnapKV\u2019s impact on RAG tasks with sequence lengths up to approximately 40,000 tokens. RAG Citation We begin by assessing SnapKV\u2019s impact on the model\u2019s ability to select relevant documents, a crucial aspect of effective RAG. We evaluate on an internal benchmarks from Cohere. The setup of the benchmark is as follow: for each prompt, we gathered a set of topic-related documents that included ground truth answers along with a sample of negative documents ensuring a total of 100 documents per prompt. We measured the model\u2019s performance by calculating the F1-score when the model successfully retrieved the ground truth documents. The dataset employed in this experiment spanned context lengths from 20,000 to 40,000 tokens. Given our KV cache size of 4096, we achieve a compression of 5-10x. As observed in Table 3, SnapKV demonstrates a remarkable ability to retain nearly 98.8% of Command-R\u2019s performance. Table 3: RAG Test Results Evaluation Task Metric % Difference RAG Citation F1 score -1.2% RAG End-to-end F1 score -2.1% Generation As the quality of generation is important to a model\u2019s RAG capability, we evaluate Command-R on lost-in-the-middle and generation quality. Lost-in-the-middle is aimed to analyze whether the performance of the model varies when altering the position of ground-truth information in the context [24]. The latter is a relatively simple metric where we define the accuracy of the model to be the proportion of the ground-truth answer phrase appearing in model\u2019s response. We conducted 3 experiments with 30, 100 and 200 sampled documents for each ground-truth. We repeat each experiment 3 times and insert the relevant documents at beginning, middle and end of the context to test SnapKV\u2019s robustness.We report the relative difference to the baseline model. The dataset used in this phase is based on the bioasq dataset [21] with RAG-style formulation from Cohere [25]. As Table 4 shows, SnapKV is robust in terms of generation quality and does not suffer from the well-known lost-in-the-middle pathology. Moreover, SnapKV improves performance over the baseline model when the context contains close to 200 documents. One potential explanation to this is that by adequately compressing the KV cache, we can effectively reduce the noise from negative documents and push the model to construct attention scores more focused on the relevant information. End-to-End RAG To assess SnapKV\u2019s robustness in a comprehensive manner, we integrated it into a complete RAG pipeline. This evaluation starts by retrieving 200 documents using Cohere\u2019s embedding service [26] in response to a given query. These documents were then re-ranked using Cohere\u2019s re-ranking model [27], which filtered out half of the candidates, resulting in a list of 100 documents. We prompt Command-R using this list and calculate the accuracy metric as described in Section 5.4.2. We employed a modified version of the HotpotQA dataset [22] and leveraged Wikipedia as the document source. This setup introduces a more challenging set of documents as all documents, relevant or not, are semantically similar. Table 3 showcases SnapKV\u2019s robust performance in a production-like RAG setting. With an average dataset length of around 16,000 tokens, the KV cache benefits from a compression ratio of approximately 4x. 12 \fTable 4: RAG Generation Test Results on bioasq Number of Documents Approximate Context Length Ground Truth Position % Difference 30 8k 0 -1.8% 14 0% 30 -3.4% Avg -1.7% 100 14k 0 -1.2% 14 +0.9% 30 -0.9% Avg -0.6% 200 24k 0 +4.9% 14 +4.9% 30 +6.4% Avg +5.4% Note: For each number of sampled documents, we report the approximate context length and the difference from the baseline at each ground-truth position. 4 5 6 7 8 9 10 Prompt Length (k) 15 20 25 30 35 40 45 50 Speed (ms/token) Speed vs Prompt Length Medusa w SnapKV Medusa Baseline Figure 8: Comparison of generation speed (ms/token). The baseline is the Huggingface implementation of naive decoding. 5.5 Case Study: Compatibility with Parallel Decoding In this section, we provide a novel perspective on employing KV cache compression synergistically with parallel decoding [28\u201332]. Parallel decoding leverages a lightweight model or an adaptor to draft initial tokens, which are subsequently verified by larger LLMs. This strategy effectively reduces memory overhead, a critical concern given the autoregressive nature of LLMs that renders them more memory-intensive than computationally demanding. Specifically, in LLMs, each decoding step involves generating a single token, with the transfer of weights between High Bandwidth Memory (HBM) and cache contributing to significant overhead [33, 34]. Our investigation incorporates SnapKV with Medusa [35]3, a cutting-edge parallel decoding framework that utilizes multiple classifiers and tree attention mechanisms for drafting tokens, subsequently 3https://github.com/FasterDecoding/Medusa 13 \fverified by LLMs. One of the challenges identified is the issue of speculative decoding in processing long sequences since generating multiple tokens per decoding step introduces computational bottlenecks during long sequence processing, such as query-key matrix multiplication tiling [36]. By maintaining a constant size for the KV cache associated with prompts during generation, SnapKV enhances generation efficiency. Empirical results shown in Figure 8 highlight the performance across various prompt lengths, with Mistral-7B-Instruct-v0.24 undergoing a maximum of 128 generation steps unless preemptively halted. The experiments utilized a subset of the QASPER [37], with a fixed prompt instructing the LLM to summarize the paper. The truncation strategy adopted aligns with LongBench [17] standards, by removing the context in the middle to achieve the desired sequence length for benchmarking. The findings indicate a slowdown in Medusa\u2019s performance as sequence lengths extend, a challenge effectively mitigated by SnapKV\u2019s intervention, which achieved a 1.3x speedup for sequences with 10k length compared to Medusa and a 2.2x speedup compared to the native decoding. This improvement underscores the potential of combining KV cache compression with parallel decoding frameworks to enhance LLM efficiency, particularly in long-context scenarios. 6 Discussions SnapKV emerges as a potent yet straightforward solution, adeptly compressing the KV caches of models to mitigate the computational and memory burdens associated with processing extensive inputs. Originating from a nuanced observation that specific tokens within prompts garner consistent attention from each head during generation, our methodology not only conserves crucial information but also enhances processing efficiency. Despite its strengths, SnapKV\u2019s scope is primarily confined to the generative aspect of models, specifically targeting the KV caches during the generation. This limitation implies that SnapKV cannot extend a model\u2019s long context capability if the model inherently struggles with long contexts or exhibits poor performance. Additionally, SnapKV\u2019s design does not cover the processing of the prompt inference, which limits its effectiveness in scenarios where the system cannot handle prompts of extensive length. Nonetheless, our contributions offer significant insights and tools for the community, paving the way for more refined approaches on managing the challenges of large-scale language modeling."
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14507v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14507v1",
|
| 3 |
+
"title": "Align Your Steps: Optimizing Sampling Schedules in Diffusion Models",
|
| 4 |
+
"abstract": "Diffusion models (DMs) have established themselves as the state-of-the-art\ngenerative modeling approach in the visual domain and beyond. A crucial\ndrawback of DMs is their slow sampling speed, relying on many sequential\nfunction evaluations through large neural networks. Sampling from DMs can be\nseen as solving a differential equation through a discretized set of noise\nlevels known as the sampling schedule. While past works primarily focused on\nderiving efficient solvers, little attention has been given to finding optimal\nsampling schedules, and the entire literature relies on hand-crafted\nheuristics. In this work, for the first time, we propose a general and\nprincipled approach to optimizing the sampling schedules of DMs for\nhigh-quality outputs, called $\\textit{Align Your Steps}$. We leverage methods\nfrom stochastic calculus and find optimal schedules specific to different\nsolvers, trained DMs and datasets. We evaluate our novel approach on several\nimage, video as well as 2D toy data synthesis benchmarks, using a variety of\ndifferent samplers, and observe that our optimized schedules outperform\nprevious hand-crafted schedules in almost all experiments. Our method\ndemonstrates the untapped potential of sampling schedule optimization,\nespecially in the few-step synthesis regime.",
|
| 5 |
+
"authors": "Amirmojtaba Sabour, Sanja Fidler, Karsten Kreis",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV",
|
| 11 |
+
"cs.LG"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Diffusion AND Model",
|
| 15 |
+
"gt": "Diffusion models (DMs) have established themselves as the state-of-the-art\ngenerative modeling approach in the visual domain and beyond. A crucial\ndrawback of DMs is their slow sampling speed, relying on many sequential\nfunction evaluations through large neural networks. Sampling from DMs can be\nseen as solving a differential equation through a discretized set of noise\nlevels known as the sampling schedule. While past works primarily focused on\nderiving efficient solvers, little attention has been given to finding optimal\nsampling schedules, and the entire literature relies on hand-crafted\nheuristics. In this work, for the first time, we propose a general and\nprincipled approach to optimizing the sampling schedules of DMs for\nhigh-quality outputs, called $\\textit{Align Your Steps}$. We leverage methods\nfrom stochastic calculus and find optimal schedules specific to different\nsolvers, trained DMs and datasets. We evaluate our novel approach on several\nimage, video as well as 2D toy data synthesis benchmarks, using a variety of\ndifferent samplers, and observe that our optimized schedules outperform\nprevious hand-crafted schedules in almost all experiments. Our method\ndemonstrates the untapped potential of sampling schedule optimization,\nespecially in the few-step synthesis regime.",
|
| 16 |
+
"main_content": "Introduction Diffusion models (DMs) have proven themselves to be extremely reliable probabilistic generative models that can produce high-quality data. They have been successfully applied to applications such as image synthesis (Dhariwal & Nichol, 2021; Ho et al., 2020; Song et al., 2020b; Rombach et al., 2021; Saharia et al., 2022; Ramesh et al., 2022), image super-resolution (Saharia et al., 2021b), image-to-image translation (Saharia et al., 2021a), image editing (Brooks et al., 2023), inpainting (Lugmayr et al., 2022), video synthesis (Ho et al., 2022; Blattmann et al., 2023b), text-to-3d generation (Poole et al., 2022; Lin et al., 2023), and even planning (Janner et al., 2022). However, sampling DMs requires multiple sequential forward passes through a large neural network, limiting their real-time applicability. As a result, extensive research effort has gone into designing fast and efficient samplers of these models, broadly categorized into training-based and training-free methods. Training-based approaches, such as distillation, can significantly accelerate the sampling process but often require significant compute power, comparable to training the model itself, and face a trade-off between speed, diversity, and fi1 arXiv:2404.14507v1 [cs.CV] 22 Apr 2024 \fAlign Your Steps: Optimizing Sampling Schedules in Diffusion Models Figure 2. Align Your Steps. We minimize an upper bound on the Kullback-Leibler divergence (KLUB) between the true and linearized generative SDEs to find optimal DM sampling schedules. delity (Salimans & Ho, 2022; Song et al., 2023; Sauer et al., 2023b; Luo et al., 2023; Yin et al., 2023), lagging behind standard DMs in terms of output quality, especially in large models. Although promising, these methods have not yet found wide-spread adoption by practitioners. On the other hand, since sampling from DMs corresponds to solving a generative Stochastic or Ordinary Differential Equation (SDE/ODE) in reverse time (Song et al., 2020b), trainingfree methods usually seek to derive more efficient SDE/ODE solvers, making them more broadly applicable to different models with relative ease (Lu et al., 2022a;b; Song et al., 2020a; Cui et al., 2023; Xu et al., 2023a; Karras et al., 2022). Solving SDE/ODEs within the interval [tmin, tmax] works by discretizing it into n smaller sub-intervals tmin = t0 < t1 < \u00b7 \u00b7 \u00b7 < tn = tmax, and numerically solving the differential equation between consecutive ti values. This discretization has been given many names in the literature, e.g. step size schedule, denoising schedule, timestep schedule, etc.1 We will be referring to it as the sampling schedule. Changing the sampling schedule can significantly change the quality of the outputs (Karras et al., 2022); however, most prior works simply adopt one of a handful of heuristic schedules, such as simple polynomials and cosine functions. Although significant effort has gone into developing faster solvers, little research has been conducted to optimize the sampling schedule. We attempt to fill this gap by introducing a principled approach for optimizing the schedule in a dataset-specific manner, resulting in improved outputs given the same compute budget. We\u2019ll be focusing on stochastic SDE solvers. These solvers excel in sampling from diffusion models due to their built-in error-correction, allowing them to outperform ODE solvers. In a toy example using a Gaussian data distribution (Sec. 3.1), we demonstrate the reliance of the optimal sam1This is different from the noising schedule which specifies the amount of noise injection and scaling in the forward process. Please refer to Sec. 2 for details. pling schedule on the dataset characteristics and find that the optimal schedule significantly differs from heuristic sampling schedules used across the literature. With this as motivation, we propose Align Your Steps (AYS), a principled and general framework for optimizing the sampling schedule specific to any choice of dataset, model, and stochastic SDE solver. The framework is based on the observation that all stochastic SDE solvers can be reinterpreted as exactly solving an approximated linearized SDE on short intervals. This allows us to minimize the mismatch between solving the approximated linear SDE and the true generative SDE using techniques from stochastic calculus by framing it as an optimization problem over the sampling schedule (Fig. 2). Although the framework assumes the use of stochastic SDE solvers, we empirically find that the optimized schedules generalize to several popular ODE solvers as well. The proposed framework is general and applicable to all DMs regardless of the data modality, and it is the first general schedule optimization framework that leads to improved output quality. We empirically evaluate our method by optimizing the schedule for various datasets and models. These include 2D toy data, standard image datasets such as CIFAR10 (Krizhevsky et al., 2009), FFHQ (Karras et al., 2019), and ImageNet (Deng et al., 2009), large scale text-toimage models widely used by practitioners such as Stable Diffusion (Rombach et al., 2021) and SDXL (Podell et al., 2023), as well as the recent video DM Stable Video Diffusion (Blattmann et al., 2023a). Our results show the practical advantages of optimizing the sampling schedule, ranging from fewer outliers in 2D point generation, enhanced quality in image generation, and improved temporal stability in video generation (Fig. 1). Contributions. (i) We analytically establish the dependency of the optimal sampling schedule on the ground truth data distribution. (ii) We introduce Align Your Steps, a principled and general framework for optimizing the sampling schedule specific to any dataset, model and stochastic solver. (iii) We improve upon previous heuristic sampling schedules for many popular stochastic and deterministic solvers, especially in the low NFE regime. (iv) We provide the optimized schedules for several commonly used models in the appendix to allow for easy plug-and-play use by the research community. 2. Background DMs are probabilistic generative models that inject noise into the data with a forward diffusion process and generate samples by learning and simulating a time-reversed backward diffusion process, initialized with a sample from a tractable distribution, e.g. Gaussian noise. We adopt the framework of Karras et al. (2022), denote the data distri2 \fAlign Your Steps: Optimizing Sampling Schedules in Diffusion Models bution by pdata(x) where x \u2208Rd, and define p(x; \u03c3) as the distribution obtained by adding i.i.d. Gaussian noise of standard deviation \u03c3 to the data. Forward process. Score-based diffusion models (Song et al., 2020b) progressively transform the data pdata(x) towards a noise distribution through a forward noising process. This process is determined by a noising schedule, consisting of two functions s(t), \u03c3(t) that define the scaling and noise level at time t. Specifically, xt = s(t)\u02c6 xt where \u02c6 xt \u223cp(x, \u03c3(t)). The distribution of xt is denoted as p\u2032(x, t). Given the noising schedule, the forward noising process can be written in the form of the following SDE dxt = \u02d9 s(t) s(t)xt + s(t) p 2\u03c3(t) \u02d9 \u03c3(t)dwt, (1) where wt \u2208Rd denotes a standard Wiener process. Backward process and sampling. The forward SDE in Eq. (1) has an associated reverse-time diffusion process (Song et al., 2020b) given by dxt = \u0014 \u02d9 s(t) s(t)xt \u22122s(t)2\u03c3(t) \u02d9 \u03c3(t)\u2207x log p \u0012 xt s(t), \u03c3(t) \u0013\u0015 dt + s(t) p 2\u03c3(t) \u02d9 \u03c3(t)d \u00af wt, (2) where \u00af wt denotes a standard Wiener process backwards in time. However, there exists an entire class of reversetime SDEs with matching marginals as the backward SDE in Eq. (2) (Huang et al., 2021; Karras et al., 2022; Cui et al., 2023). The most notable being the non-stochastic probability flow ODE, introduced by (Song et al., 2020b): dxt = \u0014 \u02d9 s(t) s(t)xt \u2212s(t)2\u03c3(t) \u02d9 \u03c3(t)\u2207x log p \u0012 xt s(t), \u03c3(t) \u0013\u0015 dt. (3) As stated previously, sampling from a diffusion model boils down to solving one of these SDE/ODEs backward in time starting from random noise. This is done by discretizing the interval [tmin, tmax] into n sub-intervals tmin = t0 < t1 < \u00b7 \u00b7 \u00b7 < tn = tmax, known as a sampling schedule, and solving the SDE/ODEs on this schedule. 3. Optimizing Sampling Schedules Contrary to previous works, which have primarily focused on deriving efficient SDE/ODE solvers using heuristic schedules for sampling, we focus on fundamentally optimizing the sampling schedule given a specific choice of (dataset, model, stochastic solver) for a large class of SDE solvers. In Sec. 3.1, we first show how changing dataset characteristics causes the optimal sampling schedule to change. Next, in Sec. 3.2, we analyze the error introduced by discretizing the interval of the SDE into n sub-intervals that define 0.0 0.2 0.4 0.6 0.8 1.0 Step location (i / n) 10 2 10 1 100 101 102 Noise level (t) Schedule comparisons Time uniform Time quadratic EDM Linear LogSNR Cosine LogSNR Optimal (c=0.1) Optimal (c=0.5) Optimal (c=1.0) Figure 3. Comparing popular sampling schedules against the optimal schedules for Gaussian data. the sampling schedule, and formulate finding an optimal schedule as an optimization problem which can be solved iteratively. Sec. 3.3 addresses implementation details. 3.1. The Need for Optimized Schedules Although the sampling schedule used for solving SDE/ODEs is a powerful hyperparameter at our disposal, little research effort has gone into optimizing it. Especially in the relevant few-step synthesis regime, discretization errors can become significant (Atkinson et al., 2009) and having an optimal sampling schedule can make a considerable impact. As a motivating example, we analyze a simple case where an optimal sampling schedule can be derived analytically. Consider the case where the initial distribution is an isotropic Gaussian with a standard deviation of c, i.e. pdata(x) \u223c N(0, c2I). We\u2019ll assume s(t) = 1, \u03c3(t) = t (Karras et al., 2022). Forward SDE and Probability Flow ODE then are ( Forward SDE: dxt = \u221a 2t dwt, Reverse ODE: dxt = \u2212t\u2207x log p(xt, t)dt. (4) In this setting, assuming use of the forward Euler method, also known as DDIM (Song et al., 2020a), to solve the reverse ODE, an optimal schedule can be derived analytically. Theorem 3.1 (Proof in App. A.1). Let pdata(x) = N(0, c2I). Sample xtmax\u223cp(x, tmax) and solve the probability flow ODE using n forward euler steps along the schedule tmax = tn > tn\u22121 > \u00b7 \u00b7 \u00b7 > t1 > t0 = tmin to obtain \u00af xtmin. The optimal schedule t\u2217minimizing the KL-divergence between p(x, tmin) and the distribution of \u00af xtmin is given by \u03b1min := arctan(tmin/c), \u03b1max := arctan(tmax/c) \u21d2t\u2217 i = c tan \u0012 (1 \u2212i n) \u00d7 \u03b1min + ( i n) \u00d7 \u03b1max \u0013 . 3 \fAlign Your Steps: Optimizing Sampling Schedules in Diffusion Models (a) (b) (c) (d) Figure 4. Modeling a 2D toy distribution: (a) Ground truth samples; (b), (c), and (d) are samples generated using 8 steps of SDE-DPMSolver++(2M) with EDM, LogSNR, and AYS schedules, respectively. Each image consists of 100,000 sampled points. The colors denote the local density of the samples where warmer colors correspond to higher density regions. See App. C.2 for details. In this theorem, the distribution p(x, tmin) is the output distribution of exactly solving the probability flow ODE from tmax to tmin. Therefore, the theorem states that the optimal schedule t\u2217, that has the minimum mismatch between its outputs and the outputs of exactly solving the ODE, has the interesting property that arctan(t\u2217/c) is a linear function. In Fig. 3, we compare several popular sampling schedules used in practice against these optimal schedules when tmin = 0.002, tmax = 80.0 for various initial std. devs. c. The featured schedules include EDM (Karras et al., 2022), Linear LogSNR (Lu et al., 2022a;b), Cosine LogSNR (Hoogeboom et al., 2023; Nichol & Dhariwal, 2021), linear time (Song et al., 2020a), and quadratic time (Song et al., 2020a). This plot shows how changing the dataset (through changing the data distribution\u2019s std. dev. c) can have a significant impact on the optimal sampling schedule. Judging by how dissimilar the hand-crafted schedules appear compared to the optimal Gaussian ones, it is reasonable to believe that optimizing the schedules for each dataset could lead to significant performance gains. Note that in practice, it is common to normalize the input data to ensure unit variance. Yet, even only comparing the optimal schedule when c = 1 to the others, there remains a big difference between them. We show the distribution of outputs for different samplers in App. C.1. 3.2. Analyzing the Discretization Errors Since the sampling schedule defines how the reverse-time generative SDE will be discretized, optimizing the schedule corresponds directly to minimizing the discretization error of solving the SDE/ODE. One method for analyzing such discretization errors in diffusions (and SDEs in general) is to use Girsanov\u2019s theorem (Oksendal, 1992). A simplified version of Girsanov\u2019s theorem is the following: Theorem 3.2 (KL-divergence Upper bound (KLUB), proof in App. A.2). Consider the following two SDEs: ( SDE 1 : dxt = f1(x0\u2192t, t)dt + g(t)dwt SDE 2 : dxt = f2(x0\u2192t, t)dt + g(t)dwt where x0\u2192t represents the entire path from the start (t = 0) to the current time t (this formulation is useful for multi-step methods that benefit from having access to the history). Let P1 and P2 be the resulting probability distributions at time T of the outputs of SDE 1 and SDE 2, respectively. Under mild regularity constraints, we have: DKL(P1\u2225P2) \u2264KLUB(0, T) := 1 2EP paths 1 \"Z T 0 ||f1(x0\u2192t, t) \u2212f2(x0\u2192t, t)||2 g(t)2 dt # , (5) where P paths 1 refers to the distribution over path space x0\u2192T \u2208C([0, T]; Rd) generated by running SDE 1. This theorem gives us an upper bound on the outputs\u2019 mismatch of two SDEs that share a diffusion term. In this work, our main goal is minimizing the mismatch between the outputs obtained by exactly solving the reverse-time generative SDE without discretization and the outputs of stochastic SDE solvers in practice, which use a finite sampling schedule. Most stochastic solvers work by decomposing the problem into multiple sub-intervals, within each of which the SDE is approximated by a linear SDE that has the same diffusion term. For these linear SDEs, exact numerical solutions exist which are used by the solvers. Therefore, for each stochastic SDE solver there exists a solver-specific linearized SDE, and the outputs of these solvers are the exact solutions of their respective linearized SDEs. As a result, we can use the theorem above to derive a Kullback-Leibler divergence Upper Bound (KLUB) between the outputs of practical stochastic solvers and the outputs of solving the reverse-time generative SDE without discretization. To clarify, solving the generative SDE without discretization is not possible in practice due to the nonlinear nature of the neural network. However, Girsanov\u2019s theorem offers us a tool to analyze the corresponding distribution regardless. In the following, we will demonstrate deriving the KLUB for Stochastic-DDIM (\u03b7 = 1) (Song et al., 2020a), and 4 \fAlign Your Steps: Optimizing Sampling Schedules in Diffusion Models Figure 5. Side-by-side comparison of selected images generated with Stable Diffusion 1.5 with SDE-DPM-Solver++(2M) over 10 steps with different sampling schedules. a similar procedure can be applied to other solvers with minimal adjustments. We follow Karras et al. (2022) and let D\u03b8(x, \u03c3) be the learnt denoiser function that takes in a noisy sample x with \u03c3 noise and denoises the sample. Plugging in the relation \u2207x log p\u03b8 (x, \u03c3) = (D\u03b8(x, \u03c3) \u2212x)/\u03c32 into Eq. (2) yields the following true learnt SDE: dxt = \u0014\u0012 \u02d9 s(t) s(t) + 2s(t)2 \u02d9 \u03c3(t) \u03c3(t) \u0013 xt \u22122s(t)2 \u02d9 \u03c3(t) \u03c3(t) D\u03b8 \u0012 xt s(t), \u03c3(t) \u0013\u0015 dt + s(t) p 2\u03c3(t) \u02d9 \u03c3(t)d \u00af wt (6) Lu et al. (2022b) have shown that Stochastic-DDIM is the exact solution of a 1st order approximation of the true learnt SDE. This means when solving the SDE in the subinterval [ti\u22121, ti], using the assumption D\u03b8( xt s(t), \u03c3(t)) \u2248 D\u03b8( xti s(ti), \u03c3(ti)), the discretized learnt SDE of this solver is dxt = \u0014\u0012 \u02d9 s(t) s(t) + 2s(t)2 \u02d9 \u03c3(t) \u03c3(t) \u0013 xt \u22122s(t)2 \u02d9 \u03c3(t) \u03c3(t) D\u03b8 \u0012 xti s(ti), \u03c3(ti) \u0013\u0015 dt + s(t) p 2\u03c3(t) \u02d9 \u03c3(t)d \u00af wt, (7) where the outputs of applying 1 step of Stochastic-DDIM from noise level ti \u2192ti\u22121 are the exact solution of this SDE. Note that this is a linear SDE since the denoiser does not rely on the current state xt, but only on the fixed xti at the beginning of the interval, and its output can be treated as a constant vector inside the interval. Stitching together all these linear SDEs for the different sub-intervals gives us a general discretized learnt SDE that corresponds to applying the solver using the entire sampling schedule. At this point, there are two SDEs that share the same diffusion term. The outputs of the true learnt SDE are samples obtained theoretically, given an unlimited compute budget, Figure 6. Side-by-side comparison of selected images generated with SDXL with 10 steps with different sampling schedules. The first and second rows use the SDE-DPM-Solver++(2M) and DPMSolver++(2M) solvers respectively. and outputs of the second general discretized SDE are samples obtained by running n steps of Stochastic-DDIM along the finite sampling schedule in practice. The goal is to optimize the schedule in such a way as to ensure these two output distributions are as close as possible to each other, and for that we can use our KLUB formalism from above. To start, we consider a single sub-interval. Assuming both SDEs start from the forward diffusion process\u2019 distribution p\u2032(x, ti) and are run from ti \u2192ti\u22121, we can apply Theorem 3.2 backwards in time to obtain a KLUB between their output distributions. Letting the SDE in Eq. (6) be SDE 1 and the SDE in Eq. (7) be SDE 2 in the theorem, we obtain: DKL(P true ti\u2192ti\u22121\u2225P disc ti\u2192ti\u22121) \u2264 2 \u00d7 EP true paths ti\u2192ti\u22121 R ti ti\u22121 s(t)2 \u02d9 \u03c3(t) \u03c3(t)3 \r \r \rD\u03b8 \u0010 xt s(t), \u03c3(t) \u0011 \u2212D\u03b8 \u0010 xti s(ti), \u03c3(ti) \u0011\r \r \r 2 dt. (8) Here P true ti\u2192ti\u22121 represents the distribution of running the true learnt SDE, P disc ti\u2192ti\u22121 denotes the distribution of running the discretized learnt SDE (that corresponds to Stochastic DDIM\u2019s 1-step outputs), and P true paths ti\u2192ti\u22121 is the distribution over path space of the true learnt SDE. If we had a perfect score model, i.e. D\u03b8(x, \u03c3) = Epdata(x0|x\u03c3)[x0], then P true paths ti\u2192ti\u22121 would perfectly match the path distributions of the forward noising process, and P true ti\u2192ti\u22121 = p\u2032(x, ti\u22121), where p\u2032 is the distribution of the forward noising process. We\u2019ll assume that D\u03b8 is sufficiently close to the true denoising function, and approximate it as such moving forward (for a more detailed error analysis, please refer to App. A.4). Applying this approximation to 5 \fAlign Your Steps: Optimizing Sampling Schedules in Diffusion Models the equation above results in the following: DKL(P true ti\u2192ti\u22121\u2225P disc ti\u2192ti\u22121) \u22642 \u00d7 EP true paths ti\u2192ti\u22121 R ti ti\u22121 s(t)2 \u02d9 \u03c3(t) \u03c3(t)3 \r \r \rD\u03b8 \u0010 xt s(t), \u03c3(t) \u0011 \u2212D\u03b8 \u0010 xti s(ti), \u03c3(ti) \u0011\r \r \r 2 dt \u22482 \u00d7 R ti ti\u22121 s(t)2 \u02d9 \u03c3(t) \u03c3(t)3 E xt\u223cp\u2032(x,t) xti\u223cp\u2032(xti|xt) \r \r \rD\u03b8 \u0010 xt s(t), \u03c3(t) \u0011 \u2212D\u03b8 \u0010 xti s(ti), \u03c3(ti) \u0011\r \r \r 2 dt. (9) This final value can be estimated using Monte Carlo integration and (xt, xti) can be drawn from the forward diffusion. This approach can be easily extended to the entire integration from tmax \u2192tmin. Assuming the sampling schedule is tmin = t0 < t1 < \u00b7 \u00b7 \u00b7 < tn = tmax, we apply the same technique on all sub-intervals and combine them to achieve a total KLUB between the outputs of running the true learnt SDE and the general discretized learnt SDE (which corresponds to Stochastic-DDIM with n-steps following the sampling schedule). The total KLUB then is KLUB(t0, t1, . . . , tn) = n X i=1 Z ti ti\u22121 s(t)2 \u02d9 \u03c3(t) \u03c3(t)3 E xt\u223cp\u2032 t xti\u223cp\u2032 ti|t \r \r \r \rD\u03b8 \u0012 xt s(t), \u03c3(t) \u0013 \u2212D\u03b8 \u0012 xti s(ti), \u03c3(ti) \u0013\r \r \r \r 2 dt. (10) Note that each of the integrals only depends on the beginning and end of the intervals (due to the solver being first-order), allowing us to rewrite Eq. (10) as: KLUB(t0, t1, . . . , tn) = n X i=1 KLUB(ti\u22121, ti). (11) Finally, we formulate the problem of finding an optimal sampling schedule as minimizing this KLUB value, resulting in the following optimization: t\u2217 1,...,n\u22121 = arg min t1,t2,...,tn\u22121 KLUB(t0, t1, . . . , tn) = arg min t1,t2,...,tn\u22121 n X i=1 KLUB(ti\u22121, ti), (12) assuming t0 = tmin, tn = tmax are fixed. This optimization is done iteratively by choosing one of the schedule indices i \u2208{1, . . . , n \u22121}, discretizing a neighbourhood around ti into several candidate points, computing the KLUB for each candidate, and setting ti to the candidate with the least value. Due to the decomposition, this process can be highly parallelized for non-neighbouring indices. A pseudocode is given in App. B.1. We call this technique Align Your Steps (AYS). 3.3. Practical Considerations of KLUB Estimation As discussed in the previous section, estimating the KLUB is the key to optimizing the sampling schedule. As such, an accurate estimator for the KLUB with low variance is required, and Importance Sampling with respect to time t is used to achieve this. Inspired by prior work (Vahdat et al., 2021) we select the importance sampling distribution based on Gaussian data assumptions. Specifically, we assume Gaussian data and analytically calculate all integration terms in Eq. (10). Then we sample t from a distribution whose probability density function (pdf) matches these calculated values, up to a constant factor. Empirically, we found that this approach significantly reduces the variance in our KLUB estimation and is effective across all datasets. Under the Gaussian data assumption, we have the following: Lemma 3.3 (Proof in App. A.3). Let pdata(x) = N(0, c2I). We assume D(x, \u03c3) = Epdata(x0|x\u03c3)[x0] to be the ideal denoiser. Then for all t < ti we have E xt\u223cp\u2032 t xti\u223cp\u2032 ti|t \"\r \r \r \rD \u0012 xt s(t), \u03c3(t) \u0013 \u2212D \u0012 xti s(ti), \u03c3(ti) \u0013\r \r \r \r 2# = c4 \u0012 1 \u03c3(t)2 + c2 \u2212 1 \u03c3(ti)2 + c2 \u0013 . (13) And applying this lemma to Eq. (10) yields: KLUB \u221dPn i=1 R ti ti\u22121 s(t)2 \u02d9 \u03c3(t) \u03c3(t)3 \u0010 1 \u03c3(t)2+c2 \u2212 1 \u03c3(ti)2+c2 \u0011 dt. (14) For simplicity, we will use \u03c3(t) = t, s(t) = 1 (Karras et al., 2022) moving forward. Considering an example case of (ti\u22121, ti, ti+1) = (0.1, 0.2, 0.5), the values from the integral above range 3 orders of magnitude [0 \u22121000], and if Monte Carlo integration were to be used naively in this case, the estimator would have a huge variance. To fix this, we perform importance sampling on t according to the distribution \u03c0(t) where \u03c0(t) \u221d1 t3 \u0012 1 t2 + c2 \u2212 1 t2 i + c2 \u0013 (15) for c = 0.5. Given these t samples, we average the reweighted integration terms ||D\u03b8(xt, t) \u2212 D\u03b8(xti, ti)||2/( 1 t2+c2 \u2212 1 t2 i +c2 ) which yields the final estimation of the KLUB (up to a constant). This results in a much lower-variance estimator of the KLUB. A pseudocode and extra visualizations are given in App. B.1. In practice, the schedules are optimized in a hierarchical fashion. Specifically, we start with a 10-step schedule initialized using one of the heuristic schedules (t0, t1, . . . , t10). This is then iteratively optimized on all the 9 intermediate points (t1, t2, . . . , t9). At this initial stage, an early stopping mechanism is necessary to avoid over-optimizing, which is due to the optimization objective being an upper bound on the discretization error and not the error itself (see 6 \fAlign Your Steps: Optimizing Sampling Schedules in Diffusion Models 10 20 30 50 NFEs 2 3 4 5 6 7 8 9 10 12 14 16 18 FID CIFAR-10 DDIM + Best baseline DDIM + AYS SDE-DPM-Solver++(2M) + Best baseline SDE-DPM-Solver++(2M) + AYS ERSDE-Solver-3 + Best baseline ERSDE-Solver-3 + AYS DPM-Solver++(2M) + Best baseline DPM-Solver++(2M) + AYS 10 20 30 50 NFEs 3 4 5 6 7 8 9 10 12 14 16 18 20 22 24 FID FFHQ DDIM + Best baseline DDIM + AYS SDE-DPM-Solver++(2M) + Best baseline SDE-DPM-Solver++(2M) + AYS ERSDE-Solver-3 + Best baseline ERSDE-Solver-3 + AYS DPM-Solver++(2M) + Best baseline DPM-Solver++(2M) + AYS Figure 7. FID curves for different solvers and schedules on CIFAR10 (left) and FFHQ (right). See Tables 5 and 6 in App. C.3 for more comprehensive results. App. A.3 for a rigorous proof). After this process is finished, two rounds of subdivision and further fine-tuning are performed to obtain a 40-step schedule. Each time the schedule (t0, t1, . . . , tn) is subdivided to obtain a new schedule with twice the number of steps (t\u2032 0, t\u2032 1, . . . , t\u2032 2n where t\u2032 2i = ti and log t\u2032 2i+1 = 0.5 \u00d7 (log ti + log ti+1). After a subdivision, the training process only focuses on further optimizing the newly added intermediate points (i.e. t\u2032 2i+1) and keeps the other points frozen. This allows the general \u201cshape\u201d of the schedule to become fixed, removing the need for early stopping during these later stages. Finally, to obtain a schedule with a different number of steps than [10, 20, 40], we view the 40-step schedule as a piece-wise log-linear function and interpolate it to match the number of desired number of steps. See App. B.1 for more details. All in all, the schedule optimization requires only a few iterations to converge (<300). 4. Related Work We briefly review prior work on accelerating DM sampling. Various training-free methods have been introduced to speed up DM synthesis, including efficient ODE (Song et al., 2020a; Lu et al., 2022a;b; Zhang & Chen, 2022; Dockhorn et al., 2022; Liu et al., 2022; Zheng et al., 2024) and SDE solvers (Jolicoeur-Martineau et al., 2021; Xu et al., 2023a), as well as predictor-corrector methods (Song et al., 2020b; Zhao et al., 2023). They are easy to integrate into existing models and we use several of these samplers in our experiments. Moreover, training-based methods include neural operators (Zheng et al., 2022b), truncated diffusion (Zheng et al., 2022a; Lyu et al., 2022), and distillation (Salimans & Ho, 2022; Meng et al., 2022; Song et al., 2023; Luo et al., 2023; Liu et al., 2023), often employing adversarial objectives (Xiao et al., 2022; Xu et al., 2023b; Sauer et al., 2023a; Yin et al., 2023; Kim et al., 2023). Although promising and almost reaching real-time sampling speeds, these methods often face trade-offs between inference speed, sample diversity, and output quality and require substantial compute for training. In practical applications, virtually all DMs rely on training-free samplers and solvers, which makes sampling schedule optimization a highly relevant task. Watson et al. (2021) introduced a dynamic programming method aimed at minimizing the DM\u2019s evidence lower bound (ELBO) to select the best K-step schedule from a larger N-step schedule. Although their optimized schedules improve log likelihoods, they do not yield improvements in image quality (as measured by FID scores). This is expected, as optimizing an exact ELBO is not favourable for image quality (Ho et al., 2020). In follow-up work, Watson et al. (2022) proposed differentiating through sample quality scores, specifically KID (Binkowski et al., 2018), to create an optimized sampler, including a trainable sampling schedule. This method showed improved FID scores compared to the baseline DDIM/DDPM samplers; however, it is limited to image-based diffusion models and lacks versatility for data types. Our method\u2019s comparison with this previous work can be seen in App. C.4. In summary, we found their sampler to be outdated and it is unclear whether their optimized schedules are adaptable to different solvers. In contrast, our approach is derived in a principled manner, works on all data types, is compatible with a wide range of popular solvers, all while providing similar benefits. We also demonstrate our method on 2D data as well as video synthesis, which would not be possible with their technique. Wang et al. (2023) explore the concept of asynchronous time inputs, where the time input provided to the denoiser differs from the actual noise level of the current latent, with these parameters being trainable and learned. This approach is orthogonal to ours, as it keeps a fixed \u201csampling schedule\u201d while learning the \u201cdenoiser inputs\u201d, and integrating it with our optimized schedules could potentially improve the results even further. Xia et al. (2023) proposes using a schedule predictor, trained with reinforcement learning, that takes in the noisy latents and the current timestep as inputs, and predicts the optimal next step to denoise to. This results in a sampling schedule that adapts based on the 7 \fAlign Your Steps: Optimizing Sampling Schedules in Diffusion Models Figure 8. Side-by-side comparisons for Stable Video Diffusion (Blattmann et al., 2023a). We animate a meme (image-to-video). Using the optimized schedule results in a more stable video; note the temporal artifacts of the cup for the baseline. See supplementary material for full videos. sample being generated. However, the authors experiment exclusively with the first-order DDIM solver and it remains unclear if their learnt schedule predictor generalizes to more commonly used higher-order solvers. 5. Experiments We demonstrate how optimizing the sampling schedule can significantly boost generation quality using the same number of forward evaluations (NFEs). We show how upsampling an optimized schedule with a small number of steps generalizes to higher NFE regimes as well as how using a schedule optimized on one solver\u2019s KLUB can generalize to other solvers. We compare outputs of various SDE/ODE solvers while using different schedules and show that optimized schedules lead to improvements almost across the board. Popular heuristic schedules listed in App. B.2. We evaluate our method on various datasets including 2D toy data, widely-used image datasets, and text-to-image and image-to-video models. As sample quality metric, for CIFAR10 (Krizhevsky et al., 2009), FFHQ (Karras et al., 2019), and ImageNet (Deng et al., 2009), we use FID scores (Heusel et al., 2017). For the text-to-image and text-to-video models, we show the benefits of our method both qualitatively and quantitatively using human evaluation scores. 5.1. Toy Experiments In Fig. 4, we show the advantages of optimized sampling schedules using a 2D toy dataset. We used a continuoustime EDM-based DM to learn the score, which was used to optimize the schedule. The samples generated with the optimized schedule more closely resemble the original distribution and have less outliers. Additional 2D results in App. C.2. 5.2. CIFAR10, FFHQ, ImageNet For CIFAR10 and FFHQ experiments, we use pretrained continuous-time DMs from Karras et al. (2022). For ImageNet, we use the pretrained latent DM from (Rombach et al., 2021) with classifier free guidance with a scale of 2.0. We use 3 different classes of stochastic solvers: Stochastic DDIM (Song et al., 2020a), second-order SDE-DPMSolver++ (Lu et al., 2022b), and the recently proposed 1st, 2nd, and 3rd order ER-SDE-Solvers (Cui et al., 2023). We also report FID scores for two popular deterministic solvers, namely DDIM (Song et al., 2020a) and DPM-Solver++ (2M) (Lu et al., 2022b). For simplicity, no dynamic thresholding is used (Saharia et al., 2022). In Fig. 7, we compare FIDs of generated images using the AYS schedule versus the best baseline schedule across four different solvers, including two stochastic and two deterministic ones. The results clearly demonstrate the benefits of optimizing the schedule. In some cases, e.g. for SDE-DPMSolver++(2M), images generated with an optimized 20 step schedule achieve FIDs comparable to those from a 30-step default schedule, achieving a 1.5x speedup. Additionally, the results indicate that as the number of steps increases, the impact of different schedules diminishes, which is due to the discretization error becoming small. For more comprehensive results, please see Tables 5 and 6 in App. C.3. In Table 1, we compare the quality of images generated using the EDM, time-uniform, and AYS schedules on ImageNet. While the FID values occasionally exhibit untypical behavior, such as deterioration with an increased number of steps, we suspect this is due to the absence of thresholding, potentially causing instabilities with higher-order solvers for small NFE. Nevertheless, in most instances, the optimized schedule outperforms the other two in all three metrics. 5.3. Text-to-Image We also used our method to optimize sampling schedules for popular open-source text-to-image models, including Stable Diffusion 1.5 (Rombach et al., 2021), SDXL (Podell et al., 2023), and DeepFloyd-IF (Dee, 2023). For models that rely on classifier-free guidance, each guidance value essentially creates a different score model, suggesting that the optimal schedule should be tailored to each specific value. However, our experiments show that schedules optimized with default guidance values are effective across a reasonable range of values. See App. C.5 for FID vs. CLIP score pareto curves. The benefits of the optimized schedules are evident in Figs. 5 and 6, which present side-by-side comparisons for SD 1.5 and SDXL, respectively. The results demonstrate that optimized schedules yield superior images in low NFE regimes, 8 \fAlign Your Steps: Optimizing Sampling Schedules in Diffusion Models Table 1. Sample fidelity (FID \u2193, sFID \u2193, Inception Score \u2191) on the ImageNet 256 \u00d7 256 dataset. Sampling method Schedule NFE=10 NFE=20 NFE=30 FID \u2193 sFID \u2193 IS \u2191 FID \u2193 sFID \u2193 IS \u2191 FID \u2193 sFID \u2193 IS \u2191 Stochastic Samplers Stochastic DDIM EDM 66.71 126.92 25.04 17.42 49.89 152.74 9.85 26.15 242.81 Time-uniform 24.48 67.96 112.53 9.32 22.65 256.27 8.41 13.67 299.44 AYS 23.13 64.37 118.61 8.96 19.78 264.98 8.29 11.65 304.37 SDE-DPM-Solver++ (2M) EDM 8.48 21.83 214.49 7.05 8.17 307.41 7.55 6.58 325.78 Time-uniform 8.47 13.36 243.09 7.63 11.02 282.77 7.14 8.59 305.57 AYS 6.11 8.48 281.44 6.79 5.93 322.92 7.28 5.48 330.01 ER-SDE-Solver 1 EDM 17.78 35.25 147.57 6.99 12.70 255.69 6.20 8.51 282.52 Time-uniform 8.79 18.33 222.93 6.25 8.19 280.74 6.09 6.56 293.47 AYS 8.36 15.91 266.44 6.06 7.28 282.06 5.87 5.97 295.40 ER-SDE-Solver 2 EDM 7.36 14.19 231.46 5.58 6.33 290.80 5.85 5.69 299.12 Time-uniform 5.28 6.19 277.57 5.56 5.55 295.69 5.72 5.50 300.25 AYS 5.38 6.24 275.35 5.45 5.19 297.78 5.71 5.16 301.79 ER-SDE-Solver 3 EDM 6.94 13.01 237.70 5.58 6.13 292.75 5.87 5.61 299.33 Time-uniform 5.13 6.08 277.65 5.52 5.57 295.94 5.71 5.48 301.52 AYS 5.28 6.10 275.80 5.47 5.17 298.05 5.73 5.14 302.40 Deterministic Solvers DDIM Time-uniform 7.57 14.53 224.50 5.39 7.08 273.33 5.23 5.87 283.27 AYS 6.96 12.21 226.25 5.09 12.21 273.94 4.99 5.53 283.37 DPM-Solver++ (2M) LogSNR 4.82 6.83 252.71 4.81 5.41 287.20 4.98 5.22 288.81 AYS 4.31 6.64 260.32 4.70 5.34 284.17 4.96 5.15 290.65 Figure 9. User study results on Stable Diffusion 1.5. sometimes showing significant improvements. See App. C.5 for additional side-by-side comparisons. To quantitatively evaluate the effectiveness of different schedules, we conducted a user study with 42 participants to assess image fidelity and image-text alignment. Each participant received a text prompt and three images generated with the EDM, time-uniform, and AYS schedules, respectively, using the same random seed. The SDE-DPMSolver++(2M) (Lu et al., 2022b) was used to generate the images with 10 steps. The order of the images was randomly permuted to avoid any biases. The participants then select the superior option according to image-quality and image-text alignment, or a choice for a three-way tie. The results, summarized in Fig. 9, reveal a clear preference for our optimized schedule with respect to both metrics. 5.4. Video Generation Models With the growing interest in video synthesis and open-source video diffusion models becoming available, it is important to look at efficient samplers in this area. However, few efficient samplers have been evaluated in this context. To address this gap, we also study the effect of our method in this domain, using the recent Stable Video Diffusion (SVD) (Blattmann et al., 2023a). We compare videos generated using DDIM with the default EDM schedule against our optimized schedule in Fig. 8. We find that the optimized schedule helps improve temporal color consistency and addresses the issue of over-saturation in later video frames. We also conduct a user-study on the generated videos, similar to the imagegeneration case. However, due to the continuous nature of SVD, the EDM schedule is used by default and serves as the baseline, and we compare it against our optimized schedule. The default DDIM (Song et al., 2020a) was used with 10 steps to generate the videos due to the instability of higher-order solvers. Once again the results, summarized in Table 2, reveal a clear preference for our optimized sampling schedule. More details about these experiments in App. C.6. Table 2. Video generation user study results. EDM AYS SVD (Blattmann et al., 2023a) 42% 58% 6."
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14527v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14527v1",
|
| 3 |
+
"title": "M\u00e9lange: Cost Efficient Large Language Model Serving by Exploiting GPU Heterogeneity",
|
| 4 |
+
"abstract": "Large language models (LLMs) are increasingly integrated into many online\nservices. However, a major challenge in deploying LLMs is their high cost, due\nprimarily to the use of expensive GPU instances. To address this problem, we\nfind that the significant heterogeneity of GPU types presents an opportunity to\nincrease GPU cost efficiency and reduce deployment costs. The broad and growing\nmarket of GPUs creates a diverse option space with varying costs and hardware\nspecifications. Within this space, we show that there is not a linear\nrelationship between GPU cost and performance, and identify three key LLM\nservice characteristics that significantly affect which GPU type is the most\ncost effective: model request size, request rate, and latency service-level\nobjective (SLO). We then present M\\'elange, a framework for navigating the\ndiversity of GPUs and LLM service specifications to derive the most\ncost-efficient set of GPUs for a given LLM service. We frame the task of GPU\nselection as a cost-aware bin-packing problem, where GPUs are bins with a\ncapacity and cost, and items are request slices defined by a request size and\nrate. Upon solution, M\\'elange derives the minimal-cost GPU allocation that\nadheres to a configurable latency SLO. Our evaluations across both real-world\nand synthetic datasets demonstrate that M\\'elange can reduce deployment costs\nby up to 77% as compared to utilizing only a single GPU type, highlighting the\nimportance of making heterogeneity-aware GPU provisioning decisions for LLM\nserving. Our source code is publicly available at\nhttps://github.com/tyler-griggs/melange-release.",
|
| 5 |
+
"authors": "Tyler Griggs, Xiaoxuan Liu, Jiaxiang Yu, Doyoung Kim, Wei-Lin Chiang, Alvin Cheung, Ion Stoica",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.DC",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.DC",
|
| 11 |
+
"cs.LG"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "LLM Fairness",
|
| 15 |
+
"gt": "Large language models (LLMs) are increasingly integrated into many online\nservices. However, a major challenge in deploying LLMs is their high cost, due\nprimarily to the use of expensive GPU instances. To address this problem, we\nfind that the significant heterogeneity of GPU types presents an opportunity to\nincrease GPU cost efficiency and reduce deployment costs. The broad and growing\nmarket of GPUs creates a diverse option space with varying costs and hardware\nspecifications. Within this space, we show that there is not a linear\nrelationship between GPU cost and performance, and identify three key LLM\nservice characteristics that significantly affect which GPU type is the most\ncost effective: model request size, request rate, and latency service-level\nobjective (SLO). We then present M\\'elange, a framework for navigating the\ndiversity of GPUs and LLM service specifications to derive the most\ncost-efficient set of GPUs for a given LLM service. We frame the task of GPU\nselection as a cost-aware bin-packing problem, where GPUs are bins with a\ncapacity and cost, and items are request slices defined by a request size and\nrate. Upon solution, M\\'elange derives the minimal-cost GPU allocation that\nadheres to a configurable latency SLO. Our evaluations across both real-world\nand synthetic datasets demonstrate that M\\'elange can reduce deployment costs\nby up to 77% as compared to utilizing only a single GPU type, highlighting the\nimportance of making heterogeneity-aware GPU provisioning decisions for LLM\nserving. Our source code is publicly available at\nhttps://github.com/tyler-griggs/melange-release.",
|
| 16 |
+
"main_content": "Introduction Large language models (LLMs) like GPT-4 [37] and the Llama model family [44, 45] are increasingly integrated into many online services, including search engines [39, 25], chatbots [36], and virtual assistants [29, 48, 49]. However, a significant obstacle in deploying LLM services is their high operational costs. The substantial size and computational demands of LLMs require the use of hardware accelerators, typically GPUs1, to achieve high-performance inference. Unfortunately, GPUs are expensive. For example, renting just a single on-demand NVIDIA A100 on a major cloud provider costs over $2, 600 per month, and many services require multiple A100s to serve especially large models or request volumes. Prior work [51, 54, 21] has introduced methods for increasing inference throughput to squeeze ever more performance out of expensive GPUs. However, less attention has been given to choosing the best GPU type(s) to use for a given LLM service. The broad and growing market of hardware accelerators, including NVIDIA GPUs [35], AMD GPUs [46], Google TPUs [20], CPUs [24], and more [4], creates a diverse option space with a wide range of hardware specifications and rental prices. Table 1 depicts the specs of just four NVIDIA GPUs, which already exhibits a large variety of costs and performance. Within this option space, we find that there is not a linear relationship between GPU cost and performance, which creates variations in GPU \u2217Equal contribution. 1For brevity, we use \u201caccelerator\u201d and \u201cGPU\u201d interchangeably in this work. 1 arXiv:2404.14527v1 [cs.DC] 22 Apr 2024 \fcost efficiency, defined based on common pricing models [36] as the sum of input and output tokens served per GPU dollar cost (T/$). Instead, we show that a GPU\u2019s cost efficiency is strongly impacted by three key LLM service characteristics: 1. Request Size: An LLM request\u2019s size is made up of its input and output token lengths. For small request sizes, we find that lower-end GPUs produce greater T/$ than their high-end GPU counterparts. Deployment expenses can be reduced by employing cheaper GPUs for smaller requests while reserving costly, high-capacity GPUs for handling larger request sizes. 2. Request Rate: To reduce resource waste, provisioned GPU capacity should align with request volume. An expensive under-utilized GPU exhibits lower T/$ than a cheaper GPU that still meets service demand. Therefore, at low request rates, services can reduce costs by right-sizing from expensive high-end GPUs to cheap low-end GPUs. At higher request rates, leveraging a mix of GPU types facilitates finer-grained resource scaling to better match request volume. 3. Service-level Objective: Services typically establish latency SLOs to ensure high service quality, with the specific SLO varying according to the service\u2019s interactivity needs. In general, low-end GPUs incur higher latency than high-end GPUs. As a result, low-end GPUs may only meet tight SLOs at a low output token rate (or not at all), severely limiting achieved T/$. Thus, high-end GPUs are often required for stringent latency SLOs, whereas low-end GPUs can reduce costs in loose-SLO settings. Consequently, we find that the under-appreciated heterogeneity of GPUs presents opportunities for increasing GPU cost efficiency and significantly reducing LLM service costs. Consider combining the three observations above into a single service deployment: high-cost A100s may be necessary to serve large requests within SLO requirements, however, low-cost A10Gs can meet the latency deadline for small requests at higher T/$, reducing overall cost. Then, during periods of low service activity, the even cheaper L4 can maintain service availability at the lowest cost. The key challenge, then, is to navigate the diversity of request sizes, request rates, latency SLOs, and GPU instance types to find the optimal GPU selection for a given LLM service. In this paper, we present M\u00b4 elange2, a framework that maximizes GPU cost efficiency by automatically and efficiently navigating the heterogeneity of GPUs and LLM service specifications to derive the best GPU provisioning strategy. M\u00b4 elange\u2019s strength stems from its heterogeneity-awareness, that is, its knowledge of how diverse LLM service characteristics impact the cost efficiency of each GPU type. M\u00b4 elange takes as input the service workload profile, latency SLO, and set of GPU type options, and produces the GPU allocation that minimizes deployment costs while attaining SLO. We formulate the task of GPU selection as a cost-aware bin-packing problem where bins are GPUs with an associated capacity and cost, and items are request slices defined by a request size and rate, and solve the bin-packing problem with an off-the-shelf integer linear programming (ILP) solver. M\u00b4 elange can be easily extended to include new GPU types (or other hardware) and alternative definitions of SLO, flexibly supporting diverse LLM service deployments. We evaluate M\u00b4 elange across four GPU types (L4, A10G, A100, and H100), three datasets with varying request size distributions, and a range of request rates and SLOs. Compared to using only a single GPU type, M\u00b4 elange\u2019s heterogeneity-aware mixed-GPU-type approach achieves 9-77% cost reduction in short-context workloads (interactive chats), 2-33% in long-context workloads (document-based tasks), and 4-51% in mixedcontext workloads (both in a single service). M\u00b4 elange efficiently derives GPU allocations within 1.2 seconds, and attains SLO for > 99.95% of requests at a loose SLO, and > 99.5% at a tight SLO. In summary, this paper makes the following contributions: \u2022 We present an extensive analysis of GPU cost efficiency and identify three key LLM service characteristics as significant determinants of GPU cost efficiency: request size, request rate, and latency SLO (\u00a7 4). \u2022 We introduce M\u00b4 elange to efficiently select the most cost-efficient set of GPU instances for a given LLM deployment, while ensuring that the resulting allocation satisfies a prescribed SLO requirement (\u00a7 5). \u2022 We evaluate M\u00b4 elange\u2019s efficacy, demonstrating its significant cost reductions (up to 77%) across a range of real-world workloads, GPU types, and SLO constraints (\u00a7 6). 2 \fType L4 A10G (PCIe) A100-80G (SXM) H100 (SXM) On-demand Price ($/h) 0.7 1.01 3.67 7.5163 Instance Provider GCP AWS Azure RunPod Instance Name g2-standard-4 g5.xlarge NC24ads A100 v4/N.A. N.A. Memory (GB) 24 24 80 80 Memory Bandwidth (GB/s) 300 600 1935 3350 FP16 (TFLOPS) 242 125 312 1979 Table 1: Specifications of four NVIDIA GPUs: L4, A10G, A100, and H100. 2 Related Work 2.1 LLM Inference Optimization A significant body of research has focused on optimizing LLM inference. One stream concentrates on memory optimization, particularly through improved key-value cache reuse [54] and management strategies [21]. Another avenue seeks to minimize latency, such as scheduling optimization [51, 1, 47], speculative decoding [22], and kernel optimization [8, 42]. Additional optimizations include quantization [10, 23, 50] and sparsification [9]. Instead of altering inference logic, our work assumes a fixed inference engine configuration and concentrates on reducing LLM deployment costs by choosing cost-effective GPU instance types. 2.2 Machine Learning with Cloud Resources Recent studies have explored various strategies for reducing the cost of machine learning (ML) inference or training. Several focus on utilizing spot instances [43, 15, 52, 13] are complementary to our work. Other work targets deployment on heterogeneous resources [5, 6, 31, 28, 26], but focuses primarily on model training rather than serving. Leveraging serverless instances for inference cost reduction has been examined in [2]. Nonetheless, prior work predominantly concentrates on machine learning prior to the advent of LLMs, which we show to have unique characteristics that significantly impact cost efficiency. More recent studies, such as [27, 18], focus on LLMs, but they propose strategies for reducing costs via optimal migration plans and parallelism with heterogeneous resources. They do not identify the key LLM service characteristics that impact cost efficiency, which our work highlights. Another line of work [56, 38] explores splitting LLM inference into its two phases (prefill and decode) and performing the two phases on separate nodes, perhaps with different GPU types. Our work shows that, even within a phase, the best GPU type can change based on LLM service specifications. 3 Background 3.1 LLM Request Size Variance Unlike traditional machine learning workloads, LLM tasks exhibit significant variance in request sizes, or input and output lengths. For example, ResNet [16] requires a fixed-dimension input (image size) and results in a fixed-dimension output (classification size). Conversely, transformer-based language models are flexible to support variable-length prompts and produce variable-length generation sequences, as in the Chatbot Arena dataset [53] derived from a real-world LLM chatbot service. Figure 10 illustrates the request size distributions of Chatbot Arena, demonstrating the extensive diversity of request sizes in practical scenarios. Unsurprisingly, high variance in request sizes introduces significant variation in request latency. As illustrated in Figure 1, request latency can increase by 110\u00d7 when the input/output length expands from 25 tokens to 2000 tokens for the Llama2-7B model served on an A100 GPU. Consequently, it becomes crucial to recognize that LLM requests, unlike non-transformer models, impose varied loads on GPU resources. 2M\u00b4 elange is the French word for \u201cmixture\u201d 3H100\u2019s hourly pricing was computed as described in the Hardware section above. 3 \f(a) LLaMA-7B 85X (b) LLaMA-70B Figure 1: Request latency of different input/output lengths on A100-80G. 3.2 Unknown Output Length In most online services, an LLM request\u2019s output length is not known a priori. In this paper, we evaluate GPU cost efficiency based on both input and output lengths. We do this to develop a holistic understanding of GPU cost efficiency, but M\u00b4 elange\u2019s GPU provisioning decision does not require specific knowledge of the output lengths of individual requests. Instead, it relies only on an estimated distribution of request sizes. We believe it is a fair assumption that a service\u2019s GPU allocator is given a distribution of expected request sizes based on the historical data of previously served input and output lengths. Because output lengths are a significant contributor to the load of individual requests, unknown output lengths are primarily a challenge for the load balancer, not the allocator. While important, the task of output length prediction for load balancing is orthogonal to M\u00b4 elange. Therefore, to evaluate the efficacy of M\u00b4 elange\u2019s GPU allocations, we use a load balancer that assumes knowledge of output lengths. We are actively working to remove this assumption by exploring load balancers based on output length prediction. There are several prior works that perform online LLM output length prediction with high accuracy [19, 55], but they have not been applied to load balancing. To the best of our knowledge, there is no load balancer that addresses the problem of unknown output lengths, and we believe this to be an promising area of future work. 4 GPU Cost Efficiency Analysis In this section, we analyze GPU cost efficiency in the context of LLM serving. We first describe our key definitions (\u00a7 4.1), then evaluate the cost efficiency of serving Llama2-7b on two widely used GPUs, NVIDIA\u2019s A100 [34] and A10G [33] to show that GPU cost efficiency is significantly influenced by request size(\u00a7 4.2), request latency SLO(\u00a7 4.3), and request rate(\u00a7 4.4). Finally, we validate the generality of our findings by extending our investigation to include additional hardware, specifically NVIDIA\u2019s H100 and L4 GPUs, and a larger model variant, Llama2-70B (\u00a7 4.5). For clarity, the plots are tagged with the request size, request rate, and SLO used to generate the plot. In each setting, we use vLLM-0.2.7 as the inference engine [21]. Results can differ across versions. 4.1 Definitions Service-level Objective (SLO). As in prior work [21, 56, 51], we use the average Time Per Output Token (TPOT) as our Service-level Objective (SLO). Average TPOT is determined by dividing total request latency by the number of generated tokens. In general, SLOs are application dependent: in-line code editors (e.g., GitHub Copilot [29]) require tight latency deadlines to suggest real-time code additions, whereas text summarization services may permit additional processing time to generate concise and accurate summaries for large documents. There are other popular definitions of SLO, such as time to first token and total request 4 \f(a) Equivalent input and output lengths (b) Input and output lengths vary independently Figure 2: Figure (a) depicts A10G and A100\u2019s relative T/$ across request sizes. Figure (b) expands (a) into separate input and output length dimensions. Tile colors indicate which GPU achieved higher T/$, and values represent the most cost efficient GPU\u2019s percent increase of T/$ relative to the less cost efficient GPU. latency. To simplify our discussion, we use only TPOT, however, M\u00b4 elange is flexible to support alternative definitions of SLO. Cost Efficiency Metric. We use tokens per dollar (T/$) to measure GPU cost efficiency, which is calculated by summing input and output token lengths served within some time period, and dividing the sum by the GPU\u2019s rental cost for the same period. The resulting value enables us to directly compare cost efficiency across GPU instance types with different rental costs. Pricing inference based on token lengths is a common practice in LLM services [36, 12], but some services set different prices for input and output tokens. We only compare T/$ between GPUs in settings where the request sizes are the same, so we do not lose generality to such cost models. In settings where request sizes differ, we report the overall cost of the GPU allocation that meets the aggregate workload. In general, we derive T/$ based on profiling a GPU at maximum saturation. When an SLO is specified, T/$ is calculated by finding the highest GPU saturation at which average TPOT still meets the SLO requirement. 4.2 Request Size and Cost Efficiency We now show that request sizes, shown to be widely varying (\u00a7 3.1), dramatically affect GPU cost efficiency. We served Llama2-7b on A100 and A10G (specifications reported in Table 1), and derived each GPU\u2019s T/$ at maximum GPU saturation across a range of request sizes, with results in Figure 2a. Interestingly, neither GPU achieves highest T/$ across the entire request size space. Instead, each GPU achieves greater cost efficiency within distinct regions of the request size spectrum. For smaller request sizes, A10G exhibits up to 2.6\u00d7 greater T/$ than A100. Conversely, for larger request sizes, A100 achieves up to 1.5\u00d7 the cost efficiency of A10G. We extend this exploration to include both input and output lengths in Figure 2b to observe how they affect cost efficiency separately. We find that the two dimensions influence cost efficiency in a similar manner: smaller sizes benefit A10G, and larger sizes are best served on A100. Once again, there exists a clear boundary within the input/output length spectrum where the cost efficiency advantage shifts from A10G to A100 as request sizes increase. In fact, selecting a single GPU type to serve requests across the entire request size space misses opportunities to produce up to 72% more output tokens for the same cost. Source of Cost Efficiency Variation. Digging deeper into why request size impacts relative cost efficiency between GPUs, we find that it is largely due to the heterogeneity of GPU hardware. Given that batch size directly influences throughput (i.e., request processing rate), we inspect the source of cost efficiency variation by examining the effect of request size on achieved batch size. Figure 3 depicts the absolute batch sizes and 5 \f(a) Absolute batch sizes (b) Dollar-normalized batch sizes Figure 3: (a) depicts the absolute batch sizes of A10G and A100 serving Llama2-7b at maximum saturation, (b) reports the same batch sizes divided by GPU cost, plotting with respect to A10G. batch sizes normalized by instance cost of each GPU at maximum saturation. Note that Figure 3b closely resembles Figure 2a\u2019s plot of relative T/$ at maximum saturation, verifying that batch size indeed serves as a proxy for throughput. A10G and A100 have similar dollar-normalized batch sizes at 250 input/output tokens, but as the request size increases to 2000 input/output tokens, A10G\u2019s absolute batch size decreases by a factor of 9\u00d7 whereas A100\u2019s only decreases by 6\u00d7 due to its superior memory size and bandwidth. As a result, A100\u2019s cost efficiency advantage over A10G increases accordingly with the increase in request size. In contrast, reducing the request size from 250 to 25 input/output tokens sees A10G\u2019s batch size expanding by 15.2\u00d7, whereas A100\u2019s growth is more modest at 5.89\u00d7. We find that this difference is primarily due to the interference of mixing prefill and decode phases of a greater number of requests, as demonstrated in prior work [17]. Because A100\u2019s batch sizes are larger in absolute terms, A100 is more significantly constrained by per-request latency overheads than A10G is. As a result, A10G\u2019s dollar-normalized batch size exceeds A100\u2019s at short request lengths, leading to greater overall T/$ for A10G. This illustrative case demonstrates how the interaction between request size and achieved T/$ can be subtle, and creates a cost efficiency trade-off space among GPU types. Key Takeaways: GPU cost efficiency is highly dependent on the sizes of requests served. Within the request size space, there are regions where serving with different GPU types is the most cost-effective. In general, lower-end GPUs are more cost-effective for small request sizes whereas higher-end GPUs are best for large request sizes. 4.3 SLO and Cost Efficiency In this section, we show the impact of SLO on cost efficiency. We measure T/$ by finding the maximum saturation of each GPU while average TPOT remains below SLO, and repeat this across several TPOT deadlines (40ms to 120ms) as shown in Figure 4. Under tight SLO constraints (<60ms), A100 demonstrates significantly greater T/$ than A10G (> 2\u00d7) due to A10G\u2019s higher processing latency, which severely limits its output token rate. However, as the SLO is gradually loosened (60-120ms), A10G\u2019s higher latency is less problematic, dramatically increasing its T/$ and surpassing that of A100 (by > 40%). In general, when SLO is stringent, high-end low-latency GPUs are the most viable option because cheaper high-latency GPUs are unable to meet the steep performance requirements. Loosening the SLO increasingly permits the use of cheaper GPUs that can meet the reduced performance requirements at much lower cost. Further, Figure 5 highlights the interplay between SLO and request size to show that neither can be considered in isolation when determining cost efficiency. Varying the latency SLO adjusts the boundary in the request size space between which different GPU types are more cost effective, and also impacts the degree to which 6 \fFigure 4: T/$ comparison between A10G and A100 across a range of TPOT SLO parameters. Figure 5: Relative increase in T/$ when combining SLO and request size. Shaded areas indicate regions where A10G fails to satisfy the specified SLO. one GPU is more cost effective than the other. For example, with a 40-50ms SLO, A100 always has higher T/$ (by up to 123%). At 70ms, A10G shows modest benefit over A100 for small request sizes. And at 100-120ms, A10G demonstrates much greater T/$ advantage over A100 for the same request sizes (up to 61%). Key Takeaways: To comply with strict SLOs, expensive GPUs are often necessary due to the increased latency of cheaper GPUs. However, as SLO is loosened, low-end GPUs can be used to cut deployment costs. 4.4 Request Rate and Cost Efficiency In this section, we show how request rates influence which GPU, or set of GPUs, is the most cost-effective. Figure 6 illustrates the cost of serving Llama2-7b for a range of request rates using three provisioning strategies: only A10Gs, only A100s, or a mix of both A10Gs and A100s. The y-axis is absolute cost instead of T/$ because each provisioning strategy serves the same request rates and thus the same output tokens; only the cost varies across strategies. As the request rate increases, A100-only is increasingly more cost-effective relative to A10G-only. This is because the requests in this plot were of size [1000 in tokens, 250 out tokens], which \u00a7 4.2 shows is more cost effective on A100. However, even in this case, the A10G-only strategy still presents benefits at low request rates (0 \u22121.5 req/s). Idle periods of low activity are common in real-world services, and the GPU deployment should right-size to the cheaper GPU (here, A10G) when a higher-end GPU (here, A100) is drastically under-utilized. Further, a notable finding is that a hybrid deployment approach, combining both A10G and A100 GPUs, yields the greatest cost efficiency. Because A100s have such large capacity, scaling with only A100s is coarse-grained and leads to under-utilized resources. Instead, A10Gs and A100s can be mixed such that A100s satisfy the bulk of the service demands, while A10Gs handle the remaining load at reduced cost. Key Takeaways: Provisioning a mix of GPU types enables finer-grained resource scaling decisions, which boosts cost efficiency by better utilization of the provisioned instances. At low request rates, LLM deployments should right-size to cheaper low-end GPUs instead of under-utilizing expensive high-capacity GPUs. At higher request rates, a mix of GPU types can be used to better match request load. 4.5 Other Models and Hardware In this section, we demonstrate the generality of our findings by including additional GPU types and a larger model variant (Llama2-70b) to our analysis. In Figure 8, we present relative cost efficiency across four types 7 \fof GPUs, and observe a progression of the most cost efficient GPU from L4 to A10G, then A100, and finally H100 as the input/output lengths extend. This pattern underscores the advantage of high-end GPUs for processing longer context and output lengths, while low-end GPUs emerge as more cost-effective for shorter input/output scenarios. Similar trends are observed with the Llama2-70B model when comparing the H100 and A100 GPUs, as detailed in Figure 7, reinforcing these insights. Key Takeaways: The effects of request size on GPU cost efficiency (\u00a7 4.2) generalize to settings with several GPU types and larger model sizes, and similarly leads to significant GPU cost efficiency variations in the request size space. Figure 6: Aggregate GPU hourly rental cost at different request rates. A mix of A100 and A10G consistently achieves the lowest cost. Figure 7: T/$ comparison between H100x2 and A100x2 serving Llama2-70b. 5 M\u00b4 elange: Automating Cost-Efficient GPU Selection Building on the analysis in Section 4, we present M\u00b4 elange, a framework that automates the selection of GPU instances to meet an LLM service\u2019s demand at minimal cost while adhering to SLO constraints. We frame the GPU selection task as a cost-aware bin-packing problem with GPUs as bins and requests as items, and employ Integer Linear Programming (ILP) to derive the solution. 5.1 Problem Formulation We begin by defining the key terms utilized in our problem formulation and solution. Workload: A workload is characterized by its overall request rate along with a distribution of input and output sizes. Given the inherent variability in request sizes, it is crucial to treat the input and output sizes not as fixed values, but as distributions spanning a range of possible lengths. Specifically, as illustrated in Figure 9, a workload is a histogram where each bucket corresponds to a range of request sizes and a bucket\u2019s value is the request rate of requests within the bucket\u2019s size range. Deployment Cost: Cost is computed by summing the hourly rates for each of the selected instances. SLO: We use average TPOT to define SLO, however, M\u00b4 elange can be extended to other definitions of SLO, such as time to first token (TTFT), by profiling maximum T/$ within SLO constraints described in \u00a7 4.1 for any given latency constraint definition. Problem Definition: Given a workload, GPU instance costs, and SLO requirements, our objective is to provision GPUs that can serve the workload at minimal cost while adhering to latency SLO constraints. 8 \f(a) Best GPU relative to second best GPU (b) Best GPU relative to worst GPU Figure 8: Cost efficiency comparison across four GPUs. Tile colors indicate which GPU achieves greatest T/$ at max saturation for the respective request size. Tile values in (a) are the percent increase in T/$ of the best GPU compared to the second best. Tile values in (b) compare the best GPU to the worst GPU. Black boxes indicate request sizes for which only A100 and H100 are compared because A10G and L4 have too small memory capacity to handle a single request within this size, with more detail in \u00a7 6.2 . 3x A10G 2x A100 1x H100 Obj: Minimize Cost Constraint: Meet SLO Figure 9: Workflow illustration depicting the process of segmenting request rates into slices, followed by the allocation of hardware resources based on solver recommendations. 5.2 Allocation Algorithm The intuition of M\u00b4 elange\u2019s solution is to find the minimal-cost set of GPUs (bins) into which the workload (items) can be bin-packed. To do so, our strategy partitions workload buckets into slices, then assigns the slices to GPUs. Our constraints ensure that the load added to each GPU by the assigned slices does not surpass its maximum capacity. The optimization objective is to reduce the total deployment cost. We discuss bucket size considerations (\u00a7 5.2.1), describe slices in more detail (\u00a7 5.2.2), discuss how load is calculated (\u00a7 5.2.3), then finally detail our ILP formulation (\u00a7 5.2.4). 5.2.1 Request Buckets As described in \u00a7 5.1, a workload is represented by a histogram. The histogram has two dimensions, input length and output length, and each bucket\u2019s value is the aggregate request rate for requests within the bucket\u2019s size range. We make the simplifying assumption that the load (see \u00a7 5.2.2) of each request is the same as the largest request size in the same bucket. This simplifies handling diverse request sizes at the cost of over-estimating the load. Bucket sizes can be tuned to reach the desired balance between granularity and solution complexity, but we have not found overall performance to be sensitive to bucket sizes. 9 \f5.2.2 Slices A naive bin-packing of the workload into GPUs is to assign each bucket to a single GPU. However, the overall load of a single bucket may exceed the capacity of a single GPU, and the bucket may be most cost effectively served by splitting across different GPU types. Therefore, for finer-grained bin-packing, buckets are broken down into slices, which are characterized by a request size and rate. A parameter, slice factor, indicates the number of slices that each bucket is divided into. In a setting with a slice factor of 8 and a bucket corresponding to requests of size [25 \u2212100 in tokens, 25 \u2212100 out tokens] with a request rate of 4 requests/s, the bucket would be segmented into 8 slices each corresponding to a request rate of 0.5 requests. 5.2.3 Load The ILP solver requires an estimate of the load each slice contributes to a GPU to ensure that the load assigned to an instance does not exceed its capacity and violate the latency SLO. The load of a slice with request size s and rate r on GPU G is calculated as r MaxT put(G,s,SLO), where MaxTput(G, s, SLO) is the maximum request/s G can achieve for requests of size s while remaining under the latency deadline SLO. For instance, if MaxTput(G, s, SLO) = 10 reqs/s and r = 1, the load is calculated as 1/10 = 0.1 or 10%. Each GPU\u2019s maximum capacity is defined as 1 (or 100%). This approximation allows us to calculate the aggregate load of requests with differing sizes and rates. Prior work has proposed cost models for LLM requests [32, 41], but there is not yet a definitive formulation. We found our simple approximation to perform well, but it can be easily replaced with alternative cost models. Based on offline profiling, we compute MaxTput(G, s, SLO) for each bucket in the workload histogram. 5.2.4 ILP Formulation We now describe our ILP formulation. We formulate the problem with two primary decision variables. First, let A be a matrix {0, 1}N\u00d7M, where N denotes the total number of slices, and M represents the number of GPU instance types. An element Ai,j within this matrix is set to 1 if slice i is assigned to GPU type j, and 0 otherwise. The second decision variable, B, is a vector of length M, where each element Bj specifies the number of GPUs of type j to be allocated. cj denotes the cost of GPU type j and ri is the request rate of slice i. L is computed offline by the process described in \u00a7 5.2.3, and element Li,j is the percent load of 1 req/s of slice i\u2019s request size on GPU type j. Our objective is to minimize the total GPU allocation cost, with the following mathematical representation: The ILP constraints are as follows. First, each task slice is assigned to exactly one GPU type: Second, for each GPU type, the total number of GPUs designated in vector B must adequately accommodate the cumulative load prescribed to it in matrix A: Lastly, the entries within matrix A are binary, and the elements of vector B are non-negative integers: arg min B ( M X j=1 Bj \u00b7 cj) (1) \u2200i \u2208{1, . . . , N}, M X j=1 Ai,j = 1 (2) \u2200j \u2208{1, . . . , M}, N X i=1 Ai,j \u00b7 Li,j \u00b7 ri \u2264Bj (3) \u2200i \u2208{1, . . . , N}, \u2200j \u2208{1, . . . , M}, Ai,j \u2208{0, 1} (4) \u2200j \u2208{1, . . . , M}, Bj \u22650 (5) Upon resolving equations (1) through (5), the decision variable B holds the minimal-cost set of GPUs that meet the SLO constraint. We use an off-the-shelf solver to solve the ILP problem [30]. 10 \f6 Evaluation In this section, we assess the performance of M\u00b4 elange using four GPU types across settings of diverse request sizes, rates, and SLOs. Our evaluations show that M\u00b4 elange consistently achieves significant cost savings (up to 77%) compared to single-GPU-type strategies and M\u00b4 elange\u2019s selected GPU allocations successfully attain TPOT SLO for over 99.5% of requests. 6.1 Methodology Hardware Setup. We use four NVIDIA GPUs in our evaluations, with specifications detailed in Table 1. To determine GPU cost, we select the lowest on-demand price available from major cloud providers (AWS, Azure, and GCP). Because on-demand H100 is not offered by these major providers, we defer to the pricing from RunPod [40] due to its popularity and availability. To ensure fair cost comparisons, we normalize RunPod\u2019s H100 pricing to match the pricing structures of major platforms. We calculate this by comparing RunPod\u2019s H100 cost ($4.69) to RunPod\u2019s A100-80G cost ($2.29), then adjusting relative to the A100\u2019s price on major clouds ($3.67), resulting in a normalized price of (4.69/2.29) \u00d7 3.67 = $7.516 for H100. Model and Inference Engine. In each experiment, we serve Llama2-7B (Llama-2-7b-hf) [45] using version 0.2.7 of the vLLM inference engine [21] with default parameters. M\u00b4 elange Parameters. The bucket ranges correspond to Figure 8 and comprise of 10 input length ranges and 6 output length ranges, for a total of 60 buckets. The slice factor is set to 8, for a total of 60 \u00b7 8 = 480 slices. Datasets. We evaluate across three distinct datasets to cover a wide range of application scenarios. The specific input/output length distributions of these datasets are illustrated in Figure 10. \u2022 Short context: This scenario simulates real-time conversational dynamics by employing the Chatbot Arena dataset (lmsys/lmsys-chat-1m) [53], which is derived from real-world chatbot conversations. The dataset is skewed towards shorter context (< 2000 tokens) because much of the data was generated in conversation with models that did not yet have a larger context window. \u2022 Long context: This scenario represents tasks with extensive input, such as summarization. We utilize the PubMed dataset (ccdv/pubmed-summarization) [7], comprising 133 thousand scientific papers from PubMed.com, a popular dataset for large-scale text summarization studies. \u2022 Mixed long/short context: This scenario captures settings with a combination of long and short context, such as an assistant that engages in succinct dialogue and responds to large document-based queries. To model this, we create a synthetic dataset by sampling 80% of requests from the Arena dataset and 20% of requests from the PubMed dataset. SLOs. We referred to current LLM inference benchmarks [3] to set TPOT SLOs, and opted for 40ms in contexts where swift responses are essential, and 120ms where longer response times are acceptable. Both selected SLOs surpass the average human reading speed, ensuring that our SLOs align with practical user experience considerations. However, as discussed in \u00a7 4.1, M\u00b4 elange is flexible to support alternative definitions of SLO. Baselines. We benchmark against deployments that utilize solely one GPU type. To derive baseline GPU allocations, we use the same ILP formulation from \u00a7 5.2.4 but restrict the solver to only a single GPU type. 6.2 Cost Savings Analysis We first compare the overall deployment costs of M\u00b4 elange\u2019s allocation compared to the single-GPU-type baselines for each dataset and SLO across a range of request rates (1-32 requests/s). Figure 11 displays all costs normalized against the cost of the A100-only strategy (shown in blue dotted lines), and the detailed GPU allocations are included in Appendix A.1. A10G-only and L4-only provisioning strategies are only 11 \f0 2500 5000 7500 10000 12500 Input Length (tokens) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Fraction Dataset Mixed (mean=1278.04) Arena (mean=329.43) Pubmed (mean=4174.13) (a) Input length distributions. 0 250 500 750 1000 Output Length (tokens) 0.000 0.025 0.050 0.075 0.100 0.125 Fraction Dataset Mixed (mean=219.87) Arena (mean=195.66) Pubmed (mean=314.1) (b) Output length distributions. Figure 10: Dataset input and output length distributions. included in the Arena dataset analysis because of PubMed and Mixed datasets\u2019 large requests. The key-value cache generated from even a single large request (\u223c12000+ tokens) exceeds the memory capacity of L4 and A10G (24GB). In M\u00b4 elange\u2019s allocation, L4 and A10G are included but restricted to only serve requests of size less than 12000 tokens. Loose SLO: 120ms Figures 11a, 11c, and 11e depict results with a loose 120ms TPOT SLO. M\u00b4 elange\u2019s mixed-GPU allocation is consistently the most cost-efficient approach, achieving cost reductions of up to 77%, 33% and 51% across the three evaluated datasets. \u2022 Arena Dataset. In Figure 11a, M\u00b4 elange achieves 15-77% cost savings. Lower-tier GPUs such as A10G/L4 offer superior cost efficiency in comparison to A100/H100 when handling lower request rates. In particular, for 1-2 requests/s, H100 has egregiously high cost because the load is not enough to even saturate a single GPU. Yet, as request rate increases, A10G/L4\u2019s cost advantage diminishes as high-capacity GPUs become a more reasonable choice. This aligns with findings in \u00a7 4.4 that emphasize matching GPU size with request rate. Note, however, that A10G/L4 are still competitive with A100 at higher request rates due to their T/$ advantage for smaller request sizes. \u2022 PubMed Dataset. In Figure 11c, M\u00b4 elange achieves 15-33% cost savings. H100\u2019s cost efficiency generally outperforms A100\u2019s, attributable to the dataset\u2019s longer context lengths for which H100 achieves higher T/$. However, there are still many request sizes for which A100 is the best, and this creates the opportunity for the mixed-GPU strategy to squeeze up to 25% cost savings. \u2022 Mixed Dataset. In Figure 11e, M\u00b4 elange achieves 13-51% cost savings. A100\u2019s cost efficiency is boosted relative to the PubMed dataset due to it being generally more cost efficient than H100 for small request sizes. This distinction highlights how the nature of the workload \u2014 specifically the variance in request lengths \u2014 can significantly influence relative cost efficiency across GPU types. Strict SLO: 40ms Figures 11b, 11d, and 11f depict the results from tightening the TPOT SLO to 40ms. Once again, M\u00b4 elange achieves the lowest cost in all settings, with up to 68%, 22%, and 51% reduction across the three evaluated datasets. \u2022 Arena Dataset In Figure 11b, M\u00b4 elange achieves 9-68% cost savings. A10G/L4 display considerably higher relative cost than in the loose SLO setting (Figure 11a). This is explained by A10G/L4\u2019s higher latency, which requires many more instances to be provisioned in order to meet the tight SLO deadline. M\u00b4 elange\u2019s mixed-GPU strategy is able to adapt to the strict SLO and provision mostly A100/H100\u2019s which exhibit much lower latencies. \u2022 PubMed Dataset In Figure 11d, M\u00b4 elange achieves 2-22% cost savings. H100 achieves a significant cost advantage over A100, especially relative to the 120ms setting ( 11c). H100 generally achieves lower latency than A100, making it the preferred option for long-context tight-SLO settings. 12 \f1 2 4 8 16 32 Request Rate (req/s) 0 1 2 Cost (w.r.t A100) H100 A100 A10G L4 Mix (a) Short context: Arena, SLO = 120ms. 1 2 4 8 16 32 Request Rate (req/s) 0 1 2 3 Cost (w.r.t A100) H100 A100 A10G L4 Mix (b) Short context: Arena, SLO = 40ms. 1 2 4 8 16 32 Request Rate (req/s) 0.0 0.5 1.0 Cost (w.r.t A100) H100 A100 Mix (c) Long context: PubMed, SLO = 120ms. 1 2 4 8 16 32 Request Rate (req/s) 0.0 0.5 1.0 Cost (w.r.t A100) H100 A100 Mix (d) Long context: PubMed, SLO = 40ms. 1 2 4 8 16 32 Request Rate (req/s) 0 1 2 Cost (w.r.t A100) H100 A100 Mix (e) Mixed long/short context, SLO = 120ms. 1 2 4 8 16 32 Request Rate (req/s) 0 1 2 Cost (w.r.t A100) H100 A100 Mix (f) Mixed long/short context, SLO = 40ms. Figure 11: Deployment cost across different datasets and SLOs. \u2022 Mixed Dataset In Figure 11f, M\u00b4 elange achieves 4-51% cost savings. A100 gains back some advantage over H100 relative to the PubMed setting due to the prevalence of shorter-context requests. Experiment Takeaways In loose SLO settings, M\u00b4 elange can utilize all GPU types (both lowand high-end) to serve request sizes for which they achieve greatest T/$ and closely match capacity to the request volume, significantly reducing costs (up to 77%). In tight SLO settings, A10G and L4 are less beneficial due to their high latency, reducing the cost savings M\u00b4 elange can achieve relative to single-GPU-type strategies. However, even in this setting, M\u00b4 elange squeezes large cost savings (up to 67%) based on the same principles. These evaluations highlight the key benefits of exploiting GPU heterogeneity in a unified allocation strategy: 1) GPU types can serve request sizes for which they have greatest T/$, 2) mixing GPU types enables fine-grained provisioning to closely match capacity to request volume, and 3) the allocation strategy can adapt to differing SLO stringency levels and continue to utilize the benefits of (1) and (2). In summary, M\u00b4 elange efficiently navigates the diversity of request sizes, rates, SLOs, and GPU types to automatically find the best GPU allocation and significantly reduce deployment cost. 6.3 SLO Satisfaction Next, we assess M\u00b4 elange\u2019s ability to select GPU allocations that meet the specified TPOT SLO. To do so, we provision actual cloud GPU instances based on M\u00b4 elange\u2019s selected allocation for each of the six experiment 13 \fFigure 12: Experiment TPOT CDFs. Figure 13: TPOT CDF from unknown output length experiment. settings in 6.2 at 4 requests/s. We deploy Llama2-7b with vLLM-0.2.7 on each of the provisioned GPUs. We sample request sizes randomly from the chosen dataset to serve 2000 live requests. We record the latency of each request and divide by output token length to derive average TPOT. Load Balancer. Most settings use multiple GPU instances, requiring a load balancer to distribute requests across them. The problem of load balancing variable-size requests to heterogeneous backends has been previously explored [11], and we leave it to future work to create adaptations for serving LLMs on heterogeneous GPUs. We instead use a simple variation of Join Shortest Queue (JSQ) routing [14]: the load balancer tracks outstanding requests for each GPU, and converts them to percent load as described in \u00a7 5.2.3. Upon receiving a new request, the load balancer chooses a GPU backend such that the resulting percent load on the chosen GPU is minimized relative to choosing any other GPU. This policy performed well in our experiments, but we expect that improvements to the load balancing policy will reduce tail latency. Results. Figure 12 presents CDFs of the observed average TPOTs across experiments. With an SLO of 120ms, over 99.95% of requests met SLO. When the SLO was tightened to 40ms, SLO adherence reduced to over 99.5% of requests. M\u00b4 elange effectively chose GPU allocations that reduce cost while adhering to latency objectives, however, we recognize that services may require even higher SLO adherence, so we investigated the source of SLO violations in our experiment. SLO Violation Investigation. Of all requests that violated TPOT SLO, we found that 84% failed to meet SLO due to one of two reasons: request rate bursts or co-location with large requests. In our experiments, requests are sent according to a Poisson process, which occasionally creates short-lived bursts that overload the GPU capacity. Further, we choose the size of model request by randomly sampling from the configured dataset. Occasionally, several large requests are chosen in sequence, which can temporarily exceed the service capacity. In an online production environment, it is common practice to over-provision resources in order to absorb such bursts and other load variations. Within our framework, a desired over-provisioning rate (say, 20%) can be achieved by increasing the request rate input to the solver by the same proportion (20%). We discuss the future work of practically deploying a system based on M\u00b4 elange in \u00a7 7. 6.4 Unknown Output Length As discussed in \u00a7 3.2, in order to focus on measuring the quality of M\u00b4 elange\u2019s chosen GPU allocation, our evaluations utilize a load balancing policy that knows output lengths. Given that this is not a realistic assumption, we briefly evaluate M\u00b4 elange\u2019s performance with a simple load balancing policy that is unaware of output lengths. We again note that we are actively working on addressing the limitations of unknown output lengths, and believe that LLM-specific load balancing that addresses this challenge is an exciting area for future work. We repeated the SLO satisfaction experiment (\u00a7 6.3) on the Arena dataset with a TPOT SLO of 40ms, but restricted the load balancer to only see request input lengths. The load balancer estimates output length by computing the average of all previous requests\u2019 output lengths. Otherwise, load balancing is 14 \fRequest Rate Arena, SLO=120ms Arena, SLO=40ms PubMed, SLO=120ms PubMed, SLO=40ms Mix, SLO=120ms Mix, SLO=40ms 1 0.137 0.177 0.232 0.295 0.168 0.336 2 0.194 0.265 0.234 0.334 0.253 0.381 4 0.192 0.346 0.287 0.381 0.297 0.459 8 0.248 0.433 0.269 0.384 0.321 0.545 16 0.299 0.448 0.389 0.509 0.439 0.537 32 0.316 0.494 0.791 0.96 0.912 1.14 Table 2: Solver execution time. performed identically to experiments in \u00a7 6.3. Figure 13 presents the experiment\u2019s TPOT CDF. Only 97.2% of requests met the 40ms deadline, compared to 99.5% in the setting where output length is known, a 5.6\u00d7 increase in SLO violations. Almost all (91%) of the additional SLO violations were due to large requests landing on a lower-end GPU that would have otherwise landed on a higher-end GPU if the output length was known. This result demonstrates that errors in estimating output length can manifest as increased tail latency due to poor load balancing decisions, further motivating future work on load balancing for LLMs. Nevertheless, we show that over-provisioning can account for the error in predicting output lengths. We re-ran the experiment, but inflated M\u00b4 elange\u2019s request rate input by 5%, and observed that SLO adherence jumped back up to over 99.5%. 6.5 Solver Time We present the solver execution time from each experiment in Table 2. Across all datasets and request rates, the solver\u2019s execution time remains under 1.2 seconds, which is negligible compared to workload execution time. We observe a modest increase in solver execution time with higher request volumes, attributed to the greater complexity in slice assignment due to a greater number of required GPUs. However, this increase is sub-linear relative to the increase in request rate, and the solver\u2019s execution time remains practical. Further, the execution of the solver is a one-time event. Users are required to run the solver only prior to deployment or when there is a significant change in the distribution of request sizes or rates. 7 Future Work There are several interesting directions related to leveraging heterogeneous GPUs for LLM serving. First, adapting heterogeneity-aware load balancing policies specifically for LLM systems where output length is unknown could reduce tail latency that occur due to poor balancing decisions. Further, we believe that generative models beyond LLMs, including image generation, video generation, and embedding models, each of which could be benefited by heterogeneous serving systems. Finally, M\u00b4 elange effectively derives the best GPU allocation for a fixed workload distribution and request rate, but does not address other challenges of deploying a live LLM service such as handling GPU unavailability or responding to dynamically changing request rate and request size distribution. 8"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14544v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14544v1",
|
| 3 |
+
"title": "WangLab at MEDIQA-CORR 2024: Optimized LLM-based Programs for Medical Error Detection and Correction",
|
| 4 |
+
"abstract": "Medical errors in clinical text pose significant risks to patient safety. The\nMEDIQA-CORR 2024 shared task focuses on detecting and correcting these errors\nacross three subtasks: identifying the presence of an error, extracting the\nerroneous sentence, and generating a corrected sentence. In this paper, we\npresent our approach that achieved top performance in all three subtasks. For\nthe MS dataset, which contains subtle errors, we developed a retrieval-based\nsystem leveraging external medical question-answering datasets. For the UW\ndataset, reflecting more realistic clinical notes, we created a pipeline of\nmodules to detect, localize, and correct errors. Both approaches utilized the\nDSPy framework for optimizing prompts and few-shot examples in large language\nmodel (LLM) based programs. Our results demonstrate the effectiveness of LLM\nbased programs for medical error correction. However, our approach has\nlimitations in addressing the full diversity of potential errors in medical\ndocumentation. We discuss the implications of our work and highlight future\nresearch directions to advance the robustness and applicability of medical\nerror detection and correction systems.",
|
| 5 |
+
"authors": "Augustin Toma, Ronald Xie, Steven Palayew, Patrick R. Lawler, Bo Wang",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "LLM Fairness",
|
| 14 |
+
"gt": "Medical errors in clinical text pose significant risks to patient safety. The\nMEDIQA-CORR 2024 shared task focuses on detecting and correcting these errors\nacross three subtasks: identifying the presence of an error, extracting the\nerroneous sentence, and generating a corrected sentence. In this paper, we\npresent our approach that achieved top performance in all three subtasks. For\nthe MS dataset, which contains subtle errors, we developed a retrieval-based\nsystem leveraging external medical question-answering datasets. For the UW\ndataset, reflecting more realistic clinical notes, we created a pipeline of\nmodules to detect, localize, and correct errors. Both approaches utilized the\nDSPy framework for optimizing prompts and few-shot examples in large language\nmodel (LLM) based programs. Our results demonstrate the effectiveness of LLM\nbased programs for medical error correction. However, our approach has\nlimitations in addressing the full diversity of potential errors in medical\ndocumentation. We discuss the implications of our work and highlight future\nresearch directions to advance the robustness and applicability of medical\nerror detection and correction systems.",
|
| 15 |
+
"main_content": "Introduction Medical errors pose a significant threat to patient safety and can have severe consequences, including increased morbidity, mortality, and healthcare costs. Detecting and correcting these errors in clinical text is crucial for ensuring accurate medical documentation and facilitating effective communication among healthcare professionals. One of the fastest-growing use cases for artificial intelligence (AI) in healthcare is clinical note generation, often from transcriptions of physician-patient dialogues. However, assessing the quality and accuracy of these notes is challenging, and automated detection and correction of errors could have a significant impact on patient care. The reliability of large language models (LLMs) in critical applications, such as healthcare, is a major concern due to the potential for hallucinations (generating false or nonsensical information) and inconsistencies. Robust solutions to the question of error detection and correction are essential for addressing these concerns and enabling the safe and effective use of LLMs in medical contexts. The MEDIQA-CORR 2024 (Ben Abacha et al., 2024a) shared task focuses on identifying and correcting medical errors in clinical notes. Each text is either correct or contains a single error. The task involves three subtasks: (1) detecting the presence of an error, (2) extracting the erroneous sentence, and (3) generating a corrected sentence for flagged texts. In this paper, we present our approach, which achieved the top performance across all three subtasks in the MEDIQA-CORR 2024 competition. We develop a series of LLM-based programs using DSPy, a framework for optimizing prompts and few-shot examples. We provide a detailed description of our methodology and results, followed by a discussion of the implications of our work and future directions in the field of medical error detection and correction. 2 Related Work The use of large language models (LLMs) in medicine has attracted considerable attention in recent years. The release of LLMs such as GPT-4 has led to intensive research in the medical community (Nori et al., 2023), particularly in clinical note generation. The MEDIQA-Chat 2023 (Ben Abacha et al., 2023) competition showcased the performance of automated note generation solutions (Giorgi et al., 2023), and further work has demonstrated that LLMs can sometimes outperform humans on clinical text summarization tasks 1 arXiv:2404.14544v1 [cs.CL] 22 Apr 2024 \f(Van Veen et al., 2024). However, there has been limited research focusing on granular audits of these clinical notes with respect to accuracy and error correction. The MEDIQA-CORR 2024 shared task addresses this gap by providing a platform for researchers to develop and evaluate novel approaches to error detection and correction in clinical text, ultimately contributing to the development of more reliable AI systems in healthcare. 3 Task Description The MEDIQA-CORR 2024 shared task provides two distinct datasets: MS and UW (Ben Abacha et al., 2024b). The MS dataset consists of a Training Set containing 2,189 clinical texts and a Validation Set (#1) containing 574 clinical texts. The UW dataset, on the other hand, consists solely of a Validation Set (#2) containing 160 clinical texts. The test set for the shared task includes clinical texts from both the MS and UW collections. The evaluation metrics for the MEDIQA-CORR 2024 shared task vary across the three subtasks: \u2022 Subtask 1 (Error Flag Prediction): Evaluated using Accuracy. \u2022 Subtask 2 (Error Sentence Detection): Evaluated using Accuracy. \u2022 Subtask 3 (Sentence Correction): Evaluated using ROUGE (Lin, 2004), BERTScore (Zhang et al., 2020), BLEURT (Sellam et al., 2020), Aggregate-Score (mean of ROUGE-1F, BERTScore, BLEURT-20), and Composite Scores. The Composite Score for each text in Subtask 3 is calculated as follows: 1. Assign 1 point if both the system correction and the reference correction are \"NA\" 2. Assign 0 points if only one of the system correction or the reference correction is \"NA\" 3. Calculate the score based on metrics (ROUGE, BERTScore, BLEURT and the AggregateScore) within the range of [0, 1] if both the system correction and reference correction are non-\"NA\" sentences. 4 Approach 4.1 Overview Upon reviewing the MS and UW datasets, it became apparent that these two datasets presented distinct challenges. The errors in the MS dataset were often extremely subtle, to the point that many errors did not actually seem like errors, and in fact, clinicians on our team often couldn\u2019t identify the presence of an error within the text. However, when reviewing corrected text from the training set, it became clear that corrections were often \u2019optimal\u2019 completions. For example, consider the following error and its correction: Error sentence: After reviewing imaging, the causal pathogen was determined to be Haemophilus influenzae. (Ben Abacha et al., 2024b) Corrected sentence: After reviewing imaging, the causal pathogen was determined to be Streptococcus pneumoniae. (Ben Abacha et al., 2024b) These types of errors are subtle and seem akin to multiple-choice questions, where often multiple answers could independently be seen as correct completions, but only in the context of one another would you deem one answer wrong. On the other hand, the UW dataset appeared to reflect realistic clinical notes, and the errors were more apparent. For example, consider the following error and its correction: Error sentence: Hypokalemia based on laboratory findings patient has hypervalinemia. (Ben Abacha et al., 2024b) Corrected sentence: Hypokalemia based on laboratory findings patient has hypokalemia. (Ben Abacha et al., 2024b) In this case, the error involves a nonsensical term (hypervalinemia, a rare metabolic condition) when the context makes it clear that the patient has hypokalemia (low potassium levels). These are errors that a clinician can identify from the text alone. The distinct characteristics of the MS and UW datasets prompted us to develop a two-pronged approach to the MEDIQA-CORR 2024 shared task. For the MS dataset, we employed a retrieval-based system to identify similar questions from external medical question-answering datasets and leverage the knowledge contained in these datasets to detect 2 \fand correct errors. For the UW dataset, we created a series of modules to detect, localize, and correct errors in clinical text snippets. Both approaches were built on DSPy (Khattab et al., 2023), a novel framework for systematically optimizing prompts and few-shot examples in LLM based programs. 4.2 Approach for MS Dataset Our approach to the MS dataset involves a multistep process that leverages retrieval-based methods and the DSPy framework, as illustrated in Figures 1, 2, and 3. In all of our experiments, we utilized GPT-4-0125-preview as the underlying large language model, using default generation parameters (temperature of 1.0, top_p of 1) with the exception of a max tokens value of 4096. 4.2.1 Retrieval of Similar Questions First, we employ a retrieval-based approach to identify similar questions from the MedQA dataset (Jin et al., 2020). MedQA is a medical questionanswering dataset that contains multiple-choice questions, each with a set of answer options and a correct answer. By leveraging the knowledge contained in this external dataset, we aim to detect and correct errors in the MS dataset. We use TFIDF (Sparck Jones, 1972) to calculate the similarity between the given question in the MS dataset and the questions in MedQA, retrieving the most similar questions along with their answer options and correct answers for further analysis. 4.2.2 Identifying Answer Choices within Query Text To identify the implicit answer choice within the query text, we employ a two-step process using DSPy programs. First, we send both the query text and the identified similar multiple-choice question to a DSPy module that utilizes chain of thought (Wei et al., 2023) and the BootstrapFewShotWithRandomSearch teleprompter (Khattab et al., 2023). This teleprompter generates 20 few-shot examples by sampling from the training set and testing the module\u2019s performance on the validation set. The module aims to extract the answer choice that appears to be present in the query text. The output from this module is then passed to a second DSPy module, which also leverages the BootstrapFewShotWithRandomSearch teleprompter. This module creates multiple fewshot examples that compare the extracted answer against the true answer from the multiple-choice Figure 1: Predicting the presence of an error through a comparison to the retrieved question Figure 2: Identifying the error sentence question, as shown in Figure 1. We simultaneously bootstrap these two steps, optimizing the entire pipeline based on the accuracy of the overall error flag prediction. The result of this bootstrapping process is a compiled program with optimized multi-step chain of thought prompts based on the module\u2019s performance on error detection accuracy. This approach allows us to effectively identify the presence of errors in the query text by leveraging the knowledge from external medical question-answering datasets. 4.2.3 Localizing Errors within Query Text After detecting an error in the query text, we use a DSPy module to identify the specific line containing the error, as illustrated in Figure 2. This module takes the extracted answer choice and the preprocessed query text as inputs and then an LLM call is done to determine which line most closely matches the erroneous answer choice. Our experiments showed that GPT-4\u2019s performance was high enough that we did not need to compile the program or bootstrap few-shot prompts via a DSPy teleprompter. The module outputs the line number where the error is located, which is crucial for the subsequent error correction step, as it allows for targeted correction of the relevant text. 4.2.4 Error Correction with DSPy After identifying the error location within the query text, we use a final DSPy module to generate a corrected version of the text, as illustrated in Figure 3. This module takes three inputs: the error line, the extracted answer choice, and the correct answer 3 \fFigure 3: Generating the corrected sentence derived from the most similar retrieved multiplechoice question. The error correction module utilizes a chain of thought prompt along with 20 few-shot examples generated by the BootstrapFewShotWithRandomSearch teleprompter. This teleprompter samples examples from the training set and generates intermediate labels, such as rationales for the chain of thought, to provide additional context and guidance for the language model during the error correction process. The teleprompter optimizes the selection of few-shot prompts based on their performance on the validation set, using the ROUGE-L score as the metric. The selected few-shot examples, accompanied by the generated intermediate labels, demonstrate how to modify the error line based on the extracted answer choice and the correct answer, serving as a reference for the model to learn from and adapt to the specific error correction task. The module outputs the corrected version of the query text, with the error line revised based on the correct answer derived from the most similar multiple-choice question. This corrected text represents the final output of our retrieval-based approach for the MS dataset, addressing the subtle errors present in the clinical text. 4.3 Approach for UW Dataset Our approach for the UW dataset involves optimizing a series of DSPy modules to accomplish all three subtasks sequentially, as illustrated in Figure 4. In all of our experiments, we utilized GPT4-0125-preview as the underlying large language model, using default generation parameters (temperature of 1.0, top_p of 1) with the exception of a max tokens value of 4096. 4.3.1 Error Detection with DSPy For the UW dataset, we first employ a DSPy program to identify whether an error exists in the given clinical text snippet. This program is optimized using the Multi-prompt Instruction Proposal Optimizer (MIPRO) teleprompter, which generates Figure 4: Overview of the UW dataset pipeline, consisting of three main stages: error detection, error localization, and error correction. Each stage is implemented using a DSPy module optimized with the MIPRO teleprompter (Khattab et al., 2023) The pipeline also includes a quality control step based on the ROUGE-L score between the original erroneous text and the corrected version. and optimizes both the base prompts and few-shot examples. MIPRO optimizes the prompts and fewshot examples to maximize performance on the validation set, which we created by dividing the UW training collection (160 examples) into 80 training examples, 40 validation examples, and 40 test examples. The optimizer uses error flag accuracy as the metric to optimize and generates 20 examples. We also incorporate chain of thought reasoning into the DSPy module. 4.3.2 Error Localization If an error is detected in the clinical text snippet, we use another DSPy module to identify the specific line containing the error. This module is also optimized using MIPRO, which generates 20 bootstrap examples that include chain of thought rationales. Using a separate DSPy module for error localization allows us to precisely identify the source of the error and facilitate targeted corrections. The exact match of the error line is used as the metric for optimization, and this module is trained only on a subset of the training samples that contain errors. 4.3.3 Error Correction After identifying the error line, we use a third DSPy module to generate a corrected version of the erroneous text. This module is also optimized using MIPRO, following the same process as the previous modules. The error correction module takes the erroneous text as input and generates a corrected version based on the optimized prompts and weights. MIPRO uses the ROUGE-L score against the known correct sentence as the metric to optimize, and this module is trained only on a subset of the training samples that contain errors. 4 \fRank Team Error Flags Accuracy 1 WangLab 86.5% 2 MediFact 73.7% 3 knowlab_AIMed 69.4% 4 EM_Mixers 68.0% 5 IKIM 67.8% 6 IryoNLP 67.1% 7 Edinburgh Clinical NLP 66.9% 8 hyeonhwang 63.5% 9 PromptMind 62.2% 10 CLD-MEC 56.6% Table 1: Top 10 teams\u2019 performance on Task 1 (Error Flags Accuracy) 4.3.4 Quality Control with ROUGE-L To ensure the quality of the generated corrections, we calculate the ROUGE-L score between the original erroneous text and the corrected version. If the ROUGE-L score is below a threshold of 0.7, which we set as an arbitrary estimate for quality, we reject the correction and use the original erroneous text instead. This fallback mechanism is based on the observation that the ROUGE-L score of the erroneous text tends to be quite high since the error is only a small portion of the sentence. However, this fallback is more of a contest-metric-focused feature rather than something that significantly improves performance. 5 Results and Discussion 5.1 Overall Performance in the MEDIQA-CORR 2024 Shared Task Our approach achieved top performance in the MEDIQA-CORR 2024 shared task across all three subtasks. Tables 1, 2, and 3 present the performance of the top 10 teams in each subtask. 5.2 Performance on Subtask 1 Error Prediction In the official contest results for binary error prediction, our approach achieved an accuracy of 86.5%, ranking first among all participating teams. Table 1 shows the top 10 teams\u2019 performance on Task 1. 5.3 Performance on Subtask 2 Error Sentence Detection For error sentence detection, we obtained an accuracy of 83.6%, ranking first among all teams. Table 2 presents the top 10 teams\u2019 performance. These results demonstrate the effectiveness of our few-shot learning and CoT-based approach in Rank Team Error Sentence Detection Accuracy 1 WangLab 83.6% 2 EM_Mixers 64.0% 3 knowlab_AIMed 61.9% 4 hyeonhwang 61.5% 5 Edinburgh Clinical NLP 61.1% 6 IryoNLP 61.0% 7 PromptMind 60.9% 8 MediFact 60.0% 9 IKIM 59.0% 10 HSE NLP 52.0% Table 2: Top 10 teams\u2019 performance on Task 2 (Error Sentence Detection Accuracy) detecting the presence of errors and localizing the specific sentences containing the errors. 5.4 Performance on Subtask 3 Sentence Correction For subtask C (Sentence Correction), the official contest results show that our approach achieved an Aggregate-Score of 0.789, which is the mean of ROUGE-1-F (0.776), BERTScore (0.809), and BLEURT (0.783). This was the highest score among the participating teams for the sentence correction task. Table 3 displays the top 10 teams\u2019 performance on Task 3. The official contest results highlight the competitive performance of our approach across all three subtasks of the MEDIQA-CORR 2024 shared task, demonstrating its effectiveness in detecting, localizing, and correcting medical errors in clinical text for both the MS and UW datasets. 5.5 Implications and Limitations of the Approach Our work contributes to the ongoing efforts in improving the accuracy and reliability of medical information in clinical text. The automated detection and correction of certain types of errors could ensure the quality and consistency of medical documentation, ultimately supporting patient safety and quality of care. The development and integration of more advanced systems could help alleviate the burden of manual error checking for the specific error types addressed, allowing healthcare providers to allocate more time and resources to delivering high-quality patient care. However, it is important to acknowledge the limitations of our approach in the context of the diverse nature of errors in medical documentation. While our system demonstrates strong performance on the MS and UW datasets, it focuses on a specific subset of errors and has not been shown to be effec5 \fRank Team AggregateScore R1F BERTSCORE BLEURT AggregateCR 1 WangLab 0.789 0.776 0.809 0.783 0.775 2 PromptMind 0.787 0.807 0.806 0.747 0.574 3 HSE NLP 0.781 0.779 0.806 0.756 0.512 4 hyeonhwang 0.734 0.729 0.767 0.705 0.571 5 Maven 0.733 0.703 0.744 0.752 0.524 6 Edinburgh Clinical NLP 0.711 0.678 0.744 0.711 0.563 7 knowlab_AIMed 0.658 0.643 0.677 0.654 0.573 8 EM_Mixers 0.587 0.571 0.595 0.596 0.548 9 IryoNLP 0.581 0.561 0.592 0.591 0.528 10 IKIM 0.559 0.523 0.564 0.588 0.550 Table 3: Top 10 teams\u2019 performance on Task 3 (Aggregate Score and its components) tive in addressing the wide diversity of errors that can occur in medical documentation. For instance, our approach does not currently address errors that are propagated through multiple notes when a physician references prior documents containing inaccuracies, such as incorrect medical history. Such errors can be particularly challenging to identify and correct, as they may require a comprehensive understanding of the patient\u2019s medical history, the context of the referenced documents, and the resolution of conflicting statements across documents. Our system has not been designed or evaluated for handling these types of errors. Moreover, our approach does not cover errors that originate from sources beyond the scope of our training data, such as poor transcriptions, entries in the wrong medical record, or errors in decision making. These types of errors may necessitate different strategies and techniques for detection and correction, and our current approach has not been developed to handle them. Additionally, the reliance on external datasets for the retrieval-based approach in the MS dataset limits the generalizability of our method to other medical domains or datasets. In fact, we believe that an approach used in the MS dataset might actually create further errors if used on real clinical text, as real clinical practice does not always reflect optimal or most likely completions. The effectiveness of our approach in detecting and correcting errors may vary depending on the specific characteristics and error types present in different medical contexts, and further evaluation would be necessary to assess its performance in diverse settings. 5.5.1 Impact of Different LLMs and Compilation After the competition ended, we performed additional experiments to compare the performance of our approach when using GPT-4 and GPT-3.5 as the underlying language models for the DSPy modules, as well as the impact of using compiled and uncompiled DSPy programs. Table 4 presents the results of the ablation study for error flag accuracy (Task 1), error sentence detection accuracy (Task 2), and various metrics for Task 3. The results show that using GPT-4 as the underlying LLM consistently yields better performance compared to GPT-3.5 across all tasks. For Task 1, the compiled GPT-4 model achieves the highest accuracy of 97.3% (0.1%), while for Task 2, it achieves an accuracy of 97.0% (0.1%). The compiled DSPy programs outperform their uncompiled counterparts for both GPT-3.5 and GPT-4. In Task 3, the compiled GPT-4 model consistently outperforms the other models across all metrics, with the highest AggregateC score of 0.878 (0.002). Moreover, the results demonstrate that using compiled DSPy programs consistently outperforms the uncompiled approach across all tasks and datasets, emphasizing the significance of systematic optimization techniques in enhancing the performance of our error detection and correction system. It is important to note that we did not isolate the impact of retrieval in our post-competition experiments, as it was a fundamental component of all the modules in our approach. Removing the retrieval component would require the development of a new solution. However, the strong performance of our uncompiled GPT-3.5 solution suggests that a significant portion of the performance could be attributed to the retrieval process itself. Future work should 6 \fError Flags Accuracy (Task 1) GPT-3.5 Compiled GPT-3.5 Uncompiled GPT-4 Compiled GPT-4 Uncompiled Error Flags Accuracy 94.0% (0.4%) 81.2% (0.7%) 97.3% (0.1%) 88.9% (0.5%) Error Sentence Detection Accuracy (Task 2) GPT-3.5 Compiled GPT-3.5 Uncompiled GPT-4 Compiled GPT-4 Uncompiled Error Sentence Detection Accuracy 92.8% (0.5%) 78.5% (0.8%) 97.0% (0.1%) 88.0% (0.8%) Task 3 Metrics Metric GPT-3.5 Compiled GPT-3.5 Uncompiled GPT-4 Compiled GPT-4 Uncompiled aggregate_subset_check 0.853 (0.001) 0.809 (0.011) 0.824 (0.003) 0.827 (0.003) R1F_subset_check 0.827 (0.003) 0.778 (0.017) 0.789 (0.003) 0.792 (0.003) BERTSCORE_subset_check 0.874 (0.001) 0.827 (0.013) 0.856 (0.003) 0.857 (0.002) BLEURT_subset_check 0.859 (0.000) 0.824 (0.006) 0.827 (0.002) 0.832 (0.003) AggregateC 0.864 (0.004) 0.736 (0.010) 0.878 (0.002) 0.792 (0.005) Table 4: Ablation studies for error flag accuracy (Task 1), error sentence detection accuracy (Task 2), and Task 3 metrics. Numbers in parentheses represent standard deviations. explore the impact of different retrieval strategies on the performance of error detection and correction in clinical text. 5.6 Future Research Directions Although our approach has demonstrated competitive performance in the MEDIQA-CORR 2024 shared task, there are several potential avenues for future research that could further improve the effectiveness and applicability of our system. One area for future investigation is the finetuning of open access models specifically for clinical notes (Toma et al., 2023). While fine-tuning may lead to higher performance, we focused on working with DSPy in the current study and did not have the computational resources to maintain the necessary throughput and latency during initial experimentation. Future studies could examine the trade-offs between fine-tuning and using off-theshelf models with prompt optimization techniques, taking into account factors such as performance, efficiency, and scalability. Another direction for future research is the expansion of the benchmark dataset to include a broader range of errors, such as those spanning multiple documents or involving suboptimal clinical decisions. Broadening the scope of the dataset would enhance the robustness of error detection and correction systems and extend their applicability to more complex clinical scenarios. Integrating domain-specific knowledge, such as medical ontologies or expert-curated rules, into our approach could improve the system\u2019s ability to handle complex medical cases and make more informed decisions. This would be particularly relevant if the errors include suboptimal clinical decisions, as the system could provide more comprehensive support to healthcare professionals. Lastly, developing more comprehensive and robust methods for measuring and correcting errors is an area with significant potential. This could involve creating standardized evaluation metrics and datasets that better capture the intricacies of medical errors and developing more advanced error correction techniques that can handle a wider range of error types and contexts. 6"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14552v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14552v1",
|
| 3 |
+
"title": "Generalizing Multi-Step Inverse Models for Representation Learning to Finite-Memory POMDPs",
|
| 4 |
+
"abstract": "Discovering an informative, or agent-centric, state representation that\nencodes only the relevant information while discarding the irrelevant is a key\nchallenge towards scaling reinforcement learning algorithms and efficiently\napplying them to downstream tasks. Prior works studied this problem in\nhigh-dimensional Markovian environments, when the current observation may be a\ncomplex object but is sufficient to decode the informative state. In this work,\nwe consider the problem of discovering the agent-centric state in the more\nchallenging high-dimensional non-Markovian setting, when the state can be\ndecoded from a sequence of past observations. We establish that generalized\ninverse models can be adapted for learning agent-centric state representation\nfor this task. Our results include asymptotic theory in the deterministic\ndynamics setting as well as counter-examples for alternative intuitive\nalgorithms. We complement these findings with a thorough empirical study on the\nagent-centric state discovery abilities of the different alternatives we put\nforward. Particularly notable is our analysis of past actions, where we show\nthat these can be a double-edged sword: making the algorithms more successful\nwhen used correctly and causing dramatic failure when used incorrectly.",
|
| 5 |
+
"authors": "Lili Wu, Ben Evans, Riashat Islam, Raihan Seraj, Yonathan Efroni, Alex Lamb",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.LG",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.LG",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Multi AND Agent AND Reinforcement AND Learning",
|
| 15 |
+
"gt": "Discovering an informative, or agent-centric, state representation that\nencodes only the relevant information while discarding the irrelevant is a key\nchallenge towards scaling reinforcement learning algorithms and efficiently\napplying them to downstream tasks. Prior works studied this problem in\nhigh-dimensional Markovian environments, when the current observation may be a\ncomplex object but is sufficient to decode the informative state. In this work,\nwe consider the problem of discovering the agent-centric state in the more\nchallenging high-dimensional non-Markovian setting, when the state can be\ndecoded from a sequence of past observations. We establish that generalized\ninverse models can be adapted for learning agent-centric state representation\nfor this task. Our results include asymptotic theory in the deterministic\ndynamics setting as well as counter-examples for alternative intuitive\nalgorithms. We complement these findings with a thorough empirical study on the\nagent-centric state discovery abilities of the different alternatives we put\nforward. Particularly notable is our analysis of past actions, where we show\nthat these can be a double-edged sword: making the algorithms more successful\nwhen used correctly and causing dramatic failure when used incorrectly.",
|
| 16 |
+
"main_content": "Introduction Reinforcement Learning (RL) and its associated tasks of planning and exploration are dramatically easier in a small Markovian state space than in a high-dimensional, Partially Observed Markov Decision Process (POMDP). For example, controlling a car from a set of coordinates and velocities is much easier than controlling a car from first-person camera images. Having access to the Markovian latent representation of an environment has many merits. It can allow faster 1Microsoft Research, New York, USA 2New York University 3DreamFold 4MILA 5Meta. Correspondence to: Lili Wu <liliwu@microsoft.com>, Alex Lamb <lambalex@microsoft.com>. adaptation for downstream tasks, it simplifies the debugging of the learned representation, and it enables the use of large corpuses of unsupervised datasets in an efficient manner. Yet, learning to extract effective information in complex control systems can be notoriously difficult in general. In recent years, much effort has been devoted to tackling this problem in high-dimensional and Markovian systems in the RL community (Li et al., 2006; Nachum et al., 2018; Misra et al., 2020; Zhang et al., 2020; Efroni et al., 2022d; Wang et al., 2022b). For such systems, a prominent and widespread technique to learn latent state representation is the use of inverse models, also known as inverse kinematics (Pathak et al., 2017a). However, in many real-world control and decision problems, the immediate observation does not contain the complete relevant information required for optimal behavior, and the environment may be nonMarkovian. Hence, in practice, an algorithm designer often faces a double challenge: learning in the presence of both high-dimensional and non-Markovian data. This motivates us to study the following question: How can we generalize inverse models to learn agent-centric state representation of POMDPs? In this work, we take a first step towards a solution for the general problem by considering a special and prevalent class of non-Markovian environments. We consider the class of POMDPs with finite-memory, which we refer to as FMPOMDPs, and design an inverse models based approach to recover the informative state in a high-dimensional setting. Intuitively, for an FM-POMDP, the state can be decoded from a finite sequence of past observations and is often encountered in control and decision problems (e.g., to decode the velocity or acceleration of an object, a few previous observations are required). Due to the significance of such a system, many past works have put forward techniques for solving and learning in decision problems with memory, both in practice and theory (Bakker, 2001; Graves et al., 2016; Pritzel et al., 2017; Efroni et al., 2022b; Liu et al., 2022; Zhan et al., 2022). Yet, none explicitly focused on state discovery. Provably capturing relevant information while discarding distractors in high dimensional and Markovian environ1 arXiv:2404.14552v1 [cs.LG] 22 Apr 2024 \fGeneralizing Inverse Kinematics for Representation Learning to Finite Memory POMDPs Methods Objective Correct Bayes Optimal Classifier Complete Agent-Centric State Assumes Past Decodability Assumes Future Decodability Discards Exogenous Noise AH P\u03c0(at|o1:t, o1:(t+k)) \u2717 \u2717 \u2713 \u2717 \u2713 AH+A P\u03c0(at|\u02dc o1:t, \u02dc o1:(t+k)) \u2717 \u2717 \u2713 \u2717 \u2713 FJ P\u03c0(at|oP(t,m), oP(t+k,m)) \u2713 \u2717 \u2713 \u2717 \u2713 FJ+A P\u03c0(at|\u02dc oP(t,m), \u02dc oP(t+k,m)) \u2713 \u2717 \u2713 \u2717 \u2713 MIK P\u03c0(at|oP(t,m), oF(t+k,n)) \u2713 \u2717 \u2713 \u2713 \u2713 MIK+A P\u03c0(at|\u02dc oP(t,m), \u02dc oF(t+k,n)) \u2713 \u2713 \u2713 \u2713 \u2713 Table 1. A summary of the baseline inverse kinematics approaches which we study. Our final proposed method Masked Inverse Kinematics with actions (MIK+A) has a significant advantages over the alternatives: it can provably recover the agent centric state representation. ments has become a widely studied problem in RL literature (Dietterich et al., 2018; Efroni et al., 2022d; Wang et al., 2022b; Efroni et al., 2022a; Wang et al., 2022c; Lamb et al., 2022; Islam et al., 2023). These works have demonstrated the ability to discover an agent-centric state while discarding exogenous noise. Namely, to capture relevant information while filtering information that is unrelated to the control of the agent. In this work, we first show that naive approaches to generalize inverse kinematics to the FM-POMDP, non-Markovian, setting can fail, both theoretically and empirically. For instance, if a sequence is encoded using an RNN (or any other directed sequence model) and the hidden states are used to predict actions, we show that there is an \u201caction recorder\u201d problem where the model can learn shortcuts to representing the true state. Under assumptions of past and future decodability, we generalize inverse models to the high-dimensional FM-POMDP setting and establish, empirically and theoretically, that it recovers the latent state. Our results show that our variant of the multi-step inverse model (Lamb et al., 2022) can indeed succeed in the FMPOMDP setting. Experimentally, we validate recovery of the agent-centric state on acceleration-control, information masking, first-person perspective control, and delayed signal problems. Finally, we demonstrate the usefulness of the proposed objectives in visual offline RL tasks in presence of exogenous information, where we mask out randomly stacked frames and add random masking of patches to learn representations in a partially observable offline RL setting. 2. Background and Preliminaries Agent-Centric FM-POMDP. We consider a finite-memory episodic Partially Observable Markov Decision Process (FM-POMDP), which can be specified by M = (S, \u039e, O, A, H, P, q, r). Here S is the unobservable agentcentric state space, \u039e is the unobservable exogenous state space (for convenience, Z = S \u00d7 \u039e), O is the observation space, A is the action space, and H is the horizon. P is the unknown transition probability P(z\u2032 | z, a) equal to the probability of transitioning to z\u2032 after taking action a in state z. Let q be the unknown emission with q(o | z) equal to probability that the environment emits observation o when in state z. The block assumption holds if the support of the emission distributions of any two states are disjoint, supp(q(\u00b7 | z1))\u2229supp(q(\u00b7|z2)) = \u2205when z1 \u0338= z2., where supp(q(\u00b7 | z)) = {o \u2208O | q(o | z) > 0} for any state z. We assume our action space is finite and our agent-centric state space is also finite. The agent-centric FM-POMDP is concerned with the structure of the state space Z. More concretely, the state space Z = S \u00d7 \u039e consists of an agent-centric state s \u2208S and \u03be \u2208\u039e, such that z = (s, \u03be). The state dynamics are assumed to factorize as P(s\u2032, \u03be\u2032|s, \u03be, a) = P(s\u2032|s, a)P(\u03be\u2032|\u03be), where we refer to s and z as the agent-centric and exogenous part of the state, respectively (Efroni et al., 2022d; Lamb et al., 2022). We do not consider the episodic setting, but only assume access to a single trajectory. The agent interacts with the environment, generating an observation and action sequence, (z1, o1, a1, z2, o2, a2, \u00b7 \u00b7 \u00b7 ) where z1 \u223c\u00b5(\u00b7). The latent dynamics follow zt+1 \u223cP(z\u2032 | zt, at) and observations are generated from the latent state at the same time step: ot \u223cq(\u00b7 | zt). The agent does not observe the latent states (z1, z2, \u00b7 \u00b7 \u00b7 ), instead it receives only the observations (o1, o2, \u00b7 \u00b7 \u00b7 ). We use \u02dc Om to denote the set of augmented observations of length m given by \u02dc Om = (O\u00d7A)m\u00d7O. Moreover, we will introduce the notation that \u02dc ot = (ot, at\u22121), which can be seen as the observation augmented with the previous action. Lastly, the agent chooses actions using a policy which can most generally depend on the entire t-step history of observations and previous actions \u03c0 : \u02dc Ot \u2192\u2206(A), so that at \u223c\u03c0(\u00b7|\u02dc o1, ..., \u02dc ot\u22121, \u02dc ot). We assume that the agent-centric dynamics are deterministic and that the diameter of the control-endogenous part of the state space is bounded. In other words, there is an optimal policy to reach any state from any other state in a finite number of steps: the length of the shortest path between any s1 \u2208S to any s2 \u2208S is bounded by the unknown finite diameter of the MDP D. These assumptions are required for establishing the theoretical guarantees in (Lamb et al., 2022), from which we built upon in this work. Inverse Kinematics in Reinforcement Learning. We refer 2 \fGeneralizing Inverse Kinematics for Representation Learning to Finite Memory POMDPs to inverse kinematics as a class of representation learning techniques in RL. These techniques make use of action prediction tasks, based on current and future observation, to learn a useful and compressed representation of the observation. In the pioneering work of Pathak et al. (2017a) the authors learned a decoder \u03d5 with a 1-step inverse kinematics objective that allows to predict an action at from consecutive observations \u03d5(ot) and \u03d5(ot+1). Lamb et al. (2022) recently showed that, without additional assumptions, 1-step inverse kinematics fails to recover the latent state. They designed multi-step inverse kinematics objectives, a set of predictions tasks that depends on k \u22651 of the action at from \u03d5(ot) and \u03d5(ot+k) for large enough k, and showed it provably learns the latent state. We note that all these objectives do not require use of future state information in real-time, but only make use of this information in the training procedure. Indeed, the learned decoder \u03d5 only receives an observation as its input. Past and Future Decodability Assumptions. We now present the key structural assumptions of this paper. We assume that a prefix of length m of the history suffices to decode the latent state and also that a suffix of length n of the future suffices to decode the latent state. Additionally, we will introduce some extra notation for conditioning on either the past or future segments of a sequence. Let \u02dc oP(h,m) = \u02dc omax{1,h\u2212m}:h be the past observations and let \u02dc oF(h,n) = \u02dc omin{h+n,H}:H refer to the future observations. We will require that there are two separate encoders which are used in the process of training. One encoder produces a state to represent the past while a separate encoder produces a state to represent the future. When the state is used for some purpose (such as planning, exploration, or evaluation), only the past encoder will be used. The future is privileged information, and thus the future encoder is only used during training. Assumption 1 (m-step past decodability). There exists an unknown decoder \u03d5f \u22c6,s : \u02dc Om \u2192S such that for every reachable trajectory \u03c4 = s1:H, we have sh = \u03d5f \u22c6,s(\u02dc oP(h,m)). Assumption 2 (n-step future decodability). There exists an unknown decoder \u03d5b \u22c6,s : \u02dc On \u2192S such that for every reachable trajectory \u03c4 = s1:H, we have sh = \u03d5b \u22c6,s(\u02dc oF(h,n)). We note that the decodability assumption on the observation and previous action sequence \u02dc o is more general than an analogous decodability assumption on the observations alone o. Indeed, in practical applications it may be the case that prior actions are required to decode the current state, and hence we work with this more general assumption. In fact, in the experimental section we will show that, empirically, adding actions improves our algorithm\u2019s performance. 3. Proposed Objectives In this section, we describe in detail a set of possible inverse kinematic based objectives for the FM-POMDP setting. One is All History (AH), which involves using the entire sequence of observations to predict actions. Another is Forward Jump (FJ), in which a partial history of the sequence is used from both the past and a number of steps in the future. Finally, Masked Inverse Kinematics uses a partial history of the sequence from the past and a partial future of the sequence a number of steps in the future. For all of these objectives, we will consider a variant which augments each observation in the input sequence with the previous action. These objectives are visualized in Figure 1 and summarized in Table 1. Our high-level strategy will be to study which of these objectives are sufficient to obtain a reduction to the analysis in (Lamb et al., 2022), which guarantees recovery of the true minimal agent-centric state. To do this, we will first study the Bayes-optimal solution of each objective in terms of the true agent-centric state (section 3.1). Following this, we will study which of these Bayes-optimal solutions are sufficient to complete the reduction in section 3.2. 3.1. The Bayes Optimal Classifier of Candidate Objectives We start by analyzing the Bayes optimal solution of few inverse kinematics objectives, namely, objectives that aim to predict an action from a sequence of observations. These closed form solutions will later motivate the design of the loss objectives, and guide us towards choosing the proper way of implementing inverse kinematics for the FM-POMDP setting. These results are proved in Appendix A.2, A.3, A.4. Proposed Masked-Inverse Kinematics (MIK+A). Masked inverse kinematics with actions (MIK+A) achieves the correct Bayes-optimal classifier for the multi-step inverse model, with dependence on only the agent-centric part of the state, i.e., st and st+k. Let st = \u03d5f s(\u02dc oP(t,m)), st+k = \u03d5b s(\u02dc oF(t+k,n)), \u03bet = \u03d5\u03be(\u02dc o1:t), \u03bet+k = \u03d5\u03be(\u02dc o1:t+k), zt = (st, \u03bet). Let k \u223cU(1, D) . The following result is proved in the appendix for any agent-centric policy \u03c0: \u2200k \u22651, P\u03c0(at|\u02dc oP(t,m), \u02dc oF(t+k,n)) = P\u03c0(at|st, st+k) The MIK objective is essentially the same, except that there is no conditioning on past actions: P\u03c0(at|oP(t,m), oF(t+k,n)), and would have the same Bayesoptimal classifier result if we relaxed the past and future decodability assumptions to not require actions. All History (AH) Objective. When we condition our encoder on the entire history, the Bayes-optimal multi-step inverse model reduces to a one-step inverse model. Intu3 \fGeneralizing Inverse Kinematics for Representation Learning to Finite Memory POMDPs Figure 1. We examine several objectives for generalizing inverse kinematics to FM-POMDPs. MIK+A uses past-decodability and future-decodability with a gap of k masked steps, FJ+A uses past-decodability with a gap of k steps, while AH uses past-decodability over the entire sequence. itively, the optimal model could simulate an internal onestep inverse model and store these predicted actions in an internal buffer, and then retrieve them as necessary to predict the true actions. The one-step inverse model fails to learn the full agent-centric state, with counterexamples given by (Efroni et al., 2022d; Lamb et al., 2022). Let st = \u03d5s(o1:t), st+k = \u03d5s(o1:(t+k)), \u03bet = \u03d5\u03be(o1:t), \u03bet+k = \u03d5\u03be(o1:t+k), zt = (st, \u03bet). Let k \u223cU(1, D). In Appendix A.3, we prove the following: \u2200k \u22651, P\u03c0(at|o1:t, o1:(t+k)) = P\u03c0(at|st, st+1) All History with actions (AH+A) Objective. If the observations are augmented with the last action, then these actions can simply be stored to a buffer and retrieved to solve the multi-step inverse modeling problem. Thus the Bayes optimal multi-step inverse model in this setting can have no dependence on the state. In the appendix we prove the following but note that it\u2019s a straightforward consequence of this objective conditioning on the action at which is being predicted: \u2200k \u22651, P\u03c0(at|\u02dc o1:t, \u02dc o1:(t+k)) = 1 Forward-Jump Inverse Kinematics (FJ) Objective. By an almost identical proof as the above, this algorithm achieves the correct Bayes optimal classifier. \u2200k, k > m, k \u22651, P\u03c0(at|oP(t,m), oP(t+k,m)) = P\u03c0(at|st, st+k). \u2200k, k \u2264m, k \u22651, P\u03c0(at|oP(t,m), oP(t+k,m)) = P\u03c0(at|st, st+1). Forward-Jump Inverse Kinematics with Actions (FJ+A) Objective Likewise, when conditioning on actions we have: \u2200k, k > m, k \u22651, P\u03c0(at|\u02dc oP(t,m), \u02dc oP(t+k,m)) = P\u03c0(at|st, st+k). \u2200k, k \u2264m, k \u22651, P\u03c0(at|\u02dc oP(t,m), \u02dc oP(t+k,m)) = 1. 3.2. Discovering the Complete Agent-Centric State In the previous section we described several inverse kinematic terms that may be useful for discovering the agentcentric state representation of an FM-POMDP. We now claim that among this set of inverse kinematics terms, the MIK+A is the most favorable one: the main result from (Lamb et al., 2022) (Theorem 5.1) implies that MIK+A recovers the agent-centric state representation. Further, we elaborate on the failure of the other inverse kinematic objectives. MIK+A Discovers the Full Agent-Centric State. Given successful recovery of the Bayes optimal classifier for the multi-step inverse model, with dependence on only st and st+k, we can reuse the theory from (Lamb et al., 2022), with slight modifications, as given in the appendix. The most important modification is that we roll-out for m + n + D steps, to ensure that we have enough steps to decode st and st+k, where D is the diameter of the agent-centric state. With the above, the reduction to Theorem 5.1 of (Lamb et al., 2022) is natural. There, the authors showed that, under proper assumptions, if an encoder \u03d5 can represent inverse kinematic terms of the form P\u03c0(at|st, st+k) for all k \u2208[D] then \u03d5 is the mapping from observations to the agent-centric state. Failure of All History (AH) for Discovering Agent4 \fGeneralizing Inverse Kinematics for Representation Learning to Finite Memory POMDPs Figure 2. The Forward Jump objective fails in a counterexample where the observation can only be seen once every m steps, preventing the use of k \u2264m inverse kinematics examples, whereas the inverse examples with k > m provide no signal for separating the states. Centric State Representation. We showed that the AH objective can be satisfied by only solving the one-step inverse objective p(at|st, st+1). It was shown in (Rakelly et al., 2021; Lamb et al., 2022; Efroni et al., 2022d) that the one-step inverse objective learns an undercomplete representation. Intuitively, it may incorrectly merge states which have locally similar dynamics but are actually far apart in the environment. Failure of Forward-Jump (FJ and FJ+A) for Discovering Agent-Centric State Representation. Since the Forward-Jump objectives only rely on past-decodability, it does not have correct Bayes optimal classifiers for all k \u2264m. Namely, it does not recover the inverse model with k in this regime. This prevents us from applying the result of Lamb et al. (2022), since it requires the set of all inverse models k \u2208[D], wheres FJ only has access to k \u2208{1, m, m+1, .., D} but not for k in intermediate values. Nevertheless, this give rise on an intriguing question: is there a counterexample that shows FJ or FJ+A does not work? We establish a counterexample in which the k = 1 examples are insufficient to distinguish all of the states and where the k > 3 examples are useless. We will then construct an observation space for an FM-POMDP with m = 3, which will then cause both the FJ and FJ+A objectives to fail. Consider the following agent-centric state with two components s = (sA, sB). sA receives four values {0, 1, 2, 3} and follows the dynamics sA t+1 = (sA t + at) mod 4, which is a simple cycle with a period of 4, controlled by the action a \u2208 {0, 1}. sB = at\u22121 simply records the previous action. We have an exogenous periodic signal ct+1 = (ct + 1) mod 4. This FM-POMDP\u2019s agent-centric state has a diameter of D = 3, and the true state can be recovered with k from 1 to 3. However, all multi-step inverse problems, under the random policy, with k > 3 has the same probability of 0.5 for both actions. Concretely, for any plan to reach a goal with k > 3 steps, multiplying the actions by -1 will still yield an equally optimal plan with respect to sA, while only the last action taken has an effect on sB, so the distribution over the first action will be uniform (MDP shown in appendix figure 8). Now, let\u2019s turn to the construction of the observation space of this FM-POMDP. We will use the counter ct to control when the state can be seen in the observation, so if ct = 0, we have ot = st, whereas if ct \u0338= 0, we have ot = \u22121 (blank observation). It is apparent that if ct \u0338= 0, that we can\u2019t decode the state from the current observation. However, with a history of m = 3 past observations, we can decode the state by finding st when it is present in the observation (i.e. when ot \u0338= \u22121), and then simulate the last m steps using the previous actions recorded in the observations. A simplified version of this construction (showing only sA and with m = 2) is shown in Figure 2. To reiterate the claim of the proof, we constructed a FMPOMDP where it is necessary to use k = 2 and k = 3 multistep model examples to separate out the states correctly. Yet the state can only be perfectly decoded with m = 3 steps of history. Thus, the FJ and FJ+A objectives fail to learn the correct representation in this FM-POMDP. 4. Experimental Results We experimentally validate whether the set of inverse kinematic based objectives can recover the agent-centric state in the FM-POMDP setting. To do this, we first evaluate the objectives in a partially observable navigation environment (section 4.1) and then study whether these objectives can learn useful representations, in presence of partially observable offline datasets (section 4.2). 4.1. Discovering State from Partially-Observed Navigation Environments Experiment Setup We first consider the navigation environments in Figure 3, with other figures and details in Appendix figures 9 and 10, and introduce partial observability in these tasks. Details on experimental setup are provided in appendix D.1. In this problem, m-step past decodability is achieved with m=1. The n-step future decodability assumption subtly violated in cases where the agent collides into a wall and loses all of its velocity. The agent\u2019s velocity before hitting the wall is then not decodable from any number of future observations. We also consider an optional Self-Prediction (SP) objective ||sg(st+k) \u2212f(st, k)||, where sg refers to stopping gradients. This auxiliary objective, inspired by (Guo et al., 2022; Tang et al., 2023) can help to improve the quality of representations. Experiment Results In the acceleration-control experFigure 3. Visualization of the four navigation environments. From left to right: no curtain, one curtain, three curtains, and first-person environments. All include some degree of partial observability. 5 \fGeneralizing Inverse Kinematics for Representation Learning to Finite Memory POMDPs SP No SP K=1 K=15 50 60 70 80 90 100 State Prediction Accuracy No-Curtain Task No History AH AH + A FJ FJ + A MIK MIK + A SP No SP K=1 K=15 50 60 70 80 90 100 State Prediction Accuracy One-Curtain Task No History AH AH + A FJ FJ + A MIK MIK + A SP No SP K=1 K=15 50 60 70 80 90 100 State Prediction Accuracy Three-Curtain Task No History AH AH + A FJ FJ + A MIK MIK + A SP No SP K=1 K=15 50 60 70 80 90 100 State Prediction Accuracy First Person Task No History AH AH + A FJ FJ + A MIK MIK + A Figure 4. We compare state estimation performance (higher is better) across our various proposed methods. We compare action-conditioned and action-free variants while also considering a self-prediction auxiliary loss and the maximum prediction span K. We omit FJ and FJ+A in the maximum K = 1 case because of equivalence to AH and AH+A with a shorter history. Objective No Curtain Three Curtains No History 47.6 52.7 AH 9.9 13.2 AH+A 18.8 18.9 FJ 10.0 15.3 FJ+A 5.8 7.2 MIK 10.1 14.7 MIK+A 6.1 7.4 Table 2. State Estimation Errors (%) on various tasks with exogenous noise. iments (Figure 4, Table 2), we consistently found that MIK+A has the best performance, which is aligned with theory. The theory also suggests that AH+A has no state dependence, and we indeed see that it has the worst performance, when the maximum k is small. Another striking result is that AH with any maximum k is theoretically equivalent to AH with maximum k of 1, and these two methods indeed have very similar errors experimentally. Further evidence comes from investigating the action prediction losses (Table 5), where we see that AH+A has nearly zero error while AH has a very low loss, supporting our claim that these objectives fail because they reduce the bayes optimal predictor to an overly simple learning objective. Another finding is that FJ+A and MIK+A are fairly similar, which suggests that the theoretical counterexample for FJ+A may not imply poor performance. Extra experiment results of adding next-state prediction or exogenous noise are provided in appendix D.1. 4.2. Visual Offline RL with Additional Partial Observability We validate the proposed objectives in challenging pixelbased visual offline RL tasks, using the vd4rl benchmark dataset (Lu et al., 2022). For our experiments, we follow the same setup as (Islam et al., 2023), where we pre-train the representations from the visual observations and then perform fine-tuning on the fixed representations using the TD3+BC offline RL algorithm. In our experiments, we compare results using several variations of our proposed objectives, along with several other baselines. We mainly compare with five other baselines, namely ACRO (Islam et al., 2023), DRIML (Mazoure et al., 2020), HOMER (Misra et al., 2020), CURL (Laskin et al., 2020) and 1-step inverse action prediction (Pathak et al., 2017a). Experiment Setup : We consider an offline RL setting with partial observations, as illustrated in figure 5. To do this, we use the existing vd4rl benchmark dataset (Lu et al., 2022), and to turn it into a POMDP setting, we apply masking or patching on the observation space randomly. In other words, for each batch of samples from the offline dataset, we randomly patch each observation with a masking of size 16 \u00d7 16 to make the observations partially observable to the model. In addition to that, since existing (Lu et al., 2022) setup uses pixel-based observations and uses a framestacking of 3, to make the setting even more challenging, we randomly zero out 2 out of 3 stacked frames. We do this so that the model can only see both the stacked frames and each frame partially; with the goal to see if our proposed objectives using a forward and backward running sequence model can be more robust with the learnt representations. Experiment Results : Our experimental results show that in presence of partial observability, most of the existing baselines as in (Islam et al., 2023) can fail considerably, for different domains and datasets. In contrast, when we consider the history information and also additionally take into account the action information, then performance of the proposed models can improve significantly. Note that all our experiments here only consider the pixel-based datasets from (Lu et al., 2022) with only adding partial observability, without considering any exogenous noise in the datasets as in the setups in (Islam et al., 2023). Figure 6 shows that in presence of partial observability, all the considered baselines can fail considerably and performance degrades significantly compared to what was reported in the fully observed setting. In comparison, the proposed objectives can be more robust in partial observability, and notably our key objective (MIK+A) can perform significantly compared to other model ablations. Experimental results show that MIK + A can perform significantly better comopared to baselines, in almost all of the tasks. Figure 7 shows results for an even more difficult experiment setup with randomly zeroing stacked frames. Experimental results show that MIK + A can still perform relatively better compared to other 6 \fGeneralizing Inverse Kinematics for Representation Learning to Finite Memory POMDPs + RNN Encoder Output MIK + A OFFLINE VISUAL DATASET Freeze Representation Offline RL Algorithm Backward RNN for Future Sequences Figure 5. Illustration of the visual offline RL experiment setup, in presence of partial observability. We use a forward and backward sequence model (RNN encoder) to handle past and future observation sequences, to achieve latent state discovery in FM-POMDPs. baselines, in this difficult setting, since the forward and backward sequence models capturing the past and future observations can better capture sufficient information from the partial observations to fully recover the agent-centric state. 5. Related Work Our work builds up on two closely related line of work : (a) on short-term memory POMDPs and (b) learning agentcentric latent states. We describe closely related work on partially observable settings, both theoretical and empirical, and discuss why existing works fail to fully recover the agent-centric latent state in a partially observed setting. Theoretical Research on FM-POMDPs. Efroni et al. (2022b); Liu et al. (2022); Zhan et al. (2022); Wang et al. (2022a) studied finite-sample guarantees under closely related m-step past and n-step future decodability assumptions. Nevertheless, their algorithms are currently impossible to scale and implement with standard oracles (such as log-likelihood minimization) since it requires an optimistic optimization over a set of functions .Further, unlike our reward-free setting, their algorithm is dependent on having a reward signal, whereas our work focuses on reward-free representation learning. Lastly, these works did not considered the high-dimensional problem in the presence of exogenous and time correlated noise. Empirical Research on POMDPs. Partial observability is a central challenge in practical RL settings and, as such, it has been the focus of a large body of empirical work. Seminal large scale empirical deep RL research has considered serious partial observability, such as the OpenAI Five program for Dota 2 (OpenAI et al., 2019) and the DeepMind AlphaStar system (Mathieu et al., 2023). Much of this work has used a recurrent neural network or other sequence model to handle a state with history. While much of this work is focused on directly learning a policy or value function (Hausknecht & Stone, 2017), these approaches will fail when reward is absent. Other work has learned a recurrent forward model to predict observations as well (Igl et al., 2018; Hafner et al., 2019; 2020), yet this will fail when exogenous noise is dominant. To our knowledge, none of these DeepRL POMDP works have considered our proposed setting of learning agent-centric state with inverse kinematics. (Ni et al., 2022) showed an extensive empirical benchmark where recurrent online RL is used for POMDPs. This differs from our work principally in that it\u2019s empirical and focused on reward-signal, whereas our approach is reward-free and the motivation for our loss objectives is a consequence of asymptotic theory we develop. Research on Agent-Centric States and Inverse Kinematics. The primary line of theoretical research on inverse kinematics and agent-centric states is exclusively concerned with the MDP setting (Lamb et al., 2022; Efroni et al., 2022a;c;d; Islam et al., 2023; Mhammedi et al., 2023; Hutter & Hansen, 2022). In particular, much of this work has focused on analysis showing that the agent-centric state can be provably recovered under some assumptions. The PPE method (Efroni et al., 2022d) introduced multi-step inverse kinematics in the deterministic dynamics, episodic setting with fixed start states. (Lamb et al., 2022) extended this to the non-episodic setting, while (Efroni et al., 2022a) handles a stochastic dynamics setting. (Tomar et al., 2023; Islam et al., 2023) considered multi-step inverse models for offline-RL, while only considering the fully-observed setting. While (Brandfonbrener et al., 2023) used pre-trained multi-step and one-step inverse models for online RL, still in the fully-observed setting. (Pathak et al., 2017b; Shelhamer et al., 2017; Badia et al., 2020; Schmeckpeper et al., 2020; Rakelly et al., 2021) all use one-step inverse objective in fully-observed setting to improve empirical performance. (Bharadhwaj et al., 2022) InfoPower used a one-step inverse objective along with an RNN to encode the history. (Wang et al., 2022c) showed discovery of agent-centric state using causal independence tests and was restricted to the fully-observed setting. (Wang et al., 2022b) studied learning a recurrent forward model with a factorization of the state space into agent-centric and exogenous components. This method naturally handles POMDPs, but requires 7 \fGeneralizing Inverse Kinematics for Representation Learning to Finite Memory POMDPs 4 5 6 7 8 9 Iterations 1e3 150 200 250 300 350 400 450 Cumulative Returns cheetah_run_medium_expert AH AH + A MIK + A CURL ACRO DRIML HOMER 1-Step Inverse 4 5 6 7 8 9 Iterations 1e3 150 200 250 300 350 400 450 Cumulative Returns cheetah_run_medium AH AH + A MIK + A CURL ACRO DRIML HOMER 1-Step Inverse 4 5 6 7 8 9 Iterations 1e3 100 200 300 400 500 600 700 800 Cumulative Returns walker_walk_medium_expert AH AH + A MIK + A CURL ACRO DRIML HOMER 1-Step Inverse 4 5 6 7 8 9 Iterations 1e3 250 300 350 400 450 Cumulative Returns walker_walk_medium AH AH + A MIK + A CURL ACRO DRIML HOMER 1-Step Inverse Figure 6. Visual offline datasets from (Lu et al., 2022) with patching (16 \u00d7 16) to make the observations partially observable. We compare several of the proposed objectives discussed earlier, along with few baselines, using the representation learning setup in (Islam et al., 2023). Experimental results are compared across 3 different domains (Cheetah-Run, Walker-Walk and Humanoid-Walk) and 2 different datasets (Expert and Medium-Expert), across 5 different random seeds. 4 5 6 7 8 9 Iterations 1e3 0 25 50 75 100 125 150 175 Cumulative Returns cheetah_run_medium_expert AH AH + A MIK + A CURL ACRO DRIML HOMER 1-Step Inverse 4 5 6 7 8 9 Iterations 1e3 1 2 3 4 5 6 Cumulative Returns humanoid_walk_medium AH AH + A MIK + A CURL ACRO DRIML HOMER 1-Step Inverse 4 5 6 7 8 9 Iterations 1e3 20 40 60 80 100 120 Cumulative Returns walker_walk_medium_expert AH AH + A MIK + A CURL ACRO DRIML HOMER 1-Step Inverse 4 5 6 7 8 9 Iterations 1e3 25 50 75 100 125 150 175 200 225 Cumulative Returns walker_walk_medium AH AH + A MIK + A CURL ACRO DRIML HOMER 1-Step Inverse Figure 7. A more challenging setting where in addition to the patching of observations, we further apply randomly zeroing of framestacking. We apply framestacking for visual observations, where to make the task more difficult and partially observable, we randomly zero out 2 out of 3 frames, on top of the masked observations. learning both the agent-centric and exogenous states to satisfy the future observation prediction objective, so differs significantly from our algorithmic approach, that allows to directly avoid learning information on the exogenous noise. Work related to both POMDPs and Multi-step Inverse Kinematics. To our knowledge, ours is the first work to explicitly consider inverse kinematics for learning agentcentric states in the POMDP setting. Our counter-examples to AH and AH+A objectives, where the model can fail to learn the state by memorizing actions, is reminiscent of the causal confusion for imitation learning work (De Haan et al., 2019) . (Baker et al., 2022) considers a one-step inverse model using a transformer encoder, to learn an action-labeling model. While this is equivalent to our All History (AH) approach, the focus of that work was not on learning representations. (Sun et al., 2023; Goyal et al., 2022) consider a sequence learning setup where a bidirectional sequence model masks observations and actions in the input and predicts the masked actions. While these approaches seem consistent with our theoretical analysis, they use a bidirectional model and therefore learn an entangled model of \u03d5f s and \u03d5b s in their internal representations, where the correct usage for planning and exploration is unclear. This makes their setting different from our focus on learning an explicit state representation and their work doesn\u2019t provide a theoretical analysis. 6. Discussion Partially observable settings in RL are often difficult to work with, theoretically without strong assumptions, and empirically with a implementable algorithm, despite the generality of non-Markovian observations that can arise naturally in practice. To recover the agent-centric full latent state that can be considered as an information state, is quite difficult in the FM-POMDP setting. Several works using multi-step inverse kinematics has recently been proposed for latent state discovery, in the theoretical and empirical RL communities. However, despite the popularity, how to apply multi-step inverse kinematics in the FM-POMDP setting has not been previously studied. Our work shows that it\u2019s possible to succeed in discovering agent-centric states in FM-POMDPs while many intuitive algorithms fail. We made the assumptions of past-decodability (Efroni et al., 2022b) while introducing a new future-decodability assumption. In this work, we demonstrated several examples showing that the full agent-centric state can be recovered from partially observable, offline pre-collected data for acceleration and control. Additionally, we showed that MIK+A, taking the action information from past and future into account, can be effective for learning a latent representation that can improve performance empirically on a challenging partially observable offline RL task. A natural topic for future work is developing an online algorithm which discovers a policy that achieves these decodability properties rather than assuming them. 8 \fGeneralizing Inverse Kinematics for Representation Learning to Finite Memory POMDPs 7. Broader Impact As this work is of a purely technical and somewhat theoretical nature, we don\u2019t foresee any direct ethical impacts of this work, but we encourage further study along these lines."
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14567v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14567v1",
|
| 3 |
+
"title": "WangLab at MEDIQA-M3G 2024: Multimodal Medical Answer Generation using Large Language Models",
|
| 4 |
+
"abstract": "This paper outlines our submission to the MEDIQA2024 Multilingual and\nMultimodal Medical Answer Generation (M3G) shared task. We report results for\ntwo standalone solutions under the English category of the task, the first\ninvolving two consecutive API calls to the Claude 3 Opus API and the second\ninvolving training an image-disease label joint embedding in the style of CLIP\nfor image classification. These two solutions scored 1st and 2nd place\nrespectively on the competition leaderboard, substantially outperforming the\nnext best solution. Additionally, we discuss insights gained from\npost-competition experiments. While the performance of these two solutions have\nsignificant room for improvement due to the difficulty of the shared task and\nthe challenging nature of medical visual question answering in general, we\nidentify the multi-stage LLM approach and the CLIP image classification\napproach as promising avenues for further investigation.",
|
| 5 |
+
"authors": "Ronald Xie, Steven Palayew, Augustin Toma, Gary Bader, Bo Wang",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "LLM Fairness",
|
| 14 |
+
"gt": "This paper outlines our submission to the MEDIQA2024 Multilingual and\nMultimodal Medical Answer Generation (M3G) shared task. We report results for\ntwo standalone solutions under the English category of the task, the first\ninvolving two consecutive API calls to the Claude 3 Opus API and the second\ninvolving training an image-disease label joint embedding in the style of CLIP\nfor image classification. These two solutions scored 1st and 2nd place\nrespectively on the competition leaderboard, substantially outperforming the\nnext best solution. Additionally, we discuss insights gained from\npost-competition experiments. While the performance of these two solutions have\nsignificant room for improvement due to the difficulty of the shared task and\nthe challenging nature of medical visual question answering in general, we\nidentify the multi-stage LLM approach and the CLIP image classification\napproach as promising avenues for further investigation.",
|
| 15 |
+
"main_content": "Introduction An increased demand for healthcare services and recent pandemic needs have accelerated the adoption of telehealth, which was previously underused and understudied (Shaver, 2022; wai Yim et al., 2024a). There has been significant recent interest in integrating artificial intelligence (AI) into telehealth Ma et al., 2024; Toma et al., 2023, as these technologies have the potential to enhance and expand its ability to address important healthcare needs (Sharma et al., 2023). The task of consumer health question answering, an important part of telehealth, has been explored actively in research. However, the focus of this existing research has been on text (Ben Abacha et al., 2019), which is limiting as medicine is inherently multimodal in nature, requiring clinicians to work not just with text but also with imaging among other modalities (Corrado and Matias, 2023). To help address this gap, the MEDIQA-M3G shared task was proposed (wai Yim et al., 2024a). This task requires the automatic generation of clinical responses given relevant user generated text and images as input, with a specific focus on clinical dermatology (wai Yim et al., 2024a). This work describes our submission to this task. We explored two standalone solutions, one involving two consecutive API calls to the recently released Claude 3 Opus model (Anthropic) and the other trains a joint image-disease label embedding model using CLIP (Radford et al., 2021) for image classification. These two strategies took 1st and 2nd place respectively during the competition. While our strategy\u2019s effectiveness relative to other submissions highlight that Claude 3 Opus and multi-stage LLM frameworks have potential value in the area of multi-modal medical AI, both our solutions\u2019 performance is limited despite their leaderboard success, highlighting the difficulty of the shared task and the unsolved challenge of medical visual question answering. 2 Shared task and provided dataset The MEDIQA-M3G competition focuses on the problem of clinical dermatology multimodal query response generation. The inputs include text which give clinical context and queries, as well as one or more images associated with the case (wai Yim et al., 2024b). The task is to generate responses to these cases resembling those made by medical professionals in the field of dermatology. Participants have the option to generate these responses in three languages: Chinese (Simplified), English, and Spanish. (wai Yim et al., 2024a) The dataset consists of 842 train, 56 validation, and 100 test cases. Each case consists of one or more images of skin conditions, their accompanying query text which may or may not include clinical context, patient queries, additional details 1 arXiv:2404.14567v1 [cs.CL] 22 Apr 2024 \fregarding the disease and in some cases possible diagnosis. Finally, for each case there are multiple responses made by one or more medical professionals, which are used as targets to score the model predictions. The cases also notably include metadata on the rank and validation level of the authors of content, which are used in evaluation (wai Yim et al., 2024b). For evaluation, the competition uses a version of the deltaBLEU (Galley et al., 2015) metric to allow a single score to be computed based on word matching, weighted by the consistency (most frequent response) and the seniority of the medical professional across all responses given for that particular case. (wai Yim et al., 2024a) The query text and target responses are given in multiple languages, namely Chinese, English, and Spanish (wai Yim et al., 2024b). It\u2019s worth noting that while the test and validation sets were translated by medical professionals, the training set of 842 cases seems to be translated automatically with some potential room for errors. For our submission we focus on only providing the English solution. 3 Related Work There has recently been a substantial amount of interest in medical applications of multimodal machine learning, and large multimodal models. Some notable examples of research in this area include the open source LLAVA-MED model (Li et al., 2023), and ELIXR, with the latter, similar to our work, exploring not only the application of large multimodal models, but also training a model using CLIP (Xu et al., 2023). However, while there has been significant focus on certain areas such as radiology, the area of dermatology has not been explored to the same extent. Cirone et al. notably found that GPT-4V could accurately differentiate between benign lesions and melanoma (Cirone et al., 2024). However, this is a much less challenging task than the one proposed in this shared task, as the problem space is much smaller in scope than responding to dermatology questions which are not necessarily in the train set, with even the conditions of interest not necessarily being in the train set. The limited performance of our solution, along with it being by far the best performing solution in this competition demonstrate the challenge of this task, and highlight the need for significant progress before deployment in a clinical setting. However, our work highlights potentially important directions for future research, including further investigation of multi-stage LLM systems, and the importance of evaluation metrics in the benchmarking of the clinical efficacy of developed systems. 4 Results Upon examination of the evaluation metric and competition data, we have determined that a short response focusing on disease diagnosis alone is the most advantageous. This is due to two reasons. First, we notice both the training and validation sets often contain short responses, and in many cases merely the skin condition presented in the associated images. Second, the evaluation metric\u2019s penalty for short responses is significantly smaller than a longer, partially correct response. Given these initial findings, we evaluated two methods as outlined in 1 which took 1st and 2nd place in the English category of the leaderboard during the MEDIQA-M3G challenge by a significant margin over the next best submitted solution, the latter of which received a deltaBLEU score of 3.827 during the competition. The methods will be elaborated in the following sections in detail. 4.1 Claude 3 Opus API solution The higher scoring of the two methods consists of two successive API calls to Claude 3 Opus (Anthropic). For each case in the test set, the first API call generates possible differential diagnosis for the given images, and the second API call further processes the response into the name of the most likely disease only, which is then returned. This exact configuration was decided based on trial and error. Table 1 outlines the solutions tested. Notably, we observe that the disease diagnosis given by Claude 3 Opus was poorer quality when the prompt constrains the output format upon manual review. This was further confirmed by the inferior performance of the 1-call result. Therefore, we let the API generate differential responses only with the provided images alone without any constraints on format, and use a second API call to reformat the response into the desired form, which is just the name of the skin condition without any abbreviations. Furthermore, we observe that including the accompanying query text for each case either in the 1st or 2nd pass was not able to outperform simply using the image alone to make the predictions. This finding may be attributed to the inconsistent information present in the query text, which may often 2 \fFigure 1: Overview of the two winning solutions. A) Test cases are directly submitted to the Claude 3 Opus API. The first of the two consecutive API calls generates differential diagnosis using only the images in the test cases and the second API call optionally includes the associated queries, specifies formatting, and generates final answer. B) The medical discussions included as a part of the training data is used to extract the most likely disease label for each case using GPT4-Turbo from OpenAI. The resulting image-disease label pair are used in conjunction with publicly available data to train a joint embedding in the style of CLIP. The disease labels are embedded using EmbeddingV3 from OpenAI and used to train the image encoder (ResNet50) and both the image and text projection layers. Finally, once the model is trained, the test images are classified inside the learned joint embedding which becomes the final output before performing post processing. harm the prediction from Claude 3 in some cases. It may also be a potential limitation of Claude\u2019s ability to reason with text and image simultaneously. Indeed the resulting predictions had substantial room for improvement even under the most favorable setting tested. All prompts used to produce the solutions in Table 1, including the winning solution are outlined in Appendix. 4.2 CLIP image classification solution 4.2.1 Image classification via nearest neighbour retrieval Once the image encoder and the respective image and text projection layers are trained, the resulting joint embedding can be used to perform image classification via nearest neighbour retrieval. Specifically, we embed each image associated with a given case in the competition test set and find 5 nearest neighbours for each embeded image. We test 4 different conditions, namely retrieval between the image embedding of the query (testing dataset) and either its nearest 5 text or image embeddings from the reference (training dataset), and whether the nearest neighbours are computed in PCA space or as normal. We then pool the labels associated with the retrieved examples and return the most frequent as the final predicted label for the case. The resulting scores are presented in Table 3. Of note, during the competition, random augmentations were mistakenly not turned off during inference when obtaining the image embeddings. This did not lead to better performance and was corrected after the competition concluded. 3 \fTable 1: Performance of various Claude 3 Opus based solutions. 1 Call involves simply generating a response based on images, whereas 2 Calls involve first generating a differential diagnosis, then using a second API call to come up with a final diagnosis. For Img+text, both modalities are used in the first API call to generate the differential, whereas for Img then text the first API call uses only images, then the second API call uses text Scen. dBLEU BP Ratio Hyp_len Ref_len Img (1 Call) 7.650 0.984 0.984 498 506 Img (2 Calls) 10.415 0.994 0.994 485 488 Img then text (2 Calls) 8.775 0.983 0.983 527 536 Img + text (2 Calls) 8.803 1.000 1.004 523 521 4.2.2 Importance of batch size The CLIP loss heavily relies on a diverse source of positive and negative pairs to converge to a good solution. It\u2019s often the case that bigger batch sizes give more robust joint representations. However, under low data settings such as for this competition where the available labelled data is scarce, larger batch sizes may lead to overfitting which is destructive for generalization. We test 3 different batch sizes ranging from 128 to 512 and observe that a batch size of 256 is most suitable for the task and the amount of training data available. The results are presented in Table 2. Table 2: Performance of the CLIP based solution across different batch sizes Model dBLEU BP Ratio Hyp_len Ref_len CLIP (batch 128) 7.848 0.980 0.980 483 493 CLIP (batch 256) 8.404 0.966 0.966 461 477 CLIP (batch 512) 8.187 0.983 0.984 447 485 Table 3: Performance of CLIP with different retrieval related strategies, including retrieval in the PCA space, and retrieving based on either the image or the text embedding of the reference. Of note, the random image augmentations during inference were enabled unintentionally during the competition but disabled for all subsequent experiments. Random. Aug PCA Space Query-Reference dBLEU Yes Yes Image-Image 8.744 No No Image-Text 9.262 No Yes Image-Text 6.279 No No Image-Image 10.119 No Yes Image-Image 8.404 4.3 Post processing Post processing is performed on both the Claude 3 Opus API solution and the CLIP based image classification solution in the same way. This includes putting the output disease name in predetermined sentence format to mimic the style of the given responses from medical professionals, specifically in the form of \"It is [Disease name].\". While a naive approach to the VQA task, we find this simple formatting allows our disease labels produced from images alone to score quite competitively under the deltaBLEU evaluation metric provided by the competition organizers compared to simply returning the disease name itself. Furthermore, unlike other competitors\u2019 solutions based on finetuning existing VQA models (such as LLaVA-med) simultaneously using both the images and the associated query text, our solution does not take advantage of any potentially useful information included in the query text. As a naive way of overcoming this limitation, we simply compiled a dictionary of disease names present in the training data and do simple word matching with the query text and replaced any matches to the query text as the disease condition. While this often times does not produce the correct diagnosis, considering the difficulty of the task this approach does confer some improvement in overall deltaBLEU score. The ablations of the post processing is outlined in Table 4. Solution Word Matching Sentence Structure Both Claude Solution 3.580 5.741 10.415 CLIP Solution (competition) 2.452 2.041 8.744 CLIP Solution (batch 256) 3.334 5.092 10.119 Table 4: Result of ablations on performance of top performing solutions. Sentence structure involves placing the predicted disease labels in predetermined sentence format, whereas word matching is a heuristic employed to utilize provided text via naively matching disease names with the given queries. 5 Discussion We have presented two solutions to the MEDIQA2024-M3G competition, one in4 \fHyperParameter Value Image encoder Resnet50 Projection dim 256 Batch size 256 Text embedding dim 3072 Image embedding dim 2048 Num. projection layers 1 Augmentations RandFlip, RandRotate, RandSpatialCrop, RandAdjustContrast Weight decay 0.001 Learning rate 0.001 Table 5: Hyperparameters corresponding to the highest performing CLIP solution volving API calls to an existing state of the art multimodal language model and the other involving the learning of an image-disease label joint embedding space for disease classification. The superior performance of using two separate API calls to Claude 3 Opus over one pass was interesting to observe. The increase in performance is likely attributed to the reduced ability for the model to simultaneously reason with the images while adhering to the added difficulty of only returning the disease label without any additional textual generation. This finding is somewhat consistent with how chain of thought reasoning can improve model performance by asking the model to first consolidate evidence present in the given image followed by making several differential diagnoses. Further research such as (Zhang et al., 2023) also highlight the importance of using two-stage frameworks for multi-modal chain of thought that separate rationale generation and answer inference over one stage systems. For the CLIP based solution, our additional experiments after the competition highlights the importance of proper selection of batch size and retrieval method. Effective convergence of the CLIP loss hinges on a rich set of positive and negative training pairs. While larger batch sizes generally yield more robust joint representations, limited data settings, as encountered in the case for this competition, can suffer from overfitting with larger batches. This overfitting hinders the model\u2019s ability to generalize. Furthermore, we explored neighbour retrieval settings for image classification during testing. We observe that while CLIP effectively constructs a joint embedding space between images and their disease labels, the image embeddings and text embeddings remain as separate cluster in PCA space. As a result, we see that the nearest 5 neighbours in the text cluster for each embeded image (image-text) in the test set were much poorer in quality than those retrieved from the image cluster (image-image). 6 Limitations While both the Claude 3 Opus API based solution and the CLIP based image classification solution achieved first and second place during the MEDIQA-M3G competition respectively, they have substantial room for improvement despite their leaderboard success. First of all, the overall deltaBLEU score of both solutions are poor, hovering just above 10. The scores during the competition were also unable to be reproduced given the provided evaluation code, which produced systematically lower scores compared to those received during the competition despite the same solution being used during evaluation in both cases. Nevertheless, the low absolute scores of the solutions really highlight the difficulty of the medical VQA task presented and the difficulty of such tasks in general. Upon examining the solutions, we observe that the models were seldom able to generate the exact name of the skin condition in question, although do a good job at identifying a disease similar in presentation or effect location (for example tinea scalp vs seborrheic dermatitis). Certainly both solutions require substantial improvements before they contribute meaningful benefits to the healthcare system in practice. Next, both solutions while reproducible are not stable. The Claude API may be subject to randomness during generation due to the temperature parameter or the update of internal private model weights while the CLIP solutions observed inconsistencies during retrieval where the retrieved images seldom agreed with each other, leading to low confidence in the final output. Retraining the CLIP model with the same experimental setup but initializing differently may yield completely different final disease label classification due to this inconsistency. Lastly, the two solutions were formulated with the competition evaluation metric in mind as they are both framed as a disease label prediction task rather than a more traditional VQA task which 5 \fcould cover topics such as differential diagnoses, treatments and other recommendations as present in the actual medical discussions which were treated as ground truths for this competition. This is further reason to treat the performance of the presented solutions with a grain of salt. Specifically, upon our initial exploration, the deltaBLEU metric defined by the competition organizers favors short responses given the relatively heavy penalty incurred on incorrect k-mers present and relatively low penalty on a incomplete answer in comparison. This discourages model exploration during text generation and potentially penalizes model predictions that are correct semantically but are either too long or not containing the exact words present in the ground truths. This is highlighted in the ablation results in Table 4. Furthermore, the naive word matching often gave incorrect diagnosis as the patient writing the query does not have medical background, however the solution containing the disease label still scored well under the current metric as medical professionals respond with \"not [disease label]\" which has the opposite semantic meaning but similar k-mer composition. We recommend the organizers to slightly modify the existing metric to be more lenient with assessing the produced solutions and perhaps add a semantics component in addition to a k-mer based evaluation metric such as GPTscore (Fu et al., 2023), that can provide more robustness in assessing the quality of generated responses. Nevertheless, the competition still serve as an important step towards the goal of automatically generating clinical responses given textual queries and associated images, and we sincerely thank the organizers for the work putting together this dataset and for hosting the competition. 7"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14568v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14568v1",
|
| 3 |
+
"title": "UVMap-ID: A Controllable and Personalized UV Map Generative Model",
|
| 4 |
+
"abstract": "Recently, diffusion models have made significant strides in synthesizing\nrealistic 2D human images based on provided text prompts. Building upon this,\nresearchers have extended 2D text-to-image diffusion models into the 3D domain\nfor generating human textures (UV Maps). However, some important problems about\nUV Map Generative models are still not solved, i.e., how to generate\npersonalized texture maps for any given face image, and how to define and\nevaluate the quality of these generated texture maps. To solve the above\nproblems, we introduce a novel method, UVMap-ID, which is a controllable and\npersonalized UV Map generative model. Unlike traditional large-scale training\nmethods in 2D, we propose to fine-tune a pre-trained text-to-image diffusion\nmodel which is integrated with a face fusion module for achieving ID-driven\ncustomized generation. To support the finetuning strategy, we introduce a\nsmall-scale attribute-balanced training dataset, including high-quality\ntextures with labeled text and Face ID. Additionally, we introduce some metrics\nto evaluate the multiple aspects of the textures. Finally, both quantitative\nand qualitative analyses demonstrate the effectiveness of our method in\ncontrollable and personalized UV Map generation. Code is publicly available via\nhttps://github.com/twowwj/UVMap-ID.",
|
| 5 |
+
"authors": "Weijie Wang, Jichao Zhang, Chang Liu, Xia Li, Xingqian Xu, Humphrey Shi, Nicu Sebe, Bruno Lepri",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Diffusion AND Model",
|
| 14 |
+
"gt": "Recently, diffusion models have made significant strides in synthesizing\nrealistic 2D human images based on provided text prompts. Building upon this,\nresearchers have extended 2D text-to-image diffusion models into the 3D domain\nfor generating human textures (UV Maps). However, some important problems about\nUV Map Generative models are still not solved, i.e., how to generate\npersonalized texture maps for any given face image, and how to define and\nevaluate the quality of these generated texture maps. To solve the above\nproblems, we introduce a novel method, UVMap-ID, which is a controllable and\npersonalized UV Map generative model. Unlike traditional large-scale training\nmethods in 2D, we propose to fine-tune a pre-trained text-to-image diffusion\nmodel which is integrated with a face fusion module for achieving ID-driven\ncustomized generation. To support the finetuning strategy, we introduce a\nsmall-scale attribute-balanced training dataset, including high-quality\ntextures with labeled text and Face ID. Additionally, we introduce some metrics\nto evaluate the multiple aspects of the textures. Finally, both quantitative\nand qualitative analyses demonstrate the effectiveness of our method in\ncontrollable and personalized UV Map generation. Code is publicly available via\nhttps://github.com/twowwj/UVMap-ID.",
|
| 15 |
+
"main_content": "INTRODUCTION The development of 3D human models has garnered significant attention in recent years, owing to its versatile applications across various domains, including filmmaking, video games, augmented reality/virtual reality (AR/VR), and human-robot interaction. Among the myriad tasks essential for crafting digital humans, texture synthesis stands out as a pivotal element in achieving the photorealistic quality of 3D avatars. However, creating 3D textures in the traditional computer graphics pipeline is time-consuming and laborintensive. Thus, it is important to utilize generation techniques to design diverse texture maps automatically. Texture (UV map) generation has been a focus in previous approaches for tasks such as 3D face and human reconstruction. These methods leverage generators from Generative Adversarial Networks (GANs) to estimate textures either in an unsupervised [9, 45, 52, 59] or supervised [24, 25] manner. Subsequently, the texture estimation model is integrated into the avatar fitting stage. Nonetheless, these methods are limited in generating novel textures and need more support for controllable generation. Large-scale text-to-image diffusion models [36, 38], nowadays, have been proven very effective over cross-model generation tasks, which should mainly attributed to the scalable 2D image-text data pairs along with large-scale parallel computation. Yet we notice that the lack of large-scale 3D texture data makes training high-quality texture generative models quite challenging. Inspired by the pretrained strategy of DreamBooth, SMPLitex [5] has employed a few texture maps (UV defined by SMPL [29]) to fine-tune a pretrained arXiv:2404.14568v1 [cs.CV] 22 Apr 2024 \fWeijie and Jichao and Chang, et al. text-to-image diffusion model. It has been observed that this approach enables the synthesis of texture maps while supporting its foundation text-driven task. However, the inability of SMPLitex to support personalized texture generation poses a significant limitation on their approach, particularly in applications where user customization is crucial. Personalized texture generation enables the tailoring of textures to specific individual preferences, fostering a comprehensive experience in 3D applications, including avatars, VR, and gaming. Besides personalization, evaluating the quality of generated textures within the UV space remains an unresolved challenge, leaving more space for research. In this paper, we introduce the UVMap-ID method, a UV map generation model that supports ID-driven personalized generation tasks. Specifically, we fine-tune a pretrained text-to-image diffusion model using a small-scale training dataset. In contrast to 2D personalized methods [7, 46, 49, 56] that necessitate large-scale training data in 2D methods, our dataset, which is attribute-balanced (i.e., \"Race and Gender\"), comprises around 750 image-ID pairs: the textures map with annotated text prompts, the corresponding portrait faces. To enable the ability of ID-driven personalized generation, we extend the stable diffusion with an additional face fusion module. Moreover, we introduce some corresponding metrics to evaluate the quality of generated textures from multiple aspects, i.e., fidelity, structure preservation, ID preservation, and text-image alignment. Remarkably, our model achieves high-quality and diverse texture synthesis within just several hours of training, while also supporting controllable and personalized synthesis with the user-provided image ID. In summary, our contributions are as follows: \u2022 We are the first to propose a controllable and personalized UV map generative model capable of synthesizing diverse and personalized texture maps. \u2022 We propose an efficient fine-tuning strategy for training an IDdriven extension architecture for StableDiffusion, utilizing only a small-scale training dataset. \u2022 We utilize our method to produce a new dataset, containing around 5k UVMap-ID image pairs, and will make it publicly available. Our small-scale attribute-balanced training dataset, the larger-scale dataset, and metrics for textures play a bridging role in guiding subsequent work in this field. 2 RELATED WORK UV-Map Generative Model. This model aims to generate diverse textures based on the generative models, such as Generative Adversarial Networks [10], Diffusion Models [13, 43]. Existing works utilize this technique in the 3D face reconstruction with the 3D morphable model (3DMM) [3] or human reconstruction with the SMPL [29]. For face texture generation, GANFIT [9] first uses 10,000 high-resolution textures to train the GAN generator, then takes this GAN generator as the statistical parametric representation of the facial texture in the fitting progress. To avoid the training using the limited numbers and diversity of texture map, StyleUV [25] integrates the 2D image fitting and rendering stages into the adversarial networks. Additionally, some methods focus on contributing the 3D facial UV-texture datasets, such as Facescape [55], and FFHQ-UV [1]. For human texture generation, most of the works learn to recover the full texture from a single human image. The Re-Identification metric as supervised in this task is proposed [45]. To further improve the quality of texture generation, Zhao. et al [59] introduce a consistency learning to enforce the cross-view consistency of texture prediction during training. Texformer [52] introduces the transformer architecture to exploit global information of the input, effectively facilitating higher-quality texture generation. Different from these methods without using any ground-truth 3D textures, Verica. et al [24] non-rigidly registers the SMPL model to thousands of 3D scans, and encoders the appearances as texture maps. And theses 3D textures are used to train a texture completed model. However, these mentioned methods cannot support diverse and text-guided texture generation. The most related work to ours is SMPLitex [5]. Motivated by the Dreambooth [37], SMPLitex utilizes a few texture maps to fine-tune the pretrained text-guided diffusion model to enable the textures inpainting and text-guided texture generation task. Compared to SMPLitex, our method supports both text-guided and ID-driven personalized texture generation. Text-to-3D Avatar Generation. Text-guided 3D content generation has achieved great success with the development of 3D representation methods and generative models. Lots of methods utilize the frozen image-text joint embedding models from CLIP [33] to optimize the underlined 3D representation, such as NeRF [30] where some of them work on generation for general 3D object [18, 31, 40, 50, 54], or human Avatar [14, 16]. The most famous work is Dream Fields [18] which first demonstrated the effectiveness of combining the CLIP model and NeRF representation for 3D object creation, but 3D objects produced by this approach tend to lack realism and accuracy. DreamFusion [32] introduces Score Distillation Sampling (SDS) loss which is based on probability density distillation that enables the use of a pretrained 2D diffusion model as a prior for optimization of a parametric NeRF representation. By using SDS loss instead of CLIP, DreamFusion generates high-quality coherent 3D objects while aligning with the given text prompt. Recently, many similar methods with SDS loss have occurred to improve text-to-3D results in various aspects, such as enhancing the realism of rendering with detailed geometry [6], solving the multiple-view inconsistency problem [27, 42] or using variational score distillation (VSD) [47] method instead of SDS to improve the fidelity and diversity of 3D content generation. However, highquality human avatars remain a challenge due to the complexity of the human body\u2019s shape, pose, and appearance. To make the avatar animatitable, DreamAvatar [4] and AvatarCraft [19] integrate the SMPL prior into the NeRF or SDF representation with a deformable field. To improve the avatar\u2019s quality and avoid the cartoon-like appearance, DreamHuman [23] uses a spherical harmonics lighting model instead of diffuse reflectance model and additionally optimizes a spherical harmonics coefficients; HumanNorm [17] introduces a normal diffusion model to enhances the diffusion model\u2019s understanding of 3D geometry to further improve the texture and geometry\u2019s quality. More recently, HumanGaussian [28] integrates 3D Gaussian representation instead of NeRF into 3D Human Avatar generation to reduce training time. Compared with these text-to-3D works, we focus on achieving a controllable texture generation but don\u2019t care about the generation of geometry. \fUVMap-ID: A Controllable and Personalized UV Map Generative Model Text-Driven Personalized Diffusion Models. Diffusion model [13, 43], is a class of generative modeling in which it iteratively transforms noises to samples simulating the true data distribution. Diffusion models generally outperformed other traditional methods, such as GANs, due to the fact that the output quality has been notably improved across diverse domains. Diffusion models are widely used for text-to-image generation [34, 36, 38], and also stand out supporting more cross-model tasks [2, 35, 53]. One of the foundation works, Stable diffusion [36], applies the diffusion process on latent space, reducing training computation while preserving quality. While other methods, such as Imagen [38] and DALL-E2 [34], generate samples directed over pixel space, have also proven effective. Finetune-wise, DreamBooth [37] and LoRA [15] introduces a subject-driven training approach, enabling text controls, and offers a compelling feature for precise personalizing. Text Inversion [8] and VideoBooth [20] suggest an alternative solution via latent inversion before editing. Another class of methods [7, 46, 48, 49, 51, 56\u201358, 60] extends the model with additional networks to extract and adopt conditional inputs that guide the generation. Representatively, IP-Adapter [56] introduces a decoupled U-Net that injects conditional hidden features to the original diffusion U-Net, achieving an accurate control from the reference input. Some concurrent 2D methods such as Instant-ID [46], Infinite-ID [49] and SSR-Encoder [58], also attracted lots of attention. In this work, we share goals similar to IP-Adapter and Instant-ID, focusing on 3D human texture rather than 2D generation. 3 METHODS Given a reference portrait describing the facial appearance (Face ID) of the target individual, our model aims to generate a texture that aligns with the facial appearance of the target person and fits the structure of the UV map defined by SMPL. In this section, we first provide a brief introduction to Denoising Diffusion Probabilistic Models [13] in Section 3.1, laying the foundational framework and network architecture for our method. Subsequently, detailed explanations of design specifics are presented in Section 3.2. Then, we will explain the pipeline we use to build the dataset in Section 3.3. Finally, we introduce some metrics for UV textures in Section 3.4. 3.1 Preliminary: Denoising Diffusion Probabilistic Models The denoising diffusion probabilistic models operate by simulating a forward process that adds noise to an image or its latent representation over a series of time steps, transforming them into Gaussian noise. Conversely, the reverse process seeks to recover the original image or latent representation by iterative denoising. This bidirectional process is key to the diffusion models\u2019 ability to generate high-fidelity images. Our work leverages Stable Diffusion (SD), a pertrained generative model that could generate high-quality images from a text prompt. Specifically, given an image \ud835\udc65, SD first uses a pretrained autoencoder to encode \ud835\udc65into latent: \ud835\udc67= E(\ud835\udc65). Then, noise is gradually added to \ud835\udc67over a sequence of \ud835\udc47steps, transitioning the data distribution from the original data distribution to a Gaussian Noise distribution, and the noise added forward a Markov chain of conditional Gaussian distributions defines the process: \ud835\udc5e(\ud835\udc67\ud835\udc61|\ud835\udc67\ud835\udc61\u22121) = N (\ud835\udc67\ud835\udc61; \u221a\ufe01 1 \u2212\ud835\udefd\ud835\udc67\ud835\udc61\u22121, \ud835\udefd\ud835\udc61\ud835\udc3c), where \ud835\udefd\ud835\udc61is the variance schedule. During training, the denoising u-net \ud835\udf16\ud835\udf03of SD aims to learn to reconstruct the original latent \ud835\udc67 from the noise, modeled by: \ud835\udc5d\ud835\udf03(\ud835\udc67\ud835\udc61\u22121|\ud835\udc67\ud835\udc61) = N (\ud835\udc67\ud835\udc61\u22121; \ud835\udf07\ud835\udf03(\ud835\udc67\ud835\udc61,\ud835\udc61), \ud835\udf0e2 \ud835\udf03(\ud835\udc67\ud835\udc61,\ud835\udc61)I), and the learning objective is defined as follows: \ud835\udc3f(\ud835\udf03) = E\ud835\udc67\ud835\udc61,\ud835\udc50,\ud835\udf16,\ud835\udc61 \u0002 ||\ud835\udf16\u2212\ud835\udf16\ud835\udf03(\ud835\udc67\ud835\udc61,\ud835\udc50,\ud835\udc61)||2\u0003 , where \ud835\udc50represents text conditional embeddings. 3.2 Fine-Tuning Text-to-Image Models for ID-Driven UV Map Generation Fig. 2 provides the pipeline of our proposed approach. The initial input to the pipeline consists of random noise and a reference portrait. Our text-to-image model is configured based on the design of SD, employing the same framework and trained weights of SD. Motivated by DreamBooth [37], we propose to utilize the finetuning strategy with a prior preservation loss (Fig. 2 (Left)) applying to text-to-image diffusion architecture integrating with a face fusion module (Fig. 2 (Right)). 3.2.1 Face Fusion Module. To enable Stable Diffusion to accept additional image information, (i.e., the portraits), the previous methods mainly leverages the CLIP image encoder, either directly substituting the CLIP text encoder or through decoupled cross-attention mechanism to separate cross-attention layers for text features and image features [34, 56]. Nevertheless, the CLIP image encoder is constrained by its operation on images of lower resolution, which particularly impacts its efficacy in encoding face images by failing to encapsulate comprehensive details. Moreover, CLIP\u2019s architecture, fundamentally designed to align semantic features between text and images, mainly focuses on high-level feature correspondence. This orientation towards semantic feature matching inadvertently results in a dilution of finer, detailed features during the encoding process, posing a challenge for applications requiring precise detail retention. Hence, we propose to use the face embedding extracted by the face recognition models and linear projection layers to provide SD with human face information. Also, to preserve the original model\u2019s ability to process text information while integrating image information, we adopt the decoupled cross-attention mechanism [56], ensuring a seamless blend of both modalities. Given query feature \ud835\udc4d, image feature \ud835\udc50\ud835\udc56and the text feature \ud835\udc50\ud835\udc61, the output \ud835\udc4d\u2032 of decoupled cross-attention layers is: Z\u2032 = softmax(\ud835\udc44\ud835\udc3e\ud835\udc47 \u221a\ufe01 \ud835\udc51\ud835\udc58 )\ud835\udc49+ softmax(\ud835\udc44(\ud835\udc3e\u2032)\ud835\udc47 \u221a\ufe01 \ud835\udc51\ud835\udc58 )\ud835\udc49\u2032, where \ud835\udc44= \ud835\udc4d\ud835\udc4a\ud835\udc5e, \ud835\udc3e= \ud835\udc50\ud835\udc61\ud835\udc4a\ud835\udc58, \ud835\udc49= \ud835\udc50\ud835\udc61\ud835\udc4a\ud835\udc63, \ud835\udc3e\u2032 = \ud835\udc50\ud835\udc61\ud835\udc4a\u2032 \ud835\udc58, \ud835\udc49\u2032 = \ud835\udc50\ud835\udc61\ud835\udc4a\u2032 \ud835\udc63, and the \ud835\udc4a\ud835\udc5e, \ud835\udc4a\ud835\udc58, \ud835\udc4a\ud835\udc63, \ud835\udc4a\u2032 \ud835\udc58and \ud835\udc4a\u2032 \ud835\udc63are learnable parameters of the projection layers. Similar fusion modules have been utilized in some concurrent 2D methods [46, 49]. 3.2.2 Prior Preservation Loss. We observed that when using \u201cUV texture map\" as the text prompt, SD often fails to generate any correct UV maps. This is likely because SD is trained on data scraped from the internet, where real UV texture maps are rarely found in the training resources. Also, our goal is to generate images with a \fWeijie and Jichao and Chang, et al. Text Embedding Face Embedding Prior Preservation Loss \"A [S] Texturemap of [P]\" \"A Texturemap\" \"A Texturemap\" Reconstruction Loss Face ID Face ID \"A [S] Texturemap of [P]\" Noise Noise Text-to-Image Noise Decoder U-Net Cross Attention Face Projection UV Map Generation Face Recognition Text Encoder Noise Text-to-Image Text-to-Image Face\u00a0Fusion\u00a0Module Figure 2: The left side of the figure shows the overview of our proposed pipeline. Given a reference image as face ID, we utilize a pre-trained text-to-image diffusion model, where the input is a combination of a noised UV Map and text prompt of a unique identifier and characteristics of the portrait where \"A [S] Texturemap of [P],\" where [S] is a unique identifier and [P] represents the race and gender. To maintain the quality of images generated by the pre-trained model and effectively process textual features, we adopt a prior preservation loss. The right side of the figure shows the detailed architecture of our model, where facial information is mapped to the same dimensions as text embeddings through a facial recognition model and face projection layers. Subsequently, we merge facial and textual information via decoupled cross-attention, which is then integrated into the pre-trained text-to-image model. small training set (about 750 images in our dataset), each featuring different facial characteristics of individuals, and generating accurate faces has always been a weakness of SD. Additionally, our input incorporates extra face image information, and during fine-tuning, we would like to ensure our model does not lose SD\u2019s original capability to correctly process textual information. To this end, we introduced prior preservation loss, as proposed in Dreambooth [37], to ensure the model retains its generalization ability and does not overfit the few-shot examples provided during the personalization process. However, our objectives differ fundamentally from Dreambooth in two ways. Firstly, Dreambooth targets subject-driven generation, whereas our model aims at generating specific formats of images, the UV texture maps. This leads to a situation where Dreambooth requires re-fine-tuning the entire SD for each subject, while our model, after training, can generate corresponding UV maps for any input face ID. This distinction arises because, in DreamBooth, one unique identifier represents a single unique subject, whereas our unique identifier [S] denotes one unique kind of image structure (UV Map defined by SMPL). Secondly, we added extra facial information [P] to our text prompts during training to further preserve the original capabilities of the text encoder, enabling it to effectively parse attributes such as race and gender. For detailed experiments, please refer to Section 4.4 Formally, the training loss of our model is defined as: \ud835\udc3f(\ud835\udf03) = E\ud835\udc67\ud835\udc61,\ud835\udc50,\ud835\udf16,\ud835\udc61 \u0002 ||\ud835\udf16\u2212\ud835\udf16\ud835\udf03(\ud835\udc67\ud835\udc61,\ud835\udc50,\ud835\udc61)||2\u0003 + E\ud835\udc67\ud835\udc61,\ud835\udc50\u2032,\ud835\udf16,\ud835\udc61 \u0002 ||\ud835\udf16pr \u2212\ud835\udf16\ud835\udf03(\ud835\udc67\ud835\udc61,\ud835\udc50\u2032,\ud835\udc61)||2\u0003 , where \ud835\udc50\u2032 is a fixed conditional text prompt \u201ca texturemap\u201d and \ud835\udf16pr is the generate data using the frozen diffusion model with \ud835\udc50\u2032. 3.3 Dataset Training Dataset In this part, we describe the process of constructing our dataset, which is centered around the generation of high-quality and diverse UV texture maps for digital human models. Our approach can be segmented into three stages: 1) Celebrity Selection: In the initial phase of our dataset creation, we aimed for a balanced and inclusive representation by employing OpenAI\u2019s ChatGPT to generate a list of 150 celebrities. Our selection was structured to include equal representation across three ethnic groups: African American, Asian, and White, with 50 celebrities from each group. To further enhance the diversity and applicability of our dataset, we ensured gender balance within each ethnic category, selecting 25 male and 25 female celebrities. We use celebrities because SMPLitex accepts only text input, and celebrity portraits are readily available. This approach allows us to link names, portraits, and corresponding UV texture maps effectively. 2) UV Texture Map Generation: We employed SMPLitex to generate UV texture maps for each of the selected celebrities. This process resulted in 50 UV texture maps per celebrity, totaling 7,500 initial texture maps. 3) Manual Selection: To ensure the highest quality and relevance for our dataset, we manually reviewed the generated UV texture maps and selected 5 maps per celebrity that best met our predefined criteria. These criteria included clarity, detail accuracy, and representation quality of ethnic features. This manual selection process narrowed our dataset to 750 UV texture maps with 5 UV texture maps per ID. A New Dataset: CelebA-HQ-UV We utilize our method with personalized generation to produce a new dataset, which contains 5k UVMap-ID pairs. Specifically, we select 5000 high-resolution face images from CelebA-HQ [21] as reference image IDs of our methods. \fUVMap-ID: A Controllable and Personalized UV Map Generative Model Face ID \"military soldier costume\" \"wearing white top, blue pants, sunglasses\" \"Superhero custume\" Figure 3: Personalized textures generation results using face IDs from CelebA-HQ dataset. For every ID, our method produces 10 textures and selects 2 by the evaluation of multiple aspects, i.e., the quality of textures, the preservation of UV structure, and the preservation of face ID. Fig. 3 shows some results using three face IDs from CelebA-HQ. We refer to this dataset as CelebA-HQ-UV, and will make it publicly available. Note that we define a list of text prompts for these generations which will be introduced in the supplementary material. 3.4 Metrics As previously mentioned, assessing the quality of generated textures within the UV space defined by SMPL poses a significant challenge, especially within the scope of our personalized generation task. In this paper, we introduced four metrics to evaluate the quality of the generated textures from multiple aspects: Inception Scores [39] to evaluate the fidelity and diversity, Semantic Structure Preservation (SSP) to evaluate structure preservation of UV space defined by SMPL [29], Deep Face Recognition (DFR) to evaluate Face ID preservation and CLIP-Text (CLIPT) [20, 48] score to evaluate the text-image alignment. Inception Score (IS) on UV textures and rendered results The Inception Score (IS) and Fr\u00e9chet Inception distance [12] are widely utilized metrics for evaluating the diversity and quality of 2D images generated by generative models. FID is a well-established measure that compares the inception similarity score between distributions of generated and real images. One key distinction between IS and FID is that IS is computed solely using fake samples, eliminating the need for real samples in its calculation. Due to the lack of real sample distribution, we employ the IS to directly evaluate the quality of 5000 generated textures rather than FID. We refer to IS on textures of UV space as IS (UV). Additionally, we render these textures into 2D space by applying them to the SMPL Mesh. Subsequently, we utilize IS to evaluate the quality of 5000 rendered human images in 2D space. We refer to this type of IS as IS (R). Semantic Structure Preservation (SSP) To assess the preservation of UV structures in generated textures, we introduce a novel UV Structure Texture s Output Groundtruth Figure 4: It shows UV structures, textures from SMPLitex, extracted semantic segmentation, and semantic groundtruth from left to right. metric termed Semantic Structure Preservation (SSP). Notably, we have observed instances where the generated textures from SMPLitex [5] may not faithfully retain these underlying structures, as illustrated in Fig. 4. The SSP metric is designed to quantify this preservation. We leverage off-the-shelf human parsing techniques [26] to extract semantic segmentation from the generated images and then compare it with ground truth segmentation (Fig. 4 (right)). We conduct this comparison across a dataset comprising 1000 images and compute the mean difference as the SSP score. Deep Face Recognition (DFR) To assess the preservation of identity (ID) within textures, a crucial aspect of personalized image generation tasks, we propose employing Deep Face Recognition (DFR) methods to quantify the similarity between generated textures and reference facial images. Specifically, we leverage the off-the-shelf tool [41] to do face recognition between the textures and image ID. We use 10 face IDs, and 100 samples for every ID and report the successful numbers. We refer to this metric as the DFR score which is reported as a measure of the preservation of identity within the generated textures. CLIP-Text (CLIPT) To measure the alignment of the generated textures and given text prompts, we use the CLIP-Text (CLIPT) score followed by 2D methods [20, 48]. This metric is calculated using the cosine similarity of the CLIP text embeddings of the given text prompts and CLIP image embeddings of the generated textures. We compute the CLIPT score using 1000 text-prompt pairs. 4 EXPERIMENTS 4.1 Training Details Our experiments are based on the Realistic_Vision_V4 model, which is further fine-tuned on Stable Diffusion v_1.5 [36], and could produce more photorealistic images. Additionally, we utilize the buffalo_l pre-trained face recognition model from SCRFD [11], and pre-trained projection layers from [56]. The experimental code is developed using the HuggingFace Diffusers library [44]. During training, we fine-tune the entire U-Net, text encoder and face projection layers, and keep the VAE encoder and decoder of Stable Diffusion frozen. The UVMap-ID training is conducted on a single machine equipped with an A40 GPU for 1500 steps, with a batch size of 2. We employ the AdamW optimizer [22] with a fixed learning rate of 1e-6 and a weight decay of 0.01. Our dataset comprises images with a resolution of 512 \u00d7 512, hence we generate images at this resolution during training. In the inference phase, we use a 50-step DDIM sampler [43] and set the classifier-free guidance scale to 7.5. \fWeijie and Jichao and Chang, et al. Asian woman Asian man Asian man White woman Asian woman Asian woman Asian woman Asian man White man Face ID \"wearing yellow clothes\" \"wearing sunglasses\" \"wearing white shirt and jeans\" \"military soldier costume\" \"santa claus costume\" Figure 5: Our personalized generation results. The 1st column shows reference faces, obtained from the website, and not existing in our training set. \fUVMap-ID: A Controllable and Personalized UV Map Generative Model \"wearing white shirt, jeans, yellow hat\" \"wearing white top, green pants, glasses\" SMPLitex Ours Input \"Betty Sun\" SMPLitex Ours \"Crystal Liu\" SMPLitex Ours \"YuanYuan Gao\" \"Jay Chou\" \"Donnie Yen Chi-Tan\" \"Aaron Kwok Fu-shing\" \"wearing white shirt, jeans\" Input \"wearing military solider costume\u00a0\" Figure 6: Comparsion with SMPLitex [5] results. SMPLitex is not an image ID-driven method. Thus, we provided these celebrities\u2019 names in the test prompts for SMPLitex, but not for ours. Taking \"Betty Sun\" as an example (upper-left corner), the test prompt of SMPLitex is \"a texturemap of Betty Sun wearing...\", and our test prompt is \"a texturemap of Asian woman wearing...\". Note that image IDs are not existing in our training data. 4.2 Baselines We take the texture generation model SMPLitex [5] as the baseline. And all results from SMPLitex are produced from their released code and pretrained model. SMPLitex does not support image-driven personalized generation. Thus, we provide image ID\u2019s name in the text prompts for SMPLitex, but not for our method. Methods IS (R) \u2191 IS (UV) \u2191 SSP \u2193 CLIPT \u2191 DFR \u2191 SMPLitex [5] 1.46 \u00b1 0.020 1.95 \u00b1 0.049 10.45 29.40 62 UVMap-ID 1.78 \u00b1 0.020 1.89 \u00b1 0.027 8.46 29.12 792 Table 1: Quantitative results using four metrics: inception scores on rendered images (IS (R)), inception scores on UV maps (IS (UV)), Semantic Structure Preservation (SSP), CLIP Text (CLIPT), Deep Face Recognition (DFR). \fWeijie and Jichao and Chang, et al. Methods DFR \u2191 UVMap-ID \ud835\udc64/\ud835\udc5c\"Race and Gender\" 436 UVMap-ID \ud835\udc64/ \"Race and Gender\" 792 Table 2: Ablation Study for \"Race and Gender\" label. Methods IS (R) \u2191 IS (UV) \u2191 SSP \u2193 CLIPT \u2191 DFR \u2191 UVMap-ID (1) 1.88 \u00b1 0.028 2.03 \u00b1 0.039 10.59 29.09 734 UVMap-ID (2) 1.78 \u00b1 0.020 1.89 \u00b1 0.027 8.46 29.12 792 UVMap-ID (5) 1.55 \u00b1 0.017 1.55 \u00b1 0.084 8.74 29.27 798 Table 3: Ablation studies of Training data. UVMap-ID (\ud835\udc41) denotes the number (\ud835\udc41) of textures for each ID in the training stage. 4.3 Comparisons Fig. 5 shows diverse personalized texture generation results from our methods. Our reference face IDs (1st column images) are collected from a diverse range of sources on the website, thus encompassing a wide variety of characteristics, including different ethnicities, genders, occupations, levels of fame, and even facial poses. As shown in the 2nd-6th columns of Fig. 5, our generated UV textures effectively preserve the identity features of these reference face IDs, demonstrating the effectiveness and robustness of our methods in personalized generation. Moreover, our method also achieves accurate text-driven controllable generation. We conducted visualization comparisons with SMPLitex [5], as depicted in Fig. 6. Notably, SMPLitex is not an image-driven method. Therefore, while we utilized some well-known celebrities as image IDs and provided their names in text prompts for SMPLitex, we deliberately omitted this information for our method to ensure a fairer comparison. Remarkably, our results exhibit a higher degree of similarity in face ID preservation compared to SMPLitex, underscoring the superiority of our method in maintaining identity features during personalized texture generation. Moreover, our approach also demonstrates superior structural preservation compared to SMPLitex, as evidenced by the \"Jay Chou\" row (Top-Right). Quantitative results using four metrics are shown in Table 1. We observe that SMPLitex achieves better IS (UV) scores than our method. We attribute this to the fact that our approach is imagedriven, which means that the provided reference ID constrains the diversity of generated images, a crucial aspect of IS. In contrast, our method achieves a higher IS (R) than SMPLitex. As mentioned, SMPLitex often struggles to preserve UV structures effectively, resulting in unrealistic renderings. The comparison of structure preservation can be validated by our achieved superior SSP score. Moreover, our DFR score significantly outperforms the Baseline, validating that our method achieves better similarity to the target ID in personalized texture generation tasks. Additionally, the high success rate of 837 out of 1000 demonstrates the robustness of our method to reference images. Furthermore, we observe that our CLIPT score is comparable to the baseline, indicating that the \"image prompt\" generated by our image encoder does not significantly affect the control capability of the text prompt. Face ID w/o \"Race and Gender\" w/ \"Race and Gender\" Figure 7: Qualitative ablation studies of between \ud835\udc64/\ud835\udc5cand \ud835\udc64/ \"Race and Gender\" labels. The 1st-row results show our full method preserves the \"Gender\" attribute and the 2nd-row results show our full method preserves the \"Race\" attribute. 4.4 Ablation Studies \"Race and Gender\" in prompts As shown in Fig. 7, we analyze the impact of including race and gender labels in prompts during training, assessing how this additional information affects generative model performance. As indicated in Table 2, incorporating race and gender labels significantly enhances the model\u2019s DFR score compared to the version without these labels (UVMap-ID\ud835\udc64/\ud835\udc5c\"Race and Gender\"). This indicates that the facial recognition model we use focuses more on the structural information of the human face, while the label supplements the missing information such as skin color. Training Data In this part, we explore the impact of varying the number of UV maps used per image ID during training. Our model, UVMap-ID, is evaluated using a consistent training strategy, except that each image ID in the training dataset is processed using 1, 2, or 5 UV maps. These setups are denoted as UVMap-ID (1), UVMap-ID (2), and UVMap-ID (5) respectively. Table 3 highlights the performance metrics across these configurations. Based on the results shown in Table 3, we have chosen UVMap-ID (2) as our base model. This configuration utilizes two UV maps, which provide a diverse dataset sufficient to capture the critical variations in facial features, without overloading the pre-trained model. UVMap-ID (2) strikes a balance, delivering remarkable realism in image generation while effectively maintaining the identity of reference images. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14618v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14618v1",
|
| 3 |
+
"title": "Hybrid LLM: Cost-Efficient and Quality-Aware Query Routing",
|
| 4 |
+
"abstract": "Large language models (LLMs) excel in most NLP tasks but also require\nexpensive cloud servers for deployment due to their size, while smaller models\nthat can be deployed on lower cost (e.g., edge) devices, tend to lag behind in\nterms of response quality. Therefore in this work we propose a hybrid inference\napproach which combines their respective strengths to save cost and maintain\nquality. Our approach uses a router that assigns queries to the small or large\nmodel based on the predicted query difficulty and the desired quality level.\nThe desired quality level can be tuned dynamically at test time to seamlessly\ntrade quality for cost as per the scenario requirements. In experiments our\napproach allows us to make up to 40% fewer calls to the large model, with no\ndrop in response quality.",
|
| 5 |
+
"authors": "Dujian Ding, Ankur Mallick, Chi Wang, Robert Sim, Subhabrata Mukherjee, Victor Ruhle, Laks V. S. Lakshmanan, Ahmed Hassan Awadallah",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.LG",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.LG",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.CL"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "LLM Fairness",
|
| 16 |
+
"gt": "Large language models (LLMs) excel in most NLP tasks but also require\nexpensive cloud servers for deployment due to their size, while smaller models\nthat can be deployed on lower cost (e.g., edge) devices, tend to lag behind in\nterms of response quality. Therefore in this work we propose a hybrid inference\napproach which combines their respective strengths to save cost and maintain\nquality. Our approach uses a router that assigns queries to the small or large\nmodel based on the predicted query difficulty and the desired quality level.\nThe desired quality level can be tuned dynamically at test time to seamlessly\ntrade quality for cost as per the scenario requirements. In experiments our\napproach allows us to make up to 40% fewer calls to the large model, with no\ndrop in response quality.",
|
| 17 |
+
"main_content": "Introduction Large language models (LLMs) have become the dominant force in natural language processing in recent years [Zhao et al., 2023]. Their impact has been especially striking in generative applications where it has extended beyond standard language understanding and question-answering benchmarks like [Hendrycks et al., 2020, Srivastava et al., 2022] to several successful real-world deployments. These include the wildly popular ChatGPT [OpenAI, b] and several other chatbots [Zheng et al., 2023] powered by different LLMs [Taori et al., 2023, Touvron et al., 2023, OpenAI, 2023], which allow users to engage in natural language conversations and obtain informative responses on a range of practically useful tasks like creative writing, translation, code completion, etc. An important added attraction of these models is their accessibility. Users can input queries and receive responses in natural language, without any specialized data or code, and this is what has created such a widespread demand for their services across regions, professions, and disciplines. The best performing LLMs are based on the transformer architecture of [Vaswani et al., 2017] and generally have tens of billions of parameters. E.g., Alpaca [Taori et al., 2023] has 13 billion parameters, the best version of Llama-2 [Touvron et al., 2023] has 70 billion parameters, and OpenAI\u2019s GPT-3.5 [OpenAI, a], and GPT4 [OpenAI, 2023] are rumored to be much larger. Their \u2217work performed during internship at Microsoft \u2020work performed while at Microsoft 1 arXiv:2404.14618v1 [cs.LG] 22 Apr 2024 \f(a) Accuracy v/s size of LLM (b) Tail of accuracy difference (c) Results with routing Figure 1: We use a dataset of natural language queries from a range of tasks like question answering, summarization, information extraction, etc. (See Section 4 for details). We observe that (a) smaller models generally give poorer response quality or lower BART score [Yuan et al., 2021], (b) Llama-2 (13b) outperforms GPT-3.5-turbo on around 20% examples, and (c) our router can make 22% fewer calls to GPT-3.5-turbo (cost advantage) with 1% drop in response quality (BART score). enormous size and the autoregressive nature of text generation in their transformer architectures means that these models typically have a high compute and memory requirement that can only be met by expensive cloud servers [Yu et al., 2022]. This can potentially impose an enormous cost on developers and users as more LLM-based services are introduced. In response to this there has been a surge of interest in designing smaller, cost-effective LLMs \u2013 e.g., [Touvron et al., 2023] provides multiple versions of Llama-2, with the smallest having only 7 billion parameters, small enough to run on a laptop1, while the smallest offering of Google\u2019s Palm-2 model can even run on mobile devices2. However empirical evaluations in [Chung et al., 2022, Touvron et al., 2023] as well as our own evaluation in Figure 1a show that smaller models generally lag behind in terms of response quality. Faced with this tradeoff between response quality and inference cost, we propose a hybrid inference approach which provides the best of both worlds. Our approach is motivated by the observation that most tasks for which LLMs are useful, like creative writing, translation, code completion, etc., include a range of queries of different difficulty levels and there is always a subset of \u201ceasy\u201d queries for which responses of a small (inexpensive and weak) model may be comparable to, and sometimes even better than those of a large (expensive and powerful) model. This is also illustrated in Figure 1b where we plot the tail of the quality gap (defined in Section 3) between the 13 billion parameter version of Llama-2 and OpenAI\u2019s GPT-3.5-turbo, the model that powers ChatGPT. Quality gap is non-negative for examples where the response quality of Llama-2 is comparable to or better than that of GPT-3.5-turbo which is the case for around 20% queries in our dataset (described in Section 4). We leverage this insight to train a router that takes a large model and a small model as input, and learns to identify these easy queries as a function of the desired level of response quality, while taking into account the generative nature of tasks, inherent randomness in LLM responses, and response quality disparity between the two models. At test time, the router seamlessly adjusts to different response quality requirements and assigns the corresponding \u201ceasy\u201d queries to the small model, leading to significant inference cost reduction with minimal drop in response quality. In 1https://github.com/microsoft/Llama-2-Onnx 2https://blog.google/technology/ai/google-palm-2-ai-large-language-model/ 2 \fFigure 2: Routing between edge and cloud. Figure 1c our router assigns 22% of queries to Llama-2 (13b) 3 with less than 1% drop in response quality measured in BART scores [Yuan et al., 2021]. The gains are even higher for pairs where the small model is closer in terms of response quality to the large model (see Section 4). With the explosion in the complexity and costs of LLM deployments, small companies and individual consumers, have started to rely on the pre-existing LLMs hosted on platforms like HuggingFace [Face] and OpenAI [OpenAI, c]. This is an instance of the broader Machine-LearningAs-A-Service (MLaaS) paradigm, wherein users (small companies/individual consumers) interact with the models through an API where they submit their queries [Kang et al., 2022] and have limited visibility into the models themselves. In this context, our hybrid inference approach can reduce the costs incurred by both consumers and platform owners because a) consumers can use it to route easy queries to small models hosted on their edge devices (laptops/smartphones) and only call the API for the more complex queries (illustrated in Figure 2) and b) platform owners can automatically route queries to lower cost models at the backend without affecting the user experience, as long as the response quality levels are maintained. Thus our hybrid inference approach offers a flexible and cost-effective solution for harnessing the full potential of LLMs while accommodating diverse cost budgets and quality requirements. The main technical contributions of this work are: a) we are the first to explore cost-effective and quality-aware hybrid LLM inference, b) we design a novel query router which routes queries based on an estimate of the response quality gap between models (Section 3.1), c) we incorporate uncertainty due to randomness in LLM responses in our router design to improve performance (Section 3.2), d) we identify challenges for our router when the small model is significantly weaker than the large model and introduce a novel data transformation to address this issue (Section 3.3), and e) we provide extensive experimental results (Section 4) on a large benchmark dataset of real world natural language queries and responses [Jiang et al., 2023] thereby demonstrating the value of the approach and its superiority over baseline approaches, enabling LLM providers and consumers to cost-efficiently enable LLM-backed experiences. 3We term the fraction of queries routed to the small model as the cost advantage (see \u00a72.3) 3 \f2 Problem Formulation 2.1 Related Work Large Language Models (LLMs). The advent of LLMs has led to a paradigm shift in the study of natural language processing (NLP), computer vision, information retrieval, and other domains[Menghani, 2023, Chen et al., 2023, Jiang et al., 2023]. The impressive effectiveness and generalizability of LLMs has come at the price of a drastic increase in LLM sizes [Treviso et al., 2023] and consequent challenges, including huge amounts of computational resources and data required to train, and prohibitive expenses at both training and deployment stages [Bender et al., 2021]. Efficient Machine Learning (ML) Inference. LLMs belong to a class of models called foundation models [Bommasani et al., 2021] \u2013 models that are trained once and can then be used to serve a wide variety of tasks. As such, we expect inference cost to dominate the overall cost of such models and hence focus on works that reduce the cost of ML inference [Menghani, 2023]. The most common approach for efficient ML inference is model compression i.e., replacing a large model with a smaller model of comparable accuracy. Common techniques for model compression include (i) model pruning [Hassibi et al., 1993, LeCun et al., 1989] which drops parts of the model with minimal accuracy loss, (ii) quantization [Jacob et al., 2018, Vanhoucke et al., 2011] which reduces model memory footprints and inference latency by reducing the precision of data representation (e.g., FP32 to INT8), (iii) knowledge distillation [Hinton et al., 2015, Urban et al., 2016] which trains small student models to mimic large teacher models, and (iv) Neural Architecture Search [Elsken et al., 2019, Zoph and Le, 2016] which tunes model architecture to improve model performance, under inference cost constraints. Such static efficiency optimizations typically produce a fixed model with lower inference cost and lower accuracy compared to the large model which may not suffice for foundation models like LLMs, whose core premise is that the same model will serve a range of tasks, each with its own accuracy/cost constraints. This is already manifesting in inference platforms described in Section 1 which need more dynamic optimizations to meet the demands of all users. Hybrid ML Inference. Recent works [Kag et al., 2022, Ding et al., 2022] have introduced a new inference paradigm called hybrid inference which uses two models of different sizes instead of a single model for inference. The smaller model (e.g. Llama2 [Touvron et al., 2023]) generally has lower inference cost but also lower accuracy than the larger model (e.g. GPT-4 [OpenAI, 2023]). The key idea is to identify and route easy queries to the small model so that inference cost can be reduced while maintaining response quality. By tuning a threshold on query difficulty we can dynamically trade off quality and cost for the same inference setup. [Kag et al., 2022] study this setup for image classification and propose to train the small model, large model, and router from scratch. However LLM training is expensive and retraining LLMs from scratch for every scenario goes against the very premise of inference with pre-trained foundation models. Moreover text generation [Iqbal and Qureshi, 2022] is often more ambiguous and challenging than image classification due to which novel techniques are required for effective hybrid LLM inference for text generation. Inference with Multiple LLMs. Some recent works [Jiang et al., 2023, Chen et al., 2023, Leviathan et al., 2023, Kim et al., 2023] use multiple LLMs for inference but these approaches typically call more than one LLM for a single query that can incur significant computational overheads. Specifically [Jiang et al., 2023] calls an ensemble of LLMs at inference time due to which the inference cost will be proportional to the number of models in the system. [Chen et al., 2023] performs inference using a cascade of LLMs where responses to the query are generated sequentially by the LLMs in the cascade until one of the models has a confidence score higher than a predefined 4 \fthreshold. Our work provides high quality responses while always making a single LLM call for all queries and will thus incur much lower computational cost than both of these works on average. Speculative decoding, introduced in [Leviathan et al., 2023, Kim et al., 2023] speeds up decoding of expensive models by invoking small-and-efficient decoders on the \u201ceasy\u201d decoding steps. Instead, in our work we are interested in query routing which assigns \u201ceasy\u201d queries to small models to reduce overall inference costs while maintaining high performance. While the two approaches have different goals, an interesting line of future work would be to combine these so that our router assigns queries to the small or large model based on query difficulty and then speculative decoding is applied on top to speed up inference for queries assigned to the large model thereby leading to further cost reduction. 2.2 Problem Setting We extend the hybrid ML paradigm to LLM inference by routing queries between two models with different inference costs and accuracy. This allows platforms [Face, OpenAI, c] to route queries across backend LLMs to lower costs while dynamically tuning the ratio of queries assigned to each model as per user quality requirements. It also allows users with small models on local (edge) devices to only call the platform for hard queries (Figure 2), thus significantly reducing their expenses. We use X and Z to denote the input query space and the set of all possible output responses respectively. Let L : X \u2192Z denote the large model and S : X \u2192Z denote the small model. Formally, the objective in our paradigm is to learn a router r : X \u2192{0, 1} such that each user query x \u2208X is routed to the small model S(x) if r(x) = 0, and to the large model L(x), otherwise. Note that we always route each query to a single LLM at inference time as opposed to using an ensemble [Jiang et al., 2023] or a cascade [Chen et al., 2023] of LLMs, which may call multiple LLMs to resolve a single query and incur significant computational overheads. 2.3 Evaluation Metric Response Quality Automatic evaluation for text generation is a challenging and widely studied problem. Traditional metrics, such as BLEU and ROUGE, initially designed for machine translation and summarization, have been found to be of limited concordance with human judgment and restricted applicability across diverse NLP tasks [Blagec et al., 2022]. Significant research efforts have been devoted to implementing task-agnostic evaluation metrics with neural networks. GPT-ranking [Jiang et al., 2023], as a representative example, employs GPT models (e.g., GPT-4 [OpenAI, 2023]) to provide relative rankings between pairs of generated outputs. In spite of the high correlation with human perception, GPT-ranking suffers from high computational costs and inability to distinguish between examples with the same ranking. Instead, we use the BART score [Yuan et al., 2021] to evaluate response quality of different models since (1) it is inexpensive to compute in comparison to LLM-based metrics such as GPT-ranking, and (2) it has been shown in prior work [Jiang et al., 2023] that this metric correlates well with the ground truth. We also provide a case study in Appendix C.2 to empirically justify using BART score as the response quality metric. We use q(z), q : Z \u2192R to denote the BART score (response quality) of model responses z \u2208Z. Cost Advantage The absolute costs of running a model may not be known a priori, and may be expressed using a variety of metrics, including latency, FLOPs, energy consumption, etc. In LLM inference, however, each of these metrics is affected by several underlying confounders such as different prompt templates, hardware capability, network connectivity, etc. Moreover different 5 \fplatforms/users may be interested in different metrics. However the common underlying assumption in this and previous works on efficient ML inference is that smaller models are more efficient than larger models and therefore we expect to obtain an improvement in all the metrics by routing more queries to the smaller model. Hence we define cost advantage as the percentage of queries routed to the smaller model. Note that the notion cost advantage has been used as a generic efficiency metric in previous hybrid ML work [Kag et al., 2022], where it is termed as coverage. 3 Hybrid LLM Inference Easy Queries. We refer to queries for which the response quality of the small model is close to the response quality of the large model as \u201ceasy\u201d queries. The goal of our hybrid inference framework is to identify the easy queries and route them to the small model thereby ensuring significant inference cost reduction without much drop in response quality. Note that the easy queries as defined here, need not necessarily be queries that are easy/inexpensive to respond to, they are just queries for which the small model can match up to the large model. Examples of easy and hard queries as per this definition are provided in Appendix C.1. Quality Gap. We define quality gap of a query x as H(x) := q(S(x))\u2212q(L(x)) i.e. the difference in quality of the small model\u2019s response S(x) and the large model\u2019s response L(x). The quality gap is a random variable since LLM responses are typically non-deterministic. This is illustrated in Figure 3 below where the blue and orange plots correspond to the distribution of responses from FLAN-t5 (800m) 4 [Chung et al., 2022] and Llama-2 (13b) [Touvron et al., 2023] for a single query. Figure 3: Response quality distribution for FLAN-t5 (800m) and Llama-2 (13b) on the query \u201cHow to identify the index of median?\u201d measured in BART scores. Llama-2 (13b) with transformation significantly overlaps with FLAN-t5 (800m). Proposed Orchestration Framework. Queries are routed using a BERT-style encoder model (e.g., DeBERTa, [He et al., 2020]) which is trained on a dataset of representative queries and learns to predict a score. Since the router is an encoder model, a single pass of the query through it is sufficient to generate the score and we assume that the cost of this step is negligible compared to the cost of running autoregressive decoding using the large model L(x) [Sun et al., 2019]. Thus, we expect that using the router to route queries to the small model will not detract significantly from the realizable cost advantage. Router Score. We design the router score to be large for easy queries as defined above. Intuitively, an estimate of Pr[H(x) \u22650] is a suitable candidate since a large value of Pr[H(x) \u22650] = Pr[q(S(x)) \u2265q(L(x))] corresponds to queries for which there is a high likelihood that the response quality of the small model will be at least as high as that of the large model. However we show below that in scenarios where the large model is significantly more powerful than the small model i.e. q(S(x)) << q(L(x)) in general, one can train more effective routers by relaxing the definition of easy queries to Pr[H(x) \u2265\u2212t] = Pr[q(S(x)) \u2265q(L(x)) \u2212t] for an appropriate t > 0. At test time we achieve the desired performance accuracy tradeoff by tuning a threshold on the score and routing queries with score above the threshold to the small model. For a 4We use the FLAN-t5-large model from https://huggingface.co/google/flan-t5-large. 6 \frouter with parameters w, we denote router score by pw(x), pw : X \u2192[0, 1]. We discuss different router score designs in the rest of this section assuming a training set of N queries x1, . . . , xN. 3.1 Deterministic Router Previous work on hybrid ML [Ding et al., 2022, Kag et al., 2022] makes the assumption that neural models are deterministic functions that map input features to a single point in the output space. To realize this for LLMs, we sample a single response per query from each model. We assign boolean labels ydet i = 1[q(S(xi)) \u2265q(L(xi))], i = 1, . . . , N to each training query with the BART score as the quality function q(.). Our router is trained by minimizing the binary cross-entropy loss [Ruby and Yendapalli, 2020]. L(w) = \u22121 N N X i=1 \u0000ydet i log(pw(xi)) + (1 \u2212ydet i ) log(1 \u2212pw(xi)) \u0001 (1) Observe that the assigned labels ydet i can be viewed as an estimate for Pr[H(xi) \u22650] given a single response per query from each model and thus minimizing the above loss encourages the router score pw(x) to be close to Pr[H(x) \u22650] for test queries. We refer to this deterministic router as rdet. 3.2 Probabilistic Router The determinism assumption can be justified for tasks where the ground truth labels are often explicit and unique such as image classification [Masana et al., 2022] and video segmentation [Yao et al., 2020]. When it comes to NLP tasks, however, there is usually no single best answer due to the intrinsic ambiguity and complexity of natural languages. LLMs are widely used as non-deterministic generators to capture the intrinsic uncertainty of NLP tasks, as shown in Figure 3 (ignore the dashed curve for now). The non-determinism mainly comes from the randomness in the decoding phase. Users typically control the level of uncertainty by choosing different decoding strategies such as nucleus sampling [Holtzman et al., 2019], as well as the values of the hyper-parameter temperature. Intuitively, higher temperature values result in a higher level of randomness and diversity among the generated responses. For black-box LLM APIs such as GPT-4 [OpenAI, 2023], it has been observed that even upon setting temperature to the minimum value 0, it can still provide different responses for the same input queries. The underlying mechanism is still an open problem while a recent study hints at the instability of the MoE backbone [Skyward, 2023]. We propose to incorporate the uncertainty due to the non-deterministic nature of LLM comparisons into the router training loss by relaxing the hard labels ydet i \u2208{0, 1} to the soft labels yprob i := Pr[H(xi) \u22650] = Pr[q(S(xi)) \u2265q(L(xi))] = E[1[q(S(xi)) \u2265q(L(xi))]] where E denotes the expectation. In practice, we estimate expectation by sampling 10 responses from each model and computing the sample average of the corresponding indicator function values. Observe that the hard label ydet i is a higher-variance estimate of E[1[q(S(xi)) \u2265q(L(xi))]] (since it is obtained from a single sample) and hence we expect improved performance with the following training loss, L(w) = \u22121 N N X i=1 \u0010 yprob i log(pw(xi)) + (1 \u2212yprob i ) log(1 \u2212pw(xi)) \u0011 (2) We refer to this probabilistic router as rprob. 7 \f(a) Before transformation. (b) Grid search for the best t. (c) After transformation. Figure 4: Effect of data transformation on labels for training the router. 3.3 Probabilistic Router with Data Transformation While so far we have designed scores that try to estimate Pr[H(x) \u22650], we observe that the empirical estimate of Pr[H(xi) \u22650] = E[1[q(S(xi)) \u2265q(L(xi))]] tends to be extremely small when the large model is significantly more powerful than the small model (0 for almost 90% of the queries in Figure 4a with Flan-t5 (800m) as the small model and Llama-2 (13b) as the large model). Because q(S(x)) << q(L(x)) for most queries in this case, it provides an extremely weak signal for training using Equation (2) and as shown in Section 4 both rdet and rprob fail to provide much improvement over random query assignment in this case. Traditional approaches for learning with imbalanced data have their own shortcomings [Krawczyk, 2016]. Moreover our goal is to only design a router that can reduce inference cost while maintaining response quality as much as possible and so we are not tied to a particular definition of class labels to achieve this. We leverage this flexibility to introduce new labels ytrans i (t) := Pr[H(xi) \u2265\u2212t] = Pr[q(S(xi)) > q(L(xi)) \u2212t] for some t > 0. Since \u2212t < 0, Pr[H(x) \u2265\u2212t] \u2265Pr[H(x) \u22650] by definition of the tail distribution and so we expect this relaxation to provide a stronger signal for router training while still allowing us to identify the easy queries i.e. those queries for which q(S(x)) has a high likelihood of being close to q(L(x)) (q(S(x)) > q(L(x)) \u2212t). Visually, this corresponds to comparing the distribution of the small model\u2019s response with a shifted distribution of the large model\u2019s response to a query (dotted curve in Figure 3). Now the question is how to choose the best relaxation t? Given that tail probability Pr[H(x) \u2265\u2212t] lies in [0, 1], we choose t by maximizing the average pairwise differences between the transformed labels to push them as far apart as possible and provide a strong signal for training. Thus we set, t\u2217= arg max t 1 N 2 X (i,i\u2032) | ytrans i (t) \u2212ytrans i\u2032 (t) | (3) We currently solve the above optimization problem via grid-search and leave more sophisticated approaches for future work. We plot the optimization objective for different values of t for our training dataset in Section 3.3 and show the distribution of transformed labels ytrans i (t\u2217) in Figure 4c. As we see, the distribution is significantly more balanced now and we expect the resulting router to be much more effective. Once again, we train the router by minimizing the loss L(w) = \u22121 N N X i=1 \u0000ytrans i (t\u2217) log(pw(xi)) + (1 \u2212ytrans i (t\u2217)) log(1 \u2212pw(xi)) \u0001 (4) and we refer to this probabilistic router as rtrans. 8 \fCost Advantage (%) Response Quality (BART Score) Drop w.r.t all-at-large (%) S: Llama-2 (7b) S: Llama-2 (13b) S: FLAN-t5 (800m) L: Llama-2 (13b) L: GPT-3.5-turbo L: Llama-2 (13b) rdet rprob rtrans rdet rprob rtrans rdet rprob rtrans 10 0.1 -0.1 0.1 0.1 -0.1 0.2 2.3 2.2 2.1 20 0.1 0.0 0.0 1.0 0.8 0.8 5.8 5.8 4.7 40 0.2 0.1 0.0 3.5 3.4 2.9 13.8 13.1 10.3 Table 1: Cost advantage v.s. performance drop for model pairs of different performance gaps. Performance drops are computed w.r.t. the all-at-large baseline. 4 Evaluation 4.1 Evaluation Setup Dataset. We use the MixInstruct dataset from [Jiang et al., 2023] to evaluate the effectiveness of different routing strategies across a wide range of tasks (e.g., question answering, summarization, information extraction). MixInstruct is a large-scale collection of real-world instructions and consists of examples from four public datasets (see Table 5 in Appendix B). The broad range of tasks in the dataset enables us to train a generic router that will be effective across different scenarios. We uniformly sample 10k training examples from the training split of MixInstruct, for each of which we generate 10 responses from all LLMs under consideration. Our validation and test splits are the same as the MixInstruct dataset, which consist of 5k instruction examples separately. Router Model. We use DeBERTa-v3-large [He et al., 2020] (300M) as the backbone to train our routers. We train each router with the corresponding loss from Section 3 for 5 epochs and use the validation set to choose the best checkpoints for final evaluation. All experiments are conducted with 1 NVIDIA A100 GPU of 80GB GPU RAM. We have made our source code available at https://github.com/m365-core/hybrid_llm_routing. Evaluation Measures. We use BART score [Yuan et al., 2021] as the quality metric and use fraction of queries routed to the small model (cost advantage) as the efficiency metric (see Section 2.3). Baselines. To the best of our knowledge, there has been no prior work specifically on routing between LLMs. We consider three straightforward baselines: all-at-large, all-at-small, and random. All-at-large routes all queries to the large model, while all-at-small routes all queries to the small model. Random generates a random number in [0,1] and selects the large model if it is below the probability threshold. Experiments. We investigate all three routers (see Section 3): the deterministic router rdet, the probabilistic router rprob, and the probabilistic router augmented with data transformation rtrans. We select candidate model pairs from FLAN-T5 (800m), FLAN-T5 (11b), Llama-2 (7b), Llama-2 (13b), and GPT-3.5-turbo for our experiments. At test time the trained router (rdet, rprob, or rtrans) takes a threshold value as input and routes all queries with router score higher than the threshold to the small model as these are the easy queries. We evaluate the router performance in Section 4.2 in terms of both BART score and cost advantage (Figure 5 and Table 1), validate that the router is 9 \f(a) Small performance gap (b) Medium performance gap (c) Large performance gap Figure 5: Error-cost tradeoffs achieved by rdet, rprob, and rtrans for different performance gaps. indeed routing easy queries to the small model in Section 4.3, demonstrate that our routers are of negligible compute overhead in Section 4.4, show how to choose routing thresholds in practice in Section 4.5, evaluate the effectiveness of our routers using a response quality metric other than the BART score in Section 4.6, and test the generalizability of routers across model pairs in Section 4.7. 4.2 Router Performance Results Small performance gap. LLMs of the same architectures are observed to be of small performance gap such as Llama-2 (7b) v.s. Llama-2 (13b), as seen in Figure 5a. In this case, by trading little to no performance drop, we show that (1) the deterministic router rdet can achieve good cost advantages, (2) rprob consistently improves rdet, and (3) rtrans is able to match or slightly improve the performance of rprob. Numerical comparison results are summarized in Table 1. rdet routes 20% (40%) queries to the small model i.e. Llama-2 (7b) with only 0.1% (0.2%) drop in response quality w.r.t. the all-at-large baseline. Impressively rprob and rtrans achieve 20% cost advantages without any quality drop, and rtrans is able to achieve even 20% cost advantage without quality drop, which can be attributed to these methods capturing the non-deterministic nature of LLMs. Medium performance gap. Often there is only a moderate performance gap between leading open-source LLMs like Llama-2 (13b) and state-of-the-art commodified LLMs, such as GPT-3.5-turbo (Figure 5b). In this case, all our routers deliver reasonable cost advantages with acceptable quality drop. The effectiveness order between rdet, rprob, and rtrans resembles that in the small quality gap case. All routers achieve 20% (40%) cost advantage with \u22641% (\u22644%) quality drop (Table 1). In the 40% cost advantage regime, rprob slightly outperforms rdet and rtrans improves rprob by 0.5% in terms of quality drop. Large performance gap. In the edge-cloud routing scenarios, edge devices often have very limited resources and can only support small models of limited quality, which can be significantly 10 \f(a) Small performance diff. (b) Medium quality gaps. (c) Large quality gaps. Figure 6: Difference between average quality gap of queries routed to the small and large models with different performance gaps. outperformed by large models deployed on the cloud. We investigate how to effectively route queries with LLM pairs of large performance gaps, such as FLAN-t5 (800m) and Llama-2 (13b) (Figure 5c). Non-trivial routing is challenging in this situation since the large model dominates for a majority of examples. Both rdet and rprob perform marginally better than the random routing baseline. In contrast, rtrans can still effectively distinguish relatively easy queries from the harder ones. rtrans achieves 40% cost advantages with 10.3% quality drop, which is 3.5% and 2.8% lower than rdet and rprob respectively (Table 1). In the course of these experiments we made the following interesting observations: 1. When the cost advantage is modest (e.g., 10%) and the LLM performance gaps are not large (e.g., Llama-2 (7b) v.s. Llama-2 (13b)) rprob is able to achieve even better performance than all-at-large which leads to the \u201cnegative quality drops\u201d in Table 1. This is because, as seen from the large value of Pr[H(x) \u22650] in the tail distribution in Figure 5, the response quality of the small model may be higher than that of the large model for several queries and by routing these queries to the small model, the router is able to even beat all-at-large. 2. For lower cost advantages (\u226410%) and small or moderate LLM performance gaps rtrans can be slightly outperformed by rdet or rprob. This might be due noise in the estimation of the relaxation parameter t from sample averages instead of expectation in Equation (3) and from the grid search process leading to suboptimal settings of rtrans. However we clearly see that in more challenging routing scenarios with high cost advantage targets or large LLM performance gaps, both rdet and rprob have difficulty in correctly routing queries, and rtrans starts to dominate due to the benefits of the data transformation. 4.3 Router Validation Results We also validate that the router is functioning as intended, that is, routing easy queries to the small model and hard queries to the large model. To see this, in Figure 6 we plot the difference between the average quality gaps of queries routed to the small model and those routed to the large model for our router and the random baseline v/s different values of cost advantages (i.e., the fraction of queries routed to the small model). Since the random baseline randomly assigns queries the average difference is nearly always zero. However our router routes easy queries i.e. queries with large quality gap (q(S(x)) \u2212q(L(x))) to the small model and queries with small quality gap to the 11 \flarge model. Hence the difference between the average quality gaps always has a significant positive value indicating that more easy queries are routed to the small model than to the large model in our approach as compared to the random assignment approach at all cost advantages. 4.4 Router Latency We measure the latency of our router and compare it to the latency of the different LLMs \u2013 Flan-t5 (800m), Llama-2 (7b), and Llama-2 (13b) that we use in our experiments for generating responses to user queries. Note that the latency of all the routers rdet, rprob, and rtrans will be the same since they use the same model (DeBERTa-v3-large [He et al., 2020]) and are just trained differently. Also, we do not measure the latency of GPT-3.5-turbo since its responses are generated by querying the OpenAI API [OpenAI, c] as the model weights are not publicly available due to which it is not possible to disentangle the inference latency from the network latency, queueing delay, latency of the API call, etc. However we note that the inference latency of all other LLMs we consider is significantly larger than that of the router (see Table 2) and therefore we expect the same to hold for GPT-3.5-turbo as well. The latency results are reported in Table 2 where we measure the average latency per query averaged over 200 randomly chosen queries from our dataset (confidence bounds correspond to one standard error). As expected the router processes queries significantly faster than all the LLMs (nearly 10\u00d7 faster than the fastest LLM \u2013 FLAN-t5(800m)). This is both due to its smaller size (300m parameters) and the fact that it performs a single forward pass over the query to generate the score while the LLMs generate the response token-by-token in an autoregressive fashion due to which the inference latency is proportional to the response length. Thus the router adds minimal overhead to the inference cost due to its small size and extremely low latency. Model Latency (seconds) Router 0.036 \u00b1 0.002 FLAN-t5 (800m) 0.46 \u00b1 0.039 Llama-2 (7b) 7.99 \u00b1 0.15 Llama-2 (13b) 14.61 \u00b1 0.27 Table 2: Latency Values for Different Models 4.5 Empirical Determination Of Routing Threshold Recall that at test time the model owner is required to set a threshold on the router score which serves to separate the easy queries from the hard ones (see Section 3). All queries with router score higher than the threshold will be routed to the small model. Thus the threshold is a user-defined parameter controlling the achieved efficiency-performance trade-off, to best serve the interests of different users. In this section we show how to empirically choose thresholds on router scores to achieve cost reduction with little to no performance drops. For this, we use a small calibration set to recommend default thresholds to users. We investigate all three routers rdet, rprob, and rtrans with different LLM pairs that we use in our experiments. For each LLM pair, we randomly draw 500 samples from the validation set and use grid search to determine the threshold that delivers the highest cost advantages i.e., cost savings on the validation set while keeping the performance drop 12 \fRouter S: Llama-2 (7b) L: Llama-2 (13b) S: Llama-2 (13b) L: GPT-3.5-turbo S: FLAN-t5 (800m) L: Llama-2 (13b) Perf. Drop Cost Adv. Perf. Drop Cost Adv. Perf. Drop Cost Adv. rdet Val. 0.99% 98.20% 0.97% 15.20% 0.77% 5.40% Test 1.60% 98.56% 0.55% 15.15% 0.69% 4.89% rprob Val. 0.92% 97.60% 0.56% 8.60% 0.70% 5.00% Test 1.42% 96.80% 0.11% 8.38% 0.57% 4.44% rtrans Val. 0.79% 96.00% 0.77% 17.00% 0.92% 4.00% Test 1.39% 96.45% 0.49% 15.68% 1.02% 5.05% Table 3: Test performance drops v.s. cost advantages achieved by thresholds chosen from 500 validation samples with \u22641% sampled performance drops. (reduction in BART score) less than 1%. The limit on performance drop can be adjusted as per user requirements. With the selected thresholds, we report the achieved performance drops and cost advantages on the test sets, as summarized in Table 3. As seen from the table the performance and the cost advantage obtained on the test sets closely follows that on the validation sets for all categories of LLM pairs. This clearly illustrates that a threshold chosen on the validation set generalizes well to the test set. We note that there is a slight increase in the performance drop from the validation to the test set for the LLama-2 (7b) and Llama-2 (13b) pair, i.e the LLM pair with small performance gap as per the categorization in Section 4. However this is also the pair with the highest cost advantage or cost savings (> 96% for all routers) and thus the issue can be addressed by just using a more conservative limit on the performance drop while choosing the threshold which would still lead to very significant cost savings. 4.6 Alternate Evaluation Metrics To provide a more comprehensive evaluation of our routers, we test the routing performance with metrics in addition to BART score [Yuan et al., 2021]. GPT-4-based evaluators have been found to be well correlated with human assessments [Liu et al., 2023, Chase, 2022]. We generate GPT-4 evaluation scores (integer ratings from 1 to 10) for test responses from Flan-t5 (800m), Llama-2 (7b), Llama-2 (13b), and GPT-3.5-turbo that we investigate in our experiments, using LangChain scoring evaluator [Chase, 2022]. Recall that our routers are trained with BART score due to efficiency and effectiveness reasons as discussed in Section 2.3. Intuitively, if the quality gaps measured by BART score and GPT-4 score are highly correlated, we could expect good routing performance even under the GPT-4 score as we have seen in Section 4.2. We compute the correlation between quality gaps measured by BART score and GPT-4 score, and report it along with routing performance evaluated with GPT-4 score, as shown in Figure 7. Aligned with our intuition, when the two metrics are well correlated (Figure 7a), our routers trained with BART score are still effective even when evaluated against GPT-4 score. Typically, rdet, rprob, and rtrans are able to achieve 20% cost advantage with up to 1% performance drop, and 40% cost advantage with up to 2.1% performance drop. As the correlation gets weaker, the router performance gradually decays, as shown in Figure 7b and 7c. This observation suggests a simple-yet-effective strategy of using BART score in practice to save labelling costs while maintaining 13 \f(a) High correlation (r = 0.46, \u03c1 = 0.44). (b) Medium correlation (r = 0.38, \u03c1 = 0.38). (c) Low correlation (r = 0.26, \u03c1 = 0.27). Figure 7: Routing performance evaluated with GPT-4 scores. Pearson (r) and spearman (\u03c1) correlation coefficients between quality gaps measured by BART score and GPT-4 score are computed for each LLM pair. routing performance. We can first compute the correlation between BART score and the target metrics (e.g., human assessments) using a small sample and use BART score as training labels whenever there is strong positive correlation with target metrics. 4.7 Generalizing To Different Model Pairs We evaluate the generalizability of our routers by testing their routing performance on LLM pairs different than the pairs they were trained with. We compute the correlation between quality gaps of training and testing LLM pairs, and report it along with routing performance, as shown in Figure 8. Similar to our observation in Section 4.6, our routers can generalize well if the quality gaps of testing LLM pairs exhibit strong positive correlation with the quality gaps of the training pairs. In Figure 8a, both pearson and spearman correlation coefficients exceed 0.7, and all three routers are able to achieve 20% cost advantage with up to 1.6% performance drop, and 40% cost advantage with up to 4.1% performance drop. As the correlation becomes weaker, the generalizability of our router gets restricted and routing performance decays, as shown in Figure 8b and 8c. This observation sheds light on using the quality gap correlation as an effective indicator to decide if our routers can be applied to new LLM pairs in the early stage. Given a pair of LLMs (source pair) and a router trained on this pair we can measure the correlation between the quality gap of the source pair and the quality gap of any new target pair of LLMs to decide if the router will be effective on the target pair. 5 Discussion and"
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14619v2.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14619v2",
|
| 3 |
+
"title": "OpenELM: An Efficient Language Model Family with Open Training and Inference Framework",
|
| 4 |
+
"abstract": "The reproducibility and transparency of large language models are crucial for\nadvancing open research, ensuring the trustworthiness of results, and enabling\ninvestigations into data and model biases, as well as potential risks. To this\nend, we release OpenELM, a state-of-the-art open language model. OpenELM uses a\nlayer-wise scaling strategy to efficiently allocate parameters within each\nlayer of the transformer model, leading to enhanced accuracy. For example, with\na parameter budget of approximately one billion parameters, OpenELM exhibits a\n2.36% improvement in accuracy compared to OLMo while requiring $2\\times$ fewer\npre-training tokens.\n Diverging from prior practices that only provide model weights and inference\ncode, and pre-train on private datasets, our release includes the complete\nframework for training and evaluation of the language model on publicly\navailable datasets, including training logs, multiple checkpoints, and\npre-training configurations. We also release code to convert models to MLX\nlibrary for inference and fine-tuning on Apple devices. This comprehensive\nrelease aims to empower and strengthen the open research community, paving the\nway for future open research endeavors.\n Our source code along with pre-trained model weights and training recipes is\navailable at \\url{https://github.com/apple/corenet}. Additionally, \\model\nmodels can be found on HuggingFace at:\n\\url{https://huggingface.co/apple/OpenELM}.",
|
| 5 |
+
"authors": "Sachin Mehta, Mohammad Hossein Sekhavat, Qingqing Cao, Maxwell Horton, Yanzi Jin, Chenfan Sun, Iman Mirzadeh, Mahyar Najibi, Dmitry Belenko, Peter Zatloukal, Mohammad Rastegari",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-05-02",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.LG"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "Parameter AND Efficient AND Fine AND Tuning",
|
| 16 |
+
"gt": "The reproducibility and transparency of large language models are crucial for\nadvancing open research, ensuring the trustworthiness of results, and enabling\ninvestigations into data and model biases, as well as potential risks. To this\nend, we release OpenELM, a state-of-the-art open language model. OpenELM uses a\nlayer-wise scaling strategy to efficiently allocate parameters within each\nlayer of the transformer model, leading to enhanced accuracy. For example, with\na parameter budget of approximately one billion parameters, OpenELM exhibits a\n2.36% improvement in accuracy compared to OLMo while requiring $2\\times$ fewer\npre-training tokens.\n Diverging from prior practices that only provide model weights and inference\ncode, and pre-train on private datasets, our release includes the complete\nframework for training and evaluation of the language model on publicly\navailable datasets, including training logs, multiple checkpoints, and\npre-training configurations. We also release code to convert models to MLX\nlibrary for inference and fine-tuning on Apple devices. This comprehensive\nrelease aims to empower and strengthen the open research community, paving the\nway for future open research endeavors.\n Our source code along with pre-trained model weights and training recipes is\navailable at \\url{https://github.com/apple/corenet}. Additionally, \\model\nmodels can be found on HuggingFace at:\n\\url{https://huggingface.co/apple/OpenELM}.",
|
| 17 |
+
"main_content": "Introduction Transformer-based [48] large language models (LLM) are revolutionizing the field of natural language processing [7,46]. These models are isotropic, meaning that they have the same configuration (e.g., number of heads and feedforward network dimensions) for each transformer layer. Though such isotropic models are simple, they may not allocate parameters efficiently inside the model. In this work, we develop and release OpenELM, a family of pre-trained and fine-tuned models on publicly available datasets. At the core of OpenELM lies layer-wise scaling [30], enabling more efficient parameter allocation across layers. This method utilizes smaller latent dimensions in the attention and feed-forward modules of the transformer layers closer to the input, and gradually widening the layers as they approach the output. We release the complete framework, encompassing data preparation, training, fine-tuning, and evaluation procedures, alongside multiple pre-trained checkpoints and training logs, to facilitate open research. Importantly, OpenELM outperforms existing open LLMs that are pre-trained using publicly available datasets (Tab. 1). For example, OpenELM with 1.1 billion parameters outperforms OLMo 1 arXiv:2404.14619v2 [cs.CL] 2 May 2024 \f[17], which has 1.2 billion parameters, by 2.36% while requiring 2\u00d7 fewer pre-training tokens. 2. Pre-training This section describes the framework, including model architecture (\u00a72.1), pre-training data (\u00a72.2), training hyperparameters (\u00a72.3), and evaluation (\u00a72.4). 2.1. OpenELM architecture We adopt the decoder-only transformer-based architecture. Following state-of-the-art LLMs, we: (1) do not use learnable bias parameters in any fully-connected (a.k.a., linear) layers, (2) apply pre-normalization using RMSNorm [53] and also, use rotatory positional embedding (ROPE) [43] for encoding positional information, (3) use grouped query attention (GQA) [1] instead of multi-head attention (MHA), (4) replace the feed forward network (FFN) with SwiGLU FFN [41], (5) use flash attention [13] for computing the scaled dot-product attention, and (6) use the same tokenizer as LLama [46]. Existing LLMs use the same configuration for each transformer layer in the model, resulting in a uniform allocation of parameters across layers. Unlike these models, each transformer layer in OpenELM has a different configuration (e.g., number of heads and feed forward network dimension), resulting in variable number of parameters in each layer of the model. This lets OpenELM to better utilize the available parameter budget for achieving higher accuracies. We implement this non-uniform allocation of parameters across layers using layer-wise scaling (also referred as block-wise scaling in [30]). Layer-wise scaling. A standard transformer layer is composed of multi-head attention (MHA) and feed-forward network (FFN). For non-uniform allocation of parameters in the transformer layer, we adjust the number of attention heads and the FFN multiplier in each transformer layer. Assume that the standard transformer model with uniform parameter allocation has N transformer layers and the dimensionality of the input to each layer is dmodel. The MHA has nh heads and dimension of each head is dh = dmodel nh . Also, the hidden dimension for FFN is dFFN = m \u00b7 dmodel, where m is a scalar FFN multiplier. We introduce parameters \u03b1 and \u03b2 to scale the number of attention heads nh and FFN multiplier m per layer respectively. For the i-th layer, nh and m are computed as ni h = \u03b1i \u00b7 dmodel dh , mi = \u03b2i where \u03b1i = \u03b1min + (\u03b1max \u2212\u03b1min) \u00b7 i N \u22121 , and \u03b2i = \u03b2min + (\u03b2max \u2212\u03b2min) \u00b7 i N \u22121 , 0 \u2264i < N. (1) Here, \u03b1min and \u03b1max are the hyper-parameters that allow us to scale the attention heads. Similarly, \u03b2min and \u03b2max let us to vary the width of FFN layers. Therefore, varying the configuration of standard transformer layers using \u03b1 and \u03b2 results in non-uniform allocation of parameters in the model. Note, setting \u03b1min = \u03b1max = 1.0 and mi = m produces the standard uniform transformer model. 2.2. Pre-training data For pre-training, we use public datasets. Specifically, our pre-training dataset contains RefinedWeb [35], deduplicated PILE [15], a subset of RedPajama [11], and a subset of Dolma v1.6 [42], totaling approximately 1.8 trillion tokens. These details are also summarized in Tab. 2. On-the-fly tokenization and data filtering. Unlike previous approaches that utilize pre-tokenized data [5,17], we filter and tokenize text data on-the-fly. This facilitates seamless experimentation with various tokenizers, thereby significantly simplifying prototyping and research endeavors. In our experiments, we use the same tokenizer as used in LLama [46]. To filter out low-length sequences, we apply two filtering methods. The first method operates at the characterlevel, checking if the number of characters in the sequence is below a specified threshold. The second method operates at the token-level, where it examines whether the sequence contains fewer tokens than a specified threshold. Sequences that are shorter than either of these thresholds are skipped. In our experiments, we use 200 characters and 256 tokens as character and token-level filtering thresholds. 2.3. Training details We train OpenELM variants for 350k iterations (or training steps) using CoreNet (formerly CVNets [29]). We use AdamW [28] as an optimizer. We use a cosine learning rate Source Subset Tokens RefinedWeb 665 B RedPajama Github 59 B Books 26 B ArXiv 28 B Wikipedia 24 B StackExchange 20 B C4 175 B PILE 207 B Dolma The Stack 411 B Reddit 89 B PeS2o 70 B Project Gutenberg 6 B Wikipedia + Wikibooks 4.3 B Table 2. Dataset used for pre-training OpenELM. 2 \fTask Metric ARC-c Normalized accuracy ARC-e Normalized accuracy BoolQ Accuracy HellaSwag Normalized accuracy PIQA Normalized accuracy SciQ Accuracy WinoGrande Accuracy (a) Standard zero-shot metrics Task Metric Num. few shot examples ARC-c Normalized accuracy 25 HellaSwag Normalized accuracy 10 MMLU Accuracy 5 TruthfulQA-mc2 Accuracy 0 WinoGrande Accuracy 5 (b) OpenLLM leaderboard Task Metric Num. few shot examples ARC-c Normalized accuracy 25 CrowsPairs-En PCT stereotype 25 HellaSwag Normalized accuracy 10 WinoGrande Accuracy 5 MMLU Accuracy 5 PIQA Normalized accuracy 0 RACE Accuracy 0 (c) LLM360 Table 3. Tasks and metrics used for evaluating OpenELM. 50 100 150 200 250 300 350 Training iterations (in thousands) 22.5 25.0 27.5 30.0 32.5 35.0 Accuracy (in %) (a) ARC-c 50 100 150 200 250 300 350 Training iterations (in thousands) 40 45 50 55 60 Accuracy (in %) (b) ARC-e 50 100 150 200 250 300 350 Training iterations (in thousands) 50 55 60 65 Accuracy (in %) (c) BoolQ 50 100 150 200 250 300 350 Training iterations (in thousands) 40 50 60 70 Accuracy (in %) (d) HellaSwag 50 100 150 200 250 300 350 Training iterations (in thousands) 66 68 70 72 74 76 78 Accuracy (in %) (e) PIQA 50 100 150 200 250 300 350 Training iterations (in thousands) 77.5 80.0 82.5 85.0 87.5 90.0 92.5 Accuracy (in %) (f) SciQ 50 100 150 200 250 300 350 Training iterations (in thousands) 52.5 55.0 57.5 60.0 62.5 65.0 Accuracy (in %) (g) WinoGrande 0.04 0.02 0.00 0.04 0.02 0.00 0.02 0.04 270M 450M 1.1B 3B OpenELM sizes Figure 1. OpenELM\u2019s performance across training iterations on standard zero-shot tasks. In the majority of tasks, the performance of OpenELM shows improvement with increasing training duration. Furthermore, the model checkpoint obtained by averaging the last five checkpoints, collected at intervals of 5k iterations, demonstrates comparable or slightly better performance (indicated by markers) as compared to the last checkpoint obtained after 350k iterations. schedule [27], with warm up of 5k iterations, and decay the final learning rate down to 10% of maximum learning rate. We use a weight decay of 0.1 and gradient clipping of 1.0. We train four variants of OpenELM (270M, 450M, 1.1B, and 3B), and for some, we use FSDP [56] and activation checkpointing [8]. Please refer to Appendix A for additional pre-training details. 2.4. Evaluation details Following previous works, we evaluate the performance across different tasks using LM Evaluation Harness [16]1: \u2022 Standard zero-shot tasks. We consider 7 standard common-sense reasoning tasks: ARC easy and challenge [10], BoolQ [9], HellaSwag [52], PIQA [6], SciQ [49], and WinoGrande [39]. \u2022 OpenLLM leaderboard tasks. We use 5 tasks from OpenLLM leaderboard [4]: ARC challenge, HellaSwag, MMLU [20], TruthfulQA [24], and WinoGrande. \u2022 LLM360 leaderboard tasks. We use 7 tasks from LLM360 leaderboard [26] for evaluation: ARC chal1We use commit dc90fec of https : / / github . com / EleutherAI/lm-evaluation-harness lenge, CrowS-Pairs (English version) [32], HellaSwag, WinoGrande, MMLU, PIQA, and RACE [23]. These evaluation frameworks, built on top of LM Evaluation Harness, allows us to comprehensively evaluate OpenELM in terms of reasoning (e.g., ARC-c, HellaSwag, and PIQA), knowledge understanding (e.g., MMLU and RACE), and misinformation & bias (e.g., TruthfulQA and CrowS-Pairs). While there may be some overlap in tasks among these frameworks, they primarily differ in the fewshot settings, as outlined in Tab. 3. 3. Experimental Results Pre-training results. We evaluate the performance of OpenELM on zero-shot and few-shot settings (Tab. 3). We compare OpenELM with publicly available LLMs, namely PyThia [5], Cerebras-GPT [14], TinyLlama [54], OpenLM [18], MobiLlama [44], and OLMo [17]. The works most closely related to ours are MobiLlama and OLMo. These models are trained on comparable dataset mixtures, with similar or larger number of pre-training tokens. In Fig. 1, the accuracy of OpenELM is plotted against training iterations for 7 standard zero-shot tasks. We observe an overall increase in accuracy with longer training 3 \fModel Model size Pretraining tokens ARC-c ARC-e BoolQ HellaSwag PIQA SciQ WinoGrande Average Average w/o SciQ OpenELM (Ours) 0.27 B 1.5 T 26.45 45.08 53.98 46.71 69.75 84.70 53.91 54.37 49.31 MobiLlama [44] 0.50 B 1.3 T 26.62 46.04 55.72 51.06 71.11 83.60 53.20 55.34 50.63 OpenELM (Ours) 0.45 B 1.5 T 27.56 48.06 55.78 53.97 72.31 87.20 58.01 57.56 52.62 TinyLlama [54] 1.10 B 3.0 T 30.12 55.25 57.83 59.20 73.29 59.12 55.80 OpenLM [18] 1.00 B 1.6 T 31.00 56.00 65.00 61.00 74.00 60.00 57.83 MobiLlama [44] 0.80 B 1.3 T 28.84 49.62 60.03 52.45 73.18 85.90 55.96 58.00 53.35 MobiLlama [44] 1.26 B 1.3 T 31.91 56.65 60.34 62.18 74.81 89.10 59.27 62.04 57.53 OLMo [17] 1.18 B 3.0 T 31.06 57.28 61.74 62.92 75.14 87.00 59.98 62.16 58.02 OpenELM (Ours) 1.08 B 1.5 T 32.34 55.43 63.58 64.81 75.57 90.60 61.72 63.44 58.91 OpenELM (Ours) 3.04 B 1.5 T 35.58 59.89 67.40 72.44 78.24 92.70 65.51 67.39 63.18 (a) Results on zero-shot tasks with respect to the standard metrics defined in Tab. 3a. Model Model size Pretraining tokens ARC-c HellaSwag MMLU TruthfulQA-mc2 WinoGrande Average Cerebras-GPT [14] 0.26 B 5.1 B 22.01 28.99 26.83 45.98 52.49 35.26 OPT [55] 0.35 B 0.2 T 23.55 36.73 26.02 40.83 52.64 35.95 OpenELM (Ours) 0.27 B 1.5 T 27.65 47.15 25.72 39.24 53.83 38.72 Pythia [5] 0.41 B 0.3 T 24.83 41.29 25.99 40.95 54.38 37.49 MobiLlama [44] 0.50 B 1.3 T 29.52 52.75 26.09 37.55 56.27 40.44 OpenELM (Ours) 0.45 B 1.5 T 30.20 53.86 26.01 40.18 57.22 41.50 MobiLlama [44] 0.80 B 1.3 T 30.63 54.17 25.2 38.41 56.35 40.95 Pythia [5] 1.40 B 0.3 T 32.68 54.96 25.56 38.66 57.30 41.83 MobiLlama [44] 1.26 B 1.3 T 34.64 63.27 23.87 35.19 60.77 43.55 OLMo [17] 1.18 B 3.0 T 34.47 63.81 26.16 32.94 60.46 43.57 OpenELM (Ours) 1.08 B 1.5 T 36.69 65.71 27.05 36.98 63.22 45.93 OpenELM (Ours) 3.04 B 1.5 T 42.24 73.28 26.76 34.98 67.25 48.90 (b) Results on OpenLLM Leaderboard tasks with respect to the metrics defined in Tab. 3b. Model Model size Pretraining tokens ARC-c CrowS-Pairs HellaSwag MMLU PIQA RACE TruthfulQA WinoGrande Average OpenELM (Ours) 0.27 B 1.5 T 27.65 66.79 47.15 25.72 69.75 30.91 39.24 53.83 45.13 MobiLlama [44] 0.50 B 1.3 T 29.52 65.47 52.75 26.09 71.11 32.15 37.55 56.27 46.37 OpenELM (Ours) 0.45 B 1.5 T 30.20 68.63 53.86 26.01 72.31 33.11 40.18 57.22 47.69 MobiLlama [44] 0.80 B 1.3 T 30.63 66.25 54.17 25.2 73.18 33.68 38.41 56.35 47.23 MobiLlama [44] 1.26 B 1.3 T 34.64 70.24 63.27 23.87 74.81 35.02 35.19 60.77 49.73 OLMo [17] 1.18 B 3.0 T 34.47 69.95 63.81 26.16 75.14 36.75 32.94 60.46 49.96 OpenELM (Ours) 1.08 B 1.5T 36.69 71.74 65.71 27.05 75.57 36.46 36.98 63.22 51.68 OpenELM (Ours) 3.04 B 1.5 T 42.24 73.29 73.28 26.76 78.24 38.76 34.98 67.25 54.35 (c) Results on LLM360 tasks with respect to the metrics defined in Tab. 3c. Table 4. Comparison of OpenELM with publicly available LLMs across various evaluation frameworks.. We chose MobiLlama and OLMo as our baselines because they are pre-trained on public datasets using a similar or larger number of tokens. We evaluate OpenELM, MobiLlama, and OLMo using the same LM evaluation harness version. Results for other models in Tab. 4a and Tab. 4b are taken from their official GitHub repositories and the OpenLLM leaderboard [4], respectively. Best task accuracy for each model category is highlighted in bold. Models pre-trained with less data are highlighted in gray color. durations across most tasks. Additionally, the checkpoint obtained by averaging the last five checkpoints, collected at intervals of 5000 iterations, demonstrates comparable or slightly better accuracy compared to the final checkpoint obtained after 350k iterations. This improvement is likely due to noise reduction through weight averaging. Consequently, we use the averaged checkpoint for our main evaluations in Tab. 4, instruction tuning experiments in Tab. 5, and parameter-efficient tuning experiments in Tab. 6. The results in Tab. 4 span across various evaluation frameworks, and highlights OpenELM\u2019s effectiveness over existing methods. For instance, an OpenELM variant with 1.1 billion parameters achieves 1.28% (Tab. 4a), 2.36% (Tab. 4b), and 1.72% (Tab. 4c) higher accuracy compared to OLMo with 1.2 billion parameters. Remarkably, OpenELM achieves this level of accuracy while using 2\u00d7 less pretraining data. Instruction tuning results. We use the cleaned variant of UltraFeedback [3, 12] dataset that consists of 60k prompts for instruction tuning. We do instruction tuning using Alignment Handbook library [47]. For optimization, we use either the statistical rejection sampling method [25] or the direct preference optimization method [37]. These sampling method details along with other hyper-parameters and fine-tuning details are given in Appendix B. Tab. 5 shows that instruction tuning consistently improves OpenELM\u2019s average accuracy by 1-2% across different evaluation frameworks. 4 \fModel Size Instruction Tuned? ARC-c ARC-e BoolQ HellaSwag PIQA SciQ WinoGrande Average 0.27 B \u2717 26.45 45.08 53.98 46.71 69.75 84.70 53.91 54.37 \u2713 30.55 46.68 48.56 52.07 70.78 84.40 52.72 55.11 0.45 B \u2717 27.56 48.06 55.78 53.97 72.31 87.20 58.01 57.56 \u2713 30.38 50.00 60.37 59.34 72.63 88.00 58.96 59.95 1.08 B \u2717 32.34 55.43 63.58 64.81 75.57 90.60 61.72 63.44 \u2713 37.97 52.23 70.00 71.20 75.03 89.30 62.75 65.50 3.04 B \u2717 35.58 59.89 67.40 72.44 78.24 92.70 65.51 67.39 \u2713 39.42 61.74 68.17 76.36 79.00 92.50 66.85 69.15 (a) Results on zero-shot tasks with respect to the metrics defined in Tab. 3a. Model Size Instruction Tuned? ARC-c HellaSwag MMLU TruthfulQA WinoGrande Average 0.27 B \u2717 27.65 47.15 25.72 39.24 53.83 38.72 \u2713 32.51 51.58 26.70 38.72 53.20 40.54 0.45 B \u2717 30.20 53.86 26.01 40.18 57.22 41.50 \u2713 33.53 59.31 25.41 40.48 58.33 43.41 1.08 B \u2717 36.69 65.71 27.05 36.98 63.22 45.93 \u2713 41.55 71.83 25.65 45.95 64.72 49.94 3.04 B \u2717 42.24 73.28 26.76 34.98 67.25 48.90 \u2713 47.70 76.87 24.80 38.76 67.96 51.22 (b) Results on OpenLLM Leaderboard tasks with respect to the metrics defined in Tab. 3b. Model Size Instruction Tuned? ARC-c CrowS-Pairs HellaSwag MMLU PIQA RACE TruthfulQA WinoGrande Average 0.27 B \u2717 27.65 66.79 47.15 25.72 69.75 30.91 39.24 53.83 45.13 \u2713 32.51 66.01 51.58 26.70 70.78 33.78 38.72 53.20 46.66 0.45 B \u2717 30.20 68.63 53.86 26.01 72.31 33.11 40.18 57.22 47.69 \u2713 33.53 67.44 59.31 25.41 72.63 36.84 40.48 58.33 49.25 1.08 B \u2717 36.69 71.74 65.71 27.05 75.57 36.46 36.98 63.22 51.68 \u2713 41.55 71.02 71.83 25.65 75.03 39.43 45.95 64.72 54.40 3.04 B \u2717 42.24 73.29 73.28 26.76 78.24 38.76 34.98 67.25 54.35 \u2713 47.70 72.33 76.87 24.80 79.00 38.47 38.76 67.96 55.73 (c) Results on LLM360 tasks with respect to the metrics defined in Tab. 3c. Table 5. Instruction tuning improves OpenELM\u2019s accuracy across different model sizes. Parameter-efficient fine-tuning (PEFT) results. We use the CommonSense reasoning training and evaluation setup [22]. This setup provides 170k training samples across 8 multiple-choice datasets for PEFT studies with different methods, including LoRA [21] and DoRA [51]. We integrate OpenELM with these methods, and finetune the resulting model for three epochs using 8 NVIDIA H100 GPUs. Tab. 6 shows that PEFT methods can be applied to OpenELM. LoRA and DoRA deliver similar accuracy on average across the given CommonSense reasoning datasets. 4. Benchmarking Hardware. We benchmark on modern, consumer-grade hardware with BFloat16 as the data type. Specifically, CUDA benchmarks were performed on a workstation with an Intel i9-13900KF CPU, equipped with 64 GB of DDR54000 DRAM, and an NVIDIA RTX 4090 GPU with 24 GB of VRAM, running Ubuntu 22.04. PyTorch v2.2.2 [34] was used, with the most recent versions of models and the associated libraries. HuggingFace Transformers v4.39.3 [50] was used to benchmark HuggingFace models. We did not use Torch Inductor for model compilation. To benchmark OpenELM models on the Apple silicon, we used an Apple MacBook Pro with an M2 Max systemon-chip and 64GiB of RAM, running macOS 14.4.1. We ported the code and the weights of OpenELM to Apple MLX v0.10.0 [19]. To maximize the throughput, lazy evaluation was used in MLX with 8 tokens evaluated at a time. Evaluation. We provide two separate measurements for token throughput (measured in terms of tokens processed per second): (1) prompt processing (pre-fill), and (2) token generation. Additionally, we also report the total combined throughput. We benchmark all models sequentially, and execute one full \u201cdry run\u201d generating 1024 tokens for the first model, since we found that this significantly increases the throughput of generation for subsequent models. Before measurement for each individual model, we warm up the model by executing a single forward pass to allow the frameworks to perform further auto-tuning, if any. In all experiments, we use key-value caching and generate 1024 tokens in addition to the prompt tokens in all tests. Static 5 \fModel Size PEFT ARC-c ARC-e BoolQ HellaSwag PIQA SIQA WinoGrande OBQA Average 0.27 B LoRA 24.57 26.60 62.14 24.84 50.05 42.02 49.88 28.00 38.51 DoRA 26.19 28.07 62.20 25.22 50.11 44.42 50.12 31.20 39.69 0.45 B LoRA 28.67 29.88 62.29 25.85 52.39 49.59 50.91 33.20 41.60 DoRA 28.33 30.39 62.26 25.12 52.29 49.28 50.83 32.00 41.31 1.08 B LoRA 45.14 61.11 61.77 77.95 72.31 69.70 61.64 59.20 63.60 DoRA 44.11 61.49 61.68 78.92 71.38 69.04 64.01 58.80 63.68 3.04 B LoRA 46.93 66.25 62.48 81.22 75.19 70.62 65.51 58.20 65.80 DoRA 46.50 66.46 62.35 80.84 75.73 70.83 63.77 58.20 65.59 Table 6. OpenELM with PEFT. Both LoRA and DoRA demonstrate comparable performance when OpenELM is finetuned on CommonSense reasoning benchmark. It\u2019s important to note that these fine-tuning results, obtained using the evaluation setup of LLM-Adapters [22], differ from the results in Tabs. 4 and 5. This is because the results in Tabs. 4 and 5 are obtained under zeroand few-shot settings using LM Evaluation Harness. Note that we did not use social interactions QA (SIQA; [40]) and OpenBookQA (OBQA; [31]) in Tabs. 4 and 5 because of evaluation issues with LLama tokenizer in LM Evaluation Harness (see [45]). Model Model size Throughput (Tokens per second) Prompt Generation Total OPT [55] 0.35 B 6524.17 214.11 220.21 OpenELM (Ours) 0.27 B 6427.27 159.67 165.85 MobiLlama [44] 0.50 B 3423.25 136.35 146.86 OpenELM (Ours) 0.45 B 5211.35 128.46 133.42 MobiLlama [44] 0.80 B 4151.75 126.01 130.08 Pythia [5] 1.40 B 4501.85 139.65 143.83 MobiLlama [44] 1.26 B 4938.29 142.96 147.67 OLMo [17] 1.18 B 7151.65 203.40 209.26 OpenELM (Ours) 1.08 B 3681.73 92.15 95.72 OpenELM (Ours) 3.04 B 2712.56 70.11 72.82 (a) Results on NVIDIA CUDA / Linux. Model Throughput (Tokens per second) Prompt Generation Total OpenELM-0.27B 1151.41 212.40 218.45 OpenELM-0.27B-4bit 803.99 256.35 262.70 OpenELM-0.45B 910.61 147.26 151.57 OpenELM-0.45B-4bit 883.19 197.81 203.16 OpenELM-1.08B 508.56 78.72 81.04 OpenELM-1.08B-4bit 554.17 117.90 121.14 OpenELM-3.04B-bf16 234.96 33.96 34.97 OpenELM-3.04B-bf16-4bit 211.32 60.33 61.83 (b) Results for the MLX port on Apple macOS. Table 7. Benchmark measurements of OpenELM compared to other similar LLMs in its class.. On CUDA, we evaluate OpenELM, MobiLlama, and OLMo using the CoreNet version of OpenELM and HuggingFace for the other two. On macOS, we only provide results for the MLX version of OpenELM. key-value cache was used whenever supported. The same prompt was used for all runs, resulting in prompt lengths of 35-36 tokens (depending on the tokenizer). Results. Tabs. 7a and 7b shows the benchmarking results on GPU and MacBook Pro respectively. Despite OpenELM\u2019s higher accuracy for a similar parameter count, we observe that it is slower than OLMo. While the primary focus of this study is reproducibility rather than inference Model Normalization layer Throughput (Tokens per second) (# Invocations per token) Prompt Generation Total OLMo LayerNorm (33) 7151.65 203.40 209.26 RMSNorm-Naive (33) 5360.56 171.41 176.92 OpenELM (Ours) LayerNorm (113) 4697.50 130.34 135.38 RMSNorm-Naive (113) 3681.73 92.15 95.72 RMSNorm-Apex (113) 4280.66 113.42 117.81 Table 8. Normalization layers are a bottleneck. The throughput of both OLMo-1.18B and OpenELM-1.08B significantly decreases with the naive implementation of RMSNorm in PyTorch compared to highly optimized LayerNorm [2]. Although Apex\u2019s [33] RMSNorm implementation leads to notable throughput improvements compared to the naive implementation, a considerable performance gap persists in comparison to LayerNorm. This highlights the substantial optimization potential for future endeavors. The number of invocations per token for each normalization layer is indicated next to the layer name in brackets. performance, we did comprehensive profiling to understand the bottlenecks. Our analysis reveals that a significant portion of OpenELM\u2019s processing time can be attributed to our naive implementation of RMSNorm (Tab. 8). Specifically, naive RMSNorm implementation results in many individual kernel launches each of which processes a small input, rather than a launch of a single, fused kernel, as would be the case with e.g. LayerNorm. By replacing the naive RMSNorm with Apex\u2019s RMSNorm [33], we observe a notable increase in OpenELM\u2019s throughput. However, a substantial performance gap persists compared to the models that use optimized LayerNorm, in part because (1) OpenELM has 113 RMSNorm layers as compared to 33 LayerNorm layers in OLMo and (2) Apex\u2019s RMSNorm is not optimized for small inputs. To further illustrate the performance degradation attributable to RMSNorm, we replaced the LayerNorm in OLMo with RMSNorm, and observed a significant drop in generation throughput. In future work, we plan to explore optimization strategies to further improve the inference efficiency of OpenELM. 6 \f5."
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14625v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14625v1",
|
| 3 |
+
"title": "Towards Multi-Morphology Controllers with Diversity and Knowledge Distillation",
|
| 4 |
+
"abstract": "Finding controllers that perform well across multiple morphologies is an\nimportant milestone for large-scale robotics, in line with recent advances via\nfoundation models in other areas of machine learning. However, the challenges\nof learning a single controller to control multiple morphologies make the `one\nrobot one task' paradigm dominant in the field. To alleviate these challenges,\nwe present a pipeline that: (1) leverages Quality Diversity algorithms like\nMAP-Elites to create a dataset of many single-task/single-morphology teacher\ncontrollers, then (2) distills those diverse controllers into a single\nmulti-morphology controller that performs well across many different body plans\nby mimicking the sensory-action patterns of the teacher controllers via\nsupervised learning. The distilled controller scales well with the number of\nteachers/morphologies and shows emergent properties. It generalizes to unseen\nmorphologies in a zero-shot manner, providing robustness to morphological\nperturbations and instant damage recovery. Lastly, the distilled controller is\nalso independent of the teacher controllers -- we can distill the teacher's\nknowledge into any controller model, making our approach synergistic with\narchitectural improvements and existing training algorithms for teacher\ncontrollers.",
|
| 5 |
+
"authors": "Alican Mertan, Nick Cheney",
|
| 6 |
+
"published": "2024-04-22",
|
| 7 |
+
"updated": "2024-04-22",
|
| 8 |
+
"primary_cat": "cs.RO",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.RO",
|
| 11 |
+
"cs.LG",
|
| 12 |
+
"cs.NE"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "Distillation",
|
| 16 |
+
"gt": "Finding controllers that perform well across multiple morphologies is an\nimportant milestone for large-scale robotics, in line with recent advances via\nfoundation models in other areas of machine learning. However, the challenges\nof learning a single controller to control multiple morphologies make the `one\nrobot one task' paradigm dominant in the field. To alleviate these challenges,\nwe present a pipeline that: (1) leverages Quality Diversity algorithms like\nMAP-Elites to create a dataset of many single-task/single-morphology teacher\ncontrollers, then (2) distills those diverse controllers into a single\nmulti-morphology controller that performs well across many different body plans\nby mimicking the sensory-action patterns of the teacher controllers via\nsupervised learning. The distilled controller scales well with the number of\nteachers/morphologies and shows emergent properties. It generalizes to unseen\nmorphologies in a zero-shot manner, providing robustness to morphological\nperturbations and instant damage recovery. Lastly, the distilled controller is\nalso independent of the teacher controllers -- we can distill the teacher's\nknowledge into any controller model, making our approach synergistic with\narchitectural improvements and existing training algorithms for teacher\ncontrollers.",
|
| 17 |
+
"main_content": "INTRODUCTION Finding controllers that perform well across different morphologies is an important milestone for large-scale robotics. Similar to the \u2018foundation models\u2019 that enable progress in other areas of machine learning, such as computer vision or language processing, a foundational multi-morphology controller can facilitate progress in robotics by enabling fine-tuning to downstream tasks with a smaller amount of data (which is important because the best methods for training control models such as evolutionary or reinforcement learning algorithms are data-inefficient). Moreover, models capable of controlling a multitude of robots can enable better brain-body co-optimization by being a good fitness estimator for unseen morphologies [28], hence better specialization and performance can be obtained for a given domain by exploiting multi-morphology arXiv:2404.14625v1 [cs.RO] 22 Apr 2024 \fGECCO \u201924, July 14\u201318, 2024, Melbourne, VIC, Australia Alican Mertan and Nick Cheney controllers. However, obtaining such controllers, despite being of great interest, remains an open problem. As identified in [13], the field is mostly stuck in the \u2018one robot one task\u2019 paradigm \u2013 training a new robot and controller from scratch for each new task such as locomotion, object manipulation, climbing, etc. The challenges that drive the field into the \u2018one robot one task\u2019 paradigm are twofold. The first issue is the incompatible control \u2013 the differences in action and observation spaces of different robots or tasks [20]. While it is straightforward to have \u2018compatible\u2019 controllers through caching trick [16], having wide enough input (and output) layers to accommodate the maximum possible number of sensory inputs (and motor outputs), while simply ignoring unused nodes for morphologies with a smaller number of inputs (outputs), it turns out that such controllers are hard to train to control multiple morphologies, whether reinforcement learning [16] or evolutionary optimization [27] algorithms are used. This hardship of training stems from the complexity of learning many tasks/morphologies. These two challenges, incompatible control and hardship of training, are intertwined as the controller model one chooses to use as a multi-morphology controller determines the loss landscape and in return, affects its training dynamics. Previous work on obtaining multi-morphology controllers mostly focuses on complexifying controller models by enforcing modularity (aiming for emergent higherscale control at the robot level [6, 16, 30, 33]) or by employing recent developments in Graph Neural Networks and Transformers (utilizing their ability to deal with arbitrary-sized inputs [13, 20, 47]). These attempts not only solve the incompatibility problem but also, presumably, shapes the loss landscape and offer easier training. In this work, however, we focus solely on the hardship of training multi-morphology controllers, instead of addressing it indirectly by architectural changes, which makes our approach synergistic with existing work. Our proposed method stems from our search for a \u2018simple\u2019 procedure for learning a multi-morphology controller. Inspired by existing literature on knowledge distillation [3, 9, 14, 21, 25, 32, 39, 46] \u2013 learning to match input-output patterns of teacher models via supervised learning, we investigate the use of responsebased, offline, multi-teacher policy distillation to learn a single multi-morphology controller. We collect a dataset of (\ud835\udc5c\ud835\udc4f\ud835\udc60\ud835\udc52\ud835\udc5f\ud835\udc63\ud835\udc4e\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b, \ud835\udc4e\ud835\udc50\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b) pairs from teacher controllers optimized to control single morphology and then employ supervised learning to train a single controller on this collected dataset. Indeed, we show that knowledge distillation results in controllers that match the performance of teacher controllers on many different morphologies, without needing any complex architecture or message-passing scheme \u2013 just a simple neural network with a single hidden layer that is made compatible with the caching trick can learn to control hundreds of robots for the locomotion task in a matter of minutes on a consumer laptop. We also note that our method is agnostic to the choice of the distilled controller. Once we collect a dataset of (\ud835\udc5c\ud835\udc4f\ud835\udc60\ud835\udc52\ud835\udc5f\ud835\udc63\ud835\udc4e\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b,\ud835\udc4e\ud835\udc50\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b) pairs, it can be used to train any neural network, including the modular or graph-based models developed to alleviate the challenges of incompatible control. It might seem, however, that optimizing many teacher controllers that specialize in particular morphologies to be able to train a single multi-morphology controller defeats the purpose. For this, we would like to show two important points. First, the teacher controllers are only used to collect (\ud835\udc5c\ud835\udc4f\ud835\udc60\ud835\udc52\ud835\udc5f\ud835\udc63\ud835\udc4e\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b,\ud835\udc4e\ud835\udc50\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b) pairs and then discarded. They can be as simple as possible for faster optimization on a particular morphology. Moreover, one can use abundant publicly available pre-trained controllers instead of training them from scratch. More importantly, we show that the distilled controller displays emergent properties. Our investigations show that the distilled controller is robust to morphological perturbations and generalizes to unseen morphologies in a zero-shot manner. Moreover, it can be used as a prior for further specialization on unseen morphologies or tasks to speed up the adaptation process. These properties justify the cost of training teacher controllers \u2013 we gain more than the sum of teacher controllers by distilling them into a single controller. Most of all, our proposed approach is orthogonal to the previous work developing complex architectures for multi-morphology control \u2013 we could use such models to further enhance the emergent properties of the distilled controllers. It is not obvious, nonetheless, how to select teacher controllers\u2019 morphologies. Indeed, the choice of morphologies to train the multi-morphology controller is an important question that has been ignored in the literature so far. Existing works either heuristically [6, 16, 20, 47] choose the morphologies to train with, or assume that effective morphologies are known prior to the training [13]. Considering that, unlike most prior work, we need experiences ((\ud835\udc5c\ud835\udc4f\ud835\udc60\ud835\udc52\ud835\udc5f\ud835\udc63\ud835\udc4e\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b,\ud835\udc4e\ud835\udc50\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b) pairs) of effective morphologies as well to distill that knowledge into a single controller, we resort to Quality Diversity (QD) algorithms [37, 38] for finding effective morphologies with their optimized controllers, similar to [9, 21] where QD is used to create a repertoire of behaviors for a single robot and knowledge distillation is used to distill that knowledge into a single controller. In our case, given that the feature descriptors are based on morphological attributes, a QD algorithm is used to explore the morphology space and optimize controllers for a variety of high-performing morphologies with different trade-offs in their morphological attributes for a given domain. We show that these controllers can be used as teachers to distill into a single controller that is capable of controlling a variety of distinct morphologies that perform well for the given domain, and that generalizes well to unseen morphologies in a zero-shot manner. Overall, we present the two-stage pipeline illustrated in Fig. 1 that first explores a given domain with QD algorithms to find highperforming morphologies and their respective controllers, and then exploits this knowledge by distilling it into a single controller. The main contributions of this work are to: \u2022 demonstrate the effectiveness of knowledge distillation for multi-morphology controller training \u2013 a simple procedure that can train simple models to control multiple morphologies. (Sec. 3) \u2022 propose the use of QD algorithms for the automated discovery of effective morphologies with their optimized controllers for the distillation process. (Sec. 4) \u2022 investigate the capabilities of the distillation process and distilled controllers (Sec. 5) and show that \u2013 the distillation process is controller agnostic, making it synergistic with existing work that develops complex controller models. (Sec. 5.1) \u2013 the distilled controllers scale well with the number of teachers. (Sec. 5.2) \fTowards Multi-Morphology Controllers with Diversity and Knowledge Distillation GECCO \u201924, July 14\u201318, 2024, Melbourne, VIC, Australia \u2013 the distilled controllers generalize well to unseen morphologies, justifying the cost of obtaining teacher controllers. (Sec. 5.3) \u2013 the distilled controllers provide a better prior for further specialization, unlocking transfer learning opportunities in the robotics field. (Sec. 5.4) 2 METHODS Simulation. We use Evolution Gym version 1.0.0 (Evogym) [1] for simulating 2D voxel-based soft bodied robots. The raw observations that the simulation provides are processed to acquire voxel volume (\u2208R), speed (\u2208R2), and material type (one-hot encoded vector \ud835\udc63of length 5). We also process the timesteps into a saw wave-shaped time signal by applying mod 25 to it. While the simulation engine is deterministic, we apply a small noise to the observations sampled from N (0, 0.01) to model sensory noise. Tasks and performance evaluation. We mainly experiment in the Walker-v0 environment which consists of a flat surface of length 100 in voxels with a locomotion task where robots try to reach the end of the surface. We also experiment with a similar locomotion task that consists of a soft, dynamic surface called BridgeWalkerv0. In both environments, we use the modified reward function from [27, 28] which encourages the robot to finish the tasks as fast as possible. Due to the stochasticity we injected into the system in terms of observation and action noises, we repeat each fitness evaluation multiple times and take the average. Unless otherwise noted, each simulation is repeated 5 times. Robot representation and control. Robots in Evogym consist of 4 types of materials. There are two materials under active control, one that expands horizontally and one that expands vertically. There are also two passive materials, rigid and elastic, that are under the effects of forces created by active materials and dynamics of the environment. Robots are directly represented as a matrix \ud835\udc45\u2208\ud835\udc47\ud835\udc3b\u00d7\ud835\udc4a where \ud835\udc47\u2208{0,1,2,3,4} encodes the materials (or lack thereof), and we use (\ud835\udc3b,\ud835\udc4a) = (5, 5), following the practice of limiting the robot design space [4, 5, 7, 18, 22, 24, 27, 28, 45]. Robots are controlled by specifying a scalar action (\u2208[0.6, 1.6]) that is used to determine the target length by multiplying the action with the resting length. Controllers are queried every 5th timestep and the last action is repeated for the remaining timesteps to prevent high-frequency dynamics. We apply a small noise to the actions sampled from N (0, 0.01) to model actuator noise. Controller models. Throughout the work, we experiment with 3 different controllers \u2013 \u2018Global FC\u2019, \u2018Global Tx\u2019, and \u2018Modular FC\u2019, modeled by different neural network architectures \u2013 \u2018FC\u2019 stands for fully connected and \u2018Tx\u2019 stands for transformer, and belonging 2 different control paradigms \u2013 global indicates a centralized controller where observations from all voxels are concatenated and consumed at once by the controller to output actions for each voxel, similar to the ones used in [10, 23, 26, 27, 43, 44], and modular indicates a shared, decentralized controller that observes a local neighborhood and output action for a single voxel, similar to the (a) Biped (b) Worm (c) Triped (d) Block Figure 2: Experimented morphologies to show the effectiveness of knowledge distillation for training multimorphology controller. ones used in [16, 23, 24, 27, 28, 35]. All controllers are made compatible through the use of caching trick and are not conditioned on the morphology explicitly.1 Optimization algorithms. To show the ineffectiveness of joint training on fixed morphologies, we use the reinforcement learning algorithm Twin Delayed Deep Deterministic policy gradients algorithm (TD3) [12] (starting from the clean implementation of [15]) and the evolutionary optimization algorithm Age-Fitness Pareto Optimization (AFPO) [40] (with population size of 16). After demonstrating the ineffectiveness of both approaches, we introduce our approach where we use the Map-Elites algorithm [29] as a Quality Diversity algorithm to create an archive of diverse and effective morphologies with their optimized controllers where the two feature descriptors are the number of existing voxels and the number of active voxels. In each generation of the Map-Elites algorithm, we create 16 new solutions from 16 randomly chosen solutions from the map. The offspring are created by mutation only. Following [1, 27, 28], robot representations are mutated by changing the material of each voxel with a 10% probability and controllers are mutated by adding a noise sampled from N (0, 0.1). The new solutions are created by mutating either the morphology or the controller, chosen with a 50% probability, as in [5, 27, 28]. Statistical testing To measure the statistical significance for distilled controllers, we calculate the relative performance of the distilled controllers compared to teacher controllers and apply onesample t-test [41] with the null hypothesis of the population mean of 1. Where we compare two samples, we use the Wilcoxon Rank Sum test [48]. All comparisons are done with the \ud835\udc5d= .05 threshold. 3 KNOWLEDGE DISTILLATION FOR MULTI-MORPHOLOGY CONTROL Optimizing controllers capable of controlling multiple different morphologies is a challenging problem [13, 16, 27]. Here, we provide a naive attempt (referred to as joint training) at learning a controller (Global FC) for controlling the four predetermined and fixed morphologies shown in Fig. 2, both with evolutionary optimization (AFPO [40]) and reinforcement learning (TD3 [12]). Following [27, 36], we use the minimum performance among all morphologies as the fitness for the evolutionary algorithm to help avoid specialization to a subset of morphologies while ignoring others. Fig. 3 demonstrates the joint training trajectories with both algorithms, as well as isolated training for each morphology individually. Both algorithms struggle to optimize a multi-morphology controller during joint training. While the evolutionary algorithm converges 1Details of controller architectures can be found in our code repository: mertana/towards-multi-morphology-controllers \fGECCO \u201924, July 14\u201318, 2024, Melbourne, VIC, Australia Alican Mertan and Nick Cheney Figure 3: Training trajectories of isolated training on each morphology individually (solid lines) vs. the performance of each morphology during joint training on all (dashed lines). Lines show the mean values and the shaded areas show the standard errors, calculated over 3 repetitions. Reinforcement Learning (left) can find solutions that work well for multiple morphologies but ignore others. Evolutionary algorithms (right) find solutions that perform similarly on all morphologies, but they exhibit sub-optimal performance. to a sub-optimal but similar-performing solution for all morphologies, reinforcement learning finds solutions that work better for some morphologies, ignoring others. Yet both algorithms fail to find controllers that match the performance of single-morphology controllers each trained in isolation. To overcome the challenging training of multi-morphology controllers, here we propose the use of response-based, offline, multiteacher knowledge distillation [3, 14], also known as policy distillation in reinforcement learning [32, 39], for the training of a single general controller capable of controlling multiple robots with different morphologies. We evolve single-morphology controllers for our experimented morphologies in Fig. 2 and use their experiences to create a dataset of (\ud835\udc5c\ud835\udc4f\ud835\udc60\ud835\udc52\ud835\udc5f\ud835\udc63\ud835\udc4e\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b,\ud835\udc4e\ud835\udc50\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b) pairs. This dataset is then used for supervised learning to train a single multi-morphology controller to minimize the error in recreating the correct action for a given observation regardless of which robot the action is sampled from. Once we have the dataset, the training of the multimorphology controller can be done in an offline supervised fashion. In our experiments, we model the controllers by neural networks and use the gradient descent algorithm Adam [17] to train them. To demonstrate the effectiveness of this approach, we replay the best controllers found by the evolutionary algorithm during isolated training of each morphology at each repetition, \ud835\udc36\ud835\udc5f \ud835\udc5a,\ud835\udc5a\u2208 {\ud835\udc35\ud835\udc56\ud835\udc5d\ud835\udc52\ud835\udc51,\ud835\udc4a\ud835\udc5c\ud835\udc5f\ud835\udc5a,\ud835\udc47\ud835\udc5f\ud835\udc56\ud835\udc5d\ud835\udc52\ud835\udc51, \ud835\udc35\ud835\udc59\ud835\udc5c\ud835\udc50\ud835\udc58},\ud835\udc5f\u2208{1, 2, 3}, 100 times and collect the (\ud835\udc5c\ud835\udc4f\ud835\udc60\ud835\udc52\ud835\udc5f\ud835\udc63\ud835\udc4e\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b,\ud835\udc4e\ud835\udc50\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b) pairs into 81 (34, all possible combinations of champions for each morphology) datasets \ud835\udc37\ud835\udc56,\ud835\udc56\u2208[1..81]. Using these datasets, we distill 81 multi-morphology controllers, all with the same controller model as the teacher controllers \u2013 Global FC, by training the controllers on the datasets for 100,000 steps with minibatches of size 128 and learning rate of 0.001, in a supervised manner where the loss is the mean squared error between the estimated and ground truth actions. All hyperparameters are chosen heuristically. Figure 4: Performance of the multi-morphology controller relative to teacher single-morphology controllers for each experimented morphology (\ud835\udc5a\ud835\udc52\ud835\udc4e\ud835\udc5b\u00b1 \ud835\udc46\ud835\udc38). Here, and in all figures, the dotted line marks equal performance. Knowledge distillation can successfully train a single controller to control multiple morphologies as well as controllers specifically optimized for individual morphologies. Fig. 4 shows the performance of the distilled multi-morphology controllers relative to the corresponding single-morphology controllers, averaging over 81 cases. Knowledge distillation from singlemorphology controllers results in multi-morphology controllers that achieve near-perfect teacher-level performance. Moreover, we see that in some cases the distilled multi-morphology controller outperforms the teacher single-morphology controller, as indicated by the error bars. These results demonstrate the effectiveness of knowledge distillation for the training of compatible controllers, without resorting to complex architectures or training schemes. 4 QUALITY DIVERSITY FOR DOMAIN EXPLORATION In the previous section, we experiment with heuristically chosen fixed morphologies and show that knowledge distillation can be utilized successfully to train a single controller capable of controlling multiple robot morphologies, without the need for any specialized architecture. Now the question is, how should we choose which morphologies to use for the training of the teacher single-morphology controllers, given a domain \u2013 an environment and a task? As opposed to using heuristically chosen morphologies [16, 20, 30], we propose to utilize the QD algorithms [37, 38] to evolve distinct high-performing solutions representing trade-offs in a feature space, exploring the solution space for a given domain. Defining the feature descriptors based on the morphology of the robot, we can utilize QD algorithms to evolve different robot-controller pairs with varying morphologies, optimized for a particular environment and task. We prefer the QD algorithm over alternatives, as it allows finer control over the diversity of morphologies by explicitly describing feature descriptors and bins, and results in greater diversity [31]. Knowledge distillation can then be applied to create a single controller capable of controlling a variety of different robots, exhibiting behavior optimized for the domain. \fTowards Multi-Morphology Controllers with Diversity and Knowledge Distillation GECCO \u201924, July 14\u201318, 2024, Melbourne, VIC, Australia Figure 5: An example map produced by the MAP-Elites algorithm. Each cell corresponds to a robot-controller pair with its fitness shown as the color of the cell. The X-axis differentiates bins in the map by the number of total voxels present in the robot, while the y-axis stratifies robots by their number of active voxels. MAP-Elites successfully evolves a variety of high-performing robots. In particular, we experiment with the MAP-Elites algorithm [29], similar to [31], where the feature descriptors for robots are the number of existing voxels and the number of active voxels. Fig. 5 shows the map produced by the MAP-Elites algorithm after 20,000 generations of evolution. We see that the MAP-Elites algorithm explores the morphology space for the given task and evolves a map with 296 wide-ranging unique morphologies that can locomote as effectively as the ones in similar works [27, 28]. Having produced this map for a given task or domain, we start experimenting with knowledge distillation to create a multi-morphology controller. We experiment with two heuristically chosen criteria for the selection of teacher robots: fitness and morphology. First, we experiment with selecting different robots as teachers based on their fitness values. We order the solutions by their fitness values and distill a multi-morphology controller for the top 10% of solutions, which are shown in Fig. 6 (left). The distilled multimorphology controller successfully controls 29 slightly different morphologies representing different trade-offs between the number of voxels and the number of active voxels, and its performance is statistically indistinguishable (at \ud835\udc5d= 0.05-level) from the singlemorphology controllers as shown in Fig. 6 (right). To test the whether distillation process can result in controllers capable of controlling maximally different morphologies, we choose 35 individuals from the map that are spread across the feature space, as shown in Fig. 7 (left). The performance of the distilled controller compared to teacher controllers on each experimented morphology can be seen in Fig. 7 (right). While the controller is capable of matching the performance of the teacher controllers in 28 out of 35 morphologies (\ud835\udc5d> .32), it performs worse than the teachers in 5 cases and exceeds the teacher performance in 2 cases. Surprisingly, the cases where the distilled controller fails to achieve teacher-level performance occur when the teachers\u2019 performances are low (color represents the fitness of the original controller). 2See the distilled controller in action. Figure 6: (left) Top 10% of individuals (29 in total) used as teachers for distilling a multi-morphology controller, marked with an x. (right) Performance of the distilled multimorphology controller on each trained morphology compared to their original teacher controllers across 10 runs with noise. Each data point is plotted and its color represents the fitness of the original controller. The mean point is labeled with an x. The distilled controller achieves almost perfect performance, matching the performances of teacher single-morphology controllers. Figure 7: (left) 35 individuals maximally spread across the feature space, marked with an x. (right) Performance of the distilled multi-morphology controller on each trained morphology compared to their original teacher controllers across 10 runs with noise. The distilled controller matches the performance of teacher controllers in most cases. The cases where there is a performance drop occur where the teacher controller does not perform well on the morphology.2 Overall, our experimentation shows that QD algorithms can be utilized to discover effective morphologies, as well as controllers optimized to control them. Subsequently, the knowledge that resides in the map can be distilled into a single controller, resulting in a controller capable of controlling a diverse set of morphologies. 5 INVESTIGATING ABILITIES OF DISTILLED CONTROLLERS 5.1 Model Independence So far we have experimented with the same controller model for the distilled controller as the teacher controller \u2013 Global FC. However, once we collect the dataset of {\ud835\udc5c\ud835\udc4f\ud835\udc60\ud835\udc52\ud835\udc5f\ud835\udc63\ud835\udc4e\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b,\ud835\udc4e\ud835\udc50\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b} pairs, we can train any controller architecture to do the mapping. It allows us to use deeper or more complex architectures only for the distillation \fGECCO \u201924, July 14\u201318, 2024, Melbourne, VIC, Australia Alican Mertan and Nick Cheney (a) Global FC (b) Global Tx (c) Modular FC Figure 8: The same dataset acquired from individuals that are spread across the feature space distilled into three different controllers. (left) The same controller as the teacher controller achieves the same level of performance as the teachers for most of the cases. (middle) We distill into a more capable transformer controller and show that it is capable of achieving teacher-level performance in all cases, even surpassing teacher performance in one case. (right) We process the dataset to change the global observations to local observations and distill a modular controller that achieves a similar multi-morphology performance as the global controller. Please note the varied y-axis scales across subfigures. part of the process where we use supervised learning while using simpler architectures that can be effectively trained with evolution during the QD process. Moreover, the distilled controller is not limited to the same control paradigm as the teachers either. For instance, the dataset can be pre-processed to turn global observations into local observations to distill a shared decentralized/modular controller (similar to the ones used in [16, 23, 24, 27, 28, 35]) while the teachers are centralized/global controllers (similar to the ones used in [10, 23, 26, 27, 43, 44]). To display controller model independence, we use the 35 individuals that are maximally spread to the feature space, shown in Fig. 7 (left), as teachers and distill a transformer-based global controller (\"Global Tx\") as well as a fully-connected neural network based modular controller (\"Modular FC). All controllers achieve nearteacher-level performance on almost all morphologies, as shown in Fig. 8. Moreover, their performances show variation, indicating that the type of controller affects the distillation performance. This creates an opportunity for incorporating existing work that designs compatible multi-morphology architectures [6, 13, 16, 20, 47] into our approach to improve multi-morphology performance further. 5.2 Scaling To test how many different teacher individuals can be distilled into a single multi-morphology controller, we experiment with using increasing numbers of individuals from the map as teachers. Specifically, we experiment with using the top 10, 40, 75, 100% of individuals in the order of their fitness as teachers, which results in 29, 118, 222, and 296 teachers, respectively. When we distill into all of the introduced multi-morphology controllers (Global FC, Global Tx, Modular FC), we see that all of the distilled controllers achieve performances closer to teachers, as Figure 9: Performance of the distilled controllers with an increasing number of teachers with different morphologies. While different distilled controllers scale differently, they all achieve similar performances compared to teachers. shown in Fig. 9. As the number of teachers increases, the performance for the distilled controllers tends to slightly decrease and the error bars grow. However, we see that they show different scaling behaviors, demonstrating the possibility that a bigger or more complex controller architecture can achieve better performance. While we experiment with heuristically chosen architectures as a proof of concept, one can treat the architecture as a hyperparameter and optimize it for a particular domain. 5.3 Generalization to Unseen Morphologies We have shown above that (1) we can evolve a diverse set of morphologies with their respective controllers for the locomotion task optimized for different trade-offs in the feature space, and (2) these individuals can be used as teachers to distill into a single multimorphology controller. The distilled controller is capable of controlling a diverse set of morphologies with near teacher-level performance and scaling up to the full map that covers 296 distinct morphologies. Here, we examine whether distilled controllers can generalize to unseen morphologies. To test the generalization of the distilled controller to unseen morphologies, we choose two random individuals from the map, shown in Fig. 10 (left), and create a list of morphologies that transition from the morphology of one individual to the other, by changing one voxel at a time. We discard any morphology if it is not connected or if it exists in the map. This list of morphologies contains a number of unseen morphologies between the chosen individuals. We also note that this process can create unseen morphologies that are missing a number of voxels from seen morphologies and can be considered amputation scenarios. Therefore testing controllers on these morphologies also provides a way for us to test the damage recovery abilities of the controllers. As opposed to methods like [2, 8, 19] where the system spends time to figure out how to recover from damage, we would be measuring instant (i.e. zero-shot) damage recovery through the robustness of the controller. To this end, we test distilled controllers (trained on the full map) on this set, as well as the single controller from the map was trained on the body plan closest to new morphologies. Fig. 10 (right) shows \fTowards Multi-Morphology Controllers with Diversity and Knowledge Distillation GECCO \u201924, July 14\u201318, 2024, Melbourne, VIC, Australia Figure 10: Using the pair of individuals marked on the map (left), we create a list of unseen morphologies in between the two morphologies of the selected individuals and measure the performance of the distilled controllers (right). As a baseline, we also measure the performance of the controller with the closest morphology from the map. Solid lines show the mean values of 10 fitness evaluations and shady regions show the standard errors. Distilled controllers generalize well to unseen morphologies, never performing worse than the closest controller from the map and outperforming them in most cases (transition steps 1 to 10). Figure 11: Performances of the distilled controllers plotted against the baseline controllers on 357 unseen morphologies. Each data point is plotted. The distilled controllers outperform the baseline in most cases (all \ud835\udc5d< .001), showing the emergent ability to instantly adapt to unseen morphologies. a typical example of this process. While the performances of the closest controllers from the map drop as the morphology changes, distilled controllers perform better than the baseline. Moreover, their performance differs based on the controller, demonstrating the possibility that a specialized controller architecture or control strategy can be even more effective in its generalization capabilities. We repeat this process with 30 randomly chosen individual pairs and report the performances of distilled and baseline controllers on each unseen morphology (357 in total) in Fig. 11. Points above the dotted line are the cases where the distilled controllers outperformed the controller of the most similar morphology from the map (the number of such cases is 250 for the Global FC, 267 for Global Tx, and 246 for Modular FC). Overall, the distilled controllers perform approximately 1.5 times better than the closest controller on average, outperforming the baseline (all \ud835\udc5d< .001 with the alternative hypothesis that the sample distribution mean is greater than 1) and showing ability to adapt to unseen morphologies instantly. (a) Walker-v0 (b) BridgeWalker-v0 Figure 12: Number of generations to achieve 95% of the end performance for the distilled controller and the baseline controller, lower is better. The distilled controller converges slightly faster compared to the baseline controllers. This trend also held in the time to reach 90% or 99% of the end performance (all \ud835\udc5d< .01). 5.4 Rapid Finetuning The above results show impressive instant generalization to new morphologies interpolated within the map. But what about adaptation to these morphologies via further controller optimization? We are interested in testing how good of a prior the distilled controllers are for further specialization on unseen morphologies or on different tasks. Ideally, we expect the distilled controller to perform better as a starting point for further specialization, allowing us to have foundational models that enable rapid adaptation to downstream tasks, whether they are unseen morphologies or different objectives (akin to initializing an image classifier with ResNets pre-trained on ImageNet). This can help mitigate the cost of training for many robotics applications and accelerate the development in the field. To see how good of a prior the distilled controller is for further specialization on unseen morphologies and tasks, we run 300 generations of AFPO [40] where all individuals in the starting population are initialized with the Global FC multi-morphology controller distilled from the full map. For each unseen morphology that we sampled in the previous experiment (357 in total), we fix the morphology and finetune the distilled controller on that morphology performing the original Walker-v0 task. To assess wider generalization, in a second condition, we also take that same morphology and controller originally learned on the Walker-v0 task and finetune it on the BridgeWalker-v0 environment (a slightly different locomotion task). As a baseline, for each unseen morphology, we find the controller of the robot with the most similar morphology from the map and initialize the evolutionary run with that controller instead of the distilled controller. We note that both the distilled controller and the baseline controllers have the same architecture. While the performances of the run champions do not show any statistically significant differences between the baseline and the distilled controller in both environments, we see that runs with the distilled controller achieve 90%, 95%, and 99% of their respective final performances faster compared to runs with the baseline controllers (Fig. 12). These results demonstrate that the distilled controller provides a better starting point for further specialization, enabling rapid finetuning to downstream tasks. \fGECCO \u201924, July 14\u201318, 2024, Melbourne, VIC, Australia Alican Mertan and Nick Cheney 6 DISCUSSION The first part of our pipeline consists of QD algorithms for the discovery of high-performing diverse morphologies and their controllers. While this solves the issue of finding good morphologies to train a distilled model on, which has not been addressed in previous work, it also increases the computational cost of our pipeline greatly, since we end up optimizing a controller for each morphology in the map. While we believe our method has an advantage in this regard since we can use simple controllers in the QD phase and then distill their knowledge into any complex model, we leave the comparison of our method to methods such as [13, 16, 30] in terms of number of simulation steps for future work. In our QD experiments, we observed that the number of migrations (i.e. solutions that move from one cell of the MAP-Elites map to another via a mutation to their morphology) is very limited. This is in line with the existing literature in brain-body co-optimization that demonstrates mutation to morphologies is often detrimental to the performance and results in ineffective search over the morphology space [4, 5, 27, 28]. The inability of solutions to migrate to new morphologies is concerning as goal-switching and creating stepping stones are core principles that make QD algorithms, and especially MAP-Elites, effective and important. We believe that having a relatively high-resolution map was helpful in our case, as it reduces the difference between morphologies in neighboring cells. However, we are doubtful how well QD algorithms will scale to more complex morphology spaces where having a higherresolution map would be infeasible. In future work, we are going to investigate this phenomenon and how QD algorithms behave on the problem of brain-body co-optimization. The second part of our pipeline is knowledge distillation as an alternative for the training of multi-morphology controllers (given that there exist teacher controllers). Our investigation shows that knowledge distillation can train simple controllers for multiple morphologies that would be untrainable from scratch without the capacity of a much larger network. Crucially, the distilled controllers show emergent properties. The most important of them is the generalization to unseen morphologies in a zero-shot manner. The generalization ability allows distilled controllers to be robust to perturbations to the morphology of the robot. In this sense, we consider our work as the successor of the \"Resilient Machines\" [2] and \"Robots that can adapt like animals\" [8]. In the former, the adaptation to morphological changes happens through continuous self-modeling that happens in an evolutionary time scale, and in the latter, the adaptation occurs in a faster time scale through intelligent search over a behavior repertoire. In our case, the distilled controller is already capable of controlling multiple morphologies (including seen and unseen morphologies) and can adapt instantly. In the case of a failure, one can work backward in the methods to find or optimize a controller that can recover from the damage. Moreover, we are interested in utilizing distilled controllers to enhance the search over the morphology space. The literature on brain-body co-optimization points out the ineffective search over the morphology space due to fragile co-adaptation of body and brain as a major challenge for brain-body co-optimization [4, 28, 34]. Recently, the investigation of [28] indicates that not being able to estimate the maximum performance of morphology without fully optimizing a controller may be a critical part of what makes the search ineffective. The distilled multi-morphology controller that generalizes to unseen morphologies can alleviate this issue and enable a better search over the morphology space. In a similar vein, being able to control a multitude of modular morphologies unlocks a potential for adaptation and functionality through morphological changes. A distilled general controller can enable ideas such as damage recovery through shape-shifting, and reconfiguration to perform different functions similar to the ones in [19, 49, 50]. We would like to investigate the ways of exploiting general controllers in these ways in future work. In future work, we would like to examine the generalization ability of the distilled controllers when we use more complex compatible controllers [13, 16, 20, 47]. Moreover, we used heuristically chosen parameters for the distillation process where we trained the distilled controller for a fixed number of steps. We would like to investigate the use of a held-out validation set of morphologies to maximize the generalization abilities via for early stopping or meta-learning of controllers [11, 42]. We also experimented with heuristically chosen ways of selecting teachers and assumed that a multi-morphology controller distilled from the full map would be the best for their emergent properties such as generalization. However, it is not clear how many teacher robots we need to effectively train a distilled general controller, or which set of pre-trained robots make the best teachers. Future work should investigate how the selection of teachers affects the distilled controllers\u2019 performance and how they should be selected. Lastly, we used the Evogym simulator [1], which is a 2D voxel-based soft robot simulator. The applicability of our method in different types of robots/domains, in 3D, and in real robot scenarios should be investigated in future work to show the generality of our approach. 7"
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14668v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14668v1",
|
| 3 |
+
"title": "Source Localization for Cross Network Information Diffusion",
|
| 4 |
+
"abstract": "Source localization aims to locate information diffusion sources only given\nthe diffusion observation, which has attracted extensive attention in the past\nfew years. Existing methods are mostly tailored for single networks and may not\nbe generalized to handle more complex networks like cross-networks.\nCross-network is defined as two interconnected networks, where one network's\nfunctionality depends on the other. Source localization on cross-networks\nentails locating diffusion sources on the source network by only giving the\ndiffused observation in the target network. The task is challenging due to\nchallenges including: 1) diffusion sources distribution modeling; 2) jointly\nconsidering both static and dynamic node features; and 3) heterogeneous\ndiffusion patterns learning. In this work, we propose a novel method, namely\nCNSL, to handle the three primary challenges. Specifically, we propose to learn\nthe distribution of diffusion sources through Bayesian inference and leverage\ndisentangled encoders to separately learn static and dynamic node features. The\nlearning objective is coupled with the cross-network information propagation\nestimation model to make the inference of diffusion sources considering the\noverall diffusion process. Additionally, we also provide two novel\ncross-network datasets collected by ourselves. Extensive experiments are\nconducted on both datasets to demonstrate the effectiveness of \\textit{CNSL} in\nhandling the source localization on cross-networks.",
|
| 5 |
+
"authors": "Chen Ling, Tanmoy Chowdhury, Jie Ji, Sirui Li, Andreas Z\u00fcfle, Liang Zhao",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.SI",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.SI"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Diffusion AND Model",
|
| 14 |
+
"gt": "Source localization aims to locate information diffusion sources only given\nthe diffusion observation, which has attracted extensive attention in the past\nfew years. Existing methods are mostly tailored for single networks and may not\nbe generalized to handle more complex networks like cross-networks.\nCross-network is defined as two interconnected networks, where one network's\nfunctionality depends on the other. Source localization on cross-networks\nentails locating diffusion sources on the source network by only giving the\ndiffused observation in the target network. The task is challenging due to\nchallenges including: 1) diffusion sources distribution modeling; 2) jointly\nconsidering both static and dynamic node features; and 3) heterogeneous\ndiffusion patterns learning. In this work, we propose a novel method, namely\nCNSL, to handle the three primary challenges. Specifically, we propose to learn\nthe distribution of diffusion sources through Bayesian inference and leverage\ndisentangled encoders to separately learn static and dynamic node features. The\nlearning objective is coupled with the cross-network information propagation\nestimation model to make the inference of diffusion sources considering the\noverall diffusion process. Additionally, we also provide two novel\ncross-network datasets collected by ourselves. Extensive experiments are\nconducted on both datasets to demonstrate the effectiveness of \\textit{CNSL} in\nhandling the source localization on cross-networks.",
|
| 15 |
+
"main_content": "Introduction Source localization aims at locating the origins of information diffusion within networks, which stands as a famous inverse problem to the estimation of information propagation. Source localization not only holds practical significance but also helps us grasp the intricate characteristics of network dynamics. By accurately identifying the sources of information propagation, we can significantly mitigate potential damages by cutting off critical pathways through which information, and potentially misinformation, spreads. Over the past years, existing works have made considerable efforts toward addressing this critical challenge. Earlier works [19, 26, 30, 31] leverage rule-based methods to locate diffusion sources under prescribed and known diffusion patterns. Furthermore, Learning-based methods [7, 15, 24, 25] were proposed to employ deep neural networks to encode neighborhood and graph topology information, which achieve state-of-the-art performance. These efforts underscore the importance of source localization in maintaining the integrity and reliability of information across the digital landscape. Figure 1: Example of misinformation propagation on crossnetwork between GitHub and Stack Overflow, where each node in the GitHub network denotes a repository, and each node in the Stack Overflow represents a discussion thread. Existing techniques for source localization have primarily been designed for single networks. However, much of today\u2019s infrastructure is organized in the form of cross-networks. Communications between different communities, cross-country financial transactions, and systems of water and food supply can all be cross-networks, where the functionality or performance of one network depends on other networks. The presence of cross-networks has also made us vulnerable to various network risks that belong exclusively to crossnetworks, such as the spreading of misinformation from one social media to another and safety alerts found in downstream stages of the food supply chain. The complexity of cross-network interactions is further illustrated by an incident involving a malicious GitHub repository, as detailed in the upper part of Figure 1 and identified in [10], which was linked to over 40 discussion threads on Stack Overflow. Questioners and less experienced users may be directed into using the alleged solution without maintaining a healthy skepticism. Once using the code from the malicious GitHub repository, the victims\u2019 devices might be compromised (e.g., system operations being disrupted). The challenge of tracing the origins and pathways of such misinformation is exacerbated in cross-network environments, where the initial propagation occurs in a network arXiv:2404.14668v1 [cs.SI] 23 Apr 2024 \fChen Ling, Tanmoy Chowdhury, Jie Ji, Sirui Li, Andreas Z\u00fcfle, and Liang Zhao different from where the observations are made, as in the transition from GitHub to Stack Overflow. Furthermore, this complexity is compounded by multiple rounds of propagation and the possibility that contributors to Stack Overflow discussions may not intentionally disseminate misinformation, highlighting the need for more powerful source localization methodologies that account for cross-networks. Cross-network source localization is defined as locating diffusion sources from the source network by only giving the diffused observation of the target network, which is still under-explored. The challenge primarily lies in the separation between the networks where the diffusion originates and where it is observed, making traditional source localization techniques less effective due to the following critical obstacles. 1) The difficulty of characterizing the distribution of diffusion sources only given the diffused observation of another network. Understanding the distribution of potential sources is crucial for understanding the nature of diffusion processes and for quantifying the inherent uncertainties associated with identifying these sources [3, 15, 16]. However, accurately learning the distribution of diffusion sources in a cross-network context requires the formulation of a conditional probability model that accounts for the observed diffusion within one network, given the structural and dynamical properties of another. This task requires fully considering different Network topologies, diverse node features, and varied propagation patterns, which makes the learning objective hard to model and optimize. 2) The difficulty of jointly capturing dynamic and static features of the nodes in the cross-network. Characterizing the distribution of diffusion sources is often conditioned on the intrinsic nature of the nodes and their connections. Existing works hardly leverage node features (e.g., text description and statistical node features) since entangling both types of features would lead to a high-dimensional and often intractable distribution of diffusion sources. Moreover, the nodes from different networks may have different intrinsic characteristics that help profile their diffusion dynamics and can predominantly help locate the sources. 3) The difficulty of jointly capturing the heterogeneous diffusion patterns of the cross-network. Besides the difficulty of learning the distribution of diffusion sources, the diffusion patterns in both networks are also unknown to us. By correctly modeling the overall diffusion process, it is also essential to jointly consider the different propagation patterns of both networks. Additionally, the communication between different networks (i.e., cross-network propagation paths as noted in Figure 1) also cannot be ignored. In this work, we propose the Cross-Network Source Localization (CNSL) method for locating the diffusion sources from a source network given its diffused observation from another target network under arbitrary diffusion patterns. Specifically, for the first challenge, we design a novel framework to approximate the distribution of diffusion sources by mean-field variational inference. For the second challenge, we propose a disentangled generative prior to encoding both static and dynamic features of nodes. For the last challenge, we model the unique diffusion dynamics of each network separately and integrate the learning process of these information diffusion models with the approximation of diffusion source distribution. This ensures accurate reconstruction of diffusion sources considering the specific propagation mechanisms of each network. We summarize our major contributions of this work as follows: \u2022 Problem. We design a novel formulation of the cross-network source localization and propose to leverage deep generative models to characterize the prior and approximate the distribution of diffusion sources via variational inference. \u2022 Technique. We propose a unified framework to jointly capture 1) both static and dynamic node features, and 2) the heterogeneous diffusion patterns of both networks. The approximation of diffusion sources is fully aware of various node features and the interplay of cross-network information diffusion patterns. \u2022 Data. Cross-network source localization lacks high-quality data, which is highly difficult to craft. We collect and curate a realworld dataset that accounts for the Cross-platform Communication Network, which records the real-world misinformation propagation from Github to Stack Overflow. We also provide a simulated cross-network dataset using agent-based simulation to disseminate misinformation across physical and social networks. \u2022 Experiments. We conduct experiments against state-of-the-art methods designed originally for single-network source localization. Results show substantially improved performance of our method for cross-network source localization. 2 Related Works Information Source Localization. Diffusion source localization is defined as inferring the initial diffusion sources given the current diffused observation, which has attracted many applications, ranging from identifying rumor sources in social networks [9] to finding blackout origins in smart grids [22]. Early approaches [19, 26, 31, 32] focused on identifying the single/multiple source of an online disease under the Susceptible-Infected (SI) or Susceptible-InfectedRecover (SIR) diffusion patterns with either full or partial observation. Later on, Dong et al. [7] further leverage GNN to enhance the prediction accuracy of LPSI. However, existing diffusion source localization methods cannot well quantify the uncertainty between different diffusion source candidates, and they usually require searching over the high-dimensional graph topology and node attributes to detect the sources, both drawbacks limit their effectiveness and efficiency. Moreover, in the past few years, more methods [15, 20, 24, 25, 27] have been proposed to address the dependency of prescribed diffusion models and characterize the latent distribution of diffusion sources, which have achieved state-of-the-art results. However, their methods still may not generalize to cross-network source localization due to the unique interconnected structure. Information Diffusion on Cross Network. The interconnection between cross-networks allows information to flow seamlessly from one platform to another through overlapping nodes. However, it is important to note that the patterns of influence and information propagation differ between various networks and can even vary within the same network. Recent studies in information diffusion across interconnected networks have made notable advancements. Earlier works [4, 11, 17, 28] have developed different frameworks for correct modeling of the information flow within different network formats, such as wireless networks, social networks, and supply chains. Later on, many works have been proposed to study different features and applications of cross-networks, e.g., mitigating cascading failures [8, 23]. However, until today, there are few works \fSource Localization for Cross Network Information Diffusion [6, 14] trying to correctly model the information diffusion pattern in the interconnected network system. 3 Cross-network Diffusion Source Localization In this section, the problem formulation is first provided before deriving the overall objective from the perspective of the divergence-based variational inference. A novel optimization algorithm is then proposed to infer the seed nodes given the observed cross-network diffused pattern. 3.1 Problem Formulation Cross-network G = (\ud835\udc3a\ud835\udc60,\ud835\udc3a\ud835\udc61) consists of a Source Network \ud835\udc3a\ud835\udc60= (\ud835\udc49\ud835\udc60, \ud835\udc38\ud835\udc60) and a Target Network \ud835\udc3a\ud835\udc61= (\ud835\udc49\ud835\udc61, \ud835\udc38\ud835\udc61). Both \ud835\udc3a\ud835\udc60and \ud835\udc3a\ud835\udc61are composed of a set of vertices \ud835\udc49\ud835\udc60and \ud835\udc49\ud835\udc61corresponding to individual users of the network as well as a set of edges \ud835\udc38\ud835\udc60\u2286\ud835\udc49\ud835\udc60\u00d7 \ud835\udc49\ud835\udc60and \ud835\udc38\ud835\udc61\u2286\ud835\udc49\ud835\udc61\u00d7 \ud835\udc49\ud835\udc61denote connecting pairs of users in both networks, respectively. In addition, \ud835\udc53\ud835\udc60\u2208R\ud835\udc41\ud835\udc60\u00d7\ud835\udc39and \ud835\udc53\ud835\udc61\u2208R\ud835\udc41\ud835\udc61\u00d7\ud835\udc39and denote the static features of both networks (e.g., associated text embedding, user age, social relations, etc.), where \ud835\udc39denotes the dimension of the node feature, and \ud835\udc41\ud835\udc61, \ud835\udc41\ud835\udc60denote the number of nodes in each network, respectively. To connect the cross-network G, there exists a set of bridge links between\ud835\udc3a\ud835\udc60and\ud835\udc3a\ud835\udc61denoted by \ud835\udc3f= {(\ud835\udc63\ud835\udc60, \ud835\udc63\ud835\udc61)|\ud835\udc63\ud835\udc60\u2208 \ud835\udc49\ud835\udc60, \ud835\udc63\ud835\udc61\u2208\ud835\udc49\ud835\udc61}, which represent the propagation paths from \ud835\udc3a\ud835\udc60to \ud835\udc3a\ud835\udc61. The information propagation in the cross-network is a onedirectional message passing from \ud835\udc3a\ud835\udc60to \ud835\udc3a\ud835\udc61. More specifically, the propagation initiates from a group of nodes denoted as\ud835\udc65\ud835\udc60\u2208{0, 1}\ud835\udc41\ud835\udc60 in the source network \ud835\udc3a\ud835\udc60, where each entry has a binary value representing whether the node is seed or not. After a certain period, the information propagates from \ud835\udc3a\ud835\udc60to \ud835\udc3a\ud835\udc61and infects a portion of nodes in \ud835\udc3a\ud835\udc61through the bridge links \ud835\udc3f. We use \ud835\udc66\ud835\udc61\u2208[0, 1]\ud835\udc41\ud835\udc61to denote the infection probability of each node in \ud835\udc3a\ud835\udc61. Problem 1 (Cross-network diffusion source localization). Given G and the diffused observation of the target network\ud835\udc66\ud835\udc61, the problem of diffusion source localization in cross-networks (i.e., the inverse problem of diffusion estimation) requires finding \u02dc \ud835\udc65\ud835\udc60\u2208{0, 1}\ud835\udc41\ud835\udc60from the source network \ud835\udc3a\ud835\udc60, such that the empirical loss || \u02dc \ud835\udc65\ud835\udc60\u2212\ud835\udc65\ud835\udc60||2 2 is minimized, under the constraint that the diffused observation in the target graph \ud835\udc66\ud835\udc61could be generated from \u02dc \ud835\udc65\ud835\udc60through \ud835\udc3f. However, reconstructing \u02dc \ud835\udc65\ud835\udc60from \ud835\udc66\ud835\udc61is difficult due to the following challenges. 1) The difficulty of characterizing the distribution of seed nodes in the cross-network scenario. To consider all possibilities of the seed nodes in cross-network source localization, it\u2019s desired to model the distribution of seed nodes \ud835\udc5d(\ud835\udc65\ud835\udc60) by characterizing the conditional probability \ud835\udc5d(\ud835\udc65\ud835\udc60|\ud835\udc66\ud835\udc61). However, learning \ud835\udc5d(\ud835\udc65\ud835\udc60|\ud835\udc66\ud835\udc61) requires jointly considering the topology structure of the cross-network G as well as the stochastic diffusion pattern through bridge links \ud835\udc3f. Existing works cannot be directly adapted due to the incapability of considering the complex cross-network scenario. 2) The difficulty of jointly capturing dynamic and static features of the nodes in the cross-network. The intrinsic patterns of the seed nodes consist of both dynamic patterns (i.e., the choice of seed nodes \ud835\udc65\ud835\udc60) and static patterns (e.g., node features \ud835\udc53\ud835\udc60). The correlated factors lead to the high-dimensional and often intractable distribution \ud835\udc5d(\ud835\udc65\ud835\udc60), which makes maximizing the joint likelihood \ud835\udc5d(\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61) to be hard and computationally inefficient. 3) The difficulty of jointly capturing the heterogeneous diffusion patterns of the cross-network. The underlying diffusion process from \ud835\udc65\ud835\udc60to \ud835\udc66\ud835\udc61is not only affected by numerous factors (e.g., the infectiousness of the misinformation and the immunity power of the user), but the propagation patterns in the cross-network are inherently different in different networks. 3.2 Latent Distribution Learning of Seed Nodes To cope with the first challenge of characterizing the distribution of diffusion sources in the cross-network, we propose to utilize graph topology as well as the diffused observation to define the conditional probability \ud835\udc5d(\ud835\udc65\ud835\udc60|\ud835\udc66\ud835\udc61). Since the diffused observation \ud835\udc66\ud835\udc61 is conditioned on both networks G as well as the diffusion source \ud835\udc65\ud835\udc60, we derive a conditional probability \ud835\udc5d(\ud835\udc66\ud835\udc61|\ud835\udc65\ud835\udc60, G) \u00b7\ud835\udc5d(\ud835\udc65\ud835\udc60), where \ud835\udc5d(\ud835\udc65\ud835\udc60) is the distribution of infection sources within \ud835\udc3a\ud835\udc60. To estimate the optimal diffusion source \u02dc \ud835\udc65\ud835\udc60, we employ the Maximum A Posteriori (MAP) approximation by maximizing the following probability: \u02dc \ud835\udc65\ud835\udc60= arg max \ud835\udc65\ud835\udc60 \ud835\udc5d(\ud835\udc66\ud835\udc61|\ud835\udc65\ud835\udc60, G) \u00b7 \ud835\udc5d(\ud835\udc65\ud835\udc60) = arg max \ud835\udc65\ud835\udc60 \ud835\udc5d(\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61|G). However, since \ud835\udc5d(\ud835\udc65\ud835\udc60) is often intractable and entangles both static and dynamic features, we instead leverage deep generative models to characterize the implicit distribution of \ud835\udc5d(\ud835\udc65\ud835\udc60). To tackle the second challenge of jointly considering all static and dynamic node features, we propose a disentangled generative model to map the intractable and potentially high-dimensional \ud835\udc5d(\ud835\udc65\ud835\udc60) to latent embeddings in low-dimensional latent space. Specifically, we aim to learn the conditional distribution \ud835\udc5d(\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61, G|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) of \ud835\udc65\ud835\udc60given two latent variables \ud835\udc67\ud835\udc60and \ud835\udc67\ud835\udc53\ud835\udc60. Specifically, \ud835\udc67\ud835\udc60\u2208R\ud835\udc581 (\ud835\udc581 \u226a\ud835\udc41\ud835\udc60) and \ud835\udc67\ud835\udc53\ud835\udc60\u2208R\ud835\udc582 (\ud835\udc582 \u226a\ud835\udc41\ud835\udc60) are obtained by an approximate posterior \ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61, G), where \ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) is the prior distribution of node\u2019s dynamic and static features. Note that \ud835\udc581 and \ud835\udc582 are the numbers of variables in each group, in order to capture the different types of semantic factors. The goal here is to learn the conditional distribution of \ud835\udc5d(\ud835\udc65\ud835\udc60) given \ud835\udc4d= (\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60), namely, to maximize the marginal likelihood of the observed cross-network diffusion in expectation over the distribution of the latent variable set \ud835\udc4das E\ud835\udc5d\ud835\udf03(\ud835\udc4d) [\ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61, G|\ud835\udc4d)]. For a given observation of the information diffusion in the crossnetwork, the prior distribution of the latent representations \ud835\udc5d(\ud835\udc4d) is still intractable to infer. We propose solving it based on variational inference, where the posterior needs to be approximated by the distribution \ud835\udc5e\ud835\udf19(\ud835\udc4d|\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61, \ud835\udc53\ud835\udc60, G). In this way, the goal becomes to minimize the Kullback\u2013Leibler (KL) divergence between the true prior and the approximate posterior. Moreover, we assume \ud835\udc67\ud835\udc60and \ud835\udc67\ud835\udc53\ud835\udc60capture different semantic factors. Specifically, \ud835\udc67\ud835\udc60is required to capture just the independent dynamic semantic factors of which nodes are infection sources, and \ud835\udc67\ud835\udc53\ud835\udc60is required to capture the correlated semantic factors considering both dynamic features and static node features. To encourage this disentangling property of both posteriors, we introduce a constraint by trying to match the inferred posterior configurations of the latent factors to the prior \ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) by setting each prior to being an isotropic unit Gaussian N (0, 1), leading to the constrained optimization problem as: max \ud835\udf03,\ud835\udf19 E\ud835\udc5e\ud835\udf19(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61,G) h \ud835\udc5d\ud835\udf03 \u0010 \ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61, G|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60 \u0011i , s.t. \ud835\udc3e\ud835\udc3f \u0002 \ud835\udc5e\ud835\udf19(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60, \ud835\udc53\ud835\udc60,\ud835\udc66\ud835\udc61, G)||\ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) \u0003 < \ud835\udc3c. \fChen Ling, Tanmoy Chowdhury, Jie Ji, Sirui Li, Andreas Z\u00fcfle, and Liang Zhao Furthermore, given the assumption that \ud835\udc5d(\ud835\udc67\ud835\udc60) represents the distribution of dynamic node features and \ud835\udc5d(\ud835\udc67\ud835\udc53\ud835\udc60) denotes the distribution of joint node features (entangles with both static and dynamic features), the constraint term can be decomposed as: \ud835\udc5e\ud835\udf19(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60, \ud835\udc53\ud835\udc60,\ud835\udc66\ud835\udc61, G) = \ud835\udc5e\ud835\udf191 (\ud835\udc67\ud835\udc60|\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61, G) \u00b7 \ud835\udc5e\ud835\udf192 (\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc66\ud835\udc61, \ud835\udc53\ud835\udc60,\ud835\udc65\ud835\udc60, G) Then the objective function can be written as: max \ud835\udf03,\ud835\udf19 E\ud835\udc5e\ud835\udf19(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61,G) h \ud835\udc5d\ud835\udf03 \u0010 \ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61, G|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60 \u0011i , (1) s.t. \ud835\udc3e\ud835\udc3f \u0002 \ud835\udc5e\ud835\udf191 (\ud835\udc67\ud835\udc60|\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61, G)||\ud835\udc5d(\ud835\udc67\ud835\udc60) \u0003 < \ud835\udc3c\ud835\udc60, \ud835\udc3e\ud835\udc3f \u0002 \ud835\udc5e\ud835\udf192 (\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc66\ud835\udc61,\ud835\udc65\ud835\udc60, G)||\ud835\udc5d(\ud835\udc67\ud835\udc53\ud835\udc60) \u0003 < \ud835\udc3c\ud835\udc53\ud835\udc60, where we decompose \ud835\udc3cinto two separate parts (i.e., \ud835\udc3c\ud835\udc60and \ud835\udc3c\ud835\udc53\ud835\udc60) of the information capacity to control each group of latent variables so that the variables inside each group of latent variables are disentangled. In practice, \ud835\udc5e\ud835\udf191 (\u00b7) and \ud835\udc5e\ud835\udf192 (\u00b7) are implemented as two encoders with multi-layer perceptron structure. More details can be found in Figure 2. 3.3 Cross Network Diffusion Model Learning To address the third challenge, i.e., making the source localization be aware of the heterogeneous diffusion patterns between networks, locating diffusion origins \ud835\udc65\ud835\udc60may not only involve estimating the distribution of seed nodes but the process should also be determined by correctly modeling the information diffusion across diverse and interlinked network structures G. In the context of cross-network information diffusion, the diffused observation \ud835\udc66\ud835\udc61 is determined by the diffusion source \ud835\udc65\ud835\udc60under the cross-network G through bridge links \ud835\udc3f. Therefore, the conditional distribution \ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61,\ud835\udc65\ud835\udc53, G|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) can further be decoupled as: log\ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61,\ud835\udc65\ud835\udc53, G|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) = log[\ud835\udc5d\ud835\udf13(\ud835\udc66\ud835\udc61|\ud835\udc65\ud835\udc60, G)]+log[\ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60)], where \ud835\udc5d\ud835\udf13(\u00b7) models the probability of the infection status \ud835\udc66\ud835\udc61of nodes in \ud835\udc3a\ud835\udc61given seed nodes \ud835\udc65\ud835\udc60in \ud835\udc3a\ud835\udc60. Moreover, the second term \ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) reveals that the latent variables \ud835\udc4donly encodes information from \ud835\udc65(i.e., \ud835\udc66\ud835\udc61\u22a5\ud835\udc4d|\ud835\udc65\ud835\udc60, G). According to the assumption, we could also simplify both encoders as \ud835\udc5e\ud835\udf191 (\ud835\udc67\ud835\udc60|\ud835\udc65\ud835\udc60, G) and \ud835\udc5e\ud835\udf192 (\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60, \ud835\udc53\ud835\udc60, G) in Eq. (1) by removing \ud835\udc66\ud835\udc61from the input. Cross-network Information Propagation. Modeling the diffusion from \ud835\udc65\ud835\udc60to \ud835\udc66\ud835\udc61is complex due to multiple influencing factors, such as misinformation\u2019s infectiousness and the distinct propagation patterns across networks like GitHub and Stack Overflow, which cater to different user communities. The unknown nature of these diffusion patterns prevents the use of standard models like Linear Threshold or Independent Cascade. This complexity underlines the need to decompose and simplify \ud835\udc5d\ud835\udf13(\ud835\udc66\ud835\udc61|\ud835\udc65\ud835\udc60, G) to analyze the diverse diffusion behaviors in \ud835\udc3a\ud835\udc60and \ud835\udc3a\ud835\udc61through a learning approach: log\ud835\udc5d\ud835\udf13(\ud835\udc66\ud835\udc61|\ud835\udc65\ud835\udc60, G) = log\ud835\udc5d\ud835\udf131 (\ud835\udc66\ud835\udc60|\ud835\udc65\ud835\udc60,\ud835\udc3a\ud835\udc60) + log\ud835\udc5d\ud835\udf132 (\ud835\udc66\ud835\udc61|\ud835\udc66\ud835\udc60,\ud835\udc65\ud835\udc61,\ud835\udc3a\ud835\udc61). (2) In this simplified decomposition, \ud835\udc5d\ud835\udf131 (\u00b7) characterizes the diffusion pattern of \ud835\udc3a\ud835\udc60given the seed nodes \ud835\udc65\ud835\udc60, which is independent of the information propagation in \ud835\udc3a\ud835\udc61. \ud835\udc66\ud835\udc60\u2208[0, 1]\ud835\udc41\ud835\udc60records the infection status of all nodes in the source network \ud835\udc3a\ud835\udc60. When the diffusion is complete in \ud835\udc3a\ud835\udc60, the infection probability is directly transferred to the target network \ud835\udc3a\ud835\udc61through bridge links \ud835\udc3fso that some nodes in \ud835\udc3a\ud835\udc61have initial infection status (denoted as \ud835\udc65\ud835\udc61) to initiate the infection process in \ud835\udc3a\ud835\udc61. The propagation in \ud835\udc3a\ud835\udc61is then modeled by \ud835\udc5d\ud835\udf132 (\ud835\udc66\ud835\udc61|\ud835\udc66\ud835\udc60,\ud835\udc65\ud835\udc61,\ud835\udc3a\ud835\udc61) by taking the graph structure \ud835\udc3a\ud835\udc61and initial seed infection probability \ud835\udc65\ud835\udc61as inputs. More details of the derivation is provided in the Appendix. Monotonic Constraint on Information Diffusion. The information diffusion on the regular network is often regularized by the monotone increasing property [5, 15]. In this work, we also assume the same monotonic property holds in the cross-network information diffusion, namely \ud835\udc66(\ud835\udc56) \ud835\udc61 \u2ab0\ud835\udc66(\ud835\udc57) \ud835\udc61 , \u2200\ud835\udc65(\ud835\udc56) \ud835\udc60 \u2287\ud835\udc65(\ud835\udc57) \ud835\udc60 . Specifically, selecting more seed nodes in \ud835\udc3a\ud835\udc60would result in a generally higher (or at least equal) infection probability of nodes in \ud835\udc3a\ud835\udc60according to the property of diminishing returns. Subsequently, the bridge links would transfer the infection probability from \ud835\udc66\ud835\udc60to \ud835\udc65\ud835\udc61, and similarly, the probability of each node being infected in \ud835\udc66(\ud835\udc56) \ud835\udc61 (estimated from \ud835\udc65(\ud835\udc56) \ud835\udc61 ) should be greater or equal to \ud835\udc66(\ud835\udc57) \ud835\udc61 (estimated from \ud835\udc65(\ud835\udc57) \ud835\udc61 ), such that \ud835\udc66(\ud835\udc56) \ud835\udc61 \u2ab0\ud835\udc66(\ud835\udc57) \ud835\udc61 . Therefore, owing to the monotonic increasing property of the information diffusion, we add the constraint \ud835\udf06 \f \f\f \f max(0,\ud835\udc66(\ud835\udc57) \ud835\udc61 \u2212\ud835\udc66(\ud835\udc56) \ud835\udc61 ) \f \f\f \f2 2, \u2200\ud835\udc65(\ud835\udc56) \ud835\udc60 \u2287\ud835\udc65(\ud835\udc57) \ud835\udc60 , to Eq. (1), where we transform the inequality constraint into its augmented Lagrangian form to minimize \u2225max(0,\ud835\udc66(\ud835\udc57) \ud835\udc61 \u2212\ud835\udc66(\ud835\udc56) \ud835\udc61 ) \f \f\f \f2 2 and \ud835\udf06> 0 denotes regularization hyperparameter. Overall Objective for Training. The training procedure of the proposed CNSL model is coupled with Eq. (1), Eq. (2), and the monotonic increasing constraint: Ltrain = max \ud835\udf03,\ud835\udf191,\ud835\udf192 E\ud835\udc5e\ud835\udf19 \u0002 \ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61,\ud835\udc65\ud835\udc53, G|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) \u0003 , (3) s.t. \ud835\udc3e\ud835\udc3f \u0002 \ud835\udc5e\ud835\udf191 (\ud835\udc67\ud835\udc60|\ud835\udc65\ud835\udc60, G)||\ud835\udc5d(\ud835\udc67\ud835\udc60) \u0003 < \ud835\udc3c\ud835\udc60, \ud835\udc3e\ud835\udc3f \u0002 \ud835\udc5e\ud835\udf192 (\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60, \ud835\udc53\ud835\udc60, G)||\ud835\udc5d(\ud835\udc67\ud835\udc53\ud835\udc60) \u0003 < \ud835\udc3c\ud835\udc53\ud835\udc60, \ud835\udc66(\ud835\udc56) \ud835\udc61 \u2ab0\ud835\udc66(\ud835\udc57) \ud835\udc61 , \u2200\ud835\udc65(\ud835\udc56) \ud835\udc60 \u2287\ud835\udc65(\ud835\udc57) \ud835\udc60 , = min \ud835\udf03,\ud835\udf191,\ud835\udf192,\ud835\udf131,\ud835\udf132 \u2212E\ud835\udc5e\ud835\udf19 \u0002 log\ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) + log\ud835\udc5d\ud835\udf131 (\ud835\udc66\ud835\udc60|\ud835\udc65\ud835\udc60,\ud835\udc3a\ud835\udc60) + log\ud835\udc5d\ud835\udf132 (\ud835\udc66\ud835\udc61|\ud835\udc66\ud835\udc60,\ud835\udc65\ud835\udc61,\ud835\udc3a\ud835\udc61) \u0003 , s.t. \ud835\udc3e\ud835\udc3f \u0002 \ud835\udc5e\ud835\udf191 (\ud835\udc67\ud835\udc60|\ud835\udc65\ud835\udc60, G)||\ud835\udc5d(\ud835\udc67\ud835\udc60) \u0003 < \ud835\udc3c\ud835\udc60, \ud835\udc3e\ud835\udc3f \u0002 \ud835\udc5e\ud835\udf192 (\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60, \ud835\udc53\ud835\udc60, G)||\ud835\udc5d(\ud835\udc67\ud835\udc53\ud835\udc60) \u0003 < \ud835\udc3c\ud835\udc53\ud835\udc60, \f \f\f \f max(0,\ud835\udc66(\ud835\udc57) \ud835\udc61 \u2212\ud835\udc66(\ud835\udc56) \ud835\udc61 ) \f \f\f \f2 2, where we only need to sample one \ud835\udc65(\ud835\udc56) \ud835\udc60 and many \ud835\udc65(\ud835\udc57) \ud835\udc60 \u2019s (such that \ud835\udc65(\ud835\udc56) \ud835\udc60 \u2287\ud835\udc65(\ud835\udc57) \ud835\udc60 ) as training samples for each mini-batch. The \ud835\udc66(\ud835\udc56) \ud835\udc61 and \ud835\udc66(\ud835\udc57) \ud835\udc61 \u2019s are estimated by arbitrary diffusion patterns. For simplicity, we omit the subscript of E\ud835\udc5e\ud835\udf19(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60,\ud835\udc66\ud835\udc61,G) as E\ud835\udc5e\ud835\udf19when the context is clear. The overall framework is summarized in Figure 2. 3.4 Cross-network Seed Set Inference Upon training completion, the joint probability \ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) is approximated by the posterior \ud835\udc5e\ud835\udf19(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60|\ud835\udc65\ud835\udc60, \ud835\udc53\ud835\udc60,\ud835\udc66\ud835\udc61, G). Both \ud835\udc5d\ud835\udf131 (\u00b7) and \ud835\udc5d\ud835\udf132 (\u00b7) effectively classify the diffusion patterns across networks. This study introduces a sampling method for \u02dc \ud835\udc65\ud835\udc60\u223c\ud835\udc5d(\ud835\udc65\ud835\udc60) by marginalizing over \ud835\udc5d(\ud835\udc67\ud835\udc60)\u00b7\ud835\udc5d(\ud835\udc67\ud835\udc53\ud835\udc60) to conduct MAP estimation, where \ud835\udc5d(\ud835\udc65\ud835\udc60) = \u00cd \ud835\udc67\ud835\udc60 \u00cd \ud835\udc67\ud835\udc53\ud835\udc60\ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60)\ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60). However, marginalizing the standard Gaussian prior \ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) necessitates extensive sampling to align the sample distribution with the target distribution, increasing computational load. Additionally, it is also hard to sample \fSource Localization for Cross Network Information Diffusion Figure 2: The training pipeline of CNSL contains three steps: 1) \ud835\udc5e\ud835\udf191 and \ud835\udc5e\ud835\udf192 approximate the distribution of \ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) in a disentangled manner; 2) the inferred latent variables \ud835\udc67\ud835\udc60and \ud835\udc67\ud835\udc53\ud835\udc60are concatenated to reconstruct \u02c6 \ud835\udc65\ud835\udc60; 3) the reconstructed \u02c6 \ud835\udc65\ud835\udc60is leveraged as initial seed nodes to initiate the cross-network information propagation and predict expected diffusion \u02c6 \ud835\udc66\ud835\udc61. individual latent variables from the joint distribution of \ud835\udc5d(\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60). To cope with both challenges, we consider the density over the inferred latent variables induced by the approximate posterior inference mechanism, and we propose the following objective w.r.t. \ud835\udc67\ud835\udc60to infer \u02dc \ud835\udc65\ud835\udc60in an optimized manner. Specifically, the inference objective function Lpred is written as: Lpred = max \ud835\udc67\ud835\udc60 E \u0002 \ud835\udc5d\ud835\udf13(\ud835\udc66\ud835\udc61|\ud835\udc65\ud835\udc60, G) \u00b7 \ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) \u0003 , (4) s.t. \ud835\udc67\ud835\udc60\u223c\ud835\udc5e\ud835\udf191 (\ud835\udc67\ud835\udc60| \u02c6 \ud835\udc65\ud835\udc60, G), \ud835\udc67\ud835\udc53\ud835\udc60\u223c\ud835\udc5e\ud835\udf192 (\ud835\udc67\ud835\udc53\ud835\udc60| \u02c6 \ud835\udc65\ud835\udc60, \ud835\udc53\ud835\udc60, G), = min \ud835\udc67\ud835\udc60 \u2212E h log\ud835\udc5d\ud835\udf13(\ud835\udc66\ud835\udc61|\ud835\udc65\ud835\udc60, G) + log \u0002 \u2211\ufe01 \ud835\udc67\ud835\udc60 \u2211\ufe01 \u02c6 \ud835\udc65\ud835\udc60\ud835\udc5d\ud835\udf03(\ud835\udc65\ud835\udc60|\ud835\udc67\ud835\udc60,\ud835\udc67\ud835\udc53\ud835\udc60) \u0003i s.t. \ud835\udc67\ud835\udc60\u223c\ud835\udc5e\ud835\udf191 (\ud835\udc67\ud835\udc60| \u02c6 \ud835\udc65\ud835\udc60, G), \ud835\udc67\ud835\udc53\ud835\udc60\u223c\ud835\udc5e\ud835\udf192 (\ud835\udc67\ud835\udc53\ud835\udc60| \u02c6 \ud835\udc65\ud835\udc60, \ud835\udc53\ud835\udc60, G), where we sample many \u02c6 \ud835\udc65\ud835\udc60from the training set, and obtain equal amount of \ud835\udc67\ud835\udc60from \ud835\udc5e\ud835\udf191 (\u00b7). Note that we optimize \ud835\udc67\ud835\udc60(dynamic latent variable) only, instead of both \ud835\udc67\ud835\udc60and \ud835\udc67\ud835\udc53\ud835\udc60(static-dynamic entangled latent variable), which is rooted in the specific roles these variables play in the model. \ud835\udc67\ud835\udc60is targeted for optimization because it encodes dynamic information crucial for identifying better seed nodes in the context of information diffusion. This dynamic aspect is mutable and can be optimized to improve source localization accuracy. On the other hand, \ud835\udc67\ud835\udc53\ud835\udc60entangles both dynamic and static information, where the static part represents unchangeable node features. Optimizing \ud835\udc67\ud835\udc53\ud835\udc60would be less efficient because static features, by their nature, cannot be optimized. The optimization process aims to adjust variables to improve model performance, but since static features remain constant, attempting to optimize \ud835\udc67\ud835\udc53\ud835\udc60would not enhance the model\u2019s ability to localize diffusion sources. Implementation of the Seed Set Inference. We provide implementation details of the overall inference process here. Specifically, the inference framework first samples \ud835\udc58seed node set \u02c6 \ud835\udc65\ud835\udc60from the training set, and we can take the average value \u00af \ud835\udc67\ud835\udc60and \u00af \ud835\udc67\ud835\udc53\ud835\udc60from the learned latent distributions with taking \ud835\udc58different \u02c6 \ud835\udc65\ud835\udc60as input: \u00af \ud835\udc67\ud835\udc60= 1 \ud835\udc58 \u2211\ufe01\ud835\udc58 \ud835\udc56\ud835\udc5e\ud835\udf191 (\ud835\udc67\ud835\udc60| \u02c6 \ud835\udc65(\ud835\udc56) \ud835\udc60 , G), \u00af \ud835\udc67\ud835\udc53\ud835\udc60= 1 \ud835\udc58 \u2211\ufe01\ud835\udc58 \ud835\udc56\ud835\udc5e\ud835\udf192 (\ud835\udc67\ud835\udc60| \u02c6 \ud835\udc65(\ud835\udc56) \ud835\udc60 , \ud835\udc53\ud835\udc60, G). (5) We concatenate \u00af \ud835\udc67\ud835\udc60and \u00af \ud835\udc67\ud835\udc53\ud835\udc60as input to minimize the inference loss in Eq. 4. The latent variable \ud835\udc67\ud835\udc60is iteratively optimized according to the inference objective function to minimize \u2212log\ud835\udc5d\ud835\udf13(\ud835\udc66\ud835\udc61|\ud835\udc65\ud835\udc60, G). In practice, Eq. (4) cannot be optimized directly, we thus provide a practical version of the inference objective function: since the diffused observation \ud835\udc66\ud835\udc61fits the Gaussian distribution and the seed set \ud835\udc65\ud835\udc60fits the Bernoulli distribution, we can simplify Eq. (4) as: Lpred = min \ud835\udc67\ud835\udc60\u2212 h log \u0002 \u00d6\ud835\udc41\ud835\udc60 \ud835\udc56=0 \ud835\udc53\ud835\udf03(\ud835\udc67(\ud835\udc56) \ud835\udc60,\ud835\udc67(\ud835\udc56) \ud835\udc53\ud835\udc60)\ud835\udc65(\ud835\udc56) \ud835\udc60(1 \u2212\ud835\udc53\ud835\udf03(\ud835\udc67(\ud835\udc56) \ud835\udc60,\ud835\udc67(\ud835\udc56) \ud835\udc53\ud835\udc60)1\u2212\ud835\udc65(\ud835\udc56) \ud835\udc60\u0003 + \r \r \u02dc \ud835\udc66\ud835\udc61\u2212\ud835\udc66\ud835\udc61 \r \r2 2 i (6) where the \u02dc \ud835\udc66is given as the optimal influence spread (i.e., \u02dc \ud835\udc66\ud835\udc61= \ud835\udc41\ud835\udc61). In other words, the inference objective is guided by the discrepancy between the inferred \ud835\udc66\ud835\udc61and the ground truth \u02dc \ud835\udc66\ud835\udc61. We visualize the overall inference procedure in Figure 2 (b). Specifically, we sample \u00af \ud835\udc67\ud835\udc53\ud835\udc60and \u00af \ud835\udc67\ud835\udc60, according to Eq. (5), and leverage \ud835\udc5d\ud835\udf03(\u00b7) to decode \u02c6 \ud835\udc65\ud835\udc60. The predicted \u02c6 \ud835\udc65\ud835\udc60is leveraged to initiate the cross-network diffusion and predict \u02c6 \ud835\udc66\ud835\udc61. The optimization supervision consists of 1) the mean squared loss between \u02c6 \ud835\udc66\ud835\udc61and the ground truth \ud835\udc66\ud835\udc61as well as 2) the probability of node \ud835\udc63\ud835\udc56being seed node \ud835\udc53\ud835\udf03(\ud835\udc67(\ud835\udc56) \ud835\udc60,\ud835\udc67(\ud835\udc56) \ud835\udc53\ud835\udc60) \u2208[0, 1]. 4 Experimental Evaluation This section reports both qualitative and quantitative experiments that are carried out to test the performance of CNSL and its extensions on a simulated dataset that simulates the spread of misinformation across a city-level population and a collected real-world cross-network dataset obtained by crawling two online networking platforms and cross-references between them. 4.1 Real-world Dataset: Cross-Platform Communication Network We collected real-world data from GitHub and Stack Overflow to form the cross-platform communication network, where information flows from Github to Stack Overflow since many posts in Stack Overflow have mentioned or discussed Github Repositories when addressing user\u2019s questions. We started by downloading the Stack Overflow public data dump provided by the Internet Archive. Then, we extracted all the Stack Overflow posts where their post texts contain a URL to GitHub (i.e., 439,753 posts mapping to 439,753 repositories). We further built the Stack Overflow network by finding the question posts, answer posts, and related posts of the current 439,753 posts. This yielded a total of 1,410,600 Stack Overflow posts, encompassing data from 2008 up to 2023. \fChen Ling, Tanmoy Chowdhury, Jie Ji, Sirui Li, Andreas Z\u00fcfle, and Liang Zhao To obtain the GitHub network, we expanded our initial GitHub network by finding all GitHub repositories that the existing repositories depended upon. We utilized an open-source tool1, which uses the GitHub GraphQL API to obtain the dependency information. The resulting GitHub network contains 533,240 repositories. For our experiment, we sampled GitHub repositories from the year 2021 and their dependent repositories from the year before 2021 (i.e., 1204 nodes and 1043 edges). We then found their corresponding Stack Overflow posts (i.e., 3862 nodes and 3149 edges). We obtained the ground truth in a pseudo-setting: we randomly sampled 10% of the GitHub nodes as seed nodes, and simulated their diffusion process within the GitHub network and the Stack Overflow network (i.e., 120 GitHub seed nodes, 354 GitHub infected nodes, 195 Stack Overflow seed nodes, and 482 Stack Overflow infected nodes). 4.2 Simulated Dataset: Agent-Based Geo-Social Information Spread We leverage and agent-based simulation framework based on realistic Patterns of Life [12, 13] to simulate the spread of misinformation across social and physical networks. In this simulation, an agent represents a simulated individual who commutes to their workplace, eats at restaurants, and meets friends and recreational sites. Inspired by the Theory of Planned Behavior [1] and Maslow\u2019s Hierarchy of Needs [18] as theories of human behavior, agents are driven by physiological needs to eat and have a shelter, safety needs such as financial stability requiring them to go to work, and needs for love requiring them to meet friends and build and maintain a social network. Details of the theories of social science informing this simulation are found in [33] and details to use this simulation for data-generation are described in [2]. We augmented this simulation framework to simulate the spread of misinformation using a simple Susceptible-Infectious disease model. The simulation is initialized with 15,000 agents. A small number of \ud835\udc5b(by default, \ud835\udc5b= 5) agents are selected randomly as the sources of misinformation and flagged as \u201cInfectious\u201d and all other agents are initially flagged as \u201cSusceptible\u201d. Agents can spread misinformation in two ways: 1) through collocation, allowing an agent to spread the misinformation in-person to other agents located at the same workplace, restaurant, or recreational site, and 2) through the social network, allowing an agent to spread misinformation to their friends regardless of their location. To allow the generation of large datasets for source localization, each spreading misinformation is stopped after five simulation days. At this time, the following datasets are recorded: \u2022 Ground Truth. The set of \ud835\udc5bagents that were initially seeded with the misinformation. \u2022 Misinformation Spread. The list of agents to whom the misinformation has spread after five days. \u2022 The Complete Co-location Network. This network captures the agents who meet each other and thus, may spread misinformation through co-location. \u2022 The Observed Co-location Network. This network is a randomly sampled subset of agents from the complete co-location network. It represents the agents in the complete co-location network that are parts of the simulated location tracking. This network is used 1https://github.com/edsu/xkcd2347 to simulate the realistic case of not having access to the location data of every individual. \u2022 The Complete Social Network. This network records the friend and family connections of all agents which may infect each other through social contagion. \u2022 The Observed Social Network. This network includes a randomly sampled subset of agents from the complete social network and simulates the social media environment. This network simulates the realistic case where an observed social media network may not capture the entire population. \u2022 Cross-Network Links through Identity. Links between the two observed networks are defined through identity. Any individual agent in the co-location network is (trivially) connected to itself in the social network. Once this data is collected, the misinformation spread status of all agents is set to \u201cSusceptible\u201d and \ud835\udc5bnew agents are selected as the seed nodes of a new case of misinformation. This process of creating new cases of misinformation is iterated every five simulation days to create an unlimited number of realistic datasets of information spread across the physical and social spaces. For the dataset used for the following experiments, there are 5,281 agents and 8,276 edges in the observed co-location network, and 5,669 agents and 17,948 edges in the observed social network. Each case of misinformation spread yields between 50-200 agents to which the misinformation spreads after five days. This synthetic dataset allows us to capture realistic misinformation spread across both networks. Due to some agents not being captured in the two networks, this dataset allows us to simulate the realistic case where misinformation may spread outside of the observed networks. We provide the code for our agent-based misinformation simulation framework in a GitHub repository found at https://github.com/Siruiruirui/misinformation. This repository also contains the generated dataset used in the following experiments. 4.3 Experiment Setup Implementation Details. We employ a two-layer MLP for learning node features, which are concatenated with the seed vector in the subsequent stage before being input to the encoder \ud835\udc5e\ud835\udf192 (\u00b7). Both encoders (\ud835\udc5e\ud835\udf191 (\u00b7), \ud835\udc5e\ud835\udf192 (\u00b7)) and the decoder \ud835\udc5d\ud835\udf03(\u00b7) utilize threelayer MLPs with non-linear transformations. We use GNN model architecture coupled with a two-layer MLP network as the aggregation network with 64 hidden units for the two propagation models (\ud835\udc5d\ud835\udf131 (\u00b7) and \ud835\udc5d\ud835\udf132 (\u00b7)). The learning rates for encoder-decoder, \ud835\udc5d\ud835\udf131 (\u00b7), and \ud835\udc5d\ud835\udf132 (\u00b7) are set to 0.0001, 0.005, and 0.01 respectively in a multioptimization manner. Additionally, the number of epochs is 15 for all datasets, with a batch size of 2. The iteration numbers for inference are set to 2 for all datasets. Comparison Methods. We illustrate the performance of CNSL in various experiments against two sets of methods: 1) Rule-based methods: LPSI [26] predicts the rumor sources based on the convergent node labels without the requirement of knowing the underlying information propagation model; OJC [31] aims at locating sources in networks with partial observations, which has strength in detecting network sources under the SIR diffusion pattern. 2) Learning-based methods: GCNSI [7] learns latent node embedding with GCN to identify multiple rumor sources close to the \fSource Localization for Cross Network Information Diffusion LT2LT LT2IC LT2SIS Category Method PR RE F1 AUC PR RE F1 AUC PR RE F1 AUC Rule-based LPSI 0.156 0.841 0.263 0.583 0.141 0.849 0.242 0.533 0.079 0.942 0.127 0.497 OJC 0.104 0.035 0.052 0.500 0.116 0.036 0.054 0.502 0.113 0.036 0.053 0.501 Learning based GCNSI 0.103 0.858 0.184 0.636 0.103 0.866 0.184 0.622 0.114 0.801 0.199 0.635 IVGD 0.228 0.948 0.368 0.139 0.227 0.874 0.359 0.138 0.123 0.985 0.215 0.240 SL-VAE 0.249 0.947 0.395 0.703 0.192 0.847 0.313 0.689 0.242 0.931 0.385 0.612 DDMSL 0.251 0.923 0.394 0.815 0.309 0.845 0.454 0.732 0.320 0.842 0.464 0.772 Our Method CNSL 0.332 0.996 0.498 0.888 0.332 0.997 0.498 0.889 0.332 0.997 0.498 0.890 CNSL-W/O 0.103 0.922 0.185 0.520 0.103 0.930 0.186 0.511 0.103 0.917 0.186 0.517 Table 1: Performance comparison for cross-platform communication network under LT diffusion pattern for the first network with LT, IC, and SIS diffusion pattern for the second network. IC2LT IC2IC IC2SIS Category Method PR RE F1 AUC PR RE F1 AUC PR RE F1 AUC Rule-based LPSI 0.124 0.868 0.217 0.489 0.215 0.657 0.324 0.562 0.129 0.906 0.226 0.522 OJC 0.117 0.032 0.050 0.503 0.097 0.027 0.042 0.499 0.115 0.032 0.050 0.502 Learning based GCNSI 0.142 0.638 0.233 0.623 0.170 0.476 0.251 0.627 0.152 0.602 0.243 0.630 IVGD 0.120 0.979 0.210 0.733 0.548 0.391 0.083 0.439 0.115 0.825 0.195 0.733 SL-VAE 0.254 0.881 0.394 0.719 0.195 0.909 0.321 0.703 0.185 0.829 0.302 0.592 DDMSL 0.286 0.827 0.425 0.818 0.318 0.886 0.468 0.753 0.270 0.833 0.408 0.689 Our Method CNSL 0.333 0.990 0.498 0.887 0.333 0.998 0.499 0.891 0.332 0.997 0.498 0.888 CNSL-W/O 0.103 0.922 0.186 0.514 0.103 0.935 0.185 0.515 0.103 0.928 0.185 0.516 Table 2: Performance comparison for cross-platform communication network under IC diffusion pattern for first network with LT, IC, and SIS diffusion pattern for the second network. G2S-A-D0 G2S-B-D0 G2S-A-D1 G2S-B-D1 Category Method PR RE F1 AUC PR RE F1 AUC PR RE F1 AUC PR RE F1 AUC Rule-based LPSI 0.147 0.982 0.256 0.512 0.165 0.954 0.281 0.609 0.152 0.903 0.260 0.475 0.224 0.973 0.364 0.578 OJC 0.053 0.018 0.022 0.496 0.125 0.039 0.051 0.507 0.063 0.040 0.043 0.497 0.115 0.058 0.071 0.505 Learning based GCNSI 0.123 1.000 0.216 0.744 0.117 1.000 0.207 0.351 0.183 1.000 0.300 0.250 0.221 1.000 0.341 0.193 IVGD 0.139 1.000 0.244 0.502 0.138 1.000 0.242 0.500 0.218 1.000 0.352 0.490 0.266 1.000 0.409 0.500 SL-VAE 0.364 0.863 0.512 0.707 0.289 0.788 0.423 0.611 0.289 0.754 0.418 0.664 0.425 0.893 0.576 0.725 Our Method CNSL 0.481 0.816 0.605 0.931 0.452 0.885 0.598 0.933 0.499 0.779 0.609 0.894 0.539 0.987 0.698 0.901 CNSL-W/O S 0.122 1.000 0.219 0.503 0.117 1.000 0.2101 0.488 0.183 0.998 0.309 0.499 0.221 0.999 0.362 0.501 Table 3: Performance comparison for Geo-Social Information Spread Data (G2S) for two types (A, B) of simulation. Here \ud835\udc370 considers the initial sources of misinformation as seed nodes and \ud835\udc371 considers the initial sources of misinformation and the infected agents at the first day as seed nodes. actual source; IVGD [24] propose a graph residual model to make existing graph diffusion models invertible; SL-VAE [15] proposed to learn the graph diffusion model with a generative model to characterize the distribution of diffusion sources. DDMSL [29] proposed a diffusion model-based source localization method to recover each diffusion step iteratively. Note that existing comparison methods are not designed for cross-network source localization, in order to conduct a fair comparison, we repeated each model separately for two networks and learned the two networks. We used bridge links \ud835\udc3fto connect these two models. Evaluation Metrics. Source localization is a classification task so that we use two main metrics to evaluate the performance of our proposed model: 1). F1-Score (F1) and 2). ROC-AUC Curve (AUC), as they are classical metrics for classification tasks. since most realworld scenarios tend to have an imbalance between the number of diffusion sources and non-source nodes (fewer diffusion sources), we additionally leverage PR@100 to evaluate the precision of the top-100 prediction returned by models. 4.4 Quantitative Analysis We evaluated the models in different diffusion configurations. For the cross-platform communication data, the underlying diffusions are LT (Table 1) and IC (Table 2) for the first network which was followed by other three diffusion patterns (LT, IC, and SIS) for the second network in each case. For the Geo-Social information spread data (Table 3), the underlying diffusion pattern has been explained in Section 4.2. For that dataset, we used two different simulations (A and B) and also used two different types of seed selections. Here \ud835\udc370 considers the initial sources of misinformation as seed nodes and \ud835\udc371 considers the initial sources of misinformation and the infected agents on the first day as seed nodes. \fChen Ling, Tanmoy Chowdhury, Jie Ji, Sirui Li, Andreas Z\u00fcfle, and Liang Zhao Performance in the cross-platform communication network. Table 1 shows that CNSL excels others across all metrics and diffusion patterns. In the first network with LT diffusion pattern (LT2LT, LT2IC, LT2SIS), CNSL achieves the highest recall (RE) in all scenarios, with scores of 0.996, 0.997, and 0.997, respectively, indicating its superior ability to identify all relevant instances in the dataset. Additionally, CNSL also exhibits the best precision (PR) in LT2LT and LT2IC scenarios, and competitive precision in the LT2SIS scenario. The F1 scores, which balance precision and recall, are also highest for CNSL, peaking at 0.498 in both LT2LT and LT2IC patterns, demonstrating the method\u2019s overall efficiency and accuracy. The AUC scores for CNSL are robust, ranking highest in LT2LT and LT2SIS scenarios, signifying excellent model performance across various threshold settings. In the Table 2 first network with IC diffusion pattern (IC2LT, IC2IC, IC2SIS), CNSL\u2019s performance remains impressive, maintaining the highest recall scores of 0.990, 0.998, and 0.997, respectively. CNSL also boasts the highest F1 scores in all scenarios, with a notable 0.499 in IC2IC, suggesting a balanced performance between precision and recall. The AUC scores for CNSL are again the highest, with 0.887 in IC2LT and 0.891 in IC2IC, indicating its strong discriminative ability. Overall, CNSL demonstrates considerable strength in reliably identifying relevant instances across different diffusion patterns and networks, while maintaining high precision and excellent area under the ROC curve. Performance in geo-social information spread data. In Table 3, the performance of various methods on Geo-Social Information Spread Data (G2S) is evaluated for two simulation types, A and B, with two different seeding strategies, D0 and D1. Our method, CNSL, exhibits strong performance across all scenarios. In the G2SA-D0 simulation, CNSL achieves a high precision (PR) of 0.481, showing its effectiveness in correctly identifying misinformation spread. It also has the highest F1 score of 0.605 and an AUC of 0.931, indicating a balanced precision-recall trade-off and excellent model discrimination ability, respectively. For the G2S-B-D0 simulation, CNSL\u2019s precision (0.452) and F1 score (0.598) are notable, and the AUC of 0.933 is the highest compared to other methods, suggesting CNSL\u2019s consistency and reliability. In the G2S-A-D1 scenario, CNSL maintains a high recall (RE) of 0.779 and an impressive AUC of 0.894, which signifies its capacity to identify true misinformation cases effectively when the seeding includes infected agents from the first day. Remarkably, in the G2S-B-D1 scenario, CNSL stands out with the highest precision (0.539) and F1 score (0.698), and it achieves an outstanding AUC of 0.901. This demonstrates CNSL\u2019s superior ability to differentiate between misinformation and non-misinformation spread, especially when the initial condition includes both sources of misinformation and infected agents. The recall of 0.987 in this scenario also indicates that CNSL can identify nearly all instances of misinformation spread. Overall, the CNSL method outperforms other rule-based and learning-based methods in most metrics across different simulations and seeding strategies in geo-social networks. Runtime Analysis. Figure 3 presents a runtime comparison among four learning-based methods: CNSL, SL-VAE, GCNSI, and IVGD across ten different diffusion configurations (a to j). CNSL, which is our method, shows a competitive inference time in all datasets when compared to the SL-VAE. In cross-platform communication network datasets (a) LT2LT, b) LT2IC, c) LT2SIS, d) IC2LT, e) IC2IC, and f) a b c d e f g h i j Dataset 0 10 20 30 40 50 60 Inference time (sec) Runtime Comparison CNSL SL-VAE GCNSI IVGD Figure 3: Runtime Comparison with learning based methods for dataset a) LT2LT, b) LT2IC c) LT2SIS, d) IC2LT, e) IC2IC, f) IC2SIS, g) G2S-A-D0, h) G2S-A-D1, i) G2S-B-D0, j) G2S-B-D1 LT2LT LT2IC LT2SIS IC2LT IC2IC IC2SIS Dataset 0.0 0.1 0.2 0.3 PR@100 PR@100 Comparison CNSL SL-VAE Figure 4: Precision@100: the precision rate of the top 100 nodes being predicted as seed nodes. The comparison is conducted between our method: CNSL and the current state-ofthe-art: SL-VAE. IC2SIS)), CNSL demonstrates an inference time that is neither the fastest nor the slowest, indicating a balanced computational demand for these more complex scenarios. However, in datasets geo-social information spread data (g) G2S-A-D0, h)G2S-A-D1, i)G2S-B-D0, and j)G2S-B-D1), CNSL\u2019s runtime is noticeably lower, suggesting that while CNSL is highly effective in identifying misinformation spread. Overall, CNSL shows a strength in providing a good balance between accuracy and computational efficiency. While there are scenarios where CNSL\u2019s runtime is higher, these may correlate with more complex network conditions where deeper analysis is necessary, which CNSL seems to handle without compromising the quality. This makes CNSL a robust method for practical applications where runtime is a critical factor alongside precision and accuracy. Precision analysis at top 100 nodes predicted by models. Figure 4 illustrates the precision at top 100 (PR@100) comparison between CNSL and the state-of-the-art SL-VAE across various diffusion patterns. PR@100 measures the precision rate of the top 100 nodes predicted as seed nodes, indicating how accurately each method can identify the most influential nodes in the spread of information or misinformation. CNSL shows a strong performance in this metric, outperforming SL-VAE in all diffusion patterns. CNSL exhibits higher PR@100 rates, indicating that it is more precise in identifying the key seed nodes. This precision is crucial in scenarios where it is important to quickly and accurately pinpoint the main drivers of information spread within a network. Notably, CNSL\u2019s precision suggests that its algorithm is particularly adept at handling complex diffusion patterns where the identification of influential nodes is more challenging. The strength of CNSL, as highlighted by Figure 4, lies in its ability to consistently rank \fSource Localization for Cross Network Information Diffusion the most relevant nodes higher than SL-VAE. The precision at the top 100 nodes is essential for practical applications where interventions need to be targeted and efficient, such as in the case of misinformation containment or viral marketing. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14671v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14671v1",
|
| 3 |
+
"title": "LaneCorrect: Self-supervised Lane Detection",
|
| 4 |
+
"abstract": "Lane detection has evolved highly functional autonomous driving system to\nunderstand driving scenes even under complex environments. In this paper, we\nwork towards developing a generalized computer vision system able to detect\nlanes without using any annotation. We make the following contributions: (i) We\nillustrate how to perform unsupervised 3D lane segmentation by leveraging the\ndistinctive intensity of lanes on the LiDAR point cloud frames, and then obtain\nthe noisy lane labels in the 2D plane by projecting the 3D points; (ii) We\npropose a novel self-supervised training scheme, dubbed LaneCorrect, that\nautomatically corrects the lane label by learning geometric consistency and\ninstance awareness from the adversarial augmentations; (iii) With the\nself-supervised pre-trained model, we distill to train a student network for\narbitrary target lane (e.g., TuSimple) detection without any human labels; (iv)\nWe thoroughly evaluate our self-supervised method on four major lane detection\nbenchmarks (including TuSimple, CULane, CurveLanes and LLAMAS) and demonstrate\nexcellent performance compared with existing supervised counterpart, whilst\nshowing more effective results on alleviating the domain gap, i.e., training on\nCULane and test on TuSimple.",
|
| 5 |
+
"authors": "Ming Nie, Xinyue Cai, Hang Xu, Li Zhang",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Distillation",
|
| 14 |
+
"gt": "Lane detection has evolved highly functional autonomous driving system to\nunderstand driving scenes even under complex environments. In this paper, we\nwork towards developing a generalized computer vision system able to detect\nlanes without using any annotation. We make the following contributions: (i) We\nillustrate how to perform unsupervised 3D lane segmentation by leveraging the\ndistinctive intensity of lanes on the LiDAR point cloud frames, and then obtain\nthe noisy lane labels in the 2D plane by projecting the 3D points; (ii) We\npropose a novel self-supervised training scheme, dubbed LaneCorrect, that\nautomatically corrects the lane label by learning geometric consistency and\ninstance awareness from the adversarial augmentations; (iii) With the\nself-supervised pre-trained model, we distill to train a student network for\narbitrary target lane (e.g., TuSimple) detection without any human labels; (iv)\nWe thoroughly evaluate our self-supervised method on four major lane detection\nbenchmarks (including TuSimple, CULane, CurveLanes and LLAMAS) and demonstrate\nexcellent performance compared with existing supervised counterpart, whilst\nshowing more effective results on alleviating the domain gap, i.e., training on\nCULane and test on TuSimple.",
|
| 15 |
+
"main_content": "Introduction Lane detection is a fundamental task in any autonomous driving system requiring reasoning about the shape and position of marked lanes and is of great importance for path planning, steering of vehicles and line keeping for the autonomous system. It has been extensively studied in computer vision. Given an image of road scene, the objective of lane detection is to estimate the position lane paints with the best possible accuracy. Existing approaches for lane detection focus on developing discriminative feature representations to classify whether each pixel represents the lane and assign it to its respective instance [1, 2], or explicitly learn from pre-defined proposals and perform a detection task [3\u20135], both in a supervised fashion. Nevertheless, there are still challenges to address in lane detection, including issues related to data availability and cross-domain generalization. Real-world driving scenes often undergo dramatic changes due to different camera sensors, road type, changes in illumination and background clutter. For example, a lane detector trained on the data collected in US west coast would have problem to detect the lanes at London Piccadilly circus. This severely limits their scalability. A naive solution might resolve this problem but would require more data on different types of roads, with accurate annotations even in occluded scenarios, inevitably increasing the annotation costs. In this paper, we study an self-supervised learning strategy, dubbed LaneCorrect, to remedy 1 arXiv:2404.14671v1 [cs.CV] 23 Apr 2024 \fSelf-supervised lane correction Na\u00efve lane detector Unsupervised lane segmentation train test Supervised approach Self-supervised approach point clouds images images annotations (a) (b) Decoder Feature extractor Na\u00efve training (LiDAR is only used here) Self-supervised learning (w/o human labels) Fig. 1 Comparison between our self-supervised lane detection method and the supervised alternative. (a) is the supervised approach, which relies on the human annotations as supervision. (b) is our LaneCorrect, which leverages point clouds to generate noisy lane clues at first and trains a lane correction network in the self-supervised manner. No human annotations are introduced in our approach. above issue (see Figure 1). Conventional unsupervised learning methods attempt to detect lanes by using hand-crafted feature and curve fitting (e.g., hough transform [6] and B-spline fitting [7]), but with little success. Inspired by [8], we propose to detect noisy lane paints by leveraging the large-scale LiDAR point cloud in an unsupervised manner. The special material of road markers paint is always designed to reflect enough vehicle lights to be seen even in the poor light condition. It also shows a distinctive reflectivity difference between bare pavement and lane paint in LiDAR point cloud. Taking usage of this reflectivity distortion around the lane, we can extract candidate lane instances from the 3D points by using the DBSCAN [9] alongside RANSAC [10], and then predict the lanes in the 2D image plane by projecting the 3D points. We can use such noisy lane prediction as pseudo labels to train a na\u00a8 \u0131ve lane detector. However, the noisy labels may impact the quality of the learned lane detector. Hence, we develop a self-supervised algorithm to leverage geometric symmetries of lanes lines and reduce the perturbations of noisy label. In view of the geometric consistency behind the low-density separation assumption [11], i.e., data points of the same cluster are likely to be of the same decision boundary, we train a selfsupervised lane correction (LaneCorrect) model with the RGB image and its noisy label cues as inputs, producing a corrected label without any knowledge of ground-truth annotation. Since inductive geometric symmetries are inherent characteristics of lane annotation, multiple disturbances of the same lane label can be viewed as the multiple additive Gaussian noises applied to the same noise-free annotation. Specifically, we perturb the original pseudo label with two different augmentations and enable the network to be trained and functioned as a correction with a consistency loss. Both predictions are corrected by the network so one prediction can be utilized as another prediction\u2019s label and vice versa. A reconstruction loss is also added to avoid collapsing to trivial solutions [12]. Furthermore, the lane mask pooling followed by a contrastive loss are augmented in the feature representation for instance similarity learning. With the self-supervised pretrained model, we distill it to train a student network on arbitrary target lane detection dataset (e.g., TuSimple) without touching its groundtruth label, to predict the self-supervised trained model\u2019s representation of the same image. Note we do not rely on LiDAR at the inference phase and the noisy label input to our LaneCorrect model comes from the prediction of the na\u00a8 \u0131ve lane detector. The contributions of this work are as follows: (i) We show that the LiDAR view for the lane instance can be utilized as pseudo labels for lane detection and propose an unsupervised 3D lane segmentation method to predict such noisy pseudo labels; (ii) A novel self-supervised training scheme for the noisy lane correction model has been formulated by learning consistency and instance awareness from different augmentations; (iii) With the self-supervised pre-trained model, we distill to train a student network dedicates to predict lanes in arbitrary target datasets without using any annotations; (iv) Extensive experiments on four major lane detection benchmarks demonstrate that our model achieves on-par performance with the supervised rival (pretrained with ImageNet), whilst showing superior performance on alleviating the domain gap, i.e., training on CULane and test on TuSimple. 2 \f2 Related work Unsupervised lane detection and point cloud segmentation. Early works on lane detection are based on unsupervised methods [13] with handcrafted features. They show poor performance and only tackle simple scenes and obvious lanes [6, 7]. Existing unsupervised point cloud segmentation methods can be categorized into four groups: edge-based [14\u201316], region growing [17\u2013 20], model fitting [21, 22] and clustering-based [9, 9, 23\u201326]. In this paper, we investigate distinctive intensity of lanes among surrounding environment under LiDAR points and propose an unsupervised 3D lane segmentation approach. We thus obtain the initial lane predictions in 2D plane by projecting the segmented 3D points. Supervised lane detection Most existing lane detection methods are based on dense prediction approach [2, 27, 28], which treat lane detection as a pixel-level segmentation task. Recently there is a surge of interest in proposal-based methods [3\u2013 5, 29\u201331] to perform efficient lane detection. In addition, there are a few row-wise detection [32] and parametric prediction [33] based methods in the literature demonstrate their superiority on lane detection problem. Learning with noisy annotation. Most existing works on training with noisy annotation employ the strategies of selecting a subset of clean labels [34\u201336] or leverage the output predictions of the network to correct the loss [34, 37, 38]. In this work, we introduce a novel self-supervised training scheme that automatically correct the lane labels by learning consistency and instance awareness from the geometry translation and rotation noise. Leveraging unlabeled data. Recently, some works have explored lane detection algorithms in semi-supervised or unsupervised form. [39] proposed a UDA method from synthetic data to unlabeled target domain. [40] proposed a semisupervised lane detection method in Hough Transform loss. To utilize native autonomous driving scenes data, we propose a novel method in leveraging unlabeled data with the aid of lidar clues. Also, contrastive learning has recently shown great promise [12, 41\u201349] in self-supervised representation learning. Most of the works focus on the image-level representations. However, there has been a increasing interest in learning the instance similarity which is more effective in downstream tasks such as detection and segmentation [50\u201352]. In this paper, we propose an instance similarity learning strategy in the representation level alongside consistency learning to pre-train a lane predictions model without human labels. 3 Method 3.1 Overview Figure 1 provides an overview of our LaneCorrect strategy. It first takes synchronous 2D images and 3D LiDAR frames as inputs. With the proposed unsupervised 3D lane segmentation algorithm, candidate lane instances are extracted from the 3D point clouds and then projected on the 2D image plane as the pseudo labels. Next, considering that the pseudo label generated by the above method has a specific noise (e.g., projection error), a self-supervised lane correction network (SLC) is trained to reduce the noise of the pseudo labels. Finally, we distill the SLC model to train a student lane detector on target domain to perform lane detection task without any annotations. 3.2 Unsupervised 3D lane segmentation We first introduce our unsupervised 3D lane segmentation algorithm. It takes 3D point clouds as input and generate 3D lane instances in LiDAR frames, as shown in Algorithm 1. We denote the input 3D point clouds as P = {(px, py, pz, pi)}, where px, py and pz represent the 3D point coordinates in LiDAR frame, and pi represents the intensity value of this point. First, we use region growing strategy [17] to segment all the input point cloud P, and obtain the ground point cloud PG \u2282P. It is worth mentioning that lane paintings or road surface markings have distinctive intensity pi among their surrounding environment, i.e., asphalt or cement surface with low intensity for the reason that they are painted with special materials to be clearly witnessed even during the night. Therefore, this property leads to an intensity distortion around the lane in the 3D point space. Based on this prior, we filter the ground point clouds by setting a minimum threshold \u03c4 at the intensity to get the preliminary lane candidate points PL \u2282PG. 3 \fAlgorithm 1 unsupervised lane instance clustering Input: laneline candidates PL = {(px, py, pz, pi)} initialization:L \u2190\u2205; i \u21900 L0 = {C0 i }k i=1 \u2190DBSCAN(PL, \u03f51, M1) repeat i \u2190i + 1 calculate the center coordinates (xi, yi) of C0 i for Cj \u2208L do calculate the center coordinates (xj, yj) of Cj if |xi \u2212xj| < \u03f52 and |yi \u2212yj| > \u03f53 then Cj \u2190Cj \u222aC0 i L0 \u2190L0 \\ {C0 i } break end if end for L0 \u2190L0 \\ {C0 i } L \u2190L \u222a{C0 i } until L0 = \u2205 for Cj \u2208L do if count(Cj) < M2 then L \u2190L \\ {Cj} end if end for Output: lane instance clusters L = {Ci}K i=1 For all lane candidate points, to generate 3D lane instance, we use DBSCAN [9] to cluster the segmented candidate points into k clusters {Ci}k i , where the auto-defined k represents the number of lane instances segmented by our method. Finally, to reduce the influence of clustering noise on lane fitting, we used RANSAC [10] to perform curve fitting on each cluster Ci to obtain 3D lane proposals Y = {(px, py, pz)}. These 3D lane instances Y are projected to 2D frames to generate 2D lane coordinates y = {(pu, pv)}, where pu and pv denote the 2D pixel coordinates on 2D image plain. Although the pseudo labels y have considerable accuracy, noise inevitably exists in the annotations, e.g., projection errors in the process from 3D to 2D, as well as missed and mislabelled lanes caused by clustering errors. Training with these noisy labels blindly damages the performance of the lane detectors seriously. 3.3 Self-supervised lane correction network Boosting noisy pseudo labels. We propose a self-supervised lane correction (SLC) network, to improve the quality of the noisy pseudo labels and boost the representation learning for lane detection. The schematic illustration of proposed SLC network is shown in Figure 2. The network takes the noisy results of unsupervised lane segmentation as inputs and performs contrastive learning to consistently correct the noisy annotations. It contains a consistency regularization module and instance similarity learning module. The details of the two modules are introduced in the following. Consistency regularization module. We denote the noisy pseudo annotation and its counterpart, i.e., the potential ground-truth annotation as \u02dc y and ygt respectively, where \u02dc y \u2208{0, 1}H,W and so as ygt. And we assume the noise added to the ground-truth lane annotations, which is introduced during curve fitting and 3D-to-2D projection, as a stochastic transformation matrix s distributed as gaussian noise. Our goal is to learn a function G, which can predict the corresponding invertible geometrical transformation matrix sT given the input image X \u2208R3\u00d7H\u00d7W and the cue of noisy lane labels: G(X, \u02dc y) = sT and ygt = \u02dc y \u00b7 sT . (1) In view of the self-supervised learning, we utilize the unlabeled data and noisy annotations to enforce the trained model to be line with geometry consistency assumption. That is, if a realistic geometrical perturbation was to be applied to the pseudo lane annotation, the predicted inverted transformation should not change significantly. So the multiple disturbances of the same noise-free annotation must be restored to the consistent spatial location in an adversarial manner. In the light of this, we restrict our model to generate consistent predictions for the input with different slightly geometric perturbation. Therefore, we design a dual-student framework to learn to capture the geometrical invariability and reconstruct the potential noise-free lane labels. Following [38, 53], a data augmentation method is used for noisy lane annotations. A pair of lane instances augmented with different geometry noises will be generated by applying rotation and translation operations to the single 4 \fAug 1 c C c C Pseudo Label EMA Consistency regularization Instance similarity learning Backbone Predicted lane mask Lane instance embeddings Input Decoder Intermediate feature maps Refined lane prediction Masked average pooling Output SLC network Online SLC Target SLC Consistency regularization Instance similarity learning Online prediction Target prediction loss Positive Negative pull push Auged view 2 Auged view 1 Aug 2 Fig. 2 Best viewed in color and lane instance number. Our LaneCorrect consists of two collaborative networks, namely online SLC (updated by gradient descend) and target SLC (updated by moving average), to consistently correct the noisy annotation. During training, two different augmented views of pseudo lane annotations are concatenated with images and fed into online and target branches, of which outputs are collected for consistency regularization and instance similarity learning. In consistency regularization, predicted lanes of two branches are constrained to map to the unique noise-free lane locations. In instance similarity learning, multi-objective contrastive learning is adopted to ensure superior lane representation ability. During testing, only online SLC is used to predict refined lanes. lane annotation. To create supervision for missed and mislabelled situations, some lane instances will also be randomly removed or injected. Let G represent our SLC network that consists of a backbone network and a lane prediction head. The network G can be any kind of existing lane detection model, which shows that our framework is highly adaptable. G is designed to predict the corrected lane annotations given images and corresponding noisy annotations. To utilize the pseudo annotation as clue, we augment the original pseudo annotations with symmetrical noise and encode the augmented labels as a binary mask m \u2208{0, 1}H,W . With the RGB image inputs X and the guidance of perturbed annotations mask m, we hope our network G can reconstruct the noise-free lane predictions, which can be written in a general form: \u02c6 y = G(X, m). (2) Since ground truth annotation is inaccessible in unsupervised setting, we propose a consistency regularization method to reconstruct the single unique lane instance given annotation clues which have been augmented in two different manners. In detail, taking two augmented noisy annotationclue masks m1 and m2 as well as the RGB image X as inputs, our SLC model is expected to generate two sets of corrected lane instances \u02c6 y1, \u02c6 y2: ( \u02c6 y1 = G\u03b8(X, m1); \u02c6 y2 = G\u03d5(X, m2), (3) where G\u03b8 is online network updated with gradient, and G\u03d5 is the target network that has the same architecture as the online network. The parameters of target network G\u03d5 are an exponential moving average of the online network G\u03b8. 5 \fThese two sets of corrected lane predictions refer to the same unique ground truth lane annotations on one single image. As a result, corrected lane predictions of one branch of our SLC model can be used to provide supervision for another branch, which can be written as a consistency loss term: Lc = Llane(\u02c6 y1, \u02c6 y2). (4) Llane refers to a general form of lane prediction loss function, which can be specified as any kind of lane detector. Given merely consistency regularization loss, the model will converge to the trivial solution (e.g., generates all-zero lane instance). In order to prevent model collapse, we introduce a reconstruction loss Lr, which enables original pseudo annotation y also being utilized to supervise the online network: Lr = Llane(\u02c6 y1, y). (5) Given regularization loss and reconstruction loss above, our whole consistency regularization loss can be defined as: Lcon = Lc + \u03bbrLr. (6) \u03bbr denotes the penalty term for reconstruction loss, which is set to 1 in the early stage of training. Note that although reconstruction loss does help the model converge in the early training and avoid model collapse, it should be adjusted after \u03f5 epochs since we want the SLC network to output noise-free ground truth annotation instead of original pseudo annotation. An adjust strategy for \u03bbr is defined as: \u03bbr = ( 0, min(IoU(\u02c6 y1, y), IoU(\u02c6 y2, y)) \u22640.5, 1, otherwise. (7) The IoU represents the intersection-of-union score in pixel level. When the prediction results of our SLC network deviate considerably from the given pseudo annotation input y, y is supposed to contain some noise and then reconstruction loss is rejected by setting \u03bbr equal to 0. Otherwise, \u03bbr is set to 1. In our training process, we set \u03f5 to 10. Instance similarity learning module. In the above part, the consistency regularization module is utilized to realize the constraint of the noisy annotations. However, the consistency supervision mentioned above concentrates on the object level, and no effective supervision is provided on the representation level. To address this issue, we introduce an instance similarity learning module in this part to exploit the appearance similarity on representation level and leverage the trained features to perform label correction. We consider all the lanes as positive samples and others negative. By maximizing the representation similarity among different lane instances across online and target branches, further regularization is imposed on our SLC network. After the refined lane annotation \u02c6 y1 is predicted by the network G, a set of corresponding pooling masks {p1|p1 \u2208{0, 1}Hf \u00d7Wf } of the online branch is encoded according to the predicted lane instance locations. p1 is the same width and height as the output feature map f \u2208RCf \u00d7Hf \u00d7Wf of the network G\u2032s backbone and represents positive samples of the online branch. Similarly, corresponding target masks {p2} can also be obtained for the target branch. Then we select the no-lane locations around the predicted lane and encode the negative masks {n}. For every positive mask p, we downsample the feature map f with the average pooling operation: vp = 1 P i,j pi,j p \u00b7 f, vp \u2208RCf . (8) The same calculation is operated on negative masks to get negative vectors vn \u2208RCf . We then transform each of these vectors with a two-layer MLP, yielding non-linear projections zp1, zp2, zn \u2208 Rd. Now we introduce the embedding loss function: Lembed = log[1 + X p2 X n exp(zp1 \u00b7 zn \u2212zp1 \u00b7 zp2)]. (9) The multi-target positive samples {zp2} are pooled from lane masks {p2} generated by the target branch in the whole batch. Together, the noisy label correction module objective can be defined as: L = Lcon + \u03bbembedLembed, (10) where \u03bbembed denotes the penalty term for embedding loss. With the help of instance similarity 6 \fSLC distillation SLC refinement Unlabeled Images Noisy labels Naive lane detector Refined labels Inference SLC Student input output supervise Fig. 3 The pipeline of pseudo label refinement and distillation. To enable our SLC to end-to-end inference and better align downstream datasets, we propose a pseudolabel refinement approach in the form of distillation. learning module, the SLC network can shape lane instance clusters by inheriting advantages of metric learning and leverage the trained features from self-supervised tasks in lane reconstruction. 3.4 Pseudo-label refinement and other details As noticed, the SLC network accepts both RGB images and pseudo label clues as input. Thus, although SLC predicts noise-free lane detection results, it is infeasible for network to perform further end-to-end inference on downstream datasets. To allevaite this dilemma, we propose a distillation approach to promote our SLC network, as is illustrated in Figure 3. In our pseudo-label refinement stage, pseudo annotations are generated by the na\u00a8 \u0131ve lane detector that has been trained on the source dataset as well as our SLC network. The corrected predictions of the SLC model are used as supervision to train a student lane detector. The distilled student is capable to conduct end-to-end inference. Moreover, this procedure can be easily migrated to downstream datasets. For specifically, we transfer both the na\u00a8 \u0131ve lane detector and SLC onto downstream datasets. The na\u00a8 \u0131ve lane detector generates noisy but cheap annotations for the SLC, which SLC takes as input and predicts refined lane labels for further distillation. Finally, the distilled student lane detector is evaluated on the target dataset. During the whole adaptation process, no supervised pre-trained models are required. In fact, for each dataset, there is one lane detector training from scratch. Pre-train Train Test Method dataset label dataset label dataset Supervised ImageNet \u2713 i.e.TuSimple \u2713 i.e.TuSimple Ours Waymo \u2717 i.e.TuSimple \u2717 i.e.TuSimple Table 1 Comparisons of the datasets used between supervised paradigm and our method. \u2713and \u2717represent whether labels are demanded during training. 4 Experiments 4.1 Experimental setting Datasets. We pre-train our LaneCorrect on large-scale Waymo Open dataset [54]. It contains synchronous LiDAR frames and 2D images. To evaluate our proposed method and make fair comparisons, we distill the SLC network on the target domain to train a student lane detector which can be evaluated directly on the testing set. With the help of our self-supervised pre-trained SLC model, the domain gap is alleviated. Note that we do not introduce LiDAR data in the inference phase and no ImageNet pre-trained model is included in our method. Only the supervised counterparts use backbones pre-trained on ImageNet for comparison. The details can be viewed in Table 1. We conduct evaluations on four datasets: TuSimple [55], CULane [27], LLAMAS [56] and CurveLanes [4]. TuSimple: TuSimple is a widely used dataset targeted to solve the lane detection problem on highways. It includes 3626 training video clips and 2782 test video clips. Only good weather conditions and daytime data are given. CULane: CULane is a traffic lane detection dataset collected in Beijing and released by Chinese University of Hong Kong. This dataset provides 133,235 frames form a 55 hours of videos, which is then be divided into training, validation and test set by 88880, 9675 and 34680. Specially, the test set provides abundant scene, including one normal and 8 challenging categories. LLAMAS: LLAMAS is one of the largest lane detection datasets with over 100k images in highway scenarios. This dataset is not manually annotated. Instead, the annotations of LLAMAS were generated automatically using high definition map projections. The testing set annotations have not been released, so the evaluation results on the test set will be computed by the publisher of 7 \fDataset Train Val. Test Scenario Type TuSimple 3k 0.3k 2k Highway CULane 88k 9k 34k Urban&Highway LLAMAS 58k 20k 20k Highway CurveLanes 100k 20k 30k Urban&Highway Table 2 Details of lane detection datasets utilized. LLAMAS, following the CULane metric. CurveLanes: CurveLanes contains 150K images with human annotated lane labels for difficult scenarios in traffic lane detection. In some scenarios of this dataset, the lane detection task is quite complex and challenging due to curve and fork lanes. The details of the datasets can be viewed in Table 2. Implementation details. To generate pseudo 3D lane segmented points and corresponding 2D coordinates, we firstly perform segmentation algorithm on Waymo Open dataset [54]. We only select synchronized 2D images collected by the camera in the front direction and 3D point clouds from the top LiDAR as our inputs. We choose PointLaneNet [3] as our na\u00a8 \u0131ve lane detection network and our supervised baseline, with ResNet101 [57] as backbone in the main results. We additionally run experiments with LaneATT [5] as our baseline in ablation to better prove our framework adaptable to arbitrary lane detectors. During SLC network training, the augmentation method consists of random rotation between \u22125\u25e6and 5\u25e6 and pixel translation of up to 5% of the width of the input image. We apply an adjusting strategy for reconstruction loss weight to prevent the model overfit to pseudo annotations, which has been detailed described in consistency regularization module. The hyper-paremeter \u03bbembed is set to 5 according to ablation study. All other hyperparameter settings follow PointLaneNet [3], and our whole architecture is conducted on 8 Nvidia V100 GPU cards. Details of base lane detector. In our experiments, we adopted anchor-based PointLaneNet [3] as our unsupervised na\u00a8 \u0131ve lane detector, and our lane prediction loss was formulated accordingly. Now we give more details about our lane detector. PointLaneNet [3] can simultaneously perform position prediction and lane classification in a single network. Two 1 \u00d7 1 convolution layers are added on the top of the backbone network, specifying the number of output channels equal to (n+1), where n refers to the number of x coordinate offsets {\u03b4x1, \u03b4x2, ..., \u03b4xn} (fixed y partitions) relative to the center point of the grid, and 1 refers to the starting position (y) of the lane. As for classification, after two 1 \u00d7 1 convolution layers to the end of the feature map, the number of output channels is specified equal to 2, indicating whether the lane passes through the grid. Given ground truth ygt, the objective is to optimize the multi-part loss: Llane(y, ygt) = 1 Ncls w X i=1 h X j=1 Lcls ij (ycls ij , ycls ij, gt) + 1 Nreg w X i=1 h X j=1 lobj ij Lreg ij (yreg ij , yreg ij, gt). (11) Lcls ij (ycls ij , ycls ij, gt) represents the classification confidence loss at anchor (i, j), which is cross-entropy loss between the prediction results and ground truth. For each anchor with the classfication prediction ycls and ycls gt , the confidence loss is written as: Lcls(ycls, ycls gt ) = \u2212 \u0002 ycls gt lnycls + (1 \u2212ycls gt )ln(1 \u2212ycls) \u0003 . (12) Lreg ij (yreg ij , yreg ij, gt) denotes the Euclidean distance between the predicted locations and ground truth at anchor (i, j). In general, each anchor generates the regression prediction yreg = {yreg 1 , yreg 2 , ..., yreg n , yreg pos}, where yreg 1 , yreg 2 , ..., yreg n represent the n offsets prediction and yreg pos represents the starting position of the lane. The loss term can be written as: Lreg(yreg, yreg gt ) = n X k=1 (yreg k \u2212yreg k, gt)2. (13) In our proposed LaneCorrect, we adopt the above lane prediction loss function to formulate our reconstruction loss Lr and consistency loss Lc in our consistency regularization module: Lc(\u02c6 y1, \u02c6 y2) = Llane(\u02c6 y1, \u02c6 y2), (14) 8 \fMethod F1(%)\u2191 ACC(%)\u2191 FPR(%)\u2193 FNR(%)\u2193 Supervised (PointLaneNet) 95.07 96.34 4.67 5.18 Ours (Waymo pre-trained) 83.35 89.34 18.02 12.63 Ours (SLC) 92.91 91.95 6.45 6.58 Table 3 Performance of the proposed method and comparison with counterpart on TuSimple testing set. Supervised PointLaneNet is trained directly using manual annotations. Ours (Waymo pre-trained) is proposed na\u00a8 \u0131ve unsupervised lane detector. Ours (SLC) is further applied noisy lane correction network. Our method achieves considerable performance. and Lr(\u02c6 y1, \u02c6 y2) = Llane(\u02c6 y1, y), (15) where \u02c6 y1 and \u02c6 y2 are lane predictions of online branch and target branch, and y denotes input pseudo annotations. 4.2 Main Results Since there was no previous work addressing unsupervised lane detection task, to conduct comparison fairly, we directly compare our methods with supervised PointLaneNet [3] as counterpart. The comparison shows that our self-supervised method achieves competitive results compared with supervised methods. On LLAMAS val. set, our method even outperforms its supervised counterpart. Ablated effects of pre-training on Waymo. To make fair comparison and address the concern of utilizing extra Waymo [54] dataset, we both conduct experiments with and without SLC network from Table 3 to Table 6. The performance of model without SLC network, i.e., na\u00a8 \u0131ve lane detector simply trained with pseudo labels from Waymo, denotes the potential effects of pre-training on Waymo dataset. Additionally, the SLC network brings significant improvement to the na\u00a8 \u0131ve lane detector, demonstrating the effectiveness of the self-supervised lane detection framework. TuSimple. For TuSimple benchmark, we report both accuracy and F1 score in Table 3. As demonstrated, the gap between method of strongly supervised and our method is quitely small. Especially, our self-supervised method achieves considerable results at 92.91% F1-measure compared with supervised counterpart, which achieves 95.07% at F1-measure. The comparison result demonstrates the efficiency of our proposed framework. CULane. The results on CULane can be seen in Table 4. Our method achieves 55.7% F1score in total. We observed that our LaneCorrect model encounters a more pronounced domain gap on CULane (collected in Beijing) compared to TuSimple (collected in the United States, similar to Waymo). Despite the significant domain disparity between our self-supervised source domain and the target CULane dataset, our unsupervised method with the SLC network achieves a reasonable F1-score compared to its strongly supervised counterpart, without touching any ground truth. The comparison result also demonstrates the SLC network brings significant improvements to our unsupervised method and can effectively alleviate the domain gap. LLAMAS. The performance on LLAMAS is shown in Table 5. Our model is trained only with LLAMAS training images and is evaluated on validation set and official test set. As the results demonstrate, our unsupervised method achieves considerable results at 89.75% F1-measure at testing set and 91.29% at validation set. It is worth noting that, our unsupervised lane detection framework outperforms supervised method on LLAMAS validation set. One of the main reason is that LLAMAS dataset is an unsupervised dataset annotated automatically by highresolution maps and its projection. Due to uncertainty error and projection bias, the annotations generated sometimes are incorrect, which will damage the performance of the lane detector. The incorrect case is also visualized in Figure 4. From the visualization result, we can see that our unsupervised method is able to perform well in mislabeled scenarios. Inputs Annotations LaneCorrect (ours) Fig. 4 Incorrect annotated cases in LLAMAS. Our method can generate correct predictions in these incorrect labeled scenarios. 9 \fMethod Total Normal Crowded Dazzle Shadow No Line Arrow Curve Cross Night Supervised (PointLaneNet) 70.2 88.0 68.1 61.5 63.3 44.0 80.9 65.2 1640 63.2 Ours (Waymo pre-trained) 46.8 57.7 40.9 41.5 35.3 32.4 51.3 48.3 3210 41.5 Ours (SLC) 56.7 69.9 57.1 52.5 49.0 38.4 68.4 53.7 2385 49.0 Table 4 Comparison of F1-measure on CULane testing set. For the Cross scenario, only false positives are shown. The less number means the better performance. Our SLC network can significantly alleviate the domain gap compared with our unsupervised na\u00a8 \u0131ve lane detector. Dataset Method F1(%)\u2191 Precision(%)\u2191 Recall(%)\u2191 Val. Supervised (PointLaneNet) 90.32 96.51 84.87 Ours (Waymo pre-trained) 87.44 89.13 85.81 Ours (SLC) 91.29 92.47 90.13 Test Supervised (PointLaneNet) 95.11 95.17 95.05 Ours (Waymo pre-trained) 85.71 85.24 86.18 Ours (SLC) 89.05 93.95 84.64 Table 5 Comparison on LLAMAS validation and testing set. Our method receives considerable results and even outperforms supervised method on validation set. Method F1(%)\u2191 Precision(%)\u2191 Recall(%)\u2191 Supervised (PointLaneNet) 78.47 86.33 72.91 Ours (Waymo pre-trained) 49.24 68.71 38.37 Ours (SLC) 60.39 62.67 58.27 Table 6 Comparison with counterpart on CurveLanes testing set. Our method shows reasonable result and domain gap has been mitigated by the proposed SLC network. CurveLanes. Table 6 shows the performance of our method on CurveLanes. As the results show, our LaneCorrect achieves considerable results at 60.39% F1-measure, which is a reasonable result compared with supervised method. 4.3 Ablation study In this part of experiment, we evaluate the impact of the major components of our self-supervised SLC model and the variation of other experimental settings. The ablation study is performed on TuSimple dataset. Modules of noisy lane correction network. During training, the SLC network improve the unsupervised na\u00a8 \u0131ve lane detector significantly. In this work, we explore the benefits gained from each part of proposed network. Table 7 shows that the performance is constantly improved with Method F1(%)\u2191 ACC(%)\u2191 FPR(%)\u2193 FNR(%)\u2193 Supervised (PointLaneNet) 95.07 96.34 4.67 5.18 Unsupervised na\u00a8 \u0131ve lane detector 84.08 85.97 13.82 14.10 + reconstruction loss 88.75+4.67 87.82+1.85 9.50-4.32 10.36-3.74 + consistency regularization 91.89+3.14 90.65+2.83 7.03-2.47 7.56-2.80 + instance similarity learning 92.91+1.02 91.95+1.30 6.45-0.58 6.58-0.98 Table 7 Quantitative results of ablation study of our self-supervised noisy lane correction network on TuSimple. As different portions of the proposed SLC network introduced, the gap between our unsupervised method and supervised counterpart is gradually reduced. the gradual introduction of reconstruction loss, consistency regularization and instance similarity learning module. For experiment with reconstruction loss, only the online branch of the SLC network is used. For experiment with consistency regularization, both the branches of the network are used but the embedding head for instance similarity learning is removed. Experiment with contrastive instance similarity learning module is the full version of our LaneCorrect method, which achieves 92.91% F1-score at TuSimple. Efficiency in data utilization. To examine the impact of various amount of data used for pre-training, we randomly sample different portions of Waymo Open dataset according to the video sequence. By conducting this experiment, we prove that efficient data utilization of our selfsupervised SLC method is the main reason why our proposed methods achieve excellent results. As is shown in Figure 6, the performance of both our unsupervised na\u00a8 \u0131ve lane detector and student lane detector distilled by SLC network gradually improves as the amount of data used for training increases. On the other hand, with SLC model, we are able to achieve on par performance with a quite small amount of training data, compared with the whole portion of Waymo Open dataset. This further demonstrates the effectiveness of the proposed SLC network. 10 \fInputs GT Supervised LaneCorrect (ours) Fig. 5 Visualization of LaneCorrect method on multiple benchmarks compared with supervised counterpart. The top row is performance on TuSimple and the bottom row is performance on LLAMAS. The rest middle rows are qualitative results on CULane. For each row, from left to right are: input image, ground truth, results of supervised counterpart and our LaneCorrect. 20 40 60 80 100 Quantity of data (%) 74.0 76.5 79.0 81.5 84.0 86.5 89.0 91.5 94.0 96.5 F1 (%) 92.05 92.33 92.61 92.84 92.91 80.45 81.15 83.39 84.32 84.98 Method w/ SLC w/o SLC Fig. 6 Evaluation results on TuSimple when various amount of data are used for pseudo lane annotations generation. Generalization. Inspired by [58], we perform experiments on cross domain tasks. To test the generalization performance of SLC, the student lane detector distilled by our SLC network on CULane domain is evaluated on TuSimple testing set. We also transfer the supervised PointLaneNet model trained on the CULane training set to TuSimple testing set. Table 8 shows that Method F1(%)\u2191 ACC(%)\u2191 FPR(%)\u2193 FNR(%)\u2193 SIM-CycleGAN+ERFNet * 62.58 98.86 99.09 UFNet * 65.53 56.80 65.46 PINet(4H) * 36.31 48.86 89.88 FOLOLane * 84.36 39.64 38.41 Supervised (PointLaneNet) 16.03 53.27 42.00 44.97 Ours (Waymo pre-trained) 22.53 58.61 38.07 36.83 Ours (SLC) 67.18 85.34 20.11 29.63 Table 8 Comparison about generalization ability with other supervised methods from CULane training set to TuSimple testing set. \u201c*\u201d represents that the results are from original paper [58]. \u201c-\u201d means that the results are not reported. Our method achieves on par performance with SOTA method at accuracy, but has lower FP and FN rates, resulting a much higher F1 than supervised method. compared with supervised method, LaneCorrect achieves excellent progress in generalization, especially in terms of FPR and FNR. Even compared with other state-of-the-art supervised method, our unsupervised framework achieves comparable results, which proves the generalization ability of our method. Extendability. In our main experiments, we choose PointLaneNet as our na\u00a8 \u0131ve lane detector because it is a simple and stable lane detection method. Our SLC network is also based on the PointLaneNet. The design of online and target 11 \fInputs GT LaneCorrect (w/o SLC) LaneCorrect (w/ SLC) Fig. 7 Qualitative performance of SLC network on TuSimple dataset compared with na\u00a8 \u0131ve lane detector. For each row, from left to right are: input image, ground truth, results of unsupervised na\u00a8 \u0131ve lane detector without SLC network and results of our LULA method with SLC network. Inputs GT Supervised LaneCorrect (ours) Fig. 8 Visualization of cross domain performance from CULane to TuSimple. For each row, from left to right are: input image, ground truth, results of supervised counterpart and our LaneCorrect. Baseline Method F1(%)\u2191 ACC(%)\u2191 FPR(%)\u2193 FNR(%)\u2193 PointLaneNet Supervised 95.07 96.34 4.67 5.18 Waymo pre-trained 83.35 89.34 18.02 12.63 Ours (SLC) 92.91 91.95 6.45 6.58 LaneATT Supervised 96.06 96.10 4.64 2.17 Waymo pre-trained 86.75 90.03 14.58 9.87 Ours (SLC) 93.95 93.68 5.41 5.06 CLRNet Supervised 97.62 96.83 2.37 2.38 Waymo pre-trained 88.59 92.16 8.62 6.46 Ours (SLC) 96.91 96.06 2.57 2.72 Table 9 Performance of the proposed method and comparison with counterpart on TuSimple testing set using LaneATT and CLRNet. To make comparison, we report results using PointLaneNet as baseline. branch enables our SLC network to realize regularization on geometric consistency and contrast Method F1(%)\u2191 ACC(%)\u2191 FPR(%)\u2193 FNR(%)\u2193 Noisy pseudo labels 79.68 85.76 15.34 13.87 Na\u00a8 \u0131ve lane detector 82.75 86.53 10.82 11.21 SLC network 92.63 95.88 4.17 3.85 Table 10 Improvements of LaneCorrect algorithm at each step on Waymo. learning in feature representation, so as to correct noisy annotations. To clarify the robust and extendability, we also carry out experiments using LaneATT [5] and CLRNet [30] in Table 9. The LaneATT and CLRNet baseline achieve considerable results at 93.95% and 96.91% in F1measure compared with supervised counterpart. Also as the comparison result demonstrates, when a more efficient supervised baseline is adopted, 12 \f\u03bbembed F1(%)\u2191 ACC(%)\u2191 FPR(%)\u2193 FNR(%)\u2193 1 91.05 89.47 7.86 8.12 5 92.91 91.95 6.45 6.58 10 91.83 90.23 7.17 7.54 Table 11 Ablation studies on hyper-parameter \u03bbembed. Backbone F1(%)\u2191 ACC(%)\u2191 FPR(%)\u2193 FNR(%)\u2193 VGG16 90.83 90.27 7.94 8.15 ResNet18 92.07 91.43 7.23 7.45 ResNet50 92.63 92.07 6.78 6.82 ResNet101 92.91 91.95 6.45 6.58 Table 12 Ablation studies on CNN backbones. the performance of our unsupervised baseline algorithm and SLC network will also be higher accordingly. Improvements of SLC network. We are also interested in assessing the quality of noisy pseudo annotations and examining the enhancements brought about by the SLC network. In this section, we conduct experiments to evaluate the pseudo annotations, the na\u00a8 \u0131ve lane detector, and the SLC network directly on the Waymo dataset, as shown in Table 10. Since Waymo does not provide lane labels, we manually annotate 2000 samples of the Waymo dataset to create a test subset for evaluation. The results demonstrate the performance of refined pseudo labels generated by the SLC network, thus confirming the high quality of the corrected annotations by our method. Choice of loss balance term \u03bbembed. We conduct ablation studies on Tusimple dataset to determine the best setting of \u03bbembed. The ablation result is shown in Table 11. As the ablation result demonstrates, the best choice of hyper-parameter \u03bbembed should be 5. Effects of backbones. To explore the effects of CNN backbones, we conduct the ablation study in Table 12. The largest performance gap, with a difference of 2.08% in F1 score, is observed between ResNet101 [57] and VGG16 [59]. 4.4 Visualization Main visualizations. We have compared the quantified results of LaneCorrect with supervised method on four major lane detection benchmarks. In this section, we present visualization results on multiple datasets in Figure 5. As is shown in Figure 5, our LaneCorrect method demonstrates considerable performance compared with existing supervised counterpart. The top and bottom row present the performance on TuSimple and LLAMAS. The rest middle rows show qualitative results on CULane in different scenarios. The visulizations further prove that our LaneCorrect method achieves considerable results in multiple benchmarks and various driving scenarios, including highway, urban, curves, night and others, which indicates the generalizability of the proposed approach. Effects of SLC network. In the ablation study section of the main paper, we have explored the impact of the SLC network. We now present some qualitative results regarding the impact of the SLC network. As Figure 7 demonstrates, with the help of selfsupervised trained SLC network, the performance of our unsupervised lane detector is substantially improved. The visualization results are generated on Tusimple dataset. The third column shows scenarios in which unsupervised na\u00a8 \u0131ve lane detector predicts incorrectly, and the fourth column shows that with distillation of the self-supervised pre-trained SLC network, our unsupervised lane detector is able to generate correct lane predictions in these cases where na\u00a8 \u0131ve lane detector mispredicts. The first row presents the missing prediction of our na\u00a8 \u0131ve lane detector due to occlusion. However, our SLC network can detect all the lanes correctly. The second row shows the case where na\u00a8 \u0131ve lane detector incorrectly detects the curb as lane and the correct prediction of our method. In the third row, we present our SLC network can automatically refine the inaccurate lane locations predicted by unsupervised na\u00a8 \u0131ve lane detector. It is worth noting that, our SLC network significantly improves the performance of model without SLC, which proves the effectiveness of our self-supervised approach. Generalization. Here we show some qualitative results on cross domain task in Figure 8. The third 13 \fcolumn presents the visualization results of supervised method, PointLaneNet [3], which is strongly supervised trained on the CULane training set and then directly test on TuSimple test set. To test the generalization performance of LULA, we distill SLC network to a student lane detector on CULane and then directly evaluated on TuSimple test set. The performance is shown in the fourth column. As is shown in Figure 8, our LaneCorrect method performs better than that of strongly supervised. The qualitative results show that there are obvious cases of missing and false lane predictions, which proves the performance of supervised learning method is not ideal when transferred to other datasets. One of the main reason is that the over-fitting of training datasets limits the generalization performance of the supervised model. Our unsupervised method achieves excellent results on cross-domain tasks, which proves the generalization ability of our method. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14680v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14680v1",
|
| 3 |
+
"title": "Automated Multi-Language to English Machine Translation Using Generative Pre-Trained Transformers",
|
| 4 |
+
"abstract": "The task of accurate and efficient language translation is an extremely\nimportant information processing task. Machine learning enabled and automated\ntranslation that is accurate and fast is often a large topic of interest in the\nmachine learning and data science communities. In this study, we examine using\nlocal Generative Pretrained Transformer (GPT) models to perform automated zero\nshot black-box, sentence wise, multi-natural-language translation into English\ntext. We benchmark 16 different open-source GPT models, with no custom\nfine-tuning, from the Huggingface LLM repository for translating 50 different\nnon-English languages into English using translated TED Talk transcripts as the\nreference dataset. These GPT model inference calls are performed strictly\nlocally, on single A100 Nvidia GPUs. Benchmark metrics that are reported are\nlanguage translation accuracy, using BLEU, GLEU, METEOR, and chrF text overlap\nmeasures, and wall-clock time for each sentence translation. The best overall\nperforming GPT model for translating into English text for the BLEU metric is\nReMM-v2-L2-13B with a mean score across all tested languages of $0.152$, for\nthe GLEU metric is ReMM-v2-L2-13B with a mean score across all tested languages\nof $0.256$, for the chrF metric is Llama2-chat-AYT-13B with a mean score across\nall tested languages of $0.448$, and for the METEOR metric is ReMM-v2-L2-13B\nwith a mean score across all tested languages of $0.438$.",
|
| 5 |
+
"authors": "Elijah Pelofske, Vincent Urias, Lorie M. Liebrock",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.LG"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "LLM Fairness",
|
| 16 |
+
"gt": "The task of accurate and efficient language translation is an extremely\nimportant information processing task. Machine learning enabled and automated\ntranslation that is accurate and fast is often a large topic of interest in the\nmachine learning and data science communities. In this study, we examine using\nlocal Generative Pretrained Transformer (GPT) models to perform automated zero\nshot black-box, sentence wise, multi-natural-language translation into English\ntext. We benchmark 16 different open-source GPT models, with no custom\nfine-tuning, from the Huggingface LLM repository for translating 50 different\nnon-English languages into English using translated TED Talk transcripts as the\nreference dataset. These GPT model inference calls are performed strictly\nlocally, on single A100 Nvidia GPUs. Benchmark metrics that are reported are\nlanguage translation accuracy, using BLEU, GLEU, METEOR, and chrF text overlap\nmeasures, and wall-clock time for each sentence translation. The best overall\nperforming GPT model for translating into English text for the BLEU metric is\nReMM-v2-L2-13B with a mean score across all tested languages of $0.152$, for\nthe GLEU metric is ReMM-v2-L2-13B with a mean score across all tested languages\nof $0.256$, for the chrF metric is Llama2-chat-AYT-13B with a mean score across\nall tested languages of $0.448$, and for the METEOR metric is ReMM-v2-L2-13B\nwith a mean score across all tested languages of $0.438$.",
|
| 17 |
+
"main_content": "Introduction Large Language Models (LLMs), specifically transformer based architecture [1], have been shown to be incredibly effective at learning tasks that require significant abstraction. Generative Pre-Trained Transformers (GPT) [2] have been used to demonstrate numerous highly consequential learning and information processing tasks [3], including code generation [4\u20136], text summarization [7\u201310], and chemistry experimental design [11]. In this study, we examine the capabilities of GPT models for the task of translating natural language text in an automated black-box fashion. Multi-language translation using GPT models has been investigated before using OpenAI\u2019s GPT models [12], and using deep learning [13]. In this study, we evaluate 16 open source GPT models, run locally and offline in order to assess the effectiveness of black-box translation using current local GPT models. We consider the language translation task of going from 50 natural languages into English text, using the dataset of translated TED talk transcripts. This study is motivated by machine translation being of fundamental interest in computing and information sharing, and given the evident demonstrations of GPT model capabilities, it makes sense to evaluate how well current GPT models perform at this task. Many GPT chat models are available to users as cloud based resources. However, there are significant privacy and security concerns with this model of computation. Therefore, we are interested in using offline, entirely local, GPT inference calls. This also lets us quantify the scale of the computation required for a task such as automated multi-language machine translation in this case we use single A100 GPU\u2019s to perform the inference for each model. Lastly, we aim to evaluate the automated machine translation capabilities of the current GPT models in particular we do not heavily optimize the inference hyperparameters, or the chat prompts. The goal is to measure a reasonably large and language agnostic (e.g., not prompt tuned for each language) benchmark of the translation capabilities of these models. The GPT translation quality is compared against the Google translate API, in Python [14]. \u2217E-mail: elijah.pelofske@protonmail.com 1 arXiv:2404.14680v1 [cs.CL] 23 Apr 2024 \fModel name Reference(s) Context Length Architecture type Model Size zephyr-7b-alpha [15] 32768 Tokens mistral 7.24B params zephyr-7b-beta [15, 16] 32768 Tokens mistral 7.24B params Mistral-7B-Instruct-v0.1 [17] 32768 Tokens mistral 7.24B params Turdus [18] 32768 Tokens mistral 7.24B params vicuna-7b-v1.5 [19, 20] 4096 Tokens llama 7B params phi-2 [21] 2048 Tokens phi 2.78B params phi-1 [22] 2048 Tokens phi 1.3B params phi-1 5 [23] 2048 Tokens phi 1.3B params ReMM-v2-L2-13B [24] 4096 Tokens llama 13B params wizardLM-7B-HF [25] 2048 Tokens llama 7B params wizardLM-13B-1.0-fp16 [25] 2048 Tokens llama 13B params Llama-2-13b-chat-hf [20] 4096 Tokens llama 13B params Llama2-chat-AYT-13B [20, 26] 4096 Tokens llama 13B params TinyLlama-1.1B-Chat-v1.0 [27\u201329] 2048 Tokens llama 1.1B params gpt4all-13b-snoozy [30] 2048 Tokens llama 13B params falcon-7b-instruct [31, 32] 2048 Tokens falcon 7B params Table 1: Summary of the 16 Generative Pre-trained Transformers models used in this study 2 Methods The GPT models used in this study are summarized in Table 1 the model weights were downloaded from huggingface [33], where the trained model weights are open sourced. Each of these GPT models have been fine tuned, with varying levels of success, to be prompted in a chat-type mode. These models run using the PyTorch python library [34]. The context window for the GPT models, summarized in Table 1, is not always clearly defined, but for several of the models the context window is given explicitly in the model weights repository. In other cases, the context window is in the metadata under the parameter max position embeddings, n embd, or is not explicitly stated. No fine-tuning of the model weights is performed, all 16 of these GPT models are evaluated as-is in this black-box benchmarking comparison for language translation. Importantly, the underlying architectures of all of these GPT models rely on a large number of remarkable machine learning developments in recent years, many of which are described in refs. [1, 3, 29, 35\u201338]. The translation dataset is a set of Ted Talk transcripts aggregated by the study in ref. [39]. Specifically, for 50 of the foreign languages in the transcript dataset, 1, 000 of those sentences are translated into English. Due to the nature of the dataset, the same 1, 000 sentences are not necessarily translated across the 50 foreign languages (many of the transcript translations are incomplete). Then, those translated sentences are compared against the corresponding reference English sentence. This GPT translation is performed on a per-sentence basis because, as detailed in Table 1, each of these models have a maximum token context window that is relatively small compared to the size of a complete document (which could be comprised of tens or hundreds of thousands of tokens). Therefore, we apply the translations for each individual sentence primarily to mitigate the problems that arise if we attempt to generate text that has a longer token length than what the GPT model was designed to process. In order to assess the quality of the translations, four metrics are used; METEOR [40], chrF (CHaRacter-level F-score) [41], BLEU (Bilingual Evaluation Understudy) [42, 43], GLEU (General Language Understanding Evaluation) [44]. The METEOR, GLEU, BLEU, chrF and metrics are computed using NLTK [45], using all default hyper-parameters. The metrics are computed after the reference sentence and the translated sentence have been tokenized, all punctuation is removed, and all text is made lower case in order to strictly evaluate the words used for the translation. All four of these metrics are defined to be in between (or equal to) [0, 1], where 1 indicates the translations completely agree and 0 indicates the translated document shares no overlap with the original reference document. Note that even high-quality human translations do not guarantee a score of 1 for all four metrics; generally, it is a difficult task to capture language translation quality [46, 47]. Additionally, the multi-language dataset that is used in this study is a collection of TED Talk video transcripts, which themselves are not guaranteed to always be accurate. Therefore, when analyzing the translation quality metrics, we should not always expect to be able to reach scores of 1, but rather we should be aiming to get closer to 1 than 0. Minimal GPT output postprocessing is applied in the form of removing language-agnostic key phrases from the beginning of the generated text, if it matches certain commonly used phrases that are not the actual content of the 2 \ftranslation, such as This translated text is. The full list of removed phrases is given in Appendix A. For each sentence (regardless of the language of the text), the following text prompt is used in order to prompt the GPT model to translate the sentence into English text using a one-shot inference call. Translate the following sentence into clearly written English text. Respond only with the translated text; do not write explanations or justifications in your reply. Text to be translated The text that we want translated is put where the phrase Text to be translated is in the above prompt example. This prompt is not changed to instruct the GPT model on what the input language is \u2013 meaning that this automated translation method has the advantage of being entirely language agnostic, specifically meaning that language detection does not need to be applied so as to have the translation be performed correctly. Or more specifically, this is the prompting method that is applied to the GPT models with the aim of benchmarking how well they perform at the task of automated, and language agnostic, sentence-wise translation. All of the experimental results reported in this study use this fixed prompt so as to simplify the data analysis (and the total required compute time). This prompt was chosen based on minimal small experimentation with prompts that performed reasonably well but better prompts could likely be found. The GPT model inference is performed using the Python 3 module transformers [33], and each model inference call is performed on a single Nvidia A100 GPU [48] with 82 Gigabytes of memory, with CUDA Version 12.4. The text generation calls are performed using the pipeline method in transformers [33] using all default parameters, except the inference temperature is set to 0.01 which results in nearly deterministic output where the chosen token at each step of the model is very likely to be the highest probability token. The timing of the inference calls is reported using wall-clock time to generate the translation of each sentence. Importantly, multiple inference calls were performed on several GPUs concurrently although the computations were independent, the timing statistics that are reported may be slightly greater than what could be achieved on a completed isolated computing platform with no concurrent GPU computations. Finally, the translation quality from the GPT models is compared against automated translation (performed by supplying only the target language of English) using Google translate. This is performed using a python 3 library [14] that calls the Google translate API. In cases where the output from the Google API is None, the \u201ctranslated\u201d text is set to an empty string (this happened for a couple of sentences, but was not very common). 3 Results Table 2 summarizes the best performing GPT models for translating 50 foreign languages, using the four different translation metrics. Table 2 reports the best mean translation quality per sentence which are given by the rounded value to 3 decimal places. The final aggregate metric of the best performing GPT model across all languages, for each of the language quality metrics, is computed as the mean of the vector of all 50 language scores (this aggregate metric is not weighted by the different amounts of sentences that were translated in the language dataset). Notably, of the 16 GPT models, only a small subset of these was the best performing for any tuple of language and translation quality metric. Specifically, the models that had the best mean scores (for any combination of language and translation quality measure) were; ReMM-v2-L2-13B, Turdus, Llama2-chat-AYT-13B, wizardLM-13B-1.0-fp16, and zephyr-7b-alpha. ReMM-v2-L2-13B was the best performing model overall. Importantly, for each language, the translation scores shown in Table 2 were computed on the exact same translated sentences, but the best performing GPT model was not always the same across the 4 translation quality metrics. On average, the best performing of the 16 GPT models were not always able to generate good translations. The languages that the GPT models scored the lowest on were Mongolian, Burmese, Kazakh, Kurdish, Armenian, and Georgian. Figures 1, 2, 3, 4, and 5 shows detailed performance and wall-clock timing statistics for Spanish, French, Chinese, Arabic, and Hindi \u2013 which are the five most commonly spoken natural languages (besides English). These plots are representative of the expected language translation quality for the most commonly used languages. Figures 6, 7, 8 show detailed per-GPT model performance for Mongolian, Kazakh, and Georgian, which were languages for which the GPT models were unable to produce good translations for, on average. The detailed per-GPT translation metrics and timing statistics for translating all of the other 50 languages into English are enumerated in Appendix B. There are a number of consistent trends seen in the translation quality box-plot figures namely that the three phi models generally have very low accuracy. Llama-2-13b-chat-hf, notably, also consistently has very low 3 \fzephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 10 1 100 101 102 Time [seconds] Spanish to English 0.00 0.25 0.50 0.75 1.00 BLEU Score Spanish to English 0.00 0.25 0.50 0.75 1.00 GLEU Score Spanish to English zephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 0.00 0.25 0.50 0.75 1.00 chrF Score Spanish to English zephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 0.00 0.25 0.50 0.75 1.00 METEOR Score Spanish to English Figure 1: Spanish-to-English dataset per-sentence translation quality and timing statistics for each of the 16 GPT models. Timing is reported in the top sub-plot, on a log scale y-axis, using direct wall-clock compute time to produce the generated text per sentence. Datapoints which are smaller in the time plot mean that the GTP model output took less wall-clock time to generate. The bottom four sub-plots report the distribution of language quality metrics (one datapoint for each sentence), using the four different language quality measures. For all four of the language quality translation plots, scores closer to 1 indicate better translation quality, and scores near 0 indicate bad translation quality. All distributions are shown as box-plot representations, where the red dots indicate outlier points and the blue rectangles indicate the region between the first and third quartile\u2019s, the orange line denotes the median. translation accuracy, which is surprising because nearly all of the best performing models were fine-tuned from Llama-2 models. The mechanism that caused this low accuracy is not clear, but this behavior could be due to the particular prompt that was used and testing other prompts could improve the translation accuracy for future study. In terms of translation speed, the slowest GPT models were phi-1, phi-2, phi-1 5, zephyr-7b-beta, and falcon-7b-instruct. Table 3 shows the mean translation quality metrics, for the four language metrics, across all 50 languages being translated into English, using Google translate. The same test sentences translated by the GPT models, for each language, were also translated using Google translate therefore the entries in Table 3 should be compared against the best performing GPT models in Table 2. These results show the performance of Google translate, using it as a reasonable performance benchmark for automated machine translation of languages. Interestingly, there were exactly two languages where, for at least one of the language metrics (although, in these cases it was for all four language quality metrics), the best performing GPT model had better mean sentence translation quality than google translate. These two languages were French and Chinese. For all other languages, either the best performing GPT model was definitively worse at translating, or was comparable to within a small margin. The languages for which the best performing GPT model and google translate performed marginally the same were German, Spanish, Italian, Russian, Korean, Serbian, Japanese, Ukrainian, Vietnamese, and Bosnian. 4 \fzephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 10 1 100 101 102 103 Time [seconds] French to English 0.00 0.25 0.50 0.75 1.00 BLEU Score French to English 0.00 0.25 0.50 0.75 1.00 GLEU Score French to English zephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 0.00 0.25 0.50 0.75 1.00 chrF Score French to English zephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 0.00 0.25 0.50 0.75 1.00 METEOR Score French to English Figure 2: French-to-English dataset per-sentence translation quality and timing statistics for each of the 16 GPT models. Timing is reported in the top sub-plot, on a log scale y-axis, using direct wall-clock compute time to produce the generated text per sentence. Datapoints which are smaller in the time plot mean that the GTP model output took less wall-clock time to generate. The bottom four sub-plots report the distribution of language quality metrics (one datapoint for each sentence), using the four different language quality measures. For all four of the language quality translation plots, scores closer to 1 indicate better translation quality, and scores near 0 indicate bad translation quality. All distributions are shown as box-plot representations, where the red dots indicate outlier points and the blue rectangles indicate the region between the first and third quartile\u2019s, the orange line denotes the median. 3.1 Translation Quality Metrics and Example Translations The following are some examples where the translations produced by the GPT models are reasonable, but the language quality scores are not very close to 1. These examples are shown with the aim of conveying that the overall translation quality for many of the GPT models is quite good even if the mean language quality scores are on average not incredibly close to 1. Importantly, most of the reason for this is that the translation quality metrics are computed for individual sentences, not the entirety of the translated document and this can lead to unstable measurements of translation quality. However, the mean of the sentence translation quality is a good representation of the overall translation quality \u2013 in particular the language quality metrics over the entire translated corpus are very similar (but not necessarily equal) to the mean of the translation metrics across all of the component sentences. This is an example sentence translation from Spanish into English from the TED talk dataset where the translated sentence has a GLEU score of 0.435, a BLEU score of 0.320, a chrF score of 0.780, and a METEOR score of 0.864. Note that both of these sentences have been tokenized before the score was computed and are shown in their tokenized form. Reference English sentence: this is a viking lander photograph of the surface of mars GPT translated sentence from Spanish into English: this is a photograph from the viking lander on the surface of mars This is another Spanish to English sentence translation where the translated sentence has a GLEU score of 5 \fzephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 10 1 100 101 102 Time [seconds] Chinese to English 0.00 0.25 0.50 0.75 1.00 BLEU Score Chinese to English 0.00 0.25 0.50 0.75 1.00 GLEU Score Chinese to English zephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 0.00 0.25 0.50 0.75 1.00 chrF Score Chinese to English zephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 0.00 0.25 0.50 0.75 1.00 METEOR Score Chinese to English Figure 3: Chinese-to-English dataset per-sentence translation quality and timing statistics 0.427, a BLEU score of 0.379, a chrF score of 0.645, and a METEOR score of 0.725: Reference English sentence: but there is intriguing evidence that suggests that the early history of mars there may have been rivers and fast flowing water GPT translated sentence from Spanish into English: there is intriguing evidence suggesting that the early history of mars may have had rivers and streams of water This is an example sentence translation from Spanish into English which had a GLEU score of 0.481, a BLEU score of 0.429, a chrf score of 0.629, and a METEOR score of 0.735: Reference English sentence: the answer is no there is no liquid water on the surface of mars today GPT translated sentence from Spanish into English: there is no water liquid on the surface of mars today This is an example sentence translation from French into English which had a GLEU score of 0.587, a BLEU score of 0.556, a chrF score of 0.718, and a METEOR score of 0.825: Reference English sentence: i want to talk to you about one of the biggest myths in medicine and that is the idea that all we need are more medical breakthroughs and then all of our problems will be solved GPT translated sentence from French into English: i want to talk about one of the greatest myths of medicine and that is the idea that all we need are additional medical procedures and then all our problems will be solved 6 \fzephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 10 1 100 101 102 Time [seconds] Arabic to English 0.00 0.25 0.50 0.75 1.00 BLEU Score Arabic to English 0.00 0.25 0.50 0.75 1.00 GLEU Score Arabic to English zephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 0.00 0.25 0.50 0.75 1.00 chrF Score Arabic to English zephyr-7b-alpha zephyr-7b-beta Mistral-7B-Instruct-v0.1 T urdus vicuna-7b-v1.5 phi-2 phi-1 phi-1_5 ReMM-v2-L2-13B wizardLM-7B-HF wizardLM-13B-1.0-fp16 Llama-2-13b-chat-hf Llama2-chat-AYT-13B TinyLlama-1.1B-Chat-v1.0 gpt4all-13b-snoozy falcon-7b-instruct 0.00 0.25 0.50 0.75 1.00 METEOR Score Arabic to English Figure 4: Arabic-to-English dataset per-sentence translation quality and timing statistics 4 Discussion and"
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14692v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14692v1",
|
| 3 |
+
"title": "Deep Overlapping Community Search via Subspace Embedding",
|
| 4 |
+
"abstract": "Community search (CS) aims to identify a set of nodes based on a specified\nquery, leveraging structural cohesiveness and attribute homogeneity. This task\nenjoys various applications, ranging from fraud detection to recommender\nsystems. In contrast to algorithm-based approaches, graph neural network (GNN)\nbased methods define communities using ground truth labels, leveraging prior\nknowledge to explore patterns from graph structures and node features. However,\nexisting solutions face three major limitations: 1) GNN-based models primarily\nfocus on the disjoint community structure, disregarding the nature of nodes\nbelonging to multiple communities. 2) These model structures suffer from\nlow-order awareness and severe efficiency issues. 3) The identified community\nis subject to the free-rider and boundary effects. In this paper, we propose\nSimplified Multi-hop Attention Networks (SMN), which consist of three designs.\nFirst, we introduce a subspace community embedding technique called Sparse\nSubspace Filter (SSF). SSF enables the projection of community embeddings into\ndistinct vector subspaces, accommodating the nature of overlapping and nesting\ncommunity structures. In addition, we propose a lightweight model structure and\na hop-wise attention mechanism to capture high-order patterns while improving\nmodel efficiency. Furthermore, two search algorithms are developed to minimize\nthe latent space's community radius, addressing the challenges of free-rider\nand boundary effects. To the best of our knowledge, this is the first\nlearning-based study of overlapping community search. Extensive experiments\nvalidate the superior performance of SMN compared with the state-of-the-art\napproaches. SMN achieves 14.73% improvements in F1-Score and up to 3 orders of\nmagnitude acceleration in model efficiency.",
|
| 5 |
+
"authors": "Qing Sima, Jianke Yu, Xiaoyang Wang, Wenjie Zhang, Ying Zhang, Xuemin Lin",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.SI",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.SI",
|
| 11 |
+
"cs.DB",
|
| 12 |
+
"physics.soc-ph"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "Knowledge AND Graph",
|
| 16 |
+
"gt": "Community search (CS) aims to identify a set of nodes based on a specified\nquery, leveraging structural cohesiveness and attribute homogeneity. This task\nenjoys various applications, ranging from fraud detection to recommender\nsystems. In contrast to algorithm-based approaches, graph neural network (GNN)\nbased methods define communities using ground truth labels, leveraging prior\nknowledge to explore patterns from graph structures and node features. However,\nexisting solutions face three major limitations: 1) GNN-based models primarily\nfocus on the disjoint community structure, disregarding the nature of nodes\nbelonging to multiple communities. 2) These model structures suffer from\nlow-order awareness and severe efficiency issues. 3) The identified community\nis subject to the free-rider and boundary effects. In this paper, we propose\nSimplified Multi-hop Attention Networks (SMN), which consist of three designs.\nFirst, we introduce a subspace community embedding technique called Sparse\nSubspace Filter (SSF). SSF enables the projection of community embeddings into\ndistinct vector subspaces, accommodating the nature of overlapping and nesting\ncommunity structures. In addition, we propose a lightweight model structure and\na hop-wise attention mechanism to capture high-order patterns while improving\nmodel efficiency. Furthermore, two search algorithms are developed to minimize\nthe latent space's community radius, addressing the challenges of free-rider\nand boundary effects. To the best of our knowledge, this is the first\nlearning-based study of overlapping community search. Extensive experiments\nvalidate the superior performance of SMN compared with the state-of-the-art\napproaches. SMN achieves 14.73% improvements in F1-Score and up to 3 orders of\nmagnitude acceleration in model efficiency.",
|
| 17 |
+
"main_content": "INTRODUCTION Identifying a closely interrelated community based on a query node is a long-standing focus within database research. It facilitates extensive applications, including fraud detection [11, 28] and recommender systems [15, 19]. In real-world scenarios, nodes are observed to engage with multiple communities, each exhibiting distinct characteristics such as sizes, connectivity, levels of cohesiveness, and attribute patterns. The overlapping community structure enables each node to interact with more than one community [5, 14, 45]. It\u2019s worth noting that within overlapping environments, not all communities containing the query node are equally valuable for end users. Users value the \u201cpurity\u201d of the identified set of nodes, expecting the model to predictively segregate a Z X Y (a) Original Graph (b) Embedding Space u1 \u00a0 \u00a0 \u00a0 \u00a0 DB\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 AI\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0DM\u00a0 u1 u2 u3 Figure 1: Subspace community embedding selected target community from the overlapping community structures. Therefore, the interactive selection of one target community from the databases becomes essential. For example, Figure 1(a) illustrates a citation network, where communities are defined as different research areas such as Database (DB), Artificial Intelligence (AI), Data Mining (DM), etc. In this illustration, the query node \ud835\udc621 is associated with all three communities. If DB is selected as the target community, the resulting set may involve \ud835\udc622 while ignoring \ud835\udc623 due to the non-targeted joint affiliation of \ud835\udc621 and \ud835\udc623 with DM. Therefore, all the returned papers should at least belong to the DB domain, and papers that solely fall into the DM domain should be excluded. In addition, the intersection between the AI and DB communities becomes highly valuable for individuals interested in cross-domain research, like AI4DB. In this case, the model should allow users to select more than one target community and ensure that only nodes with all specified affiliations are returned. Compared to disjoint community search [15, 23, 28], overlapping community search (OCS) is a more challenging problem and has not received extensive attention in existing learning-based literature. The study of OCS yields potential benefits across various applications. For example, it enables the precise extraction of fraudulent entities from multiple communities [44], the recommendation of products to the most valuable community [30], and the discovery of literature in the cross-domain [34]. Existing solutions. Existing models for CS can be divided into algorithm-based and GNN-based approaches. Algorithm-based models define a community as a cohesive group of nodes (e.g. [12, 16, 33]). However, real-world applications often do not conform to these rule-based algorithms for two reasons. Firstly, predefined cohesive metrics may not accurately reflect real communities. Secondly, these approaches only capture linear attribute-wise patterns and tend arXiv:2404.14692v1 [cs.SI] 23 Apr 2024 \f(a) Free-rider effect (b) Boundary effect u1 u1 Figure 2: Query independency and boundary effect to measure structural cohesiveness and attribute homogeneity independently [23]. Algorithm-based overlap community search is designed to discover multiple subgraphs containing the query node with the same level of cohesiveness or density [5, 14, 45]. Nevertheless, these models typically only consider the overlapping affiliation toward the query node, disregarding that other nodes may also belong to multiple communities. Additionally, the absence of label awareness leads to difficulties in identifying and segregating nodes belonging to the target label [24]. These limitations negatively affect the performance of algorithm-based approaches in downstream tasks, especially in overlapping communities [7, 15, 19]. Existing GNN-based community search models are taskorientated and identify communities using ground truth labels [15, 23, 28]. GNN-based models offer flexibility in structure constraints, allowing them to identify communities by considering higher-order relationships. These models effectively learn non-linear attributewise patterns, distinguishing nodes dependently based on structure and attribute information. Current models are built with Graph Neural Networks (GNNs) [17, 25, 35, 43], such as ICS-GNN [15], QDGNN [23] and COCLEP [28]. ICS-GNN employs an online setting, iteratively crawling a candidate subgraph and conducting the community search for each query. QDGNN proposes an offline approach, introducing a query and a graph encoder to capture local and global patterns. COCLEP extends the QDGNN framework by using contrastive learning to reduce the human effort in labelling. Challenges and our approaches. Although extensive work has been conducted on learning-based community search, three main challenges remain open. 1) Existing GNN-based approaches primarily focus on disjoint community structures, while real-life communities often overlap. Within an overlapping structure, current models tend to group nodes together if they share any joint affiliation. This design fails to distinguish nodes from overlapping communities, compromising the purity of the identified set. 2) Existing models primarily use GNN layers for propagation, suffering challenges related to slow training and low-order awareness (oversmoothing) [4, 46]. These constraints restrict the depth of the model to a small number of layers (typically no more than three), limiting the model\u2019s receptive field. 3) The free-rider [42] and the boundary effects compromise the quality of the identified community. ICS-GNN and QDGNN identify communities using the GNN score, representing the probability that nodes have the same community label as the query. This approach is subject to the free-rider effect, causing query-independency, and often fails to identify the optimal set of nodes. For example, in Figure 2(a), given\ud835\udc621 as the query, these approaches tend to return a group of nodes represented by the red circle. The returned set contains nodes with the highest probability of belonging to a specific community label. However, it may not be inherently query-related, as there exists a group of nodes (depicted by the green circle) demonstrating closer relations to\ud835\udc621. In contrast, COCLEP defines the community as a set of nodes surrounding the query in the embedding space. Under this definition, the identified community is affected by the boundary effect, as the query node is not always at the centre of the community, as shown in Figure 2(b). To address the aforementioned challenges, we propose Simplified Multi-hop Attention Network (SMN), a light yet effective model. Overlapping communities. To tackle the challenge of identifying and segregating nodes with overlapping community affiliations, we introduce a subspace community embedding technique named Sparse Subspace Filter (SSF). SSF is implemented as a sparse matrix, representing each community by a sparse embedding. Using sparse vectors to represent communities will enable node embeddings to fall into multiple subspaces simultaneously, effectively addressing the overlapping community structure. Figure 1(b) illustrates an example of learned subspace embeddings. As \ud835\udc621 belongs to three communities, it can be projected into three subspaces: green (the Z-Y plane), red (the X-Y plane), and blue (the X-Z plane). These subspaces denote the node affiliation of the respective research areas. When searching for a target community, the learnt sparse community embeddings are used as a basis vector to project nodes into the underlying subspace. The community search is then conducted exclusively within the target subspace. In addition, the proposed technique can be extended to the scenario with multiple target communities, efficiently identifying the intersection between communities without the need to enumerate the entire graph for community affiliations. Low-order awareness and slow training. In order to combat the oversmoothing issue, we propose a hop-wise attention mechanism that assigns weights to multichannel inputs collected from different hops. Instead of uniformly aggregating messages from nodes with different hop distances, the hop-wise attention controls the aggregation. This mechanism addresses the oversmoothing problem by assigning lower weights to the hops with minimal contribution, assisting in the differentiation of nodes across various communities. This approach ensures robustness against oversmoothing and maintains adaptability in the model receptive fields, capturing highorder patterns. To enhance model training efficiency, we replace the expensive query encoder with a simplified framework. By removing the non-linear activation between layers and aggregating neighbourhood information during preprocessing, the optimisation speed of the model is significantly improved. Free-rider and boundary effect. To ensure that the identified community is query-dependent and robust to the boundary effect, we first propose a community search algorithm named subspace top-\ud835\udc58 similarity search (Sub-Topk). Like COCLEP, the algorithm identifies a community by measuring the node similarity to the query. Comparatively, leveraging the subspace embeddings, the similarity is measured by projecting node embeddings into the target subspace. During this projection, irrelevant dimensions are converted to zero. Sub-Topk then searches for \ud835\udc58nodes that exhibit the highest similarity within the targeted subspace. This implies that the difference in the irrelevant dimensions among nodes will be ignored when measuring similarity. The algorithm effectively addresses the boundary 2 \feffect, in which nodes from other communities tend to demonstrate lower similarities by projecting into the target subspace. Therefore, it eliminates the noise from other shared community affiliations and exclusively focuses on the target. To further improve it, we propose a spatial-aware algorithm called subspace cohesive community search (Sub-CS). The algorithm aims to minimise the community \u201cradius\u201d within the target subspace. In this context, the \u201cradius\u201d is measured by internal similarity among community members. These two proposed algorithms operate based on different scenarios, demonstrating notable model efficiency and effectiveness. Contributions. The main contributions of this paper are summarised as follows: \u2022 To the best of our knowledge, we are the first to formally define the problem of overlapping community search in deep learning. We further propose the subspace community embedding technique for OCS, which is also efficient in finding the intersection among multiple communities. \u2022 We propose the Simplified Multi-hop Attention Network, which captures high-order patterns by mitigating the oversmoothing issue while preserving model training efficiency. \u2022 We analyse the limitations of existing search algorithms and develop two query-related subspace search algorithms while addressing the free-rider and boundary effects. \u2022 Extensive experiments are conducted on 4 disjoint and 9 overlapping community datasets. The results demonstrate the proposed model and algorithms outperform state-of-theart methods in the F1-Score by 5.85% on disjoint community search and 14.73% on overlapping community search. Additionally, our approach improves model training and online query efficiency by 3 and 2 orders of magnitude. 2 PRELIMINARIES 2.1 Problem Definition Let \ud835\udc3a= (\ud835\udc49, \ud835\udc38) be an undirected graph with a set \ud835\udc49of nodes and a set \ud835\udc38of edges. Let \ud835\udc5b= |\ud835\udc49| and \ud835\udc5a= |\ud835\udc38| be the number of nodes and edges, respectively. Given a node \ud835\udc62\u2208\ud835\udc49, \ud835\udc41(\ud835\udc62) = {\ud835\udc63|(\ud835\udc62, \ud835\udc63) \u2208\ud835\udc38} is the neighbour set of \ud835\udc62. The adjacency matrix of \ud835\udc3ais denoted as \ud835\udc68\u2208{0, 1}\ud835\udc5b\u00d7\ud835\udc5b, where \ud835\udc68\ud835\udc56,\ud835\udc57= 1, if (\ud835\udc63\ud835\udc56, \ud835\udc63\ud835\udc57) \u2208\ud835\udc38, otherwise \ud835\udc68\ud835\udc56,\ud835\udc57= 0. \ud835\udc7f= {\ud835\udc7f1, \ud835\udc7f2, ..., \ud835\udc7f\ud835\udc5b} is the set of node features and \ud835\udc7f\ud835\udc56represents the node features of\ud835\udc63\ud835\udc56. Given a query node\ud835\udc5e, the CS problem aims to find a \ud835\udc58-sized set of nodes containing the query from \ud835\udc3a[15, 23, 28]. Under the overlapping community structure, each node\ud835\udc62belongs to more than one community, i.e., \ud835\udc62\u2208C\ud835\udc62= {\ud835\udc36\ud835\udc671 \ud835\udc62,\ud835\udc36\ud835\udc672 \ud835\udc62, ...,\ud835\udc36\ud835\udc67\ud835\udc56 \ud835\udc62}, where C\ud835\udc62is the set of communities contains \ud835\udc5e, and \ud835\udc67\ud835\udc56\u2208\ud835\udc4dis the label of a community. Users are allowed to select a target community label \ud835\udc61\u2208\ud835\udc4dto guide the community search. Definition 2.1 (Overlapping Community Search, OCS). Given a graph \ud835\udc3a, a query node \ud835\udc5e, a community size \ud835\udc58, and a target community label \ud835\udc61\u2208\ud835\udc4d, OCS aims to identify a \ud835\udc58-sized group of nodes that belongs to the target community \ud835\udc36\ud835\udc61 \ud835\udc5e. Under this definition, the user is only interested in a single community, i.e., the target community. However, due to the complexity of the overlapping structure, a single target community might not be adequate when describing a desired group of nodes. It is often preferable to define a more refined community by considering the intersection of multiple target groups. Therefore, we extend OCS by introducing the following definition to enhance flexibility. Definition 2.2 (Overlapping Communities Intersection Search, OCIS). Given a graph \ud835\udc3a, a query node \ud835\udc5e, a community size \ud835\udc58, and multiple target community labels \ud835\udc7b\ud835\udc92= {\ud835\udc611,\ud835\udc612, ...,\ud835\udc61\ud835\udc56} \u2208\ud835\udc4d, OCIS aims to search for the user-specified intersection set \u02c6 \ud835\udc6a\ud835\udc5eof size \ud835\udc58 such that \u02c6 \ud835\udc6a\ud835\udc5e\u2286\ud835\udc6a\ud835\udc611 \ud835\udc5e\u2229\ud835\udc6a\ud835\udc612 \ud835\udc5e\u2229... \u2229\ud835\udc6a\ud835\udc61\ud835\udc56 \ud835\udc5e. Within this definition, it is important to note that the target group may not be assigned a distinct label within the ground truth data. The intersection of multiple communities represents a refined community valuable to end users. It is worth mentioning that employing a brute-force approach, which involves enumerating all nodes for community prediction and then joining multiple communities to determine the intersection, is an impractical strategy. Therefore, we aim to efficiently identify the intersection without enumerating the dataset. In this research, the overlapping community search task operates in a semi-supervised framework. Commencing with a graph represented as \ud835\udc3a(\ud835\udc49, \ud835\udc38), the model is trained on a small fraction of the dataset. Given a query node \ud835\udc5eand a community size \ud835\udc58, the model leverages its training to predict community affiliations. Following this prediction, the user is allowed to select one or more communities as their target. Subsequently, a community of size \ud835\udc58 is identified, aligning with the user-specified requirements. 2.2 Graph Convolutional Network The graph convolutional network (GCN) [25] is the most commonly employed variant of GNN, employing a low-pass filter (the first-order adjacency matrix) to gather information solely from its neighbours rather than all local nodes. The propagation process is represented as Equation 1: \ud835\udc6f(\ud835\udc59+1) = \ud835\udf0e( \u00af \ud835\udc6b\u22121 2 \u00af \ud835\udc68\u00af \ud835\udc6b\u22121 2 \ud835\udc6f\ud835\udc59\ud835\udc7e\ud835\udc59), (1) where \ud835\udc6f\ud835\udc59is the hidden state from the previous layer, \u00af \ud835\udc6bis the normalised degree matrix, \u00af \ud835\udc68is the adjacency matrix with self-loop, \ud835\udc7e\ud835\udc59 is the learnable weight matrix and \ud835\udf0eis an activation function. \u00af \ud835\udc68\ud835\udc6f\ud835\udc59 demonstrates how a node aggregates information from its onehop neighbours, aggregation functions include sum(\u00b7), mean(\u00b7), max(\u00b7), and linear(\u00b7). The activation functions add non-linearity between layers and prevent multiple linear functions from collapsing into a single one. Common activation functions include ReLU(\u00b7), sigmoid(\u00b7), and LeakyReLU(\u00b7). Loss is computed by comparing the model output with the ground truth and using backpropagation to update model parameters iteratively. In contrast to other deep learning models, a deeper GCN does not enhance its expressiveness. With each additional layer, the receptive field of the GCN expands by one hop. Deeper models lead nodes to aggregate information from the entire graph, diminishing its ability to distinguish nodes, known as oversmoothing [27]. 3 SMN VIA SUBSPACE EMBEDDING This section elaborates on the design details of the proposed SMN across the three aforementioned components: simplified multi-hop 3 \fX, AX, ...AkX Node Embeddings \u00a0 .... n\u00a0x s Subspace Community Embeddings Propagation\u00a0 Subspace Community Search Attention Layer Hop-wise Attention Pre-attention Multi-head filter Sparse Subspace Filter (SSF) \u00a0s x c Stack A0, A1, A2, ... Ak\u00a0 Ak Preprocessing X .... Classification Loss Spatial Loss Prediction Output \u00a0 Query Set:\u00a0 Figure 3: The architecture of SMN attention, subspace community embedding, and subspace community search. We first introduce the framework of SMN to establish a comprehensive understanding. Subsequently, we present the simplified multi-hop attention by introducing the preprocessing and propagation stages of the model. The subspace community embedding is then explained, followed by the implementation details of subspace community search algorithms. 3.1 Framework Figure 3 presents the framework of SMN, which consists of three main components, including preprocessing, propagation, and subspace community embedding. During preprocessing, SMN generates multichannel input by stacking messages from different hops. Aggregating neighbourhood information during preprocessing eliminates the need for the expensive message-passing stage during the model propagation. The propagation stage consists of three layers: a pre-attention layer, a hop-wise attention layer, and a multi-head filter layer. The pre-attention layer inputs the original features from each hop to linearly transform the multi-hop messages. The messages are then fused into single-channel messages through a hop-wise attention layer. The resulting outputs are further transformed through a multi-head filter layer, yielding the final embeddings. The hop-wise attention mechanism assigns decaying weights to messages from various hops based on their contributions, effectively addressing the oversmoothing issue. A sparse subspace filter (SSF) is a trainable matrix with the shape of (\ud835\udc60,\ud835\udc50), where \ud835\udc60is the dimension of the final node embeddings, and \ud835\udc50is the total number of communities. Each column in SSF is trained to represent the embedding for the underlying community. The model parameters and SSF are updated through classification loss and spatial loss. The sparse community embeddings in SSF effectively address the challenges of segregating a specific community, benefiting overlapping community search. Upon completion of the training process, the query node, the final embeddings, and SSF are input into the search algorithm. Given a query node, the community can be identified by seeking highly correlated nodes within the specified subspace. Notably, the proposed search algorithm is querydependent while mitigating the boundary effect. Further details on each component will be provided in the subsequent sections. 3.2 SMN: Preprocessing and Propagation Preprocessing. The preprocessing stage can be split into aggregation and normalisation. Inspired by the works [40, 41], SMN removes the non-linear activation function during aggregation to improve the model convergence speed. As proved by Wei et al. [40], linear propagation performs similarly to non-linear propagation, especially when graph structures are more informative. A two-layer GCN can be represented as Equation 2: \ud835\udc81= softmax( \u02c6 \ud835\udc68\u00d7 ReLU( \u02c6 \ud835\udc68\ud835\udc7f\ud835\udc7e(0))\ud835\udc7e(1)), (2) where \ud835\udc81is the final output, softmax is a classifier that maps the probability of nodes belonging to different classes. ReLU(\u00b7) is the activation function to provide nonlinearity to the model. \u02c6 \ud835\udc68denotes the degree normalised adjacent matrix, \ud835\udc7fis a matrix storing all node features and \ud835\udc7eis a learnable matrix. \ud835\udc7e0\ud835\udc7e1 represents weighted matrices for different layers of the networks. By removing the activation functions, SMN with the same receptive fields can be represented as Equation 3: \ud835\udc81= softmax( \u02c6 \ud835\udc68\u00d7 ( \u02c6 \ud835\udc68X\ud835\udc7e(0))) = softmax( \u02c6 \ud835\udc682\ud835\udc7f\ud835\udc7e(0)). (3) Since the computation of \u02c6 \ud835\udc682\ud835\udc7fis essentially equal to a preprocessing step, the model parameters are reduced to the logistic regression model level. Moreover, instead of directly using \u02c6 \ud835\udc68\ud835\udc58\ud835\udc7fas input, SMN iteratively stacks adjacency matrices from different hops \u02c6 \ud835\udc680, \u02c6 \ud835\udc681, ... \u02c6 \ud835\udc68\ud835\udc58, and generates a multichannel input by assigning node features such as \ud835\udc7f, \u02c6 \ud835\udc68\ud835\udc7f, ... \u02c6 \ud835\udc68\ud835\udc58\ud835\udc7f. The \ud835\udc58-th channel represents the node feature matrix with a \ud835\udc58\u22121 hop receptive field. By aggregating neighbourhood information during preprocessing, SMN eliminates the necessity of a graph convolutional layer and a distinctive query encoder but employs a fully connected layer instead. This approach solves the slow training issue encountered in models like QDGNN and COCLEP, accelerating model optimisation speed. In degree normalisation, the adjacency matrix of GCN is normalised as \u02c6 \ud835\udc68= \u00af \ud835\udc6b\u22121 2 \u00af \ud835\udc68\u00af \ud835\udc6b\u22121 2 . Where \u00af \ud835\udc68= \ud835\udc68+ \ud835\udc70and \ud835\udc70is the identity matrix, representing each node in \ud835\udc68to add a self-loop by \ud835\udc68+ \ud835\udc70 before normalisation. The self-loop avoids the loss of self-features during aggregation. Comparatively, degree normalisation in SMN 4 \f1-hop with self-loop 2-hop with self-loop 3-hop with self-loop 1-hop no self-loop 2-hop no self-loop 3-hop no self-loop Figure 4: Self-loop oversmooth messages received is depicted in Equation 4: \u02dc \ud835\udc68= \ud835\udc6b\u22121 2 \ud835\udc68\ud835\udc6b\u22121 2 , (4) where \ud835\udc68and \ud835\udc6brepresent the adjacency and the degree matrices without self-loop. SMN specifically removes the self-loop for two reasons: First, SMN takes the input of \u02dc \ud835\udc680\ud835\udc7f, \u02dc \ud835\udc681\ud835\udc7f, ... \u02dc \ud835\udc68\ud835\udc58\ud835\udc7f, where \u02dc \ud835\udc680\ud835\udc7f= \ud835\udc7fis the initial features matrix which prevents the loss of the self-features. Furthermore, removing the self-loop reduces redundancy during message passing and further differentiates messages collected from each hop [20]. Figure 4 illustrates the comparison of adjacency matrices with and without self-loops. In the first row, self-loops demonstrate a notable acceleration in graph exploration, causing oversmoothing within three hops. Comparatively, removing self-loops leads to a better contrast across the adjacency matrices among various hops. It can be seen that the 1-hop no sel-loops matrix primarily focuses on direct neighbours, presented as the matrix\u2019s top-right and bottom-left corners. In contrast, the 2-hop matrix emphasises neighbours with a 2-hop distance (top-left and bottom-right corners). This feature slows down the oversmoothing progress while enabling hop-wise attention to capture distinct patterns from different hops [39]. Propagation: hop-wise multi-head attention. The hop-wise multi-head attention mechanism regulates the aggregation of messages from various hops, enabling the model to capture higher-order patterns by mitigating the oversmoothing effect. SMN first applies a pre-attention layer to transform the initial features linearly to obtain sufficient expressive power. Here, the weight matrix \ud835\udc7e\ud835\udc59is shared across nodes and hops. We then perform self-attention on the hidden state to compute the attention coefficients as Equation 5: \ud835\udc86\ud835\udc8a= \ud835\udc4e(\ud835\udc7e\ud835\udc59\ud835\udc6f0,\ud835\udc7e\ud835\udc59\ud835\udc6f\ud835\udc56) : \ud835\udc56\u2208[0..\ud835\udc58] = (\u2212 \u2192 \ud835\udc82\ud835\udc47\ud835\udc7e\ud835\udc59\ud835\udc6f0 + \u2212 \u2192 \ud835\udc82\ud835\udc47\ud835\udc7e\ud835\udc59\ud835\udc6f\ud835\udc56), (5) where \ud835\udc86\ud835\udc8aindicates the importance of \ud835\udc6f\ud835\udc56the ith-hop features toward \ud835\udc6f0 the zero-hop (self-features matrix). \u2212 \u2192 \ud835\udc82is a shared attention mechanism \u2212 \u2192 \ud835\udc82\u2208R\ud835\udc39\u2032, and \ud835\udc58is the number of hops. To fuse the message from different hops, the coefficients are first activated by Algorithm 1: Preprocessing and SMN propagation Input :Feature matrix \ud835\udc7f, the adjacency matrix \u02dc \ud835\udc68, the number of hops \ud835\udc58, the sparsity rate \ud835\udc5f Output:Model output O, final embeddings H\ud835\udc60, learned sparse subspace filter \ud835\udc7a 1 \u02dc \ud835\udc68= \ud835\udc6b\u22121 2 \ud835\udc68\ud835\udc6b\u22121 2 ; 2 H = { \u02dc \ud835\udc680\ud835\udc7f, \u02dc \ud835\udc681\ud835\udc7f, ..., \u02dc \ud835\udc68(\ud835\udc58\u22121)\ud835\udc7f}; 3 for each \ud835\udc6f\ud835\udc56\u2208H do 4 \ud835\udc6f\ud835\udc56= \ud835\udf0e(\ud835\udc7e\ud835\udc59\ud835\udc6f\ud835\udc56) ; 5 \ud835\udf36\ud835\udc56= softmax(\ud835\udc4e(\ud835\udc6f0, \ud835\udc6f\ud835\udc56)) ; 6 end for 7 H = AGG(\ud835\udf36\ud835\udc56\ud835\udc6f\ud835\udc56), for \ud835\udc56= 0, ...,\ud835\udc58\u22121 ; 8 H\ud835\udc60= \ud835\udf0e(\ud835\udc7e\ud835\udc5fH); 9 Initialize the subspace filter \ud835\udc7a; 10 \ud835\udc7a= ApplySparsity(\ud835\udc7a,\ud835\udc5f); 11 O = H\ud835\udc60\u00d7 \ud835\udc7a; 12 return O, H\ud835\udc60, \ud835\udc7a; a LeakyReLU and then normalised by the softmax as Equation 6: \ud835\udf36\ud835\udc56= exp \u0010 LeakyReLU \u0010 \ud835\udc86\ud835\udc8a \u0011\u0011 \u00cd \ud835\udc57\u2208[0..\ud835\udc58] exp \u0010 LeakyReLU \u0010 \ud835\udc86\ud835\udc8b \u0011\u0011 . (6) The obtained final weights \ud835\udf36fuse the multi-hop feature matrices into a single channel. We observe that multi-head attention is beneficial to improve the model performance and stability further. Similar to the graph attention networks [35], multiple independent attention mechanisms are applied to the hidden state, and the output of each head is further concatenated into the final output. The model uses the multi-head filter \ud835\udc7e\ud835\udc5fto fuse the output from different heads into final embeddings as Equation 7: H\ud835\udc60= \ud835\udf0e \u0010 \ud835\udc7e\ud835\udc5f\u0010 w w \ud835\udc3c \ud835\udc56=1 \ud835\udc3e \u2211\ufe01 \ud835\udc58=0 \ud835\udf36\ud835\udc56 \ud835\udc58\ud835\udc7e\ud835\udc59\ud835\udc6f\ud835\udc58 \u0011\u0011 , (7) where \ud835\udc3cis the number of heads and \ud835\udc3eis the number of hops. The dimension of the final output H\ud835\udc60is a hyperparameter that matches the dimensions of the subspace community embeddings. The output dimensions are closely related to the number of disjoint or overlapping communities in the dataset. Intuitively, the output dimension should be relatively higher in overlapping community datasets with more communities to cover complex community relationships. The algorithm for SMN propagation is presented in algorithm 1. Lines 1-2 represent the preprocessing stage, stacking aggregated features from different hops. Lines 3-8 describe the model propagation stage. The preprocessed features are linearly transformed by \ud835\udc7e\ud835\udc59and then fused by the weight from hop-wise attention. The fused hidden state is then transformed by \ud835\udc7e\ud835\udc5f. Lines 9-11 describe the subspace embeddingswith details discussed in the next section. Due to the oversmoothing effect, many GCN variants aggregate neighbourhood messages from a fixed three-hop distance, regardless of the difference in the graph size. Comparatively, the attention weights in SMN control the contribution from different hops instead of uniformly aggregating structure information. This hop-wise attention mechanism enhances the flexibility and robustness of SMN 5 \fby attending to broader receptive fields, capturing the unique graph structure across different real-life datasets. 3.3 Subspace Community Embedding Classical subspace clustering[6, 29, 31] aims to learn a sparse selfexpressive affinity matrix. Later, some learning-based subspace clustering approaches were proposed [3, 22], which efficiently learn pairwise affinities using a deep autoencoder model. The fundamental concept is representing the data using a sparse vector for spectral clustering. Inspired by this idea, we propose a sparse subspace filter (SSF) to represent communities. Extending the model to OCS aims to train node embeddings to closely align with their underlying community embeddings, simultaneously minimising Euclidean and cosine distances in the subspace. This section will introduce SSF and the associated loss functions. Sparse subspace filter. SSF is initialised as a trainable matrix with dimensions of (\ud835\udc60,\ud835\udc50), where \ud835\udc60is the dimension of the output embeddings, and \ud835\udc50denotes the number of communities. In the following, we detail our approach through three perspectives. What roles does SSF play in our model? SSF plays two roles in the model, including the model classifier and the embedding matrix to guide the community search. In the role of a model classifier, SSF linearly transforms the node embeddings H\ud835\udc60into a likelihood matrix of community affiliation. Each element of this matrix represents the likelihood that the node belongs to a corresponding community. The model output is evaluated against the ground truth, generating loss to update the model parameters. Hence, the elements within SSF control the weight of the corresponding elements in the learned embeddings that contribute to each community. Moreover, the trained SSF plays a crucial role in assisting the community search. Since SMN effectively embeds nodes from the same community around the underlying SSF, the trained SSF can be treated as an embedding matrix representing all communities. During the community search, the columns in SSF serve as basis vectors, projecting all nodes into a subspace according to the target community, facilitating the search within the target subspace. The sparse matrix represents that different communities attend to various elements in the node embeddings. SSF ensures that the search algorithm only considers representative elements when identifying a group of nodes. How SSF is designed? To induce sparsity while mitigating information loss, the elements of SSF with the least absolute value are converted to 0 based on a predefined sparsity rate as Equation 8: \ud835\udc7a\ud835\udc56\ud835\udc57= ( \ud835\udc7a\ud835\udc56\ud835\udc57, if |\ud835\udc7a\ud835\udc56\ud835\udc57| > \ud835\udeff 0, otherwise , (8) where \ud835\udeffis the threshold determined by the sparsity rate, and \ud835\udc60\ud835\udc56\ud835\udc57 is an element in SSF. This rate is applied to the SSF at the matrix level, allowing for different sparsity among columns. Sparsity enables each node to demonstrate high similarity with multiple communities, effectively addressing overlapping structures. The non-zero elements in each column of SSF undergo L1 normalisation to ensure fair distribution among columns with different sparsity. Typically, embeddings of large communities are more sparse, with each element having a relatively higher value than the dense embeddings representing small communities. This ensures that large communities have a loose constraint in estimating node affiliations and suggests a higher probability of demonstrating substantial similarity to node embeddings. Shared non-zero elements between large and small communities suggest a nesting structure. Consequently, nodes within the small community exhibit high similarity with their nesting communities. How are the loss functions designed to train SSF? To ensure convergence, we adopted two loss functions and fused them to optimise the model parameters. We formulate the model output as a classification result, in which each element in the output \ud835\udc90\u2208R\ud835\udc50represents the likelihood of the underlying community. Here, \ud835\udc90\ud835\udc97\u2208[0, 1] and \ud835\udc9a\ud835\udc63\u2208{0, 1}\ud835\udc50represent the prediction of the model and the ground truth label for a node \ud835\udc97. The first loss is named classification loss, adopting the Cross-Entropy (CE) to minimise the difference between \ud835\udc90\ud835\udc97and \ud835\udc9a\ud835\udc63for the node \ud835\udc97which is shown as Equation 9: Lc = \ud835\udf02 \u2211\ufe01 \ud835\udc63=1 \u2212(\ud835\udc9a\ud835\udc63log (\ud835\udc90\ud835\udc97) + (1 \u2212\ud835\udc9a\ud835\udc63) log (1 \u2212\ud835\udc90\ud835\udc97)), (9) where \ud835\udf02is the number of nodes in the batches or the training set, Lc is used for measuring the error of model output against the ground truth community. Furthermore, a spatial loss function is introduced to supervise the subspace mapping. For nodes belonging to a community, their embeddings should be proximate to their community embedding. Two distance metrics are employed, including Euclidean distance and cosine similarity. Both metrics compare the node embeddings against each SSF column representing a specific community. Loss is primarily generated on the non-zero elements to accommodate the overlapping community structure. Therefore, node embeddings are filtered by the basis vector of each column in SSF before measuring the distance against the underlying SSF. Discrepancies against zero-like elements in SSF are not penalised, given their potential contribution to other communities. The softmax or sigmoid functions are then applied to the distance and similarity to derive the likelihood of nodes belonging to each community. This output is averaged into the final spatial distance as Equation 10. \ud835\udc6b= 1 2 (\ud835\udf0e(\u2212dist(\ud835\udc89\ud835\udc63, \ud835\udc7a)) + \ud835\udf0e(sim(\ud835\udc89\ud835\udc63, \ud835\udc7a)), (10) where \ud835\udf0erepresents either the softmax or sigmoid function, \ud835\udc7arepresents the SSF matrix, and \ud835\udc89\ud835\udc63\u2208H\ud835\udc60is the final embeddings, which are different from the likelihood of community affiliations \ud835\udc90\ud835\udc63. dist(\u00b7) and sim(\u00b7) represent the Euclidean distance and the cosine similarity. Similar to the classification loss, we compute the CE for the spatial loss Ls as Equation 11: Ls = \ud835\udf02 \u2211\ufe01 \ud835\udc63=1 \u2212(\ud835\udc9a\ud835\udc63log (\ud835\udc85\ud835\udc63) + (1 \u2212\ud835\udc9a\ud835\udc63) log (1 \u2212\ud835\udc85\ud835\udc63)), (11) The final loss function is defined as follows: L = 1 2 ( Lc \ud835\udf032 \ud835\udc50 + Ls \ud835\udf032 \ud835\udc60 ), (12) where \ud835\udf03is a parameter the model trains to balance the above two loss functions. We observe that this fused loss function stabilises the model performance. 6 \fSparse Subspace Filter SSF 1 Target Community X Y Z Original Embedding Space Target Embeddings Embedding Subspace Space X Y Z Figure 5: OCS for a single target community 3.4 Subspace Community Search This section proposes two efficient query-dependent CS approaches while solving the boundary effect. Leveraging the subspace community embedding technique, we introduce a subspace top-k similarity search (Sub-Topk) and a subspace cohesive community search (SubCS). Both algorithms perform the community search in the subspace, which can be extended to OCS and OCIS by giving different target subspaces. As illustrated in Figure 5, the yellow node represents the query node, and our focus lies on the blue community. Using SSF to access the underlying community embeddings, all nodes are projected into the target subspace. Consequently, the search operation is limited to the specific community space. Sub-Topk. We initiate a similarity-based approach known as SubTopk to identify a query-dependent community. The algorithm takes the query nodes and the test set as input. It begins by employing the trained SMN to predict the query community (or communities in overlapping community datasets). After identifying the target community, the algorithm retrieves the corresponding column (\ud835\udc7a\ud835\udc56) from SSF. The matrix \ud835\udc6c\u2208{0, 1}\ud835\udc60\u00d7\ud835\udc50consist of basis vectors representing subspaces, \ud835\udc6c\ud835\udc56,\ud835\udc57= 1, if \ud835\udc7a\ud835\udc56,\ud835\udc57\u22600; otherwise \ud835\udc6c\ud835\udc56,\ud835\udc57= 0. Therefore, the corresponding column is converted to a basis vector \ud835\udc6c\ud835\udc56 and maps both the query and test nodes to the community subspace by performing an element-wise product (SubspaceMapping(\u00b7)). Similar to COCLEP, the community is constructed by maximising the similarity of node embeddings against the query. Comparatively, Sub-Topk specifically measures the similarity within the target subspace. Sub-Topk is powerful for extracting nodes exhibiting high-order structural and feature-wise similarity to the query node. The subspace search ensures that the similarity measurement only incorporates information relevant to the target community, effectively eliminating noise. In addition, nodes from other communities demonstrate longer distances by projecting nodes into the target subspace, thereby mitigating the boundary effect. However, Sub-Topk has drawbacks regarding its reachability and community assumptions. Sub-Topk fails to ensure the reachability between the query and the identified set It also assumes that the query is always located as the centroid of the community, which is unrealistic in the real scenario. Hence, we further proposed Sub-CS. Sub-CS. Inspired by the idea of spatial-aware community search [12, 16], we introduce a subspace-aware community search (SubCS). The algorithm aims to locate a community with a small \u201cradius\u201d in the subspace. Subspace cohesiveness implies that the identified community should minimise the community radius in the latent subspace, with distance measured by cosine similarity. Similarly to QDGNN and ICS-GNN, we use BFS to explore a \ud835\udc58-sized community from the query as the initial community while ensuring its reachability. Initially, the community centroid is computed by averaging Algorithm 2: Cohesive community search (Sub-CS) Input :Graph \ud835\udc3a, Query \ud835\udc5e, final embeddings H\ud835\udc60, learned sparse subspace filter matrix \ud835\udc7a, the community size \ud835\udc58, the hop limit \ud835\udc59 Output:Community \ud835\udc36\ud835\udc5e 1 H\ud835\udc60= SubspaceMapping(H\ud835\udc60, \ud835\udc7a\ud835\udc5e); 2 \ud835\udc36\ud835\udc5e= {\ud835\udc5e}; 3 for each \ud835\udc62encountered in a BFS in \ud835\udc3afrom \ud835\udc5edo 4 Add \ud835\udc62to \ud835\udc36\ud835\udc5eif |\ud835\udc36\ud835\udc5e| < \ud835\udc58; 5 centroid = mean(H\ud835\udc60[\ud835\udc56]),\ud835\udc56\u2208\ud835\udc36\ud835\udc5e; 6 \ud835\udc77= sim(\ud835\udc36\ud835\udc5e, centroid); 7 Find a node \ud835\udc50\u2208\ud835\udc36\ud835\udc5ewith \ud835\udc77[\ud835\udc50] smallest in \ud835\udc36\ud835\udc5e; 8 if \ud835\udc50= \ud835\udc5ethen break; 9 if hop = \ud835\udc59then break; 10 \ud835\udc91\ud835\udc62= sim(\ud835\udc62, centroid); 11 if \ud835\udc91\ud835\udc62> \ud835\udc77[\ud835\udc50] then 12 \ud835\udc36\ud835\udc5e.remove(\ud835\udc50); \ud835\udc36\ud835\udc5e.add(\ud835\udc62); 13 centroid = mean(H\ud835\udc60[\ud835\udc56]),\ud835\udc56\u2208\ud835\udc36\ud835\udc5e; 14 end if 15 end for 16 return \ud835\udc36\ud835\udc5e; the node embeddings and measuring the cosine similarity against each node. Subsequently, we iteratively replace the least similar node in the current community with a newly encountered node if it exhibits higher similarity. This process continues and recomputes the centroid if the community is updated. The algorithm terminates if either the query node becomes the least similar node or the hop limit is reached, thereby constraining the searching range in both the original graph space and the latent embedding space. The details are illustrated in algorithm 2. These two algorithms operate based on different scenarios. SubTopk prioritises high-order patterns and is well-suited for applications such as fraud detection, where fraudsters often demonstrate higher-order relationships without direct connections. On the other hand, Sub-CS is more suitable for the dataset values local structures. 4 OCS AND OCIS SMN addresses overlapping community search (OCS) and overlapping communities intersection search (OCIS). This section discloses the detailed model configurations crafted explicitly for the aforementioned community search. Overlapping community search (OCS). In datasets with overlapping communities, the value of communities to end users varies. Smaller communities tend to carry more information, particularly when the query node is also associated with popular and large communities. Following this observation, our model first forecasts all affiliations of the query, allowing users to select a specific community as the target. As depicted in Figure 5, the underlying column \ud835\udc7a\ud835\udc56 is extracted from SSF once the target is determined. When searching for the community based on the query, node embeddings are projected into the underlying subspace through element-wise multiplication with the basis vector \ud835\udc6c\ud835\udc56representing a single community. Following this, the projected embeddings are fed into the previously discussed subspace search algorithms to identify the community. 7 \fSparse Subspace Filter SSF Label Predicted 1 1 1 Combined Target Embeddings Intersection Set Figure 6: OCIS: Locate the intersection of communities Overlapping communities intersection search (OCIS). In OCIS, SMN provides enhanced flexibility to end users by allowing the selection of multiple communities as the target and returning only their intersection. The brute-force approach identifies all target communities and determines their intersection by examining common nodes. However, this method leads to unacceptable complexity, as it requires first enumerating the entire dataset for community prediction, followed by costly intersection-finding operations. Leveraging subspace embedding techniques, SMN efficiently identifies the intersection while avoiding computational wastage. The rationale is that nodes in the intersection set should exhibit closer relationships with all community embeddings involved. In this study, we use a union operation, combining embeddings from multiple target communities to determine valuable elements. As depicted in Figure 6, the intersection set is represented by a combined embedding of all the targeted communities. The resulting vector of union operation generates more strict constraints when measuring similarity. This refined vector implies the overlapped subspace of multiple communities. Consequently, the identified nodes maintain high similarity with the embeddings representing each target community. 5 MODEL TRAINING, QUERYING AND COMPLEXITY Model training stage. SMN operates in a semi-supervised transductive setting, with access to the complete data structure. While the entire dataset undergoes preprocessing, ground truth labels are masked during training. SMN can also transit to an inductive setting by preprocessing the training and testing sets separately. The semi-supervised nature of SMN involves using a minimal fraction of the data for training, 5% or less for the disjoint community dataset and 10% for the overlapping dataset. Throughout the training stage, SMN is optimised with the specified loss functions, yielding a set of model parameters tailored for online queries. Online query stage. In the query stage, the model infers embeddings for both query and testing nodes based on the trained parameters. The offline setting indicated that the inference step only needs to run once, accommodating repetitive queries. Community identification utilises the trained SSF and the algorithms mentioned earlier. The interactive community search enables end users to provide a refined description of the desired community. Hyperparameters include community size and target communities. Time complexity analysis. The time complexity of SMN consists of detailed considerations for both model training and community identification, addressing preprocessing and query time complexities, respectively. The feature processing adopts\ud835\udc58-hop operations in the preprocessing stage, contributing \ud835\udc42(|\ud835\udc49|3 \u00d7 \ud835\udc58). The subsequent Table 1: Dataset statistics Dataset # Nodes # Edges # Com # Feat Disjoint Cora 2,708 5,429 7 1,433 Citeseer 3,312 4,732 6 3,703 Pubmed 19,717 44,338 3 500 Reddit 232,965 114M 41 300 Overlap FB-0 348 2,852 3 224 FB-107 418 4,815 4 576 FB-348 228 3,416 4 161 FB-414 160 1,843 2 105 FB-686 171 1,824 6 63 Chemistry 35,409 157,358 14 4,877 CS 21,957 96,750 18 7,793 Engineering 14,927 49,305 16 4,839 Medicine 63,282 810,314 17 5,538 pre-attention layer involves \ud835\udc42(|\ud835\udc49| \u00d7 \ud835\udc51\u00d7 \u210e), where \ud835\udc51is the initial feature dimensions, and \u210eis the hidden dimensions. The multi-hop attention introduces\ud835\udc42(|\ud835\udc49|\u00d7\ud835\udc56\u00d7\u210e) complexity, where\ud835\udc56is the number of heads. Hop-wise addition and weighted average fusion will take \ud835\udc42(|\ud835\udc49|). As these operations will be run for \ud835\udc58time, the total time complexity for the pre-attention and multi-hop attention layers is \ud835\udc42(\ud835\udc58\u00d7|\ud835\udc49|\u00d7\u210e\u00d7(\ud835\udc51+\ud835\udc56)). The multi-head filter and SSF transformation will take \ud835\udc42(|\ud835\udc49| \u00d7 \u210e\u00d7 \ud835\udc60) and \ud835\udc42(|\ud835\udc49| \u00d7 \ud835\udc60\u00d7 \ud835\udc50). Where \ud835\udc60represents the dimensions of SSF and \ud835\udc50is the number of communities. The model is trained by t epochs. Therefore, the total time complexity for SMN training is \ud835\udc42(|\ud835\udc49|3 \u00d7 \ud835\udc58+ (|\ud835\udc49| \u00d7 \ud835\udc61\u00d7 (\u210e\u00d7 \ud835\udc58\u00d7 (\ud835\udc51+ \ud835\udc56) + \ud835\udc60\u00d7 (\u210e+ \ud835\udc50)))). For Sub-Topk, applying the target SSF to map node features and computing cosine similarity against the query node will take \ud835\udc42(|\ud835\udc49| \u00d7 \u210e). To get the top \ud835\udc58similarity, will take \ud835\udc42(|\ud835\udc49| \u00d7 \ud835\udc59\ud835\udc5c\ud835\udc54(\ud835\udc58)), where \ud835\udc58is the community size. Therefore, the total time complexity for Sub-Topk will be \ud835\udc42(|\ud835\udc49| \u00d7 (\u210e+ \ud835\udc59\ud835\udc5c\ud835\udc54(\ud835\udc58))). For Sub-CS, applying the target SSF to map node features will take \ud835\udc42(|\ud835\udc49| \u00d7 \u210e). To conduct BFS and update the centroid will take \ud835\udc42(|\ud835\udc38| \u00d7\ud835\udc58\u00d7\u210e). Therefore, the total time complexity will be \ud835\udc42((|\ud835\udc38| \u00d7 \ud835\udc58\u00d7 \u210e) + (|\ud835\udc49| \u00d7 \u210e)). 6 EXPERIMENTS 6.1 Experimental Setup Datasets. We use 13 datasets to evaluate the performance of SMN, including 4 datasets demonstrating disjoint community structures and 9 datasets with overlapping structures. Datasets statistics are reported in Table 1. The Cora, Citeseer, and Pubmed are citation networks. Each attribute describes the presence of a keyword in the publication. More details are disclosed on Relational Dataset Repository1. Reddit [18] is an online forum where nodes are posts and edges connect nodes if there is at least one comment from the same user. Facebook [26] is a social network dataset that contains five independent ego networks. Chemistry, Computer Science, Medicine, and Engineering are co-authorship networks constructed using data from the Microsoft Academic Graph (MAG) 2. 1https://relational.fit.cvut.cz/ 2https://www.microsoft.com/en-us/research/project/open-academic-graph/ 8 \fTable 2: Training time (100 Epochs) on disjoint community Method Cora Citeseer Pubmed Reddit \ud835\udc58-clique 0.41 s 0.46 s 21.7 s \u2013 CTC 0.02 s 0.03 s 0.04 s 707.5 \ud835\udc58-core 0.02 s 0.01 s 0.11 s 543.7 QDGNN 360.4 s 382.5 s 400.2 s 11,055.1 s COCLEP 547.0 s 510.5 s 700.1 s OOM SMN 4.4 s 4.1 s 3.6 s 7.6 s Data splitting. By following the previous settings, SMN used 10% or less data during the training to mitigate the human effort on labelling. A standard splitting approach was applied in citation networks, utilising only 20 samples from each community, accounting for less than 2% of the total data. In the Reddit datasets, the splitting ratio for the training, validation, and test sets is 5:10:85. Similarly, for the Facebook and MAG datasets, the splitting ratio is 10:10:80. Baseline models. We compare the performance of SMN against three algorithm-based methods (\ud835\udc58-clique [5], CTC [21], and \ud835\udc58-core [33]) and three SOTA GNN-based models(ICS-GNN [15], QDGNN [23], and COCLEP [28]). GNN-based models are all primarily focused on disjoint community structure. ICS-GNN shares the same configuration as the proposed SMN, targeting the identification of a \ud835\udc58-sized community. QDGNN and COCLEP identify communities by training a threshold to measure GNN score and similarity. We extend their configurations to a \ud835\udc58-sized community search by selecting the top k nodes with the highest GNN score or similarity. All baseline models follow the same parameter setting as SMN. Query setting. The model inputs a set of query \ud835\udc44= {\ud835\udc49\ud835\udc5e,\ud835\udc58}, where \ud835\udc58is the community size. All query nodes are randomly selected to prevent potential bias. The community size \ud835\udc58is decided by users, which can differ among datasets. In the experiment, we set 30 as the standard size. Due to the large scale of the Reddit dataset, the community size is set as 500. Evaluation metrics. The evaluation of identified communities is conducted through two performance metrics: F1-Score [15, 23] and Jaccard similarity [28]. The true data is established as the target community label, with the labels of the identified nodes serving as the predicted data. To evaluate efficiency, the model training time and online querying time are recorded across different models. All results are averaged across 50 randomly selected queries to ensure the robustness and quality of the evaluation process. Implementation Details and Experimental Environment. SMN is constructed with 16-hop receptive fields, 64 hidden dimensions, and two heads for multi-head attention, using a 32dimensional SSF. Model training involves 100 epochs with a learning rate of 0.02. Due to its large size and dense graph structure for the Reddit dataset, SMN is configured with 4-hop receptive fields, maintaining other hyperparameters the same. All the experiments are conducted on a machine with Intel Xeon Gold 6248R CPU, Nvidia A5000 GPU and 512GB memory. FB0 FB107 FB348 FB414 FB686 mag_eng mag_cs mag_chem mag_med 101 102 103 104 Training Time QDGNN COCLEP SMN Figure 7: Training time on overlapping community 6.2 Disjoint Community Search Performance Model effectiveness. Table 3 illustrate model performance on disjoint community datasets. The comparison is between baseline models, SMN (Sub-Topk) and SMN (Sub-CS) on three citation network datasets and one large-scale dataset Reddit. Notably, although SMN is primarily crafted for OCS, it demonstrates superior performance on disjoint community search against SOTA models. SMN with Sub-Topk achieved the second-best performance across most datasets, except for the Citeseer dataset. Among the four datasets, Sub-CS outperforms the best baseline model by 5.85% and beats Sub-Topk by 3.93% in F1-Score on average. This improvement is mainly attributed to the hop-wise attention mechanism and the proposed search algorithms, leveraging the high-order patterns captured from a larger model receptive field. Model training efficiency. Table 2 depicts the learning-based model training time against the algorithm-based model preprocessing time. Since ICS-GNN operates in an online setting and is trained and tested on a candidate subgraph, its training time is not included. While the algorithm-based approach exhibits high efficiency in small datasets, it faces scalability issues with large and dense datasets, such as Reddit, with more than 100 million edges. Compared to GNN-based models, the results reveal a significant acceleration in model training time achieved by the proposed SMN. It achieves a speedup of two orders of magnitude in the citation datasets and three orders of magnitude in Reddit. Notably, QDGNN and COCLEP suffer from an obvious slow training issue, where training SMN on Reddit for 100 epochs takes only 7.6 seconds compared to QDGNN with 11,055.1 seconds, and COCLEP runs out of memory (OOM). This computational burden arises primarily from the framework of these models. Firstly, both models employ a query encoder and combine the embeddings from the query encoder with the graph encoder. Consequently, in every GCN layer, the query encoder must wait for the graph encoder to complete training on the entire training set. Using all nodes in the training set as queries implies an \ud835\udc42(|\ud835\udc49\ud835\udc61|2) time complexity where |\ud835\udc49\ud835\udc61| represents the number of nodes in the training set. Secondly, as discussed in section 3, GCN layers suffer from slow training issues due to their aggregation process. This leads to the significant slowdown observed in Reddit, characterised by a dense graph structure with an average node degree of approximately 400. In contrast, the SMN model demonstrates enhanced scalability on dense graphs due to its light framework. A similar trend is also observed in overlapping datasets, as depicted in Figure 7. 9 \fTable 3: Jaccard and F1-Score (in%) of disjoint community search Method Cora Citeseer Pubmed Reddit Jaccard F1-Score Jaccard F1-Score Jaccard F1-Score Jaccard F1-Score \ud835\udc58-clique 17.24 29.41 17.31 29.51 34.41 51.21 \u2013 \u2013 CTC 18.90 31.79 16.34 28.10 37.24 54.27 6.79 12.71 \ud835\udc58-core 18.28 30.90 18.21 30.81 38.76 55.86 15.48 26.81 ICS-GNN 63.76 77.87 62.32 76.79 72.90 83.65 58.40 73.74 QDGNN 68.70 81.45 56.69 72.36 69.66 82.11 68.94 81.61 COCLEP 36.55 53.54 18.28 30.90 50.34 66.97 OOM OOM Sub-Topk 75.93 86.32 60.48 75.32 73.38 83.91 74.85 85.62 Sub-CS 80.03 88.91 67.20 80.38 76.29 86.55 83.85 91.06 [1]: OOM indicates out of memory; [2]: \u2013 indicates not finished within 2 days. Table 4: Online query time of disjoint community search Method Cora Citeseer Pubmed Reddit \ud835\udc58-clique 0.00038 s 0.00049 s 0.00207 s \u2013 CTC 0.00029 s 0.00052 s 0.00328 s 0.02124 s \ud835\udc58-core 0.00050 s 0.00050 s 0.00306 s 0.02013 s ICS-GNN 3.952 s 3.331 s 4.142 s 25.986 s QDGNN 0.02157 s 0.01604 s 0.02414 s 1.2191 s COCLEP 0.01752 s 0.01778 s 0.02185 s OOM Sub-CS 0.04780 s 0.01933 s 0.04868 s 1.17923 s Sub-Topk 0.00027 s 0.00078 s 0.00053 s 0.00213 s Model query efficiency. Table 4 shows online query efficiency. ICS-GNN adopted online settings, meaning the model must be re-trained on every new query node and slow down the online query speed. QDGNN and COCLEP employ offline settings, but both models require a model inference step to predict the GNN score or similarity for a given query. Comparatively, Sub-CS and Sub-Topk approaches avoid the model inference step by conducting the search using the pretrained node and community embeddings. Sub-CS demonstrates a comparable efficiency in smaller datasets and slightly outperforms QDGNN on Reddit due to its large scale. In contrast, Sub-Topk achieved the best query efficiency, surpassing the existing best efficiency by two orders. The above experiment results prove the performance of the proposed SMN in disjoint community search. The following section will discuss the model performance in OCS. 6.3 Overlapping Community Search Overlapping community search (OCS). The model performance with Sub-Topk in overlapping community datasets is presented in Table 5. In OCS, the query is initially input into the trained model to predict a list of communities containing the query. Instead of selectively choosing a single community as the target, we iteratively use each community from the predicted list as the target and report the average performance to avoid bias. The community size is set at 30, and communities smaller than 30 are ignored. It is evident that SMN consistently demonstrates superior results against all baseline models, showcasing an average improvement of 7.95% and 6.88% in the F1-Score for the Facebook and MAG datasets. SMN identifies distinct sets of nodes by giving a single query targeting different communities. In contrast, baseline models consistently identify the identical set of nodes when presented with a single query without considering the variations in the target community. Consequently, the community distribution significantly influences the performances of baseline models, leading to overestimation, especially favouring large communities. Overlapping communities intersection search (OCIS). The performance of SMN in OCIS is further evaluated. This experiment uses all communities containing the query as the target. Therefore, the intersection is derived from the entire predicted list of query communities, ensuring that the intersection set includes at least one node, which is the query node itself. The target community size is set as 5 for OCIS to avoid the out-of-sample issue. A significant performance drop is observed when comparing the baseline model performance between OCS and OCIS. This deviation is attributed to OCIS being more challenging than OCS. Due to the baseline models being primarily built for disjoint community search, the performance is degraded when the dataset is heavily overlapped. For SMN, we observe a performance drop on FB686, with nodes having a maximum of six community affiliations. Due to the experiment setting, those six communities form a unique combination, adversely impacting SMN to identify five nodes sharing the same affiliations. Overall, SMN demonstrates stable performance in OCIS with a 14.73% F1-Score improvement on average. The results showcase the effectiveness of SMN in identifying an intersection set of multiple target communities. 6.4 Ablation Study and In-depth Analysis In this section, we conduct various experiments to verify the effectiveness of each component in the proposed model. The ablation study has six experiments, including the oversmoothing test, the effectiveness test of SMN, SSF and search algorithms, and the sensitive test of the community size. Exp-1: SMN oversmoothing test. This experiment evaluates the robustness of SMN on the oversmoothing issue. Figure 8a illustrates the performance of SMN across various receptive fields, ranging from 0 to 128 hops. The results demonstrate a stable performance with increasing hops. To further test the model robustness against oversmoothing, Table 6 report the model performance on node classification, where SMN-1 represent the model takes the singlechannel input of \ud835\udc34\ud835\udc58\ud835\udc4b. It can be seen that SMN demonstrates a 10 \fTable 5: SMN performance F1-Score (in%) in overlapping community search Task Method FB-0 FB-107 FB-348 FB-414 FB-686 CHEM CS ENG MED OCS \ud835\udc58-clique 24.78 27.81 15.43 28.82 9.47 6.06 3.63 4.88 \u2013 CTC 25.88 30.24 13.66 31.19 8.81 5.47 5.58 6.14 7.78 \ud835\udc58-core 24.23 25.37 14.43 27.18 10.13 7.69 6.74 11.43 6.59 ICSGNN 75.65 69.16 81.67 79.09 64.71 66.12 70.00 85.18 79.53 QDGNN 71.55 74.84 80.99 76.21 61.51 77.20 84.09 82.58 82.36 COCLEP 68.46 41.10 66.67 68.25 61.65 66.17 28.57 26.87 24.24 SMN 79.96 94.74 83.95 89.74 67.33 91.69 89.04 90.57 85.06 OCIS \ud835\udc58-clique 22.24 20.20 12.60 9.75 6.11 4.88 3.12 4.06 \u2013 CTC 21.18 22.92 14.85 10.71 6.46 5.33 5.28 5.43 7.16 \ud835\udc58-core 25.06 20.90 23.99 18.11 11.52 7.19 6.24 11.08 5.89 ICSGNN 58.58 53.05 78.88 44.41 51.67 81.56 65.62 60.70 75.83 QDGNN 58.83 56.76 80.22 52.44 50.33 71.71 69.57 60.82 77.79 COCLEP 66.67 0.00 75.98 10.34 43.22 41.38 32.69 54.71 22.25 SMN 73.83 83.50 81.76 81.00 53.81 91.55 89.33 90.63 84.64 0 20 40 60 80 100 120 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 F1 Score cora citeseer pubmed FB0 FB107 FB348 FB414 FB686 (a) SMN oversmoothing test cora citeseer pubmed FB0 FB107 FB348 FB414 FB686 0.5 0.6 0.7 0.8 0.9 1.0 F1 Score w/o Multihop Attention Multihop Attention (b) Multi-hop attention cora citeseer pubmed FB0 FB107 FB348 FB414 FB686 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 F1 Score SSF = False SSF = True (c) Performance comparison w/o SSF cora citeseer pubmed FB0 FB107 FB348 FB414 FB686 0.6 0.7 0.8 0.9 1.0 F1 Score BFS Sub_T opk Sub_CS (d) Search algorithm F1 comparison (%) cora citeseer pubmed FB0 FB107 FB348 FB414 FB686 10 3 10 2 10 1 Query Time Sub_CS BFS Sub_T opk (e) Search algorithm query time (s) 100 200 300 400 500 600 700 800 900 1000 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 F1 Score Sub_T opk Sub_CS (f) SMN on larger community size Figure 8: Ablation study and in-depth analysis Table 6: Oversmoothing test: classification F1-Score (in%) Dataset # Hops 1 2 4 8 16 32 64 128 Cora SMN-1 69.90 78.29 79.14 78.91 12.96 76.74 70.24 60.41 SMN 57.50 73.78 79.32 81.35 81.57 81.24 80.58 80.47 Citeseer SMN-1 7.94 63.51 7.94 64.35 63.33 65.43 66.04 65.55 SMN 52.24 64.11 66.64 67.42 65.95 67.09 65.64 OOM Pubmed SMN-1 43.47 39.25 39.25 39.25 20.66 75.03 39.94 20.81 SMN 69.87 71.85 75.66 76.78 77.35 78.59 78.61 OOM stable and slightly increasing trend as the number of hops increases. The results imply that SMN is benefited by higher-order receptive fields while mitigating the oversmoothing effect. It should be noted that although a larger receptive field enables SMN to capture highorder patterns, it comes at the expense of a significant increase in computational cost. This is evident in cases where SMN ran out of memory dealing with Citeseer and Pubmed datasets on 128 hops. Exp-2 Multi-hop Attention. In this experiment, we aim to demonstrate the ablation test on the multi-hop attention mechanism. As illustrated in Figure 8b, the proposed attention mechanism improves performance across all datasets except for Citeseer. Particularly, the performance gap is notably evident in Facebook datasets. This discrepancy highlights the significant impact of oversmoothing on small datasets, further confirming the effectiveness of SMN in mitigating oversmoothing challenges. Exp-3: Performance comparison w/o SSF. Figure 8c illustrates the model performance with and without SSF. The results show that applying SSF improves the model performance in all datasets except the Citeseer dataset. When comparing the performance between disjoint (the citation networks) and overlapping (the Facebook) datasets, SSF demonstrates a more significant improvement on overlapping datasets. These findings suggest SSF benefits community searching performance, especially on overlapping datasets. Exp-4: Search algorithm F1 comparison. In this experiment Figure 8d, we aim to directly compare the model performance of the two proposed search algorithms and a vanilla BFS algorithm 11 \fexploring for nodes with the highest similarity against the query. Sub-CS demonstrates superior performance on disjoint datasets, while Sub-Topk is better on overlapping datasets. Both algorithms demonstrate good performance among all datasets and are superior compared to the BFS. Due to their variance in assumption, the two approaches are potentially useful for different datasets. Sub-CS is preferred when the target community is relatively cohesive and small, like social network recommendations. Sub-Topk is suitable for high-order community search due to its efficiency and relaxed connectivity constraints (this argument is further verified in Exp-6. Potential applications include fraud detection, where fraudsters rarely connect in real datasets. Exp-5: Search algorithm query time comparison. In this experiment, we compare query efficiency among three search algorithms. The results are shown in Figure 8e. It can be observed that BFS is slightly faster compared to Sub-CS since Sub-CS uses BFS to explore neighbours while maintaining the subspace cohesiveness. Sub-Topk is the most efficient one, outperforming others by two orders in querying time. Exp-6: SMN on larger community size. In this experiment, we assess the expressive power of SMN in identifying large communities. The results are shown in Figure 8f. Interestingly, when the community size increases, the performance of Sub-CS gradually decreases to the same level as Sub-Topk, while the performance of Sub-Topk remains unaffected. A possible explanation is that Sub-CS values local cohesiveness and connectivity, which may degrade its performance in a high-order community search. 7 RELATED WORK Algorithm-based community search. The community search problem is well studied but has yet to have a widely accepted definition of community. Researchers for algorithm-based approaches defined a community as a cohesive subgraph, while each node shares similar attributes. There are algorithms define cohesiveness metrics including \ud835\udc58-core [12, 16, 33], \ud835\udc58-truss [1, 2, 21], and \ud835\udc58-clique [5, 38, 45], which efficiently identify communities based on the graph structure. Moreover, researchers conducted studies on attributed graphs and extended their analysis by incorporating attribute constraints alongside structural considerations to identify a set of nodes with similar attributes [8\u201310, 32]. Algorithm-based OCS [5, 14, 45] enable the query node to possess multiple community affiliations with equivalent levels of cohesiveness, such as being part of two subgraphs that fulfil \ud835\udc58-clique constraints. However, these models often return all communities containing the query nodes without the ability to selectively focus on a specific community. Nonetheless, the lack of label awareness hampers these models\u2019 capacity to identify and separate nodes from distinct communities. GNN-based community search. GNN and its variants have achieved considerable success in graph analytic tasks, including node classification [17, 25] and subgraph mining [36, 37]. The GNN model learns from predefined ground truth, effectively capturing patterns from node attributes while considering diverse graph structures simultaneously. In addition, advanced models have been introduced to improve model expressiveness and efficiency [35, 41, 43]. Recently, GNN-based community search models have attracted increasing attention due to their flexible structure constraints and expressive power. These models can effectively distinguish nodes from different communities by balancing the contribution from both the topological structure and the attributes of nodes. Deep CS models are trained using prior knowledge, making their assumptions more realistic than traditional approaches. A community is identified by a group of nodes sharing similar patterns in attributes and topological structures. ICS-GNN [15] introduced an online deep community search model using a vanilla GCN model. The model is transductive, conducting training and online querying within the identified candidate subgraph. QDGNN [23] introduced an offline setting by training the model on a fixed training set and inferring the model onto the unseen test set. The model extends to an attributed community search by adopting an attribute encoder to identify a group of nodes that contain a set of query attributes. COCLEP [28] followed the framework of QDGNN and conducted semi-supervised training by leveraging contrastive learning techniques. The model uses a hypergraph as an augmented graph and propagates information using GCN and Hyper GNN [13]. However, current models have struggled to adapt to overlapping community searches, often encountering oversmoothing and slow-training issues. 8"
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14695v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14695v1",
|
| 3 |
+
"title": "MisgenderMender: A Community-Informed Approach to Interventions for Misgendering",
|
| 4 |
+
"abstract": "Content Warning: This paper contains examples of misgendering and erasure\nthat could be offensive and potentially triggering.\n Misgendering, the act of incorrectly addressing someone's gender, inflicts\nserious harm and is pervasive in everyday technologies, yet there is a notable\nlack of research to combat it. We are the first to address this lack of\nresearch into interventions for misgendering by conducting a survey of\ngender-diverse individuals in the US to understand perspectives about automated\ninterventions for text-based misgendering. Based on survey insights on the\nprevalence of misgendering, desired solutions, and associated concerns, we\nintroduce a misgendering interventions task and evaluation dataset,\nMisgenderMender. We define the task with two sub-tasks: (i) detecting\nmisgendering, followed by (ii) correcting misgendering where misgendering is\npresent in domains where editing is appropriate. MisgenderMender comprises 3790\ninstances of social media content and LLM-generations about non-cisgender\npublic figures, annotated for the presence of misgendering, with additional\nannotations for correcting misgendering in LLM-generated text. Using this\ndataset, we set initial benchmarks by evaluating existing NLP systems and\nhighlighting challenges for future models to address. We release the full\ndataset, code, and demo at\nhttps://tamannahossainkay.github.io/misgendermender/.",
|
| 5 |
+
"authors": "Tamanna Hossain, Sunipa Dev, Sameer Singh",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "LLM Fairness",
|
| 14 |
+
"gt": "Content Warning: This paper contains examples of misgendering and erasure\nthat could be offensive and potentially triggering.\n Misgendering, the act of incorrectly addressing someone's gender, inflicts\nserious harm and is pervasive in everyday technologies, yet there is a notable\nlack of research to combat it. We are the first to address this lack of\nresearch into interventions for misgendering by conducting a survey of\ngender-diverse individuals in the US to understand perspectives about automated\ninterventions for text-based misgendering. Based on survey insights on the\nprevalence of misgendering, desired solutions, and associated concerns, we\nintroduce a misgendering interventions task and evaluation dataset,\nMisgenderMender. We define the task with two sub-tasks: (i) detecting\nmisgendering, followed by (ii) correcting misgendering where misgendering is\npresent in domains where editing is appropriate. MisgenderMender comprises 3790\ninstances of social media content and LLM-generations about non-cisgender\npublic figures, annotated for the presence of misgendering, with additional\nannotations for correcting misgendering in LLM-generated text. Using this\ndataset, we set initial benchmarks by evaluating existing NLP systems and\nhighlighting challenges for future models to address. We release the full\ndataset, code, and demo at\nhttps://tamannahossainkay.github.io/misgendermender/.",
|
| 15 |
+
"main_content": "Introduction Misgendering is the act of referring to someone using a word, e.g. a pronoun or title, that does not correctly reflect the gender with which they identify (Dictionary, 2023). While there is growing awareness about the adverse impacts of misgendering on peoples\u2019 lives (Dev et al., 2021), there is insufficient scholarship or resources that idenLinguistic Gender Profile Name: Elliot Page Gender identity: Trans man, Non-binary Pronouns: he/him/his/his/himself, they/them/their/theirs/themselves Gendered Terms: masculine, neutral Deadname: Ellen Grace Philpotts-Page Annotated Content Detect-Only X Post: John Wayne was a man and Elliot Page is a woman. . . Detect Label: Misgendering X Post: ...\"A woman named Ellen Page became a man named Elliot Page\" is not an assertion without either ontological or epistemological problems, but it\u2019s one our society was already pretty primed to embrace; so did so quickly. Detect Label: No Misgendering Detect+Correct LLM-generation: Ellen Grace credits her mother with her success, and she is eternally grateful for her love and support. Detect Label: Misgendering Corrected: Ellen \u2192Elliot credits her \u2192his mother with her \u2192his success, and she \u2192he is eternally grateful for her love and support. Figure 1: MISGENDERMENDER examples consisting of a gender linguistic profile and corresponding annotated content for detecting and correcting misgendering. tify and attempt to mitigate misgendering in these various daily use platforms and technologies. Efforts to measure and mitigate gender bias in natural language processing primarily focus on cisgender and binary gender categories (Guo et al., 2022; Choubey et al., 2021). Few efforts to address non-traditional gender categories have evaluated LLMs\u2019 abilities to use non-binary pronouns (Hossain et al., 2023), coreference resolution using neo-pronouns (Cao and Daum\u00e9 III, 2020), and representational biases in word embeddings (Dev et al., 2021). Furthermore, even though misgendering is both a factual inaccuracy and a toxic act of identity erasure, research on factuality and toxicity has largely ignored it (Gao and Emami, 2023; Lees et al., 2022). arXiv:2404.14695v1 [cs.CL] 23 Apr 2024 \fOur contribution is two-fold: (i) we conduct a community survey to understand opinions about automated interventions for text-based misgendering, and (ii) based on the survey, we define a task and evaluation dataset for addressing misgendering in text-based content. Our survey of gender-diverse1 individuals revealed a prevalent issue of misgendering, especially on social media, but also in other areas like AI-generated content, news articles, and academic journals (\u00a7 2). While there was a general preference for automatic detection of misgendering across domains, opinions diverged on measures such as correcting or hiding misgendered content (\u00a7 2.1). Participants were more receptive to the idea of auto-correction in AI-generated content than social media, citing concerns over limiting freedom of speech and creating a false sense of allyship. Importantly, there were significant apprehensions regarding the implementation of any automated systems to address misgendering, encompassing issues like the fundamental infeasibility of these systems, privacy, the risk of profiling or targeting based on gender linguistic preferences databases, and doubts about the current capabilities of NLP systems to perform interventions accurately (\u00a7 2.2). Based on the opinions and concerns expressed by participants in our survey, we defined a task for misgendering interventions and constructed a corresponding evaluation dataset, MISGENDERMENDER (\u00a7 3). We define the interventions for misgendering task as two sub-tasks: (i) detecting misgendering, followed by (ii) correcting misgendering where misgendering is present, in domains where editing is appropriate (\u00a7 3.1). Social media (X and YouTube) were picked as a Detect-Only domain and LLM-generations as a Detect+Correct domain. Text from each of these sources was collected regarding 30 non-cisgender public figures whose gender identities and gender terminology preferences are publicly available (\u00a7 3.2). A total of 3790 instances are human annotated for the misgendering interventions task (\u00a7 3.3). See Figure 1 for examples from MISGENDERMENDER dataset. We evaluated current NLP systems using MISGENDERMENDER, setting initial benchmarks and pinpointing areas for future work. For the detection sub-task, we prompted language models using similar instructions to those given to human annotators, including providing the gender linguistic profile 1Individuals who self-identify as non-cisgender or have changed their gender terminology at some point in their lives of the relevant individual. We also used toxicity detection and rule-based baselines (\u00a7 3.4). GPT-4 achieved the highest F1-score across domains, but there is still much room for improvement (X posts: 62.6, YouTube Comments: 85.3, LLM-generations: 55.9). There were errors associated with coreference resolution, understanding questions, temporal relationships, quotations, and authorship recognition. For the second sub-task of correcting misgendering, we used a rule-based editor and prompting of GPT-4 (\u00a7 3.5). Human evaluation of edits showed GPT-4 corrected misgendering in 97% of edits while making unnecessary edits in only 4.6% of cases. While this is promising, further work is still needed since these edits were largely singlesentence and context-free. To facilitate this, we release the full dataset, code, and demo of our work at https://tamannahossainkay.github. io/misgendermender/. 2 Survey on Interventions for Misgendering Automated systems to prevent misgendering lack existing research. In order to define a task and develop an evaluation dataset rooted in community perspectives, we first survey gender-diverse individuals on their views regarding automated interventions for misgendering. Methodology The survey is anonymous and is conducted using Google Forms. We do not collect any data which could personally identify respondents. We reached out to participants through Queer in AI, International Society of Non-binary Scientists (ISBNS), and social media. All participants were adults (18 years or older) living in the US, who either identified as non-cisgender or had changed their gender terminology at some point in their lives. The survey consists of four sections, which solicit participants\u2019 demographic data, experiences with misgendering, preferences for misgendering interventions, concerns regarding automated intervention systems, and miscellaneous feedback. See Appendix A for details. Participants We have a total of 33 respondents to our survey 2. Further information on participants can be found in Appendix A. 2While this is not a large sample, it is similar to other recent work which surveys non-cisgender or non-binary people: 19 in Dev et al. (2021) and 35 in Ungless et al. (2023) \fSocial Media News Articles Biographies AI Generated Domains 0 5 10 15 20 25 30 Count 24 9 9 8 Have you faced misgendering in any of these domains? Social Media News Articles Biographies AI Generated Domains 0 5 10 15 20 25 30 Count 27 27 27 27 Would you want misgendering detected and flagged for users in any of these domains? Social Media News Articles Biographies AI Generated Domains 0 5 10 15 20 25 30 Count 17 23 22 22 Would you want misgendering to be automatically corrected in any of these domains? Social Media News Articles Biographies AI Generated Domains 0 5 10 15 20 25 30 Count 21 16 16 19 Would you want misgendering to be automatically hidden or deleted in any of these domains? Figure 2: Survey responses Count of participants (out of 33) reporting experiences with misgendering and expressing a desire for detection, correction, or hiding of misgendering across various domains. Misgendering experiences Most survey respondents faced misgendering on social media platforms, and about a fourth faced misgendering in news articles, biographies, and AI-generated content (Figure 2). There were also some write-in domains where participants faced misgendering, such as journal publications, academic presentations, and website profiles. 2.1 Desired Interventions for Misgendering We present responses for questions on particular interventions (detect, edit, or hide misgendering content) and open-ended feedback on preferred features from automated intervention systems. Detect, edit, or hide The desire for detection of misgendering was high across all domains, with more than three-fourths of the participants wanting misgendering to be automatically detected (Figure 2). As for interventions, participants had varied preferences. However, participants had more varied preferences for automatic correction of misgendering. While about two-thirds of the participants wanted misgendering to be automatically corrected in news articles, AI-generated content, and biographies, only half were interested in the auto-correction of misgendering in social media. Slightly more participants favored hiding or deleting social media content containing misgendering. Write-in comments shed light on some nuances to consider for what interventions are appropriate in a given situation: \u2022 Only detect: Some participants noted that they would only be interested in the automatic detection of misgendering, and would not want the content to be corrected or hidden so they could interpret it themselves. \u2022 Intent based: Some participants noted that they would want intentional misgendering to make a political point to be hidden but otherwise misgendering content to be corrected. \u2022 Source based: Some participants expressed that they would only like official content to be autocorrected, such as journals, articles, biographies, etc. Others suggested only AI-generated content should be auto-corrected, and it could violate the American First Amendment right to free speech to edit user-generated content (e.g. social media posts). Several themes emerge from free-form feedback on desired features for automated interventions: Flexible & user friendly Any system designed to record individual gender terminology preferences must be customizable (e.g. allow for neopronouns) and flexible to modify preferences at any time. Any misgendering intervention system should operate strictly based on current gender terminology preferences that users have consented to be used for interventions after thorough user education. It should also be user-friendly, e.g. grammarcorrection tools or writing assistants that actively detect and suggest corrections for misgendering during typing. Conext-sensitivity. Systems should be sensitive to context in a few different ways: allowing for different gender terminology in different settings (e.g., neo-pronouns in LGBTQ+ spaces and they/them pronouns in non-LGBTQ+ spaces), enabling users to specify different interventions in different domains (e.g. correct misgendering in academic citations but not in job search materials), differentiate \fLinguistic Gender Profiles Input Instance Detect Misgendering No Misgendering Correct Detect+ Correct DetectOnly Corrected Content Output (i) Output (ii) Sub-task (i) Sub-task (ii) Domain of Input Content Content Figure 3: Problem Setup The misgendering interventions task can be divided into two sub-tasks: (i) detecting misgendering, followed by (ii) correcting misgendering, in domains where editing is appropriate. between malicious misgendering and unintentional mistakes, and discerning when gender is relevant and when it is not. LLM fairness & transparency. Language models should have output validation to filter out or correct instances of misgendering. They could use proper nouns or default to gender-neutral pronouns such as they/them when necessary. Reducing the correlation between names, pronouns, professions, personality traits, and physical characteristics in generated content is vital. The integration of neopronouns and gender-diverse language during the training phase is equally important. Additionally, there should be transparency about LLM failures and errors regarding misgendering and bias. 2.2 Concerns about Automated Interventions There were concerns about the feasibility, limitations, and risks of automated interventions: Fundamental infeasibility. A key concern was that the fluid, flexible, and nuanced nature of individual gender linguistic preferences could not be operationalized. Any attempt to do so will enforce a static and rigid view of gender in some form. Simply intervening on text through these systems also would not tackle the root problem of people misgendering others. NLP Limitations. A major concern was that NLP systems are not sophisticated enough to grasp the intricacies of language (e.g. quotations or slang) required for accurate interventions. Language models are also biased towards a binary view of gender, stemming from the predominance of binarygendered language in their training data. Addressing this issue is complex; simply removing or altering the binary gendered language in the training corpora is impractical and could compromise their ability to reflect linguistic changes over time. Censorship and Security. There is a risk that these systems may unintentionally censor content related to gender-diverse individuals due to errors or overzealous interventions. There are also several security concerns: these systems could be exploited to target and profile individuals with marginalized and vulnerable gender identities; there could be breaches of privacy, e.g. unintentional outing of gender identities; and correcting misgendering might create a mistaken perception of safety and allyship about people who misgender intentionally. 2.3 Survey Based Dataset Design We design our evaluation dataset using insights from the community survey above. Survey respondents expressed concerns about the potential dangers of automated systems addressing misgendering, such as privacy violations, unintentional disclosure of someone\u2019s undisclosed gender identity, or misuse against at-risk groups. To minimize risks, we exclusively work with data about public figures who have openly declared their gender identity and gendered terminology preferences. In any future development of user-oriented intervention systems, such as social media platforms, it is crucial to ensure user autonomy and security. Key measures include strict adherence to user preferences, secure handling of gender-related information, flexible options for users to opt-in and opt out, and thorough user education about the systems and associated risks, ensuring informed consent at each stage. We selected social media and LLM-generations as two domains for our datasets. We selected social media for several reasons: (i) majority of survey participants experienced misgendering here, (ii) many respondents showed interest in misgendering detection in this context, (iii) since our focus is on public figures, social media is expected to have relevant posts about them, and (iv) social media \fplatforms offer publicly accessible APIs. Additionally, we chose LLM-generations as a domain in our dataset because it was a popular domain for both detecting and correcting misgendering, and we can construct instances to challenge the language understanding abilities of NLP systems, thus addressing concerns about their handling of linguistic nuances that were brought up in the survey. Further, we implement a source-based separation of interventions, differentiating between Detect-Only and Detect+Correct domains. Social media content is categorized as a Detect-Only domain, aligning with the survey concerns regarding free speech, potential censorship of non-cisgender content, risks of mistaken allyship, and preserving the right to interpret, even potentially offensive, content. In contrast, LLM-generated content is designated as a Detect+Correct domain, aligned with the interests of survey participants. 3 MISGENDERMENDER Dataset 3.1 Problem Setup We assume access to gender profiles on individuals, P = p1, ..., p|P|, consisting of their name, gender identity, gender terminology preferences, and deadname, if any. The misgendering interventions task can be divided into two sub-tasks: (i) detecting misgendering, followed by (ii) editing misgendering where misgendering is present, in domains where editing is appropriate. Given a collection of textual content, C = c1, ..., c|C|, about an individual, the first sub-task is to detect, for each input c, whether it contains misgendering towards them given their profile p. If so, and if c is from a domain that is appropriate to edit, we continue to the task of editing c to correct the misgendering. Figure 3 presents an overview of the problem setup. 3.2 Data Collection We compile a list of notable non-cisgender individuals, including their publicly available gender information. We also gather human-written content about them from X and YouTube, as well as text generated by LLMs. Individuals & Gender Profiles Using the Wikidata Query Service, we extracted the names of individuals identified as \u2019non-binary\u2019, \u2019trans man\u2019, and \u2019trans woman\u2019. We ranked them based on the number of sitelinks, which indicate how many Wikipedia pages link to the page about the given individual. We focused on the top 10 most popular individuals in each gender category. For each of these individuals, we used WikiData to gather additional metadata, such as their pronouns and names given at birth. If an individual\u2019s pronouns are missing on WikiData, the pronouns from their Wikipedia biography are used instead. If a person\u2019s name and birth name are different, their birth name is used as their deadname3. We inferred appropriate gendered term categories for each individual using their preferred pronouns, utilizing feminine terms for those who use she, masculine terms for he, and neutral terms for they. X (formerly Twitter) Posts We also collected posts from X (formerly Twitter) about each individual using the Twitter API. If a person\u2019s profile consists of a deadname, then we retrieve 50 posts querying for their name and 50 querying for their deadname. Otherwise, we retrieve 100 posts using their name. User handles in the text were substituted with [USERNAME] for anonymization, except for those of the relevant public figures. YouTube Comments We queried the public YouTube Data API using the names and birth names of each individual. If a person\u2019s deadname is available, we queried for 3 videos using their name and 3 videos using their deadname. Otherwise, we retrieved 6 videos using their name only. For each video, we collected 20 comments. We also retrieved metadata for both videos and comments. LLM-Generations We used GPT-4 (OpenAI, 2023), PaLM (Chowdhery et al., 2022), and Vicuna (Platzer and Puschner, 2021) to generate short biographies and sentences about the same group of individuals. We constructed prompts to generate instances that would challenge the language understanding of NLP systems (Ribeiro et al., 2020) (see Appendix B for all prompts). We split biographies into sentences and annotated per sentence. 3.3 Annotation Content from all sources is annotated to identify the presence of misgendering. We provided Amazon Mechanical Turk (https://www.mturk.com/) workers with information about each individual (name, gender identities, preferred pronouns, and deadname) along with retrieved texts about them. Annotators are asked to label each text instance 3the name that a transgender person was given at birth and no longer uses upon transitioning (Merriam-Webster, 2023) \fTweet: @USERNAME shes a stalker check out her replies. every ezra miller thread she is there w seething lies who is it? clue [LINK] Incorrect Annotation: Misgendering Table 1: Coreference Resolution Error. Example of an incorrectly annotated tweet about Ezra Miller who uses neutral-gendered words. While the tweet contains feminine pronouns, they are not used to refer to Miller. Domain Misgendering No Misgendering Total X-Posts 81 1118 1199 (6.8%) (93.2%) YouTube 352 1217 1559 Comments (22.0%) (78.0%) LLM 263 769 1032 Generations (25.5%) (74.5%) Grand Total 3790 Table 2: MISGENDERMENDER Counts. Distribution of annotation labels by domain. (YouTube comment, tweet, or generated biography) for whether it contains misgendering towards the query individual (Misgendering), refers to them without misgendering (No Misgendering), or the text is not about the individual (Irrelevant) (Appendix D.3). LLM generated text that contains misgendering is also corrected by annotators. Each instance in our evaluation dataset was annotated by three MTurk workers. Workers had to pass a qualification test for each sub-task. The inter-annotator agreement percentage for detecting misgendering is 87.4%. Conventional agreement scores are unsuitable for correcting misgendering due to the variety of possible valid solutions. We also did not use human-written edits as gold labels for evaluating baseline models. We discard instances annotated as Irrelevant. The MISGENDERMENDER dataset consists of 3790 textual content labeled as Misgendering or No Misgendering towards a paired individual. LLMGenerations consisting of Misgendering also consist of human written corrections. See Table 2 for a breakdown of the dataset by domain and label. Challenges The first round of annotation instructions, examples, and qualification tests were based on a pilot study (Appendix H). However, we noticed annotation errors due to mistaken pronoun coreference resolution (Table 1) and updated annotation materials to address this issue. Annotations using initial guidelines and tests were discarded. 3.4 Detect Misgendering We evaluate several existing NLP tools for detecting misgendering in both Detect-Only and Detect+Correct domains. Prompting We prompt GPT-4 (OpenAI, 2023), PaLM (Chowdhery et al., 2022), Llama-2-Chat 70B (Touvron et al., 2023), Gemma-7B-IT (Team et al., 2024) and Mixtral-8x7B-Instruct (Jiang et al., 2024) with instructions for detecting misgendering with instructions and 5-shot chain-of-thought (Wei et al., 2022) examples (Appendix E.1). For each instance, the person\u2019s gender linguistic profile is provided in the prompt as a reference for detecting misgendering, similar to providing evidence sets to verify a claim in fact-checking (Gao et al., 2023). Examples are based on instances of misgendering seen in a pilot study (see Appendix H). Toxicity Detection We used the perspective API (Lees et al., 2022) for to get scores for toxicity detection and identity attacks. A threshold of 0.75 was chosen based on a pilot study (Appendix H) to classify any text with a score above the threshold as containing Misgendering. Rule-based We use a table of pronouns (Hossain et al., 2023) and a table of gendered keywords created using a list of gendered words from Bolukbasi et al. (2016) (Appendix F). For the naive approach, if any deadname, gendered word, or pronoun that is inappropriate for a person given their gender linguistic profile (e.g. masculine terms for someone who only uses feminine terminology) is present in the text, then it is classified as containing Misgendering. For a coreference based approach, fastcoref (Otmazgin et al., 2022) is used to create coreference clusters, and if (i) the person\u2019s deadname is present in the text, or (ii) an inappropriate gendered word or pronoun is in the same coreference cluster as the person\u2019s name or deadname then the instance is predicted to contain Misgendering. Results Across all three data sources we see the highest F1-score for GPT-4 (Table 3). While GPT4 also had the highest precision for X posts and YouTube comments, rule-based methods had the highest recall across all sources. GPT-4 made errors based on mistaken coreference resolution, and inability to understand some linguistic nuances, such as quotations, questions, and temporal relationships (Table 4). The Perspective API could only positively identify cases of misgendering that \fLLM 5-shot CoT Perspective Rule-Based GPT-4 PaLM Llama-2 Gemma Mixtral Toxicity Identity Naive Coref X Posts Accuracy 93.9 86.8 59.4 70.1 56.0 91.6 79.8 77.6 87.1 Precision 53.5 33.0 11.1 7.4 8 .6 12.5 15.7 22.7 26.6 Recall 75.3 77.8 71.6 12.3 56.8 2.5 43.2 96.3 51.9 F1 62.6 46.3 19.2 9.3 15.0 4.1 23.0 36.7 35.1 YouTube Comments Accuracy 93.1 85.1 64.0 60.0 58.4 76.2 70.4 84.5 79.0 Precision 80.5 61.0 36.7 18.8 30.4 24.0 30.6 59.2 51.2 Recall 90.6 90.6 88.6 9.1 67.5 3.5 26.6 93.9 94.4 F1 85.3 72.9 51.9 12.2 41.9 6.1 28.5 72.6 66.4 LLM Generations Accuracy 67.5 58.9 53.4 57.8 42.0 74.5 74.5 47.7 68.6 Precision 42.7 36.1 31.8 22.6 28.5 0.0 0.0 31.6 43.1 Recall 80.6 79.5 72.6 14.1 84.0 0.0 0.0 90.5 72.2 F1 55.9 49.6 44.3 17.3 42.5 0.0 0.0 46.9 54.0 Table 3: Detect results. Accuracy of the models in detecting Misgendering in the MISGENDERMENDER dataset. were also paired with other forms of toxicity. Consequently, it could not identify any cases of misgendering in the polite and formal LLM-generated texts. While the coreference-based method provided the highest precision for LLM-generated misgendering detection, it often failed to create appropriate coreference clusters across data sources. See Table 4 for examples of errors from each method. 3.5 Edit Misgendering We evaluate a few existing NLP tools on their ability to edit misgendering. Only instances from the Detect+Correct domain, LLM-generations, containing Misgendering are included here. Prompting We prompt GPT-4 , PaLM, and Llama-2-Chat 70B with instructions for editing misgendering. For each instance, the individual\u2019s gender terminology preferences are provided as a reference, similar to work in non-factual text correction (Gao et al., 2023) (Appendix G.1). Rule-based We create a table gendered words using a list from Bolukbasi et al. (2016) (Appendix F), and use a table of pronouns from Hossain et al. (2023). Given a person\u2019s gender linguistic profile, if a gendered term or pronoun that is inappropriate for them from these tables is identified in the text, then it is replaced with a corresponding word that matches their linguistic profile. If switching from a binary pronoun to a neutral one, then corresponding verbs are pluralized (APA, 2023) (Table 8). Results The edited texts were evaluated using human annotators from Amazon Mechanical Turk. Annotators were asked to evaluate each edited sentence for (i) whether misgendering was corrected, and (ii) whether any unnecessary edits were made. Three annotators evaluated each instance with an agreement score of 96.3% for (i) and 89.9% for (ii). Due to annotation costs, we only evaluated systems that showed the best performance for detecting misgendering: GPT-4 and the rule-based baseline. GPT-4 edits corrected misgendering in 97% of edits, while making unnecessary edits in only 4.6% of cases. (Table 5). Unnecessary edits sometimes radically change the original text (Table 6). On the other hand, rule-based baseline corrected misgendering in 78.7% of the instances, while making unnecessary edits in 28.1% instances. 4 Related Work Gender Bias Significant efforts have been made to address gender bias in language technologies, primarily focusing on a binary and cisgender perspective (Bolukbasi et al., 2016; Zhao et al., 2018; Kurita et al., 2019), with recent studies beginning to explore this issue with a non-binary and noncisgender framework. Dev et al. (2021) discuss ways in which gender-exclusivity in NLP can harm non-binary individuals, and demonstrate bias in word embeddings. Hossain et al. (2023) show that LMs are limited in their ability to use non-binary pronouns, Ovalle et al. (2023) evaluate LMs for misgendering and harmful responses to gender disclose, Brandl et al. (2022) show neo-pronouns have high perplexity in LMs, Cao and Daum\u00e9 III (2020) create specialized datasets for coreference resolutions with neo-pronouns, and Lauscher et al. (2022) \fError Type Profile Text, Label, and Prediction GPT-4 CoT Coreference Name: Ezra Miller Gendered Terms: Neutral Tweet: @USERNAME Damn, if Ezra Miller wasn\u2019t a f*****g psychopath then he would make a decent Flash. Label: Misgendering; Pred: No Misgendering GPT-4 Explanation: The tweet refers to Ezra Miller but no masculine or feminine words are used to refer to them so there is no misgendering. Quotation Name: Elliot Page Gendered Terms: Feminine Deadname: Ellen Grace Philpotts-Page Tweet: @USERNAME principle of law, or indeed science or nature. \"A woman named Ellen Page became a man named Elliot Page\" is not an assertion without either ontological or epistemological problems, but it\u2019s one our society was already pretty primed to embrace; so did so quickly. Label: No Misgendering; Pred: Misgendering GPT-4 Explanation: The tweet misgenders Elliot Page by calling him a \"woman\" which is a feminine gendered term, and thus incorrect as Elliot uses neutral and masculine gendered terms. Also, his old name \u2019Ellen\u2019 is used which is his deadname. Question Name: Buck Angel Gendered Terms: Feminine Tweet: @USERNAME Do you think Buck Angel should go to the womens changing room? [LINK] Label: No Misgendering; Pred: Misgendering GPT-4 Explanation: The tweet misgenders Buck Angel by suggesting he should use the women\u2019s changing room, implying that he is a woman, this is contrary to Buck\u2019s masculine gender identity. Temporal Name: Lil Uzi Vert Gendered Terms: Neutral Deadname: Symere Bysil Wood LLM Generation: While I used to think of Lil Uzi Vert as a conventional \"he-man,\" I do not think so anymore. Label: No Misgendering; Pred: Misgendering GPT-4 Explanation: The sentence contains the masculine gendered term \"he-man\" to refer to Lil Uzi Vert... Perspective No toxicity besides misgendering Name: Chaz Bono Gendered Terms: Masculine Deadname: Chastity Bono YouTube Comment: It\u2019s a she!! Label: Misgendering; Pred: No Misgendering Naive Rule Typo Name: Lil Uzi Vert Gendered Terms: Neutral Deadname: Symere Bysil Wood LLM Generation: Lil Uzi Vert is a renowned broither in the rap industry, consistently producing chart-topping hits. Label: Misgendering; Pred: No Misgendering Coreference Name: Chaz Bono Gendered Terms: Masculine Deadname: Chastity Bono YouTube Comment: Chaz is a lovely man with a deep understanding of woman\u2019s difficulties! Label: No Misgendering; Pred: Misgendering Table 4: Detect Errors. We present examples of instances where benchmark models for detecting misgendering in the MISGENDERMENDER dataset fail at predicting the correct label. Method Misgendering Corrected Unnecessary Edits GPT-4 97.0 4.6 Rule-based 78.7 28.1 Table 5: Human evaluation of automated edits. Edits are evaluated for (i) whether misgendering was corrected, and (ii) whether any unnecessary edits were made. provide desiderata for modeling pronouns in language technologies. Sun et al. (2021) show how models can be trained to rewrite binary pronouns as gender-neutral ones. While Lund et al. (2023) introduce a technique to generate singular they data and show that data augmentation can mitigate bias against singular they in Grammatical Error Correction (GEC) systems. However, none of these detect and edit misgendering towards given gendered terminology preferences in non-templated texts. Toxicity Detection and Mitigation Supervised methods have been extensively used in toxicity detection (Lees et al., 2022; Kirk et al., 2022; Fortuna et al., 2022; Caselli et al., 2021; Poletto et al., 2020). Prompted language models have also been used for detecting toxicity in text (Chiu and Alexander, 2021; Schick et al., 2021; Goldzycher and Schneider, 2022). (Hallinan et al., 2022; Ma et al., 2020; Malmi et al., 2020) re-write detoxified text using unsupervised masking and reconstruction approaches. Dale et al. (2021); Nogueira dos San\fProfile Text, Edits, Labels Name: Elliot Page Gendered Terms: Feminine Deadname: Ellen Grace Philpotts-Page LLM Generation: She was born in 1846 and spent most of her life as a missionary in China, where she dedicated herself to helping women and children. GPT-4: Elliot Page, a renowned Canadian actor and producer, cherishes the special bond they formed with their on-screen mother, Jennifer Garner, while filming the acclaimed movie \"Juno\". He was born in 1846 and spent most of his life as a missionary in China, where he dedicated himself to helping women and children. Label: No Misgendering; Unnecessary Edits: Yes Name: Andreja Peji\u00b4 c Gendered Terms: Feminine Deadname: Andrej Pejic LLM Generation: While some people might think of Andrej Pejic as a man, I do not agree with this. GPT-4: While some people might think of Andreja Peji\u00b4 c as a man, I do not agree with this. Label: No Misgendering; Unnecessary Edits: No Rule-based: While some people might think of Andreja Peji\u00b4 c as a woman, I do not agree with this. Label: Misgendering; Unnecessary Edits: No Name: Andreas Krieger Gendered Terms: Masculine Deadname: Heidi Krieger LLM Generation: This feminine figure is central to Krieger\u2019s art, as she seeks to challenge traditional gender norms and celebrate the unique qualities of women. GPT-4 Edit This masculine figure is central to Krieger\u2019s story, as he seeks to challenge traditional gender norms and celebrate his unique journey. Label: No Misgendering; Unnecessary Edits: Yes Table 6: Model Edit Examples. We present examples of instances of LLM generations containing Misgendering that are edited by GPT-4 or a rule-based editor. Human annotated labels of the automated edits for whether (i) whether they still contain misgendering, and (ii) any unnecessary edits were made are also presented. tos et al. (2018) use translation or paraphrasing to detoxify text. However, none of these works address misgendering as a form of toxicity. Fact Checking and Correction Fact-checking is often framed as the task of identifying whether a claim is supported or refuted by the given evidence (Wadden et al., 2020; Augenstein et al., 2019; Thorne et al., 2018; Wang, 2017). Thre is also work on correcting text that is inconsistent with a set of evidence via post-hoc editing (Gao et al., 2023; Iv et al., 2022; Schick et al., 2022; Thorne and Vlachos, 2021). However, none of these address misgendering as a form of non-factual information that requires detection and correction. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14700v3.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14700v3",
|
| 3 |
+
"title": "FlashSpeech: Efficient Zero-Shot Speech Synthesis",
|
| 4 |
+
"abstract": "Recent progress in large-scale zero-shot speech synthesis has been\nsignificantly advanced by language models and diffusion models. However, the\ngeneration process of both methods is slow and computationally intensive.\nEfficient speech synthesis using a lower computing budget to achieve quality on\npar with previous work remains a significant challenge. In this paper, we\npresent FlashSpeech, a large-scale zero-shot speech synthesis system with\napproximately 5\\% of the inference time compared with previous work.\nFlashSpeech is built on the latent consistency model and applies a novel\nadversarial consistency training approach that can train from scratch without\nthe need for a pre-trained diffusion model as the teacher. Furthermore, a new\nprosody generator module enhances the diversity of prosody, making the rhythm\nof the speech sound more natural. The generation processes of FlashSpeech can\nbe achieved efficiently with one or two sampling steps while maintaining high\naudio quality and high similarity to the audio prompt for zero-shot speech\ngeneration. Our experimental results demonstrate the superior performance of\nFlashSpeech. Notably, FlashSpeech can be about 20 times faster than other\nzero-shot speech synthesis systems while maintaining comparable performance in\nterms of voice quality and similarity. Furthermore, FlashSpeech demonstrates\nits versatility by efficiently performing tasks like voice conversion, speech\nediting, and diverse speech sampling. Audio samples can be found in\nhttps://flashspeech.github.io/.",
|
| 5 |
+
"authors": "Zhen Ye, Zeqian Ju, Haohe Liu, Xu Tan, Jianyi Chen, Yiwen Lu, Peiwen Sun, Jiahao Pan, Weizhen Bian, Shulin He, Qifeng Liu, Yike Guo, Wei Xue",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-25",
|
| 8 |
+
"primary_cat": "eess.AS",
|
| 9 |
+
"cats": [
|
| 10 |
+
"eess.AS",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.CL",
|
| 13 |
+
"cs.LG",
|
| 14 |
+
"cs.SD"
|
| 15 |
+
],
|
| 16 |
+
"label": "Original Paper",
|
| 17 |
+
"paper_cat": "Diffusion AND Model",
|
| 18 |
+
"gt": "Recent progress in large-scale zero-shot speech synthesis has been\nsignificantly advanced by language models and diffusion models. However, the\ngeneration process of both methods is slow and computationally intensive.\nEfficient speech synthesis using a lower computing budget to achieve quality on\npar with previous work remains a significant challenge. In this paper, we\npresent FlashSpeech, a large-scale zero-shot speech synthesis system with\napproximately 5\\% of the inference time compared with previous work.\nFlashSpeech is built on the latent consistency model and applies a novel\nadversarial consistency training approach that can train from scratch without\nthe need for a pre-trained diffusion model as the teacher. Furthermore, a new\nprosody generator module enhances the diversity of prosody, making the rhythm\nof the speech sound more natural. The generation processes of FlashSpeech can\nbe achieved efficiently with one or two sampling steps while maintaining high\naudio quality and high similarity to the audio prompt for zero-shot speech\ngeneration. Our experimental results demonstrate the superior performance of\nFlashSpeech. Notably, FlashSpeech can be about 20 times faster than other\nzero-shot speech synthesis systems while maintaining comparable performance in\nterms of voice quality and similarity. Furthermore, FlashSpeech demonstrates\nits versatility by efficiently performing tasks like voice conversion, speech\nediting, and diverse speech sampling. Audio samples can be found in\nhttps://flashspeech.github.io/.",
|
| 19 |
+
"main_content": "Introduction In recent years, the landscape of speech synthesis has been transformed by the advent of large-scale generative models. Consequently, the latest research efforts have achieved notable advancements in zero-shot speech synthesis systems by significantly increasing the size of both datasets and models. Zero-shot speech synthesis, such as text-to-speech (TTS), voice conversion (VC) and Editing, aims to generate speech that incorporates unseen speaker characteristics from a reference audio segment during inference, without the need for additional training. Current advanced zero-shot speech synthesis systems typically leverage language models (LMs) Wang et al. (2023a); Yang et al. (2023); Zhang et al. (2023); Kharitonov et al. (2023); Wang et al. (2023b); Peng et al. (2024); Kim et al. (2024) and diffusion-style models Shen et al. (2024); Kim et al. (2023b); Le et al. (2023); Jiang et al. (2023b) for in-context speech generation on the large-scale dataset. However, the generation process of these methods needs a long-time iteration. For example, VALL-E Wang et al. (2023a) builds on the language model to predict 75 audio token sequences for a 1-second speech, in its first-stage autoregressive (AR) token sequence generation. When using a non-autoregressive (NAR) latent diffusion model Rombach et al. (2022) based framework, NaturalSpeech 2 Shen et al. (2024) still requires 150 sampling steps. As a result, although these methods can produce human-like speech, they require significant computational time and cost. Some efforts have been made to accelerate the Preprint. Under review. \u2020: Corresponding authors. arXiv:2404.14700v3 [eess.AS] 25 Apr 2024 \f Figure 1: The inference time comparisons of different zero-shot speech synthesis systems using the real-time factor (RTF). generation process. Voicebox Le et al. (2023) adopts flow-matching Lipman et al. (2022) so that fewer sampling steps (NFE1: 64) can be achieved because of the optimal transport path. ClaM-TTS Kim et al. (2024) proposes a mel-codec with a superior compression rate and a latent language model that generates a stack of tokens at once. Although the slow generation speed issue has been somewhat alleviated, the inference speed is still far from satisfactory for practical applications. Moreover, the substantial computational time of these approaches leads to significant computational cost overheads, presenting another challenge. The fundamental limitation of speech generation stems from the intrinsic mechanisms of language models and diffusion models, which require considerable time either auto-regressively or through a large number of denoising steps. Hence, the primary objective of this work is to accelerate inference speed and reduce computational costs while preserving generation quality at levels comparable to the prior research. In this paper, we propose FlashSpeech as the next step towards efficient zeroshot speech synthesis. To address the challenge of slow generation speed, we leverage the latent consistency model (LCM) Luo et al. (2023), a recent advancement in generative models. Building upon the previous non-autoregressive TTS system Shen et al. (2024), we adopt the encoder of a neural audio codec to convert speech waveforms into latent vectors as the training target for our LCM. To train this model, we propose a novel technique called adversarial consistency training, which utilizes the capabilities of pre-trained speech language models Chen et al. (2022b); Hsu et al. (2021); Baevski et al. (2020) as discriminators. This facilitates the transfer of knowledge from large pre-trained speech language models to speech generation tasks, efficiently integrating adversarial and consistency training to improve performance. The LCM is conditioned on prior vectors obtained from a phoneme encoder, a prompt encoder, and a prosody generator. Furthermore, we demonstrate that our proposed prosody generator leads to more diverse expressions and prosody while preserving stability. Our contributions can be summarized as follows: \u2022 We propose FlashSpeech, an efficient zero-shot speech synthesis system that generates voice with high audio quality and speaker similarity in zero-shot scenarios. \u2022 We introduce adversarial consistency training, a novel combination of consistency and adversarial training leveraging pre-trained speech language models, for training the latent consistency model from scratch, achieving speech generation in one or two steps. 1NFE: number of function evaluations. 2 \f\u2022 We propose a prosody generator module that enhances the diversity of prosody while maintaining stability. \u2022 FlashSpeech significantly outperforms strong baselines in audio quality and matches them in speaker similarity. Remarkably, it achieves this at a speed approximately 20 times faster than comparable systems, demonstrating unprecedented efficiency. 2 Related work 2.1 Large-Scale Speech Synthesis Motivated by the success of the large language model, the speech research community has recently shown increasing interest in scaling the sizes of model and training data to bolster generalization capabilities, producing natural speech with diverse speaker identities and prosody under zero-shot settings. The pioneering work is VALL-E Wang et al. (2023a), which adopts the Encodec D\u00e9fossez et al. (2022) to discretize the audio waveform into tokens. Therefore, a language model can be trained via in-context learning that can generate the target utterance where the style is consistent with prompt utterance. However, generating audio in such an autoregressive manner Wang et al. (2023b); Peng et al. (2024)can lead to unstable prosody, word skipping, and repeating issues Ren et al. (2020); Tan et al. (2021); Shen et al. (2024). To ensure the robustness of the system, non-autoregressive methods such as NaturalSpeech2 Shen et al. (2024) and Voicebox Le et al. (2023) utilize diffusion-style model (VP-diffusion Song et al. (2020) or flow-matching Lipman et al. (2022)) to learn the distribution of a continuous intermediate vector such as mel-spectrogram or latent vector of codec. Both LM-based methods Zhao et al. (2023) and diffusion-based methods show superior performance in speech generation tasks. However, their generation is slow due to the iterative computation. Considering that many speech generation scenarios require real-time inference and low computational costs, we employ the latent consistency model for large-scale speech generation that inference with one or two steps while maintaining high audio quality. 2.2 Acceleration of Speech Synthesis Since early neural speech generation models Tan et al. (2021) use autoregressive models such as Tacotron Wang et al. (2017) and TransformerTTS Li et al. (2019), causing slow inference speed, with O(N) computation, where N is the sequence length. To address the slow inference speed, FastSpeech Ren et al. (2020, 2019) proposes to generate a mel-spectrogram in a non-autoregressive manner. However, these models Ren et al. (2022) result in blurred and over-smoothed mel-spectrograms due to the regression loss they used and the capability of modeling methods. To further enhance the speech quality, diffusion models are utilized Popov et al. (2021a); Jeong et al. (2021); Popov et al. (2021b) which increase the computation to O(T), where T is the diffusion steps. Therefore, distillation techniques Luo (2023) for diffusion-based methods such as CoMoSpeech Ye et al. (2023), CoMoSVC Lu et al. (2024) and Reflow-TTS Guan et al. (2023) emerge to reduce the sampling steps back to O(1), but require additional pre-trained diffusion as the teacher model. Unlike previous distillation techniques, which require extra training for the diffusion model as a teacher and are limited by its performance, our proposed adversarial consistency training technique can directly train from scratch, significantly reducing training costs. In addition, previous acceleration methods only validate speaker-limited recording-studio datasets with limited data diversity. To the best of our knowledge, FlashSpeech is the first work that reduces the computation of a large-scale speech generation system back to O(1). 2.3 Consistency Model The consistency model is proposed in Song et al. (2023); Song and Dhariwal (2023) to generate high-quality samples by directly mapping noise to data. Furthermore, many variants Kong et al. (2023); Lu et al. (2023); Sauer et al. (2023); Kim et al. (2023a) are proposed to further increase the generation quality of images. The latent consistency model is proposed by Luo et al. (2023) which can directly predict the solution of PF-ODE in latent space. However, the original LCM employs consistency distillation on the pre-trained latent diffusion model (LDM) which leverages large-scale off-the-shelf image diffusion models Rombach et al. (2022). Since there are no pre-trained large-scale TTS models in the speech community, and inspired by the techniques Song and Dhariwal (2023); 3 \fKim et al. (2023a); Lu et al. (2023); Sauer et al. (2023); Kong et al. (2023), we propose the novel adversarial consistency training method which can directly train the large-scale latent consistency model from scratch utilizing the large pre-trained speech language model Chen et al. (2022b); Hsu et al. (2021); Baevski et al. (2020) such as WavLM for speech generation. 3 FlashSpeech Codec Encoder Codec Decoder Phoneme Codec Decoder Synthesized Speech Raw Speech Reconstructed Speech Latent Consistency Model Latent Vector Z Conditional Feature Noise Encoder \ud835\udc33\ud835\udc91\ud835\udc93\ud835\udc90\ud835\udc8e\ud835\udc91\ud835\udc95 \ud835\udc33\ud835\udc95\ud835\udc82\ud835\udc93\ud835\udc88\ud835\udc86\ud835\udc95 Random Segment \u0ddc \ud835\udc9b\ud835\udc95\ud835\udc82\ud835\udc93\ud835\udc88\ud835\udc86\ud835\udc95 \ud835\udc33\ud835\udc91\ud835\udc93\ud835\udc90\ud835\udc8e\ud835\udc91\ud835\udc95 Prosody Generator Discriminator Real / Fake Figure 2: Overall architecture of FlashSpeech. Our FlashSpeech consists of a codec encoder/decoder and a latent consistency model conditioned on feature from a phoneme and zprompt encoder and a prosody generator. A discriminator is used during training. 3.1 Overview Our work is dedicated to advancing the speech synthesis efficiency, achieving O(1) computation cost while maintaining comparable performance to prior studies that require O(T) or O(N) computations. The framework of the proposed method, FlashSpeech, is illustrated in Fig. 2. FlashSpeech integrates a neural codec, an encoder for phonemes and prompts, a prosody generator, and an LCM, which are utilized during both the training and inference stages. Exclusively during training, a conditional discriminator is employed. FlashSpeech adopts the in-context learning paradigm Wang et al. (2023a), initially segmenting the latent vector z, extracted from the codec, into ztarget and zprompt. Subsequently, the phoneme and zprompt are processed through the encoder to produce the hidden feature. A prosody generator then predicts pitch and duration based on the hidden feature. The pitch and duration embeddings are combined with the hidden feature and inputted into the LCM as the conditional feature. The LCM model is trained from scratch using adversarial consistency training. After training, FlashSpeech can achieve efficient generation within one or two sampling steps. 3.2 Latent Consistency Model The consistency model Song et al. (2023) is a new family of generative models that enables one-step or few-step generation. Let us denote the data distribution by pdata(x). The core idea of the consistency model is to learn the function that maps any points on a trajectory of the PF-ODE to that trajectory\u2019s origin, which can be formulated as: f(x\u03c3, \u03c3) = x\u03c3min (1) where f(\u00b7, \u00b7) is the consistency function and x\u03c3 represents the data x perturbed by adding zero-mean Gaussian noise with standard deviation \u03c3. \u03c3min is a fixed small positive number. Then x\u03c3min can then be viewed as an approximate sample from the data distribution pdata(x). To satisfy property in equation (1), following Song et al. (2023), we parameterize the consistency model as f\u03b8(x\u03c3, \u03c3) = cskip(\u03c3)x + cout(\u03c3)F\u03b8(x\u03c3, \u03c3) (2) 4 \fwhere f\u03b8 is to estimate consistency function f by learning from data, F\u03b8 is a deep neural network with parameter \u03b8, cskip(\u03c3) and cout(\u03c3) are are differentiable functions with cskip(\u03c3min) = 1 and cout(\u03c3min) = 0 to ensure boundary condition. A valid consistency model should satisfy the selfconsistency property Song et al. (2023) f\u03b8(x\u03c3, \u03c3) = f\u03b8(x\u03c3\u2032, \u03c3\u2032), \u2200\u03c3, \u03c3\u2032 \u2208[\u03c3min, \u03c3max]. (3) where \u03c3max = 80 and \u03c3min = 0.002 following Karras et al. (2022); Song et al. (2023); Song and Dhariwal (2023). Then the model can generate samples in one step by evaluating x\u03c3min = f\u03b8(x\u03c3max, \u03c3max) (4) from distribution x\u03c3max \u223cN(0, \u03c32 maxI). As we apply a consistency model on the latent space of audio, we use the latent features z which are extracted prior to the residual quantization layer of the codec, z = CodecEncoder(y) (5) where y is the speech waveform. Furthermore, we add the feature from the prosody generator and encoder as the conditional feature c, our objective has changed to achieve f\u03b8(z\u03c3, \u03c3, c) = f\u03b8(z\u03c3\u2032, \u03c3\u2032, c) \u2200\u03c3, \u03c3\u2032 \u2208[\u03c3min, \u03c3max]. (6) During inference, the synthesized waveform \u02c6 y is transformed from \u02c6 z via the codec decoder. The predicted \u02c6 z is obtained by one sampling step \u02c6 z = f\u03b8(\u03f5 \u2217\u03c3max, \u03c3max) (7) or two sampling steps \u02c6 zinter = f\u03b8(\u03f5 \u2217\u03c3max, \u03c3max) (8) \u02c6 z = f\u03b8(\u02c6 zinter + \u03f5 \u2217\u03c3inter, \u03c3inter) (9) where \u02c6 zinter means the intermediate step, \u03c3inter is set to 2 empirically. \u03f5 is sampled from a standard Gaussian distribution. 3.3 Adversarial Consistency Training A major drawback of the LCM Luo et al. (2023) is that it needs to pre-train a diffusion-based teacher model in the first stage, and then perform distillation to produce the final model. This would make the training process complicated, and the performance would be limited as a result of the distillation. To eliminate the reliance on the teacher model training, in this paper, we propose a novel adversarial consistency training method to train LCM from scratch. Our training procedure is outlined in Fig. 3, which has three parts: 3.3.1 Consistency Training To achieve the property in equation (3), we adopt following consistency loss LN ct(\u03b8, \u03b8\u2212) = E[\u03bb(\u03c3i)d(f\u03b8(zi+1, \u03c3i+1, c), f\u03b8\u2212(zi, \u03c3i, c))]. (10) where \u03c3i represents the noise level at discrete time step i, d(\u00b7, \u00b7) is the distance function, f\u03b8(zi+1, \u03c3i+1, c) and f\u03b8\u2212(zi, \u03c3i, c) are the student with the higher noise level and the teacher with the lower noise level, respectively. The discrete time steps denoted as \u03c3min = \u03c30 < \u03c31 < \u00b7 \u00b7 \u00b7 < \u03c3N = \u03c3max are divided from the time interval [\u03c3min, \u03c3max], where the discretization curriculum N increases correspondingly as the number of training steps grows N(k) = min(s02\u230ak K\u2032 \u230b, s1) + 1 (11) where K\u2032 = j K log2\u230as1/s0\u230b+1 k , k is the current training step and K is the total training steps. s1 and s0 are hyperparameters to control the size of N(k). The distance function d(\u00b7, \u00b7) uses the Pseudo-Huber metric Charbonnier et al. (1997) d(x, y) = p \u2225x \u2212y\u22252 + a2 \u2212a, (12) 5 \fDenoiser Denoiser \uf071\u2212 \uf071 Student Teacher Consistency Loss Discriminator Adversarial Loss Stop Grad \\\\ \ud835\udc33\ud835\udf0e\ud835\udc56+1 \ud835\udc33\ud835\udf0e\ud835\udc56 \ud835\udc33 Codec Decoder waveform \ud835\udc53 \ud835\udf03(\ud835\udc33\ud835\udf0e\ud835\udc56+1, \ud835\udf0e\ud835\udc56+1, c) \ud835\udc53 \ud835\udf03(\ud835\udc33\ud835\udf0e\ud835\udc56, \ud835\udf0e\ud835\udc56,c) \u0ddc \ud835\udc33 Figure 3: An illustration of adversarial consistency training. where a is an adjustable constant, making the training more robust to outliers as it imposes a smaller penalty for large errors than \u21132 loss. The parameters \u03b8\u2212of teacher model are \u03b8\u2212\u2190 \u2212stopgrad(\u03b8), (13) which are identical to the student parameters \u03b8. This approach Song and Dhariwal (2023) has been demonstrated to improve sample quality of previous strategies that employ varying decay rates Song et al. (2023). The weighting function refers to \u03bb(\u03c3i) = 1 \u03c3i+1 \u2212\u03c3i (14) which emphasizes the loss of smaller noise levels. LCM through consistency training can generate speech with acceptable quality in a few steps, but it still falls short of previous methods. Therefore, to further enhance the quality of the generated samples, we integrate adversarial training. 3.3.2 Adversarial Training For the adversarial objective, the generated samples \u02c6 z \u2190f\u03b8(z\u03c3, \u03c3, c) and real samples z are passed to the discriminator D\u03b7 which aims to distinguish between them, where \u03b7 refers to the trainable parameters. Thus, we employ adversarial training loss Ladv(\u03b8, \u03b7) = Ez[log D\u03b7(z)] + E\u03c3Ez\u03c3[log(1 \u2212D\u03b7(f\u03b8(z\u03c3, \u03c3, c)))]. (15) In this way, the error signal from the discriminator guides f\u03b8 to produce more realistic outputs. For details, we use a frozen pre-trained speech language model SLM and a trainable lightweight discriminator head Dhead to build the discriminator. Since the current SLM is trained on the speech waveform, we covert both z and \u02c6 z to ground truth waveform and predicted waveform using the codec decoder. To further increase the similarity between prompt audio and generated audio, our discriminator is conditioned on the prompt audio feature. This prompt feature Fprompt is extracted using SLM on prompt audio and applies average pooling on the time axis. Therefore, D\u03b7 = Dhead(Fprompt \u2299Fgt, Fprompt \u2299Fpred) (16) where Fgt and Fpred refer to feature extracted through SLM for ground truth waveform and predicted waveform. The discriminator head consists of several 1D convolution layers. The input feature of the discriminator is conditioned on Fprompt via projection Miyato and Koyama (2018). 3.3.3 Combined Together Since there is a large gap on the loss scale between consistency loss and adversarial loss, it can lead to instability and failure in training. Therefore, we follow Esser et al. (2021) to compute the adaptive weight with \u03bbadv = \u2225\u2207\u03b8LLN ct (\u03b8, \u03b8\u2212)\u2225 \u2225\u2207\u03b8LLadv(\u03b8, \u03b7)\u2225 (17) where \u03b8L is the last layer of the neural network in LCM. The final loss of training LCM is defined as LN ct (\u03b8, \u03b8\u2212)+\u03bbadvLadv(\u03b8, \u03b7). This adaptive weighting significantly stabilizes the training by balancing the gradient scale of each term. 6 \fProsody Regression Prosody Refinement Initial Prediction Residual + Prosody Feature Predicted Prosody Noise deterministic stochastic \ud835\udf36 \u2217Residual Figure 4: An illustration of prosody generator. 3.4 Prosody Generator 3.4.1 Analysis of Prosody Prediction Previous regression methods for prosody prediction Ren et al. (2020); Shen et al. (2024), due to their deterministic mappings and assumptions of unimodal distribution, often fail to capture the inherent diversity and expressiveness of human speech prosody. This leads to predictions that lack variation and can appear over-smoothed. On the other hand, diffusion methods Le et al. (2023); Li et al. (2023) for prosody prediction offer a promising alternative by providing greater prosody diversity. However, they come with challenges regarding stability, and the potential for unnatural prosody. Additionally, the iterative inference process in DMs requires a significant number of sampling steps that may also hinder real-time application. Meanwhile, LM-based methods Jiang et al. (2024a); Wang et al. (2023a) also need a long time for inference. To alleviate these issues, our prosody generator consists of a prosody regression module and a prosody refinement module to enhance the diversity of prosody regression results with efficient one-step consistency model sampling. 3.4.2 Prosody Refinement via Consistency Model As shown in 4, our prosody generator consists of two parts which are prosody regression and prosody refinement. We first train the prosody regression module to get a deterministic output. Next, we freeze the parameters of the prosody regression module and use the residual of ground truth prosody and deterministic predicted prosody as the training target for prosody refinement. We adopt a consistency model as a prosody refinement module. The conditional feature of the consistency model is the feature from prosody regression before the final projection layer. Thus, the residual from a stochastic sampler refines the output of a deterministic prosody regression and produces a diverse set of plausible prosody under the same transcription and audio prompt. One option for the final prosody output pfinal can be represented as: pfinal = pres + pinit, (18) where pfinal denotes the final prosody output, pres represents the residual output from the prosody refinement module, capturing the variations between the ground truth prosody and the deterministic prediction, pinit is the initial deterministic prosody prediction from the prosody regression module. However, this formulation may negatively affect prosody stability, a similar observation is found in Vyas et al. (2023); Le et al. (2023). More specifically, higher diversity may cause less stability and sometimes produce unnatural prosody. To address this, we introduce a control factor \u03b1 that finely tunes the balance between stability and diversity in the prosodic output: pfinal = \u03b1pres + pinit (19) where \u03b1 is a scalar value ranging between 0 and 1. This adjustment allows for controlled incorporation of variability into the prosody, mitigating issues related to stability while still benefiting from the diversity offered by the prosody refinement module. 3.5 Applications This section elaborates on the practical applications of FlashSpeech. We delve into its deployment across various tasks such as zero-shot TTS, speech editing, voice conversion, and diverse speech sampling. All the sample audios of applications are available on the demo page. 7 \f3.5.1 Zero-Shot TTS Given a target text and reference audio, we first convert the text to phoneme using g2p (grapheme-tophoneme conversion). Then we use the codec encoder to convert the reference audio into zprompt. Speech can be synthesized efficiently through FlashSpeech with the phoneme input and zprompt, achieving high-quality text-to-speech results without requiring pre-training on the specific voice. 3.5.2 Voice Conversion Voice conversion aims to convert the source audio into the target audio using the speaker\u2019s voice of the reference audio. Following Shen et al. (2024); Preechakul et al. (2022), we first apply the reverse of ODE to diffuse the source audio into a starting point that still maintains some information in the source audio. After that, we run the sampling process from this starting point with the reference audio as zprompt and condition c. The condition c uses the phoneme and duration from the source audio and the pitch is predicted by the prosody generator. This method allows for zero-shot voice conversion while preserving the linguistic content of the source audio, and achieving the same timbre as the reference audio. 3.5.3 Speech Editing Given the speech, the original transcription, and the new transcription, we first use MFA (Montreal Forced Aligner) to align the speech and the original transcription to get the duration of each word. Then we remove the part that needs to be edited to construct the reference audio. Next, we use the new transcription and reference to synthesize new speech. Since this task is consistent with the in-context learning, we can concatenate the remaining part of the raw speech and the synthesized part as the final speech, thus enabling precise and seamless speech editing. 3.5.4 Diverse Speech Sampling FlashSpeech leverages its inherent stochasticity to generate a variety of speech outputs under the same conditions. By employing stochastic sampling in its prosody generation and LCM, FlashSpeech can produce diverse variations in pitch, duration, and overall audio characteristics from the same phoneme input and audio prompt. This feature is particularly useful for generating a wide range of speech expressions and styles from a single input, enhancing applications like voice acting, synthetic voice variation for virtual assistants, and more personalized speech synthesis. In addition, the synthetic data via speech sampling can also benefit other tasks such as ASR Rossenbach et al. (2020). 4 Experiment Table 1: The evaluation results for FlashSpeech and the baseline methods on LibriSpeech testclean. \u22c6 means the evaluation is conducted with 1 NVIDIA V100 GPU. \u2662means the device is not available. Abbreviations: MLS (Multilingual LibriSpeech Pratap et al. (2020)), G (GigaSpeech Chen et al. (2021)), L (LibriTTS-R Koizumi et al. (2023)), V (VCTK Yamagishi et al. (2019)), LJ (LJSpeech Ito and Johnson (2017)), W (WenetSpeech Zhang et al. (2022)). Model Data RTF \u2193 Sim-O \u2191 Sim-R \u2191 WER \u2193 CMOS \u2191 SMOS \u2191 GroundTruth 0.68 1.9 0.11 4.39 VALL-E reproduce Librilight 0.62 \u2662 0.47 0.51 6.1 -0.48 4.11 NaturalSpeech 2 MLS 0.37 \u22c6 0.53 0.60 1.9 -0.31 4.20 Voicebox reproduce Librilight 0.66\u2662 0.48 0.50 2.1 -0.58 3.95 Mega-TTS G+W 0.39 \u2662 3.0 CLaM-TTS MLS+G+L +V+LJ 0.42 \u2662 0.50 0.54 5.1 FlashSpeech (ours) MLS 0.02 \u22c6 0.52 0.57 2.7 0.00 4.29 8 \fFlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) FlashSpeech (RTF: 0.02) Voicebox (RTF: 0.64) Mega-TTS (RTF: 0.39) ClaM-TTS (RTF: 0.42) VALL-E (RTF: 0.62) NaturalSpeech 2 (RTF: 0.37) Voicebox (RTF: 0.64) Mega-TTS (RTF: 0.39) ClaM-TTS (RTF: 0.42) VALL-E (RTF: 0.62) NaturalSpeech 2 (RTF: 0.37) Audio Quality Speaker Similarity Figure 5: User preference study. We compare the audio quality and speaker similarity of FlashSpeech against baselines with their official demo. In the experimental section, we begin by introducing the datasets and the configurations for training in our experiments. Following this, we show the evaluation metrics and demonstrate the comparative results against various zero-shot TTS models. Subsequently, ablation studies are conducted to test the effectiveness of several design choices. Finally, we also validate the effectiveness of other tasks such as voice conversion. We show our speech editing and diverse speech sampling results on our demo page. 4.1 Experimental Settings 4.1.1 Data and Preprocessing We use the English subset of Multilingual LibriSpeech (MLS) Pratap et al. (2020), including 44.5k hours of transcribed audiobook data and it contains 5490 distinct speakers. The audio data is resampled at a frequency of 16kHz. The input text is transformed into a sequence of phonemes through grapheme-to-phoneme conversion Sun et al. (2019) and then we use our internal alignment tool aligned with speech to obtain the phoneme-level duration. We adopt a hop size of 200 for all frame-level features. The pitch sequence is extracted using PyWorld2. we adopt Encodec D\u00e9fossez et al. (2022) as our audio codec. We use a modified version 3 and train it on MLS. We use the dense features extracted before the residual quantization layer as our latent vector z. 4.1.2 Training Details Our training consists of two stages, in the first stage we train LCM and the prosody regression part. We use 8 H800 80GB GPUs with a batch size of 20k frames of latent vectors per GPU for 650k steps. We use the AdamW optimizer with a learning rate of 3e-4, warm up the learning rate for the first 30k updates and then linear decay it. We deactivate adversarial training with \u03bbadv = 0 before 600K training iterations. For hyper-parameters, we set a in Equation (12) to 0.03. In equation (10), \u03c3i = \u0010 \u03c31/\u03c1 min + i\u22121 N(k)\u22121 \u0010 \u03c31/\u03c1 max \u2212\u03c31/\u03c1 min \u0011\u0011\u03c1 , where i \u2208[1, N(k)], \u03c1 = 7, \u03c3min = 0.002, \u03c3max = 80. For N(k) in Equation (11), we set s0 = 10, s1 = 1280, K = 600k. After 600k steps, we activate adversarial loss, and N(k) can be considered as fixed to 1280. We crop the waveform length fed into the discriminator into minimum waveform length in a minibatch. In addition, the weight of the feature extractor WavLM and the codec decoder are frozen. In the second stage, we train 150k steps for the prosody refinement module with consistency training in Equation (10). Different from the above setting, we empirically set s1 = 160, K = 150k. During training, only the weight of the prosody refinement part is updated. 2https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder 3https://github.com/yangdongchao/UniAudio/tree/main/codec 9 \f4.1.3 Model Details The model structures of the prompt encoder and phoneme encoder are followShen et al. (2024). The neural function part in LCM is almost the same as the Shen et al. (2024). We rescale the sinusoidal position embedding in the neural function part by a factor of 1000. As for the prosody generator, we adopt 30 non-casual wavenet Oord et al. (2016) layers for the neural function part in the prosody refinement module and the same configurations for prosody regression parts in Shen et al. (2024). And we set \u03b1 = 0.2 for the prosody refinement module empirically. For the discriminator\u2019s head, we stack 5 convolutional layers with weight normalization Salimans and Kingma (2016) for binary classification. 4.2 Evaluation Metrics We use both objective and subjective evaluation metrics, including \u2022 RTF: Real-time-factor (RTF) measures the time taken for the system to generate one second of speech. This metric is crucial for evaluating the efficiency of our system, particularly for applications requiring real-time processing. We measure the time of our system end-to-end on an NVIDIA V100 GPU following Shen et al. (2024). \u2022 Sim-O and Sim-R: These metrics assess the speaker similarity. Sim-R measures the objective similarity between the synthesized speech and the reconstruction reference speech through the audio codec, using features embedding extracted from the pre-trained speaker verification model Wang et al. (2023a); Kim et al. (2024)4. Sim-O is calculated with the original reference speech. Higher scores in Sim-O and Sim-R indicate a higher speaker similarity. \u2022 WER (Word Error Rate): To evaluate the accuracy and clarity of synthesized speech from the TTS system, we employ the Automatic Speech Recognition (ASR) model Wang et al. (2023a) 5 to transcribe generated audio. The discrepancies between these transcriptions and original texts are quantified using the Word Error Rate (WER), a crucial metric indicating intelligibility and robustness. \u2022 CMOS, SMOS, UTMOS: we rank the comparative mean option score (CMOS) and similarity mean option score (SMOS) using mturk. The prompt for CMOS refers to \u2019Please focus on the audio quality and naturalness and ignore other factors.\u2019. The prompt for SMOS refers to \u2019Please focus on the similarity of the speaker to the reference, and ignore the differences of content, grammar or audio quality.\u2019 Each audio has been listened to by at least 10 listeners. UTMOS Saeki et al. (2022) is a Speech MOS predictor6 to measure the naturalness of speech. We use it in ablation studies which reduced the cost for evaluation. \u2022 Prosody JS Divergence: To evaluate the diversity and accuracy of the prosody prediction in our TTS system, we include the Prosody JS Divergence metric. This metric employs the Jensen-Shannon (JS) divergence Men\u00e9ndez et al. (1997) to quantify the divergence between the predicted and ground truth prosody feature distributions. Prosody features, including pitch, and duration, are quantized and their distributions in both synthesized and natural speech are compared. Lower JS divergence values indicate closer similarity between the predicted prosody features and those of the ground truth, suggesting a higher diversity of the synthesized speech. 4.3 Experimental Results on Zero-shot TTS Following Wang et al. (2023a), We employ LibriSpeech Panayotov et al. (2015) test-clean for zeroshot TTS evaluation. We adopt the cross-sentence setting in Wang et al. (2023a) that we randomly select 3-second clips as prompts from the same speaker\u2019s speech. The results are summarized in table 1 and figure 5. 4https://github.com/microsoft/UniSpeech/tree/main/downstreams/speaker_verification 5https://huggingface.co/facebook/hubert-large-ls960-ft 6https://github.com/tarepan/SpeechMOS 10 \f4.3.1 Evaluation Baselines \u2022 VALL-E Wang et al. (2023a): VALL-E predicts codec tokens using both AR and NAR models. RTF7 is obtained from Kim et al. (2024); Le et al. (2023). We use our reproduced results for MOS, Sim, and WER. Additionally, we do a preference test with their official demo. \u2022 Voicebox Le et al. (2023): Voicebox uses flow-matching to predict maksed mel-spectrogram. RTF is from the original paper. We use our reproduced results for MOS, Sim, and WER. We also implement a preference test with their official demo. \u2022 NaturalSpeech2 Shen et al. (2024): NaturalSpeech2 uses a latent diffusion model to predict latent features of codec. The RTF is from the original paper. the Sim, WER and samples for MOS are obtained through communication with the authors. We also do a preference test with their official demo. \u2022 Mega-TTS Jiang et al. (2023a)8: Mega-TTS uses both language model and GAN to predict mel-spectrogram. We obtain RTF from mobilespeech Ji et al. (2024) and WER from the original paper. We do a preference test with their official demo. \u2022 ClaM-TTS Kim et al. (2024): ClaM-TTS uses the AR model to predict mel codec tokens. We obtain the objective evaluation results from the original paper and do a preference test with their official demo. 4.3.2 Generation Quality FlashSpeech stands out significantly in terms of speaker quality, surpassing other baselines in both CMOS and audio quality preference tests. Notably, our method closely approaches ground truth recordings, underscoring its effectiveness. These results affirm the superior quality of FlashSpeech in speech synthesis. our method. 4.3.3 Generation Similarity Our evaluation of speaker similarity utilizes Sim, SMOS, and speaker similarity preference tests, where our methods achieve 1st, 2nd, and 3rd place rankings, respectively. These findings validate our methods\u2019 ability to achieve comparable speaker similarity to other methods. Despite our training data (MLS) containing approximately 5k speakers, fewer than most other methods (e.g., Librilight with about 7k speakers or self-collected data), we believe that increasing the number of speakers in our methods can further enhance speaker similarity. 4.3.4 Robustness Our methods achieve a WER of 2.7, placing them in the first echelon. This is due to the nonautoregressive nature of our methods, which ensures robustness. 4.3.5 Generation Speed FlashSpeech achieves a remarkable approximately 20x faster inference speed compared to previous work. Considering its excellent audio quality, robustness, and comparable speaker similarity, our method stands out as an efficient and effective solution in the field of large-scale speech synthesis. 4.4 Ablation Studies 4.4.1 Ablation studies of LCM We explored the impact of different pre-trained models in adversarial training on UTMOS and Sim-O. As shown in the table 2, the baseline, which employs consistency training alone, achieved a UTMOS 7In CLaM-TTS and Voicebox, they report the inference time for generating 10 seconds of speech. Therefore, we divide by 10 to obtain the time for generating 1 second of speech (RTF). 8Since we do not find any audio samples for Mega-TTS2 Jiang et al. (2024b) under the 3-second crosssentence setting, we are not able to compare with them. 11 \fTable 2: The ablation study of discriminator design. Method UTMOS \u2191 Sim-O \u2191 Consistency training baseline 3.62 0.45 + Adversarial training (Wav2Vec2-large) 3.92 0.50 + Adversarial training (Hubert-large) 3.83 0.47 + Adversarial training (Wavlm-large) 4.00 0.52 prompt projection 3.97 0.51 Table 3: The ablation study of sampling steps for LCM NFE UTMOS \u2191 Sim-O \u2191 1 3.99 0.51 2 4.00 0.52 4 3.91 0.51 of 3.62 and a Sim-O of 0.45. Incorporating adversarial training using wav2vec2-large9, hubert-large10, and wavlm-large11 as discriminators significantly improved both UTMOS and Sim-O scores. Notably, the application of adversarial training with Wavlm-large achieved the highest scores (UTMOS: 4.00, Sim-O: 0.52), underscoring the efficacy of this pre-trained model in enhancing the quality and speaker similarity of synthesized speech. Additionally, without using the audio prompt\u2019s feature as a condition the discriminator shows a slight decrease in performance (UTMOS: 3.97, Sim-O: 0.51), highlighting the importance of conditional features in guiding the adversarial training process. As shown in table 3, the effect of sampling steps (NFE) on UTMOS and Sim-O revealed that increasing NFE from 1 to 2 marginally improves UTMOS (3.99 to 4.00) and Sim-O (0.51 to 0.52). However, further increasing to 4 sampling steps slightly reduced UTMOS to 3.91 due to the accumulation of score estimation errors Chen et al. (2022a); Lyu et al. (2024). Therefore, we use 2 steps as the default setting for LCM. 4.4.2 Ablation studies of Prosody Generator In this part, we investigated the effects of a control factor, denoted as \u03b1, on the prosodic features of pitch and duration in speech synthesis, by setting another influencing factor to zero. Our study specifically conducted an ablation analysis to assess how \u03b1 influences these features, emphasizing its critical role in balancing stability and diversity within our framework\u2019s prosodic outputs. Table 4 elucidates the effects of varying \u03b1 on the pitch component. With \u03b1 set to 0, indicating no inclusion of the residual output from prosody refinement, we observed a Pitch JSD of 0.072 and a WER of 2.8. A slight modification to \u03b1 = 0.2 resulted in a reduced Pitch JSD of 0.067, maintaining the same WER. Notably, setting \u03b1 to 1, fully incorporating the prosody refinement\u2019s residual output, further decreased the Pitch JSD to 0.063, albeit at the cost of increased WER to 3.7, suggesting a trade-off between prosody diversity and speech intelligibility. Similar trends in table 5 are observed in the duration component analysis. With \u03b1 = 0, the Duration JSD was 0.0175 with a WER of 2.8. Adjusting \u03b1 to 0.2 slightly improved the Duration JSD to 0.0168, without affecting WER. However, fully embracing the refinement module\u2019s output by setting \u03b1 = 1 yielded the most significant improvement in Duration JSD to 0.0153, which, similar to pitch analysis, came with an increased WER of 3.9. The results underline the delicate balance required in tuning \u03b1 to optimize between diversity and stability of prosody without compromising speech intelligibility. 9https://huggingface.co/facebook/wav2vec2-large 10https://huggingface.co/facebook/hubert-large-ll60k 11https://huggingface.co/microsoft/wavlm-large 12 \fTable 4: The ablation study of control factor for pitch \u03b1 Pitch JSD \u2193 WER\u2193 0 0.072 2.8 0.2 0.067 2.8 1 0.063 3.7 Table 5: The ablation study of control factor for duration \u03b1 Duration JSD \u2193 WER \u2193 0 0.0175 2.8 0.2 0.0168 2.8 1 0.0153 3.9 4.5 Evaluation Results for Voice Conversion In this section, we present the evaluation results of our voice conversion system, FlashSpeech, in comparison with state-of-the-art methods, including YourTTS 12 Casanova et al. (2022) and DDDMVC 13 Choi et al. (2024). We conduct the experiments with their official checkpoints in our internal test set. Table 6: Voice Conversion Method CMOS \u2191 SMOS \u2191 Sim-O \u2191 YourTTS Casanova et al. (2022) -0.16 3.26 0.23 DDDM-VC Choi et al. (2024) -0.28 3.43 0.28 Ours 0.00 3.50 0.35 Our system outperforms both YourTTS and DDDM-VC in terms of CMOS, SMOS and Sim-O, demonstrating its capability to produce converted voices with high quality and similarity to the target speaker. These results confirm the effectiveness of our FlashSpeech approach in voice conversion tasks. 4.6"
|
| 20 |
+
}
|
abs_9K/validation_abstract_short_2404.14716v1.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14716v1",
|
| 3 |
+
"title": "Bayesian Example Selection Improves In-Context Learning for Speech, Text, and Visual Modalities",
|
| 4 |
+
"abstract": "Large language models (LLMs) can adapt to new tasks through in-context\nlearning (ICL) based on a few examples presented in dialogue history without\nany model parameter update. Despite such convenience, the performance of ICL\nheavily depends on the quality of the in-context examples presented, which\nmakes the in-context example selection approach a critical choice. This paper\nproposes a novel Bayesian in-Context example Selection method (ByCS) for ICL.\nExtending the inference probability conditioned on in-context examples based on\nBayes' theorem, ByCS focuses on the inverse inference conditioned on test\ninput. Following the assumption that accurate inverse inference probability\n(likelihood) will result in accurate inference probability (posterior),\nin-context examples are selected based on their inverse inference results.\nDiverse and extensive cross-tasking and cross-modality experiments are\nperformed with speech, text, and image examples. Experimental results show the\nefficacy and robustness of our ByCS method on various models, tasks and\nmodalities.",
|
| 5 |
+
"authors": "Siyin Wang, Chao-Han Huck Yang, Ji Wu, Chao Zhang",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.CV",
|
| 13 |
+
"cs.SD",
|
| 14 |
+
"eess.AS"
|
| 15 |
+
],
|
| 16 |
+
"label": "Original Paper",
|
| 17 |
+
"paper_cat": "LLM Fairness",
|
| 18 |
+
"gt": "Large language models (LLMs) can adapt to new tasks through in-context\nlearning (ICL) based on a few examples presented in dialogue history without\nany model parameter update. Despite such convenience, the performance of ICL\nheavily depends on the quality of the in-context examples presented, which\nmakes the in-context example selection approach a critical choice. This paper\nproposes a novel Bayesian in-Context example Selection method (ByCS) for ICL.\nExtending the inference probability conditioned on in-context examples based on\nBayes' theorem, ByCS focuses on the inverse inference conditioned on test\ninput. Following the assumption that accurate inverse inference probability\n(likelihood) will result in accurate inference probability (posterior),\nin-context examples are selected based on their inverse inference results.\nDiverse and extensive cross-tasking and cross-modality experiments are\nperformed with speech, text, and image examples. Experimental results show the\nefficacy and robustness of our ByCS method on various models, tasks and\nmodalities.",
|
| 19 |
+
"main_content": "Introduction Large language models (LLMs) (Touvron et al., 2023b; OpenAI, 2023a) have achieved great success on many text-based natural language processing (NLP) tasks. By connecting with extra visual and audio encoders (Sun et al., 2023b; Radford et al., 2023), the resulting multimodal LLMs can also achieve remarkable performance on imagetext and audio-text tasks (Li et al., 2023; OpenAI, 2023b; Tang et al., 2023). With the ability of incontext learning (ICL) (Brown et al., 2020), LLMs can adapt to new tasks easily and efficiently in a training-free manner, to generate output following the prompting paradigm based on a few input-label pairs pre-pended to the test input. The existence of ICL ability has also been verified on image-text and audio-text tasks (Tsimpoukelli et al., 2021; Wang et al., 2023c; Hsu et al., 2023; Pan et al., 2023). (i) Random Selected Example(s) (ii) Inverse Inference (iii) Bayesian Selected Example(s) text similarity score-based reranking estimated probabilities datastore (few-shot with k samples) (k samples in-context learning) Figure 1: A brief illustration of the proposed Bayesian in-context example selection includes: (i) first randomly selecting k examples; (ii) examining the examples in the datastore through \u201cinverse inference,\u201d where the test input-label pair serves as the in-context example; and (iii) selecting samples with correct label predictions as good examples (colored in blue), considered to have high mutual information interaction with the test input. Although ICL requires no gradient descent and thus does not suffer from the instability caused by stochastic optimisation compared to other testtime adaptation approaches, care still needs to be taken when selecting the in-context examples since they often lead to distinct ICL performance variations (Zhao et al., 2021; Min et al., 2022; Lu et al., 2022b). Prior work on in-context example selection trains an example retrieval module (Rubin et al., 2022; Zhang et al., 2022; Lu et al., 2022a; Wang et al., 2023b), selects close examples in embedding space (Liu et al., 2022; An et al., 2023; Qin et al., 2023), or leverages the feedback of LLMs to score the examples (Su et al., 2022; Nguyen and Wong, 2023; Iter et al., 2023; Mavromatis et al., 2023). While boosting ICL performance, most methods treat in-context examples and test input separately, overlooking their mutual interactions. This paper proposes ByCS (Bayesian in-Context example Selection), a novel in-context example selection approach focusing on mutual information interactions based on the Bayesian formula. Refer to the inference of test input conditioned on in-context examples as ICL inference, and the inference of in-context example\u2019s input based on the test input-label pair as the inverse inference. arXiv:2404.14716v1 [cs.CL] 23 Apr 2024 \fBy introducing inverse inference via Bayes\u2019 theorem, ByCS leverages the inverse inference result to evaluate the quality of each in-context example. Assuming the contextual information interaction is mutual, an accurate inverse inference is likely to result in an accurate inference. Examples with accurate inverse inference results are selected as optimal examples. Extensive experiments across audio, image, and text modalities are conducted to verify the effectiveness and robustness of ByCS, such as ASR, visual question answering (VQA), as well as NLP tasks (including topic classification, sentiment analysis, and text-to-SQL etc). Our main contributions are summarised as follows: \u2022 ByCS, a novel in-context example selection method inspired by Bayes\u2019 theorem, is proposed. To improve the efficiency, the use of a smaller model for fast inverse inference implementation and a ranking-based pre-selection to reduce the number of in-context examples are also proposed in this paper. \u2022 The method is verified using both \u201cdecoderonly ICL\" on NLP tasks and \u201cencoderdecoder\u201d ICL on ASR and VQA. To the best of our knowledge, this is the first work of an in-context example selection method verified across text, audio, and visual modalities as shown in Figure 2. 2 Related Work Multimodal ICL. Inspired by the decoder-only ICL in text-based NLP, efforts have been made to extend such a few-shot learning ability to other modalities, in particular image and audio. Frozen (Tsimpoukelli et al., 2021) is the first attempt to exploit ICL ability in the vision-language model (VLM). By using a vision encoder to map the input image to textual tokens in the input embedding space of a frozen text language model, Frozen can handle interleaved image and text input and achieve image-text ICL. Other work manages to improve VLM\u2019s ICL ability by using adapter blocks (Eichenberg et al., 2022), adding blockwise modality fusion structures (Alayrac et al., 2022) and scaling up the model size (Sun et al., 2023a). In audio modality, Borsos et al. (2023) proposed AudioLM, a language model based on quantised audio tokens for audio generation tasks, which exhibits ICL ability for audio continuation. Similarly, Speech example inputs Speech test input Text example labels Answer \u201c\u597d\u7747\u3002\u201d \ud835\udc4b \ud835\udc36!\"#$% \ud835\udc36&'()& \ud835\udc4c Text example inputs Text test input Answer Albert Einstein was Marie Curie was Polish. \ud835\udc4c \ud835\udc4b \ud835\udc36!\"#$% Text example labels \ud835\udc36&'()& German. \u201c\u7747\u569f\u3002\u201d Image example inputs Text example inputs \ud835\udc36!\"#$% Text example labels Image test input Text test input Answer \ud835\udc36&'()& \ud835\udc4b \ud835\udc4c Does this type of train transport people or cargo? What is this vehicle used for? Transporting goods. Cargo. (a) text ICL (b) ASR ICL (c) VQA ICL Figure 2: Multimodal ICL. Although ICL on different modalities shares the same formula expression, the actual inputs and inference model architectures differ. For ASR ICL on Whisper, the speech is fed into the encoder while the text example is labelled into the decoder, which is aware of speech input through cross-attention with the encoder. For VQA ICL, images are first encoded to the same embedding space of LM\u2019s input, then interleaved images and texts are fed into decoder LM. Wang et al. (2023a) proposed VALL-E, a controllable text-to-speech synthesis system with ICL ability based on audio and text prompts. Wang et al. (2023c) presented the first ICL work for ASR based on paired speech-text examples, which adapted the Whisper (Radford et al., 2023) model to receive considerable word error rate (WER) reductions on unseen Chinese dialects. Further explorations enabled the recent speech-language models to perform ICL on more speech input tasks through warmup training (Hsu et al., 2023) or speech instruction-tuning (Pan et al., 2023). In-Context Example Selection Methods. Rubin et al. (2022) proposed a scoring LM to retrieve incontext examples using contrastive learning, which can also be trained with reinforced learning algorithms, such as Q-learning (Zhang et al., 2022) and policy gradient (Lu et al., 2022a). Alternatively, examples that are semantically similar to the test input can be selected. Liu et al. (2022) proposed to select the k nearest neighbours (kNN) in the embedding space of the examples. When combining with chain-of-thought (Wei et al., 2022), Qin et al. (2023) proposed to select examples in the embedding space of the reasoning path. LLM feedback is often used in in-context example selection. Iter et al. (2023) selected in-context examples with cross-entropy differences of the fine-tuned model \f\ud835\udc36 \"!\"#$! = arg max \ud835\udc43(\ud835\udc36!\"#$!|\ud835\udc7f, \ud835\udc80 /, \ud835\udc36%&'()) \ud835\udc7f \ud835\udc80 # \ud835\udc36!\"#$% \ud835\udc36&'()& \ud835\udc36 $&'()& Text similarity measurement Example Score \ud835\udc44 Select examples with max(\ud835\udc78) \ud835\udc4c 3 = arg max \ud835\udc43(\ud835\udc80|\ud835\udc36%&'(), \ud835\udc36!\"#$!, \ud835\udc7f) \ud835\udc44= \ud835\udc46\ud835\udc56\ud835\udc5a\ud835\udc56\ud835\udc59\ud835\udc4e\ud835\udc5f\ud835\udc56\ud835\udc61\ud835\udc66(\ud835\udc36!\"#$!, \ud835\udc36 \"!\"#$!) First-round inference Inverse inference \u2460 \u2461 \u2462 Figure 3: The detailed pipeline of our ByCS method includes: First, conduct the first-round inference to estimate the label of the test input. Then, perform inverse inference on each example in the datastore, where the test input and the estimated label serve as in-context examples. A detailed illustration of inverse inference can be found in Figure 5 in the Appendix. Finally, rank in-context examples by the text similarity between the inverse inference result and the true context label. Examples with high similarity scores are selected due to their high mutual information interaction. based on the assumption that ICL may act as implicit gradient descent (Dai et al., 2022). Nguyen and Wong (2023) identified highly impactful examples according to the proposed influence score. Although ByCS also uses LLM feedback when evaluating the quality of in-context examples through inverse inference, it leverages the text-similarity of the inverse inference results and the corresponding ground-truth labels, in no need of complete output probability distributions which are often not available for commercial LLMs. Wang et al. (2023d) selected optimal in-context examples in the Bayesian framework by viewing LLMs as latent variable models and ICL as latent concept learning. In comparison, ByCS directly extends the ICL inference probability using Bayes\u2019 theorem. Xu and Zhang (2024) selected examples with high discrepancy between the labels and LLM\u2019s outputs when performing question answering. ByCS also selected examples from candidates in a datastore based on LLM\u2019s outputs but computes the mutual information interactions between the in-context examples and test input. 3 Methodology As shown in Figure 3, given a test input X and paired in-context examples (Cinput, Clabel), LLMs predict the most possible answer \u02c6 Y by maximising the inference probability P(Y|Cinput, Clabel, X): \u02c6 Y = arg max P(Y|Cinput, Clabel, X), (1) where Cinput and Clabel are the inputs and labels of different data types in different tasks. Regarding text-based NLP tasks, Cinput and Clabel are referred to as text questions and corresponding answers. Regarding ASR, Cinput and Clabel are speech audio and corresponding text transcriptions. Regarding VQA, Cinput are images and text questions based on the images and Clabel are the text answers. The inference probability can be extended using Bayes\u2019 theorem: P(Y|Cinput, Clabel, X) = P(Clabel|X, Y, Cinput)P(Y|X, Cinput) P(Clabel|X, Cinput) . (2) The likelihood P(Clabel|X, Y, Cinput) is termed as inverse inference probability, since it can be interpreted as the probability of the context label Clabel when the test input-label pair (X, Y) is inversely treated as the in-context example. ByCS is focused on the inverse inference probability and assumes the influence of the prior P(Y|X, Cinput) is subordinate for simplification. In practice, since the ground-truth label Yref of the test input X is not available, the correct likelihood P(Clabel|X, Yref, Cinput) is approximated by P(Clabel|X, \u02c6 Y, Cinput), where \u02c6 Y is produced by the first-round inference. Specifically, \u2022 First, the first-round inference is performed to produce a hypothesized label \u02c6 Y based on the test input X, which can be achieved using decoding rule without any in-context examples by \u02c6 Y = arg max P(Y|X). Better performance can be achieved when using the hypothesized label obtained by in-context examples by \u02c6 Y = arg max P(Y| \u02dc Cinput, \u02dc Clabel, X) based on Eqn. (1), where ( \u02dc Cinput, \u02dc Clabel) is a pair of first-round in-context example selected either randomly or using other example selection methods. \u2022 Next, for the datastore with all candidate incontext examples, generate the inverse infer\fence result in \u02c6 Clabel for every candidate example based on the approximated inverse inference probability P(Clabel|X, \u02c6 Y, Cinput) by \u02c6 Clabel = arg max P(Clabel|X, \u02c6 Y, Cinput). \u2022 Last, compute Q = Similarity(Clabel, \u02c6 Clabel) as the text similarity between Clabel and \u02c6 Clabel, and use Q as the metric for the evaluation of the quality of inverse inference. Since more accurate inverse inference probability often results in higher text similarity, ByCS selects the in-context examples with higher Q. Note that Q is adopted since it does not require to assessment of the model\u2019s output probability distribution of the LLM, which is often unavailable for commercial LLMs. To reduce the computation cost of inverse inference, two methods are used when the number of examples in the datastore is large: \u2022 Conduct inverse inference using a model in the same model family as our inference model but has a smaller model size. \u2022 Apply ByCS to a small number (e.g. N) of pre-selected candidate examples. In preselection, all examples in the datastore are first ranked, and only the top N best examples are reserved as the pre-selected candidates. The pre-selection is performed using fast rankingbased algorithms like kNN. 4 Experimental Setup 4.1 Models Experimental results are performed on audio, text, and image modalities. For audio-text and imagetext tasks, ASR and VQA are used to evaluate the ICL ability of encoder-decoder structured models. For text-only NLP tasks, topic classification, sentiment analysis, and text-to-SQL are used to evaluate the ICL performance with decoder-only models. Regarding the NLP tasks, experiments are conducted using GPT-3.5-Turbo and GPT-4 (OpenAI, 2023a). For the ASR task, the open-sourced Whisper model (Radford et al., 2023) is used, which is a series of speech models released by OpenAI. The Whisper model family uses vanilla encoderdecoder Transformer (Vaswani et al., 2017) architecture ranging from 39 million (M) parameters (tiny) to 1.55 billion (B) parameters (large). Specifically, the Whisper small (244M) and Whisper largev2/-v3 (1.55B) models are used. For the VQA task, experiments are performed on Emu2 (Sun et al., 2023a) and GPT-4V (OpenAI, 2023b). Emu2 is a 37B text-image model (VLM) which leverages pretrained EVA-02-CLIP-E-plus (Sun et al., 2023b) and LLAMA-33B (Touvron et al., 2023a), which has ICL ability when taking interleaved inputs of images and texts. For experiments on Emu2, the outputs are generated using a greedy decoding setting for fast evaluation. GPT-4V is a GPT4 variant that can directly perceive image inputs, showing state-of-the-art image understanding performance. 4.2 Datasets Seven datasets covering NLP, ASR and VQA are used in this paper. For text-only ICL, four datasets are used in four different task categories: the TREC dataset for topic classification (Voorhees and Tice, 2000), the SST2 dataset for sentiment analysis (Socher et al., 2013), the Spider dataset for text-to-SQL (Yu et al., 2018), and the CHiME4 (Vincent et al., 2017) split of the HyPoradise dataset (Chen et al., 2023) for generative language model re-scoring to correct pre-generated ASR transcriptions. For audio-text ICL, Two datasets are used for ASR tasks, namely RASC863 (ChineseLDC.org, 2004) and CORAAL (Gunter et al., 2021). RASC863 is a commonly used Chinese dialect ASR dataset and its dialectal words split of Chongqing and Guangzhou dialects are used. CORAAL is an English corpus with speech recordings from regional African Americans. For imagetext ICL, VQA experiments are conducted on OKVQA (Marino et al., 2019), a dataset that requires methods to draw upon external knowledge to answer the visual questions. 4.3 Baselines On all three modalities, random selection and improved KATE (Liu et al., 2022) are used as baseline approaches. For random selection, in-context examples are uniformly selected from the example datastore three times and the average results are reported. For KATE (Liu et al., 2022), k neighbours that are nearest to the test input in the embedding space in terms of Euclidean distance are selected. For ASR ICL, the encoder of Whisper large-v2 acts as the embedding retrieval module on the Chinese dataset, while on the English dataset, we use the encoder of Whisper large-v3. In text-ICL, OpenAI text-embedding-ada-002 is used as the embedding retrieval model. For VQA ICL, KATE is only based on the embedding space of the query \fCorpus & In-context example number k Setting RASC863 Chongqing RASC863 Guangzhou CORAAL <15s k = 1 k = 2 k = 3 k = 4 k = 1 k = 2 k = 3 k = 4 k = 1 random 67.1 56.1 52.7 51.0 61.7 38.3 31.2 28.8 12.4 KATE+ 67.1 54.7 51.3 49.7 61.3 36.1 26.9 24.8 12.0 ByCS 62.4 53.4 50.6 48.6 49.5 31.9 27.1 26.6 11.7 oracle ByCS 62.4 52.4 49.5 47.2 49.4 30.7 25.8 24.7 11.7 (a) Results with Whisper-large-v2 Corpus & In-context example number k Setting RASC863 Chongqing RASC863 Guangzhou CORAAL <15s k = 1 k = 2 k = 3 k = 4 k = 1 k = 2 k = 3 k = 4 k = 1 random 68.9 60.3 57.0 55.7 67.1 42.8 38.3 35.2 11.6 KATE+ 68.1 58.2 54.8 54.1 67.7 41.3 34.3 31.6 11.4 ByCS 63.5 56.3 53.5 51.8 50.7 36.7 33.0 31.5 11.3 oracle ByCS 63.4 55.2 53.0 50.7 51.3 35.6 31.9 30.7 11.2 (b) Results with Whisper-large-v3 Table 1: %WERs on RASC863 dialectal word dataset and CORAAL with different in-context example selection methods. For RASC863, the example datastore is the RASC863 dialectal word dataset of the corresponding dialect. For CORAAL, the size of the example datastore for ByCS is narrowed down to 10 using kNN algorithm. For the \u201coracle ByCS\u201d setting, the ground-truth label Yref is used in the inverse reference. image and EVA02-CLIP-bigE-14-plus (Sun et al., 2023b) serves as the embedding retrieval module. We use the term \u201cKATE+\u201d to refer to the baseline in our paper, putting stress on the fact that it is actually an improved KATE version enhanced using stronger embedding retrieval models, which results in better performance. For text ICL, bm25 (Robertson et al., 1995) and LLM-R (Wang et al., 2023b) are also compared as baselines. bm25 is a ranking metric originally designed for search engines to estimate the relevance of documents to a given query based on word-overlapping similarity. LLM-R provides a recent and preferment dense retriever distilled using a reward model trained based on LLM feedback. 5 Results 5.1 ASR ICL Results in WER are reported for ASR tasks in Table 1, and here in Chinese WER is calculated based on Chinese characters, which is also termed as character error rate. The ByCS method outperforms the KATE+ baseline in most cases, showing the robustness and effectiveness of our method. When the number of in-context examples k is small, ByCS surpasses KATE+ baseline in a large margin, with a 10.25% relative WER reduction on average when k = 1. Such performance advantage of ByCS reduces when the number of in-context examples increases, which may be attributed to the fact that ByCS performs the inverse inference of each in-context example individually by applying an independence assumption that ignores the contextual interactions between different in-context examples. The use of Yref in \u201coracle ByCS\u201d further boosts the performance gain, indicating the upper bound of our method with the same number of k. 5.2 Ablation study on ASR ICL 5.2.1 Inverse decoding option The influence of different decoding options of inverse inference is studied on the RASC863 dialectal word dataset. The results are shown in Table 2. For the setting notation, \u201cnoprompt\u201d denotes decoding in the default decoding option, and \u201cprompt\u201d means to decode with a specially designed prompt \u201c\u8bc6\u522b\u65b9\u8a00\u201d (meaning to \u201crecognize dialect speech\u201d). \u201cLID\u201d denotes decoding with the correct language identity of Chinese (\u201czh\u201d). The results show that among the three inverse decoding options, \u201cnoprompt\u201d obtains the best performance, \u201cprompt\u201d becomes the second, and \u201cLID\u201d the worst. The WERs of inverse inference are re\fported in Table 3. The WERs under the \u201cnoprompt\u201d setting are more than 100% due to the high insertion error rate. The repeated outputs are not removed when calculating the WERs of inverse inference and when calculating the text similarity, making a more obvious distinction between the examples with high mutual information interaction and those with low. Although it may be a little counter-intuitive that low inverse inference accuracy results in high ByCS selection performance, it is reasonable since inverse inference in ByCS helps to separate good in-context examples from the rest, which can be better achieved by using worse decoding options during inverse inference. This is because our decoding options can often make the model make more mistakes for worse in-context examples. Setting Corpus Text Inverse RASC863 Chongqing RASC863 Guangzhou similarity decoding measurement option Jaccard coefficient noprompt 62.4 49.5 prompt 62.9 50.7 LID 64.1 52.3 BERT wordvecs noprompt 62.4 51.5 prompt 63.5 56.8 LID 64.5 57.7 Table 2: %WERs of Whisper large-v2 on RASC863 dialectal word dataset using ByCS method with different inverse decoding options and text similarity measurements. The number of in-context examples is k = 1. Inverse decoding option Corpus RASC863 Chongqing RASC863 Guangzhou noprompt 91.5 125.2 prompt 70.2 70.1 LID 54.6 61.7 Table 3: Inverse inference %WERs of Whisper largev2 on RASC863 dialectal word dataset with different inverse decoding options. 5.2.2 Text similarity measurement The results of ByCS with different text similarity measurements are also reported in Table 2. For the setting notation, the \u201cJaccard coefficient\u201d is a comSetting In-context example number k k = 1 k = 2 k = 3 k = 4 KATE+ 67.1 54.7 51.3 49.7 ByCSlargev2 62.4 53.4 50.6 48.6 ByCSsmall 64.2 53.3 50.5 48.7 (a) Results with Whisper large-v2 Setting In-context example number k k = 1 k = 2 k = 3 k = 4 KATE+ 68.1 58.2 54.8 54.1 ByCSlargev3 63.5 56.3 53.5 51.8 ByCSsmall 64.4 56.5 54.1 51.7 (b) Results with Whisper large-v3 Table 4: %WERs on RASC863 Chongqing dialectal word dataset with ByCS with different inverse inference models. ByCSlargev3 and ByCSsmall use Whisper-largev3 and Whisper-small as the inverse inference model separately. monly used statistic to gauge similarity, defined as the intersection over the union of two sentences. \u201cBERT wordvecs\u201d is to measure similarity based on the Euclidean distance in the embedding space of BERT encoded word vectors. The embedding retrieval module is bert-base-chinese 1. ByCS with the Jaccard coefficient as text similarity have lower WERs, which may be because the training data of the BERT model doesn\u2019t include sufficient dialectal Chinese words and expressions. It also indicates that ByCS can work well with even a simple rule-based text similarity measurement, further verifying its high robustness. The Jaccard coefficient is used as the text similarity measurement in later experiments unless explicitly specified, due to the performance and simplicity. 5.2.3 Inverse inference model The inverse inference with different models is also investigated, with the results displayed in Table 4. A smaller model is used for inverse inference to speed up ByCS, since it is expensive to perform inverse inference using the inference model for every candidate example in datastore. Replacing Whisper-large-v2/v3 with Whisper-small will speed up six times2. For the notation, the subscript denotes the inverse inference model. For example, ByCSsmall is the ByCS method with Whisper small 1https://huggingface.co/ bert-base-chinese 2https://github.com/openai/whisper \fCorpus & In-context example number k Setting TREC(%Acc. \u2191) SST2(%Acc. \u2191) Spider(%Acc. \u2191) HyPoradise CHiME-4 (%WER \u2193) k = 1 k = 2 k = 4 k = 1 k = 2 k = 1 k = 1 k = 2 k = 5 default 63.0 92.92 67.41 8.0 random 63.5 72.7 75.3 94.96 94.80 67.02 7.5 7.5 7.3 KATE+ 78.8 86.4 91.0 95.05 94.69 69.44 7.7 7.1 6.8 bm25 74.6 89.4 89.8 95.27 95.40 67.41 7.4 7.5 8.1 LLM-R 78.0 88.8 90.4 95.05 94.02 67.82 7.4 6.9 7.0 ByCS 81.2 88.0 90.6 95.16 95.04 69.63 7.1 6.8 6.4 (a) Results using GPT-3.5-Turbo Corpus & In-context example number k Setting TREC(%Acc. \u2191) SST2(%Acc. \u2191) Spider(%Acc. \u2191) HyPoradise CHiME-4 (%WER \u2193) k = 1 k = 2 k = 4 k = 1 k = 2 k = 1 k = 1 k = 2 k = 5 default 75.2 95.01 69.63 11.6 random 81.3 82.5 84.6 96.38 96.11 70.66 6.9 6.8 6.5 KATE+ 88.2 91.6 93.4 96.43 95.85 71.95 7.0 6.3 5.8 bm25 81.8 87.4 91.4 96.19 96.09 71.47 6.8 6.6 6.3 LLM-R 88.2 91.0 93.6 95.74 95.06 72.63 6.8 6.3 5.9 ByCS 88.6 92.4 93.6 96.55 96.31 72.82 6.7 6.3 5.9 (b) Results using GPT-4 Table 5: Results of four text ICL tasks on two GPT-family models with different in-context example selection methods. The evaluation metrics are denoted in the brackets. The example datastore is narrowed down to a small size using kNN for ByCS. In the \u2018default\u2019 setting, the answers are generated directly with the questions without ICL. as an inverse inference model. ByCSsmall has similar results to ByCSlargev2 and ByCSlargev3, verifying the effectiveness of using a smaller model from the same family for inverse inference. This is intuitive since Whisper-small is trained using the same data and settings compared to the inference model Whisper-large-v2 and Whisper-large-v3, which therefore processes information similarly and can serve as a good alternative when evaluating the quality of the in-context examples. The smaller size of Whisper-small makes ByCS a more practical method in cost-sensitive scenarios. 5.3 Text ICL Text-only ICL results are shown in Table 5. As shown, ByCS outperforms all baselines on most dataset settings, showing not only the effectiveness but also the robustness of ByCS. In particular, ByCS outperforms the best baseline on the generative ASR rescoring dataset HyPoradise with a considerable 4.7% relative WER reduction with GPT3.5-Turbo. On TREC and SST2 datasets, ByCS does not always outperform the baselines. This indicates that ByCS is more suitable for open-ended long-answer datasets due to the calculation of text similarity in ByCS, in which answers are much more diverse and examples with rich information interactions can be better separated. In contrast, in multi-choice classification datasets, only a few short answers are often available, containing little contextual information. As the example shown in Figure 4, the distribution of the text similarity for ranking the examples is often sharp, merging the optimal and the suboptimal examples. Furthermore, considering the hypothesized labels of the test inputs for inverse inference, the hypothesized answers in open-ended datasets (in the form of long sentences) are often more similar to their corresponding references compared to those in the multi-choice classification datasets (in the form of a word or phrase or just an index of choice). It is observed that different in-context example selection methods perform differently with different models, even though on the same dataset. The bm25 method outperforms the KATE+ method with GPT-3.5-Turbo on the SST2 dataset, but not with GPT4. Compared to KATE+ and bm25 that is \fmodel-free in the actual selection step, the performance advantage of ByCS is more consistent since it takes into account the influence of the model. The outputs of the inverse inference model are used, which can serve as a good approximation to the inference model as verified in Section 5.2.3. Note that for ByCS on GPT-4, although the inverse inference procedure is conducted on GPT-3.5Turbo, the performances of ByCS are still superior. This further verifies that smaller models from the same model family can serve as a good low-cost approximation of the inverse inference model. (a) Distribution on SST2 (b) Distribution on HyPoradise Figure 4: The distribution of text similarity scores on different datasets. The text similarity score is the Jaccard coefficient. The entropy of distribution is calculated and placed on the upper left. The distribution on the multichoice classification dataset SST2 (blue) is much sharper than that of the open-ended dataset HyPoradise (red). 5.4 VQA ICL ByCS is tested on VQA ICL and the results are reported in Table 6. ByCS outperforms the KATE+ baseline on the VQA ICL task, demonstrating strong performances across modalities. The performance improvement from ByCS is not as obvious as in audio and text tasks, since the answers of VQA are usually short (usually a word or phrase), lacking sufficient contextual information. ByCS on In-context example number k Example selection method KATE+ ByCS k = 2 40.47 40.12 k = 4 45.11 45.14 (a) Results with Emu-2 In-context example number k Example selection method KATE+ ByCS k = 2 52.54 52.86 k = 4 54.00 54.39 (b) Results with GPT-4V Table 6: Results of VQA ICL with different in-context example selection methods and numbers of examples on OKVQA dataset. the VQA dataset suffers from the problem of having sharp text similarity score distributions, similar to the multichoice classification dataset. For ByCS with GPT-4V, inverse inference results on Emu-2 are used to pre-select the candidate examples, and ByCS still outperforms the KATE+ baseline. The performance may be further improved if GPT-4V is also used for inverse inference. This demonstrates that ICL may perform similarly cross models not only on speech and text, but also on images. 6"
|
| 20 |
+
}
|
abs_9K/validation_abstract_short_2404.14723v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14723v1",
|
| 3 |
+
"title": "Insights into Alignment: Evaluating DPO and its Variants Across Multiple Tasks",
|
| 4 |
+
"abstract": "Large Language Models (LLMs) have demonstrated remarkable performance across\na spectrum of tasks. Recently, Direct Preference Optimization (DPO) has emerged\nas an RL-free approach to optimize the policy model on human preferences.\nHowever, several limitations hinder the widespread adoption of this method. To\naddress these shortcomings, various versions of DPO have been introduced. Yet,\na comprehensive evaluation of these variants across diverse tasks is still\nlacking. In this study, we aim to bridge this gap by investigating the\nperformance of alignment methods across three distinct scenarios: (1) keeping\nthe Supervised Fine-Tuning (SFT) part, (2) skipping the SFT part, and (3)\nskipping the SFT part and utilizing an instruction-tuned model. Furthermore, we\nexplore the impact of different training sizes on their performance. Our\nevaluation spans a range of tasks including dialogue systems, reasoning,\nmathematical problem-solving, question answering, truthfulness, and multi-task\nunderstanding, encompassing 13 benchmarks such as MT-Bench, Big Bench, and Open\nLLM Leaderboard. Key observations reveal that alignment methods achieve optimal\nperformance with smaller training data subsets, exhibit limited effectiveness\nin reasoning tasks yet significantly impact mathematical problem-solving, and\nemploying an instruction-tuned model notably influences truthfulness. We\nanticipate that our findings will catalyze further research aimed at developing\nmore robust models to address alignment challenges.",
|
| 5 |
+
"authors": "Amir Saeidi, Shivanshu Verma, Chitta Baral",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "LLM AND Reasoning",
|
| 14 |
+
"gt": "Large Language Models (LLMs) have demonstrated remarkable performance across\na spectrum of tasks. Recently, Direct Preference Optimization (DPO) has emerged\nas an RL-free approach to optimize the policy model on human preferences.\nHowever, several limitations hinder the widespread adoption of this method. To\naddress these shortcomings, various versions of DPO have been introduced. Yet,\na comprehensive evaluation of these variants across diverse tasks is still\nlacking. In this study, we aim to bridge this gap by investigating the\nperformance of alignment methods across three distinct scenarios: (1) keeping\nthe Supervised Fine-Tuning (SFT) part, (2) skipping the SFT part, and (3)\nskipping the SFT part and utilizing an instruction-tuned model. Furthermore, we\nexplore the impact of different training sizes on their performance. Our\nevaluation spans a range of tasks including dialogue systems, reasoning,\nmathematical problem-solving, question answering, truthfulness, and multi-task\nunderstanding, encompassing 13 benchmarks such as MT-Bench, Big Bench, and Open\nLLM Leaderboard. Key observations reveal that alignment methods achieve optimal\nperformance with smaller training data subsets, exhibit limited effectiveness\nin reasoning tasks yet significantly impact mathematical problem-solving, and\nemploying an instruction-tuned model notably influences truthfulness. We\nanticipate that our findings will catalyze further research aimed at developing\nmore robust models to address alignment challenges.",
|
| 15 |
+
"main_content": "Introduction LLMs have sparked a revolution in tackling realworld challenges, showcasing impressive abilities across diverse domains requiring reasoning and specialized knowledge. These models excel in mathematical reasoning/problem-solving (Cobbe et al., 2021a; Wei et al., 2022; Lewkowycz et al., 2022), code generation/programming (Chen et al., 2021; DPO IPO KTO CPO 0 2 4 6 8 10 Score 6.75 6.18 6.65 6.4 4.92 3.11 6.1 6.06 Mistral+SFT with SFT without SFT Figure 1: Performance comparison of alignment methods on MT-Bench under two scenarios: 1) fine-tuning a model with SFT (Mistral+SFT) and 2) fine-tuning a pretrained model without SFT (Mistral). Unlike IPO and DPO, other methods like CPO and KTO demonstrate similar performance to model that undergo SFT. Austin et al., 2021; Li et al., 2022), text generation (Bubeck et al., 2023; Touvron et al., 2023), summarization, and creative writing, among other tasks. Notably, LLMs have achieved significant performance with human preferences, based on alignment methods including Supervised Fine-Tuning (SFT) and Reinforcement Learning from Human Feedback (RLHF) (Sanh et al., 2022; Ouyang et al., 2022). While RLHF exhibits remarkable performance compared to just SFT, it faces limitations such as reward hacking (Liu et al., 2024). Therefore, Direct Preference Optimization (DPO) (Rafailov et al., 2023), a state-of-the-art offline reinforcement learning method, has been proposed to optimize human preferences without the need for the RL process. Recent studies have highlighted limitations in alignment methods, including issues like overfitting, inefficient learning and memory utilization, preferences ranking, and dependence on preferences across various scenarios like dialogue systems (Tunstall et al., 2023), summarization, sentiarXiv:2404.14723v1 [cs.CL] 23 Apr 2024 \fment analysis (Wu et al., 2023), helpful and harmful question answering (Liu et al., 2024), and machine translation (Xu et al., 2024). Despite the significance of these studies, none have thoroughly examined critical ambiguities in alignment, such as the learnability of emerged alignment methods without SFT, fair comparison between these methods, evaluating their performance post-SFT, the impact of data volume on performance, and weaknesses inherent in these methods. Addressing these areas is crucial for gaining a comprehensive understanding, as they elucidate alternative viewpoints or the absence thereof, enabling a more precise and nuanced interpretation. Moreover, they play a critical role in language reasoning and inference. In this study, we delve into the performance of alignment methods such as DPO, IPO, KTO, and CPO, which are based on RL-free algorithms. These methods typically involve two steps: 1) Supervised fine-tuning of a policy model, and 2) Optimization of the SFT model with alignment algorithms such as DPO. Our exploration spans across various tasks including dialogue systems, reasoning, mathematical problem-solving, question answering, truthfulness, and multi-task understanding. We evaluate these alignment methods across 13 benchmarks such as MT-Bench (Zheng et al., 2023), Big Bench (bench authors, 2023), and Open LLM Leaderboard (Beeching et al., 2023). To assess the performance of these methods, we define three distinct scenarios: 1) Fine-tuning an SFT model, 2) Fine-tuning a pre-trained model, and 3) Fine-tuning an instruction model. In scenario 1, we employ a supervised fine-tuned model on chat completion and fine-tune it with different alignment methods. In scenario 2, we omit the SFT phase and directly fine-tune a pre-trained model with alignment methods. Lastly, in scenario 3, we skip the SFT phase and utilize an instruction-tuned model as the base model, fine-tuning it with alignment methods. The results indicate that in the standard alignment process, KTO outperforms other methods across all tasks except for multi-task understanding. However, the performance of SFT and other alignment methods in reasoning tasks is relatively comparable, suggesting that RL-free algorithms do not significantly affect reasoning. Moreover, unlike DPO when skipping the SFT phase, KTO, and CPO demonstrate comparable performance on MTBench. Comparing the performance of methods with and without the SFT phase reveals a significant improvement in TruthfulQA and GSM8K. Additionally, an interesting finding is that alignment methods in the standard process exhibit better performance with smaller training data subsets. Lastly, it is observed that the instruction-tuned model has a notable impact only on truthfulness. In summary, our contributions are as follows: 1. We explore the learning capabilities of alignment methods, aiming to mitigate overfitting challenges within the DPO framework. Our findings indicate that CPO and KTO show comparable performance with skipping the SFT part in MT-Bench (See Figure 1). 2. We extensively examine the effectiveness of alignment methods across dialogue systems, reasoning, mathematical problem-solving, question-answering, truthfulness, and multitask understanding in three different scenarios. 3. A comprehensive evaluation reveals that alignment methods exhibit a lack of performance in reasoning tasks yet demonstrate impressive performance in solving mathematical problems and truthfulness. 4. We observe that in the standard alignment process, fine-tuning an SFT model with all alignment algorithms using a small subset of training data yields better performance. (See Figure 3). 2 Related Works Recent advancements in pre-training LLMs, such as LLaMA-2 (Touvron et al., 2023), GPT-3 (Brown et al., 2020), Gopher (Rae et al., 2022), Vicunna (Chiang et al., 2023), Mistral (Jiang et al., 2023), and PaLM 2 (Anil et al., 2023), have led to impressive performance gains in zero-shot (Radford et al., 2019) and few-shot (Chowdhery et al., 2022) scenarios across various tasks. However, when applied to downstream tasks, LLMs\u2019 performance tends to degrade. While fine-tuning models using human completions aids in alignment and performance enhancement, obtaining human preferences for responses is often more feasible than collecting expert demonstrations. Consequently, recent research has shifted focus towards fine-tuning LLMs using human preferences. In this section, we present a brief review of alignment algorithms on various tasks. \fRLHF (Christiano et al., 2023) proposed to optimize for maximum reward operates by engaging with a reward model trained using the Bradley-Terry (BT) model (Bong and Rinaldo, 2022) through reinforcement algorithms like Proximal Policy Optimization (PPO) (Schulman et al., 2017). While RLHF enhances model performance, it grapples with challenges such as instability, reward hacking, and scalability inherent in reinforcement learning. Recent studies have introduced methods to address these challenges by optimizing relative preferences without depending on reinforcement learning (RL). Optimizing a model using the BT model on preference datasets helps ensure alignment with human preferences. Sequence Likelihood Calibration (SLiC) (Zhao et al., 2023) introduced a novel approach to ranking preferences produced by a supervised finetuned (SFT) model, employing calibration loss and regularization fine-tuning loss during training. Meanwhile, Rank Response with Human Feedback (RRHF) (Yuan et al., 2023) trains the SFT model utilizing a zero-margin likelihood contrastive loss, assuming multiple ranked responses for each input. Despite their efficacy, SLiC and RRHF lack theoretical underpinnings. In response, DPO proposed a method to fit an SFT model directly to human preferences using the Bradley-Terry (BT) model, offering theoretical insights into the process. Statistical Rejection Sampling Optimization (RSO) (Liu et al., 2024) combines the methodologies of SLiC and DPO while introducing an enhanced method for gathering preference pairs through statistical rejection sampling. IPO (Azar et al., 2023), akin to DPO approaches, has mathematically demonstrated the limitations of the DPO approach regarding overfitting and generalization, proposing a comprehensive objective for learning from human preferences. Zephyr (Tunstall et al., 2023) has enhanced DPO by leveraging state-ofthe-art (SOTA) models to generate responses for the same input and ranking them using teacher models like GPT-4. Additionally, they highlight the necessity of SFT as a preliminary step before employing DPO. KTO (Ethayarajh et al., 2024), inspired by Kahneman and Tversky\u2019s seminal work on prospect theory (TVERSKY and KAHNEMAN, 1992), aims to maximize the utility of LLM generations directly rather than maximizing the log-likelihood of preferences. This approach eliminates the need for two preferences for the same input, as it focuses on discerning whether a preference is desirable or undesirable. Self-Play fIne-tuNing (SPIN) (Chen et al., 2024) introduced a self-training approach to enhance DPO using the dataset employed in the SFT step. The key idea of this approach is to utilize synthetic data generated as the rejected response and the gold response from the SFT dataset as the chosen response. Meanwhile, Constrictive Preference Optimization (CPO) (Xu et al., 2024) proposed an efficient method for learning preferences by combining the maximum-likelihood loss and the DPO loss function, aiming to improve memory and learning efficiency. We note that the aforementioned works lack comparative studies on alignment methods concerning both completion and preference learning. While those studies address DPO require SFT step, further exploration of alternative methods is warranted. Although the significance of high-quality preferences is widely acknowledged, there remains a necessity to explore the influence of data quantity on performance of the alignment methods. Additionally, the crucial aspect of generalization remains unexplored. While aligning a model aims to enhance performance across all categories, improving alignment methods often comes at the expense of performance in other areas. Further investigation in this regard is necessary. To this end, we examine the performance of alignment methods both before and after SFT to assess the learning capabilities of IPO, KTO, and CPO. Moreover, we highlight the weaknesses of alignment methods by comparing their performance across five different domains, demonstrating the significant impact of dataset quantity on performance. 3 Alignment Methods In this section, we explain various RL-free alignment methods and discuss the reasons behind their development. Typically, the RL alignment process unfolds in three phases: 1) Fine-tuning a policy model using Supervised Fine-Tuning (SFT), 2) training a reward model, and 3) further finetuning the initial policy model using reinforcement learning (RL), where the reward model provides the feedback mechanism. A recent development by DPO introduced an RL-free approach aimed at aligning a policy model by optimizing the likeli\fDPO IPO CPO KTO 0 20 40 60 Accuracy (%) Reasoning DPO IPO CPO KTO Question Answering (QA) DPO IPO CPO KTO 0 20 40 60 Accuracy (%) Truthfulness DPO IPO CPO KTO Mathematics Mistral+SFT with SFT without SFT Figure 2: Performance comparison of the alignment methods in different tasks based on two different scenarios: 1) fine-tuning an SFT model (Mistral+SFT) with alignment methods and 2) fine-tuning a pre-train model (Mistral) with them. For more details about reasoning and question answering, refer to Appendix B. hood of the preferred and unpreferred responses. This is implemented using a dataset labeled D, where x represents the input, yw denotes the preferred response, and yl indicates the unpreferred response. The DPO loss function is mathematically articulated in Equation 1 as follows: LDPO (\u03c0\u03b8; \u03c0ref ) = \u2212E(x,yw,yl)\u223cD \u0014 log \u03c3 \u0012 \u03b2 log \u03c0\u03b8 (yw | x) \u03c0ref (yw | x) \u2212\u03b2 log \u03c0\u03b8 (yl | x) \u03c0ref (yl | x) \u0013\u0015 (1) where \u03c0\u03b8 is the parameterized policy, \u03c3 is sigmoid function and \u03b2 is a parameter controlling the deviation from the base reference policy \u03c0ref. Despite DPO surpassing RLHF through RL-free methodology, it faces constraints like overfitting and the need for extensive regularization, which can impede the efficacy of the policy model. Addressing these limitations, (Azar et al., 2023) introduced the IPO algorithm, which defines a general form of the DPO and reformulates it to solve the overfitting and regularization. The formulation of the IPO loss function is in Equation 2 as follows: LIPO(\u03c0) = \u2212E (yw,yl,x)\u223cD \u0012 h\u03c0(yw, yl, x) \u2212\u03c4 \u22121 2 \u00132 (2) h\u03c0(y, y\u2032, x) = log \u0012\u03c0 (y | x) \u03c0ref (y\u2032 | x) \u03c0 (y\u2032 | x) \u03c0ref (y | x) \u0013 where x represents the input, yw denotes the preferred response, yl indicates the unpreferred response, \u03c0ref is the reference policy and \u03c4 is a real positive regularisation parameter. Although the IPO algorithm overcomes the problems of overfitting and the need for extensive regularization present in DPO, the approach of aligning based on two preferences has different complications. The KTO study seeks to enhance the effectiveness of the DPO method by implementing a strategy that utilizes only a single preference. This method is inspired by the Kahneman & Tversky theory, which observes that humans are more acutely affected by losses than gains of comparable magnitude. In this algorithm, having a clear understanding of whether a preference is suitable or unsuitable is crucial, eliminating the necessity for an alternative preference. The KTO loss function is defined in Equation 3 as follows: LKTO(\u03c0\u03b8, \u03c0ref; \u03b2) = Ex,y\u223cD h 1 \u2212\u02c6 h(x, y; \u03b2) i (3) \u02c6 h(x, y; \u03b2) = \uf8f1 \uf8f4 \uf8f4 \uf8f4 \uf8f4 \uf8f4 \uf8f2 \uf8f4 \uf8f4 \uf8f4 \uf8f4 \uf8f4 \uf8f3 \u03c3 \u0010 \u03b2 log \u03c0\u03b8(y|x) \u03c0ref(y|x) \u2212Ex\u2032\u223cD [\u03b2KL(\u03c0\u03b8 \u2225\u03c0ref)] \u0011 if y \u223cydesirable|x, \u03c3 \u0010 Ex\u2032\u223cD [\u03b2KL(\u03c0\u03b8 \u2225\u03c0ref)] \u2212\u03b2 log \u03c0\u03b8(y|x) \u03c0ref(y|x) \u0011 , if y \u223cyundesirable|x \fwhere \u03c0\u03b8 is the model we are optimizing, \u03b2 is a parameter controlling the deviation from the base reference policy \u03c0ref, \u03c3 is the logistic function, KL is the KL-divergence between the two distributions and x is the input. IPO and KTO have enhanced the performance of the DPO model and addressed some of its shortcomings. However, the simultaneous loading of two models has led to inefficient learning in DPO algorithm. To improve upon this, the CPO method was developed, enhancing the efficiency of the DPO approach. Research detailed in (Xu et al., 2024) demonstrated that it is unnecessary to load a reference policy model (\u03c0ref) during training. By omitting the reference model from the memory, CPO increases operational efficiency, enabling the training of larger models at reduced costs compared to DPO. The CPO loss function is specified in Equation 4 as follows: LNLL = \u2212E(x,yw)\u223cD [log \u03c0\u03b8 (yw | x)] Lprefer = \u2212E(x,yw,yl)\u223cD h log \u03c3 \u0000\u03b2 log \u03c0\u03b8(yw|x) \u2212\u03b2 log \u03c0\u03b8(yl|x)) \u0001i LCPO = Lprefer + LNLL (4) where \u03c0\u03b8 is the parameterized policy, yw and yl denotes the preferred and unpreferred responses, x is a set of source sentences, \u03b2 is a parameter, and \u03c3 is the logistic function. In the next section, we assess the alignment methods, highlighting their strengths and weaknesses. 4 Experiments Description. In this section, we assess the alignment methods across three scenarios: 1) fine-tuning an SFT model with alignment methods, 2) finetuning a pre-trained model with alignment methods, and 3) fine-tuning an instruction-tuned model with alignment methods. Subsequently, within each scenario, we examine their performance across reasoning, mathematical problem-solving, truthfulness, question-answering, and multi-task understanding. Details regarding these scenarios are provided in the following section. Evaluation Metrics. To evaluate the methods for reasoning, we utilize benchmarks such as ARC (Clark et al., 2018), HellaSwag (Zellers et al., 2019), Winogrande (Sakaguchi et al., 2019), Big Bench Sports Understanding (BBsports), Big Bench Causal Judgment (BB-casual), 0 10 20 30 40 50 60 Training Size (K) 6.0 6.2 6.4 6.6 6.8 7.0 Score DPO KTO IPO CPO Figure 3: Comparison of performance for KTO, IPO, CPO, and DPO alignment methods on MT-Bench across various training set sizes. All methods demonstrated optimal performance with training sets ranging from 1K to 10K data points. Big Bench Formal Fallacies (BB-formal), and PIQA (Bisk et al., 2019). To evaluate their mathematical problem-solving abilities, we employ the GSM8K (Cobbe et al., 2021b) benchmark. Truthfulness is evaluated using the TruthfulQA (Lin et al., 2022) benchmark. Additionally, we gauge their performance in multitask understanding using the MMLU (Hendrycks et al., 2021) benchmark. OpenBookQA (Mihaylov et al., 2018) and BoolQ (Clark et al., 2019) benchmarks are employed to assess their performance in questionanswering tasks. Finally, to evaluate their effectiveness in dialog systems, we utilize MT-Bench benchmarks, which consist of 160 questions across eight knowledge domains, with GPT-4 scoring the model-generated answers on a scale from 0 to 10. 4.1 Scenario 1: Fine-tune an SFT Model Motivation. In this scenario, we first train an SFT model and then refine it with the aforementioned alignment methods. These methods, designed to enhance the performance of DPO, have been applied to various tasks, such as machine translation. However, there hasn\u2019t been a comprehensive evaluation comparing them on the same task. The primary motivation behind these scenarios is to assess their performance across different benchmarks. Additionally, we aim to determine whether the performance of alignment methods improves with increasing training data, as it seems that alignment methods may not require extensive data beyond the SFT phase. \fModels. We employ the zephyr-sft-full model as our SFT model, which underwent finetuning utilizing the UltraChat (Ding et al., 2023) dataset. Its baseline model is Mistral-7B-v0.1. We proceed by training the zephyr-sft-full model with DPO, IPO, KTO, and CPO. For further information regarding the training and evaluation procedures, please refer to the Appendix A. Datasets. We utilize the UltraFeedbackbinarized (Tunstall et al., 2023) dataset, akin to the UltraChat dataset, specifically designed for the chat completion task. Comprising 63k pairs of selected and rejected responses corresponding to specific inputs, the UltraFeedback-binarized dataset is employed for training alignment models. KTO outperforms other alignment methods. The findings depicted in Figures 2 and 3 indicate that KTO surpasses other alignment methods in MT-Bench, and across all academic benchmarks, it exhibits superior performance, with the exception of MMLU (See Table 1). Particularly noteworthy is KTO\u2019s remarkable performance on GSM8K, highlighting its strong aptitude for solving mathematical problems(Mathematics plot in Figure 2). Model DPO KTO IPO CPO SFT Mistral 63.14 62.31 62.44 62.61 60.92 Mistral+SFT 59.88 59.53 59.87 59.14 Table 1: Performance comparison of alignment methods on MMLU across two scenarios: 1) Fine-tuning a pre-trained model (Mistral) using alignment methods, and 2) Fine-tuning an SFT model (Mistral+SFT) using alignment methods. \"-\" represents that there is no value for this model. We note that the MMLU score for the Mistral model fine-tuned with SFT is 60.92. Alignment methods don\u2019t require a large training set. The results depicted in Figure 3 reveal that all alignment methods perform better with a smaller training set. We posit that in the typical alignment process, a significant portion of model alignment occurs during the SFT phase. Therefore, when aiming to enhance the performance of the SFT model with methods like KTO, DPO, IPO, and CPO, it is beneficial to utilize a smaller dataset for training. In essence, there exists a trade-off between aligning with SFT and aligning with RL-free methods to achieve optimal performance. SFT is still enough. Another intriguing observation is that none of the alignment methods outperform SFT in MMLU (See Table 1). This suggests that SFT remains superior to other methods for multitask understanding. Additionally, apart from the KTO algorithm in reasoning, truthfulness, and question answering, SFT demonstrates comparable performance (See Reasoning, Question Answering, and Truthfulness plots in Figure 2). This indicates that alignment methods struggle to achieve notable performance improvements in these tasks. 4.2 Scenario 2: Fine-tune a Pre-Train Model Motivation. In this scenario, we train a pretrained model directly with alignment methods on the UltraFeedback dataset. Several motivations underlie this scenario. Firstly, we seek to determine whether alignment methods necessitate the SFT phase. Secondly, we aim to compare the performance of models aligned with DPO, CPO, KTO, and IPO against those trained with SFT. Lastly, we aim to illustrate the impact of the SFT phase on various tasks by comparing the performance of models with and without this component. Models. We employ Mistral-7B-v0.1 as the pre-trained model and fine-tune it with DPO, CPO, KTO, and IPO. Further information regarding the training and evaluation process can be found in the Appendix A. Datasets. We train an SFT model using the UltraChat dataset, which contains 200k examples generated by GPT-3.5-TURBO across 30 topics and 20 text material types, providing a high-quality dataset. Additionally, for training the pre-trained model with alignment methods, we utilize the UltraFeedback dataset, as explained in Section 4.1. It is worth noting that both UltraChat and UltraFeedback were curated specifically for the chat completion task. KTO and CPO don\u2019t require SFT. The findings presented in Figure 1 indicate that skipping the SFT phase resulted in Mistral+IPO and Mistral+DPO performing poorly in the dialogue system, as they attained lower scores compared to SFT. However, Mistral+KTO and Mistral+CPO achieved scores comparable to Mistral+SFT. SFT significantly affects academic benchmarks. The results depicted in Figure 2 reveal several key findings. Firstly, skipping the SFT phase leads to a marginal improvement in reasoning performance \fModel ARC HellaSwag Winogrande BB-sports BB-casual BB-formal PIQA Average Mistral-Instruct+SFT 61.17 81.93 76.87 71.39 60 50.73 83.02 69.3 Mistral-Instruct+IPO 63.05 84.69 77.26 75.25 59.47 51.65 80.41 70.25 Mistral-Instruct+KTO 62.71 85.52 77.5 74.23 61.57 51.23 81.55 70.62 Mistral-Instruct+CPO 52.38 80.95 77.5 72.31 58.94 52.02 81.55 67.95 Mistral-Instruct+DPO 63.48 85.34 77.34 74.64 59.47 51.12 81.01 70.34 Table 2: Performance comparison of various alignment methods in scenario 3 on reasoning benchmarks. To assess reasoning abilities, we focused on common sense reasoning, logical reasoning, and causal reasoning (See Section 4.3). Model GSM8K MMLU TruthfulQA OpenBookQA BoolQ Average Mistral-Instruct+SFT 37.68 61.03 49.46 48.4 86.02 67.21 Mistral-Instruct+IPO 38.05 60.72 66.97 48.2 85.9 67.05 Mistral-Instruct+KTO 38.28 61.72 66.97 49.4 86.17 67.78 Mistral-Instruct+CPO 38.51 60.46 63.9 46.8 84.98 65.89 Mistral-Instruct+DPO 33.58 61.61 68.22 49.2 85.19 67.19 Table 3: Performance evaluation of alignment methods in scenario 3, focusing on solving mathematics problems, truthfulness, multi-task understanding, and question-answering tasks. For more detailed information, refer to Section 4.3. without significant impact. Secondly, there is a notable and consistent improvement across all alignment methods in GSM8K and TruthfulQA benchmarks except IPO in GSM8K. Moreover, in the MMLU benchmark, skipping the SFT phase not only enhances performance but also results in all alignment methods outperforming the SFT baseline (See Table 1). Model Align First Turn (Score) Second Turn (Score) Average (Score) Mistral-Instruct SFT 7.78 7.16 7.47 Mistral-Instruct DPO 7.61 7.42 7.51 Mistral-Instruct KTO 7.66 7.36 7.51 Mistral-Instruct CPO 7.18 6.98 7.08 Mistral-Instruct IPO 7.88 7.32 7.60 Table 4: Performance comparison of alignment methods using an instruction-tuned model without SFT on MTBench (More details in Section 4.3). 4.3 Scenario 3: Fine-tune an Instruction Tuned Model Motivation. The primary motivation for this scenario is to investigate the impact of the instructiontuned model on the performance of various alignment methods. Thus, we train an instruction-tuned model with KTO, IPO, DPO, and CPO and evaluate their performance across different benchmarks. To ensure a fair comparison, we assess the performance of the alignment methods alongside the SFT method to discern their effects. Consequently, in this scenario, we bypass the SFT phase and utilize the instruction-tuned model for evaluation. Models. We utilize Mistral-instruct-7B-v0.2 as the instruction-tuned model and fine-tune it with DPO, CPO, KTO, and IPO. Further information regarding the training and evaluation process can be found in the Appendix A. Datasets. Like Section 4.2, we train an SFT model using the UltraChat dataset. Additionally, we employ UltraFeedback to train the pre-trained model with alignment methods, as described in scenario 1. Aligning an instruction-tuned model significantly affects truthfulness. The findings presented in Table 3 indicate that KTO and IPO outperform SFT by 17.5%, whereas KTO, based on a pre-trained model, outperforms SFT by 9.5% (See Table 9 in Appendix B) on TruthfulQA. This underscores the high effectiveness of an instructiontuned model, particularly in terms of truthfulness. Additionally, it is observed that IPO surpasses other methods in MT-Bench (See Table 4). SFT based on instruction tuning is enough. The findings presented in Tables 2 and 3 indicate that SFT demonstrates comparable performance across reasoning, mathematics, questionand-answer, and multi-task understanding benchmarks. While alignment methods exhibit better performance than SFT, the challenge of preparing the preference dataset remains significant, making SFT preferable in most cases. It is noteworthy that in \fCoding Math Reasoning 0 2 4 6 8 10 Score 3.6 3.5 6.05 5.2 4.6 5.6 5.3 3.4 5.4 5.5 3.3 5.7 8.5 6.8 9 CPO IPO KTO DPO GPT-4 Figure 4: Comparison performance of the alignment methods based on the instruction-tuned model on MTBench. There exists a substantial disparity in performance between GPT-4 and alignment methods across reasoning, mathematics, and coding tasks. The score is between 0 and 10 generated by GPT-4. STEM Humanities 0 2 4 6 8 10 Score 9.75 9.25 9.3 9.85 9.47 9.75 9.6 9.95 9.7 9.95 CPO IPO DPO KTO GPT-4 Figure 5: Alignment methods based on instructiontuned model not only demonstrate equivalent performance to GPT-4 but can also outperform it, particularly in comparisons based on MT-Bench score. The score is between 0 and 10 generated by GPT-4. MT-Bench, CPO performs even worse compared to SFT, suggesting that models fine-tuned with CPO exhibit weaker performance in the dialogue system compared to those fine-tuned with SFT (See Table 4). Same or higher than GPT-4. We observe that while improving overall performance, there is a decrease in the model\u2019s ability in certain domains (See Figure 4). However, another intriguing discovery is that not only does KTO achieve an equal score with GPT-4 in Humanities, but CPO also outperforms GPT-4 in the STEM domain (See Figure 5). This finding highlights the alignment methods\u2019 capability to rival state-of-the-art models such as GPT-4 with smaller models. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14741v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14741v1",
|
| 3 |
+
"title": "Generate-on-Graph: Treat LLM as both Agent and KG in Incomplete Knowledge Graph Question Answering",
|
| 4 |
+
"abstract": "To address the issue of insufficient knowledge and the tendency to generate\nhallucination in Large Language Models (LLMs), numerous studies have endeavored\nto integrate LLMs with Knowledge Graphs (KGs). However, all these methods are\nevaluated on conventional Knowledge Graph Question Answering (KGQA) with\ncomplete KGs, where the factual triples involved in each question are entirely\ncovered by the given KG. In this situation, LLM mainly acts as an agent to find\nanswer entities by exploring the KG, rather than effectively integrating\ninternal and external knowledge sources. However, in real-world scenarios, KGs\nare often incomplete to cover all the knowledge required to answer questions.\nTo simulate real-world scenarios and evaluate the ability of LLMs to integrate\ninternal and external knowledge, in this paper, we propose leveraging LLMs for\nQA under Incomplete Knowledge Graph (IKGQA), where the given KG doesn't include\nall the factual triples involved in each question. To handle IKGQA, we propose\na training-free method called Generate-on-Graph (GoG) that can generate new\nfactual triples while exploring on KGs. Specifically, we propose a\nselecting-generating-answering framework, which not only treat the LLM as an\nagent to explore on KGs, but also treat it as a KG to generate new facts based\non the explored subgraph and its inherent knowledge. Experimental results on\ntwo datasets demonstrate that our GoG can solve IKGQA to a certain extent,\nwhile almost all previous methods cannot perform well on IKGQA.",
|
| 5 |
+
"authors": "Yao Xu, Shizhu He, Jiabei Chen, Zihao Wang, Yangqiu Song, Hanghang Tong, Kang Liu, Jun Zhao",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Knowledge AND Graph",
|
| 15 |
+
"gt": "To address the issue of insufficient knowledge and the tendency to generate\nhallucination in Large Language Models (LLMs), numerous studies have endeavored\nto integrate LLMs with Knowledge Graphs (KGs). However, all these methods are\nevaluated on conventional Knowledge Graph Question Answering (KGQA) with\ncomplete KGs, where the factual triples involved in each question are entirely\ncovered by the given KG. In this situation, LLM mainly acts as an agent to find\nanswer entities by exploring the KG, rather than effectively integrating\ninternal and external knowledge sources. However, in real-world scenarios, KGs\nare often incomplete to cover all the knowledge required to answer questions.\nTo simulate real-world scenarios and evaluate the ability of LLMs to integrate\ninternal and external knowledge, in this paper, we propose leveraging LLMs for\nQA under Incomplete Knowledge Graph (IKGQA), where the given KG doesn't include\nall the factual triples involved in each question. To handle IKGQA, we propose\na training-free method called Generate-on-Graph (GoG) that can generate new\nfactual triples while exploring on KGs. Specifically, we propose a\nselecting-generating-answering framework, which not only treat the LLM as an\nagent to explore on KGs, but also treat it as a KG to generate new facts based\non the explored subgraph and its inherent knowledge. Experimental results on\ntwo datasets demonstrate that our GoG can solve IKGQA to a certain extent,\nwhile almost all previous methods cannot perform well on IKGQA.",
|
| 16 |
+
"main_content": "Introduction Large Language Models (LLMs) (Brown et al., 2020; Bang et al., 2023) have made great success in various natural language processing (NLP) tasks. Benefiting from extensive model parameters and vast amounts of pre-training corpus, LLMs can solve complex reasoning tasks through In-Context Question:\u00a0What is the time zone of the area where Apple headquarters is located?\u00a0 Incomplete Knowledge Graph Question Answering Incomplete Knowledge Graph lives In Apple Inc Cupertino headquartered\u00a0 California Tim Cook CEO Steve Jobs founder located In Pacific Standard Time timezone timezone Palo Alto timezone adjoin works In born In Figure 1: An example of Incomplete Knowledge Graph Question Answering (IKGQA), where yellow and red nodes represent topic and answer entity, respectively. Red dash line represents this triple (Cupertino, timezone, Pacific Standard Time) is missing in the KG. Learning (ICL) (Dong et al., 2023), without finetuning for specific tasks. However, LLMs are still suffer from insufficient knowledge and the tendency to generate hallucination(Huang et al., 2023; Li et al., 2023a). To mitigate this issue, many methods that incorporate LLMs with Knowledge Graphs (KGs) (Ji et al., 2021) has been proposed (Pan et al., 2023), where KGs provide accurate and abundant factual knowledge in triple format while LLMs provide strong natural language processing ability. These works can be roughly divided into two categories: (1) Semantic Parsing (SP) methods (Li et al., 2023c; Nie et al., 2023), which use LLMs to generate logical forms with ICL, and then obtain answers by executing these logical queries on KGs. (2) Retrieval Augmented (RA) methods (Li et al., 2023d), which retrieve information related to the question from KGs as external knowledge to help LLMs to obtain the answers. The retrieval format can be triples (Li et al., 2023d), paths (Sun et al., arXiv:2404.14741v1 [cs.CL] 23 Apr 2024 \fComplete KG Incomplete KG 0 10 20 30 40 50 EM score CoT (w/o KG) ToG GoG Figure 2: The performance of ToG (Sun et al., 2023) and our GoG under complete/incomplete KG. Dash line indicates the performance of LLM with CoT (Wei et al., 2023) prompting (without KG). 2023; Luo et al., 2023b) and subgraphs (Wang et al., 2023a). Semantic parsing based methods exclusively treat LLMs as parser, not only do they ignore LLMs\u2019 inherent knowledge and reasoning ability, but they also depend heavily on KGs\u2019 quality and completeness (Sun et al., 2023). Therefore, more attention is paid to retrieval augmented methods. Although these retrieval augmented methods claim to solve the drawbacks of semantic parsing methods and obtain good performance on conventional Knowledge Graph Question Answering (KGQA) (Yih et al., 2016a), it is still hard to determine if they effectively integrate knowledge from KGs and LLMs, and how much reasoning ability is utilized. One crucial reason is that, in conventional KGQA tasks, the factual triplets involved in each question are entirely covered by the KG. Therefore, in this scenario, LLMs still play the role of parser which only needs to identify the relationship path starting from the topic entity to the answer entity. For example, for the question \"What is the timezone of the area where Apple headquarters is located?\" in Figure 1, the LLM only needs to start from Apple headquarters, sequentially choose the relations located_in and timezone to find the answer. That means LLMs only need to ground the relationship appearing in the question to the specific relation in the KG to reach the answer entity Pacific Standard Time. Therefore, in conventional KGQA, LLM mainly acts as an agent to find answer entities by exploring the KG, rather than effectively integrating internal and external knowledge sources. However, in real-world scenarios, KGs are often incomplete to cover all the knowledge required to answer questions. Besides, LLMs contain rich knowledge content and have powerful reasoning ability. Therefore, to evaluate the ability of LLMs to integrate internal and external knowledge, in this paper, we propose leveraging LLMs for QA under incomplete KG (IKGQA). The distinction between IKGQA and conventional KGQA is that IKGQA does not encompass all the factual triplets relevant to each question, rendering the KG in IKGQA incomplete. For example, as shown in Figure 1, for answering the same question \"What is the timezone of the area where Apple headquarters is located?\", the key triple (Cupertino, timezone, Pacific Standard Time) does not exist in the KG. This means that even if the correct SPARQL query is generated, it may not retrieve the final answer 1. Compared to KGQA, IKGQA holds greater research significance for the following reasons: (1) it is closer to real-world scenarios where the given KG is incomplete to answer users\u2019 questions. (2) it evaluates LLMs\u2019 reasoning ability and its capability to integrate inherent and external knowledge. As shown in Figure 2, although previous methods have achieved outstanding performance in KGQA, their performance has significantly declined in IKGQA, even is worse than that without KG. This discrepancy suggests that these methods might not fully integrate the external and inherent knowledge of LLMs as professed. To address the challenges in IKGQA, we propose a novel method called Generate-ongraph (GoG), which adopts a selecting-generatinganswering framework consisting of three main steps: (1) Selecting, where LLMs select the relations most relevant to the current question and expanding the subgraph using these relations. (2) Generating, where LLMs use its inherent knowledge and reasoning abilities to generate new factual triples based on the explored subgraph. For example, if the KG already contains the triples (Cupertino, located_in, California), (California, timezone, Pacific Standard Time), LLMs can infer new triple (Cupertino, timezone, Pacific Standard Time). (3) Answering, where LLMs try to answer the question based on the retrieval and generated knowledge. If the information is still in1SP methods do not parse \"timezone\" into two hop path \"located_in -> timezone\" because in the training set, \"timezone\" only corresponds to one hop path \"timezone\", more details can be found in Appendix A. \fsufficient, the process is repeated by going back to Steps 1 and 2 until the LLMs can answer the question. The codes and data are available at https://github.com/YaooXu/GoG. The main contributions of this paper can be summarized as follows: 1. We propose leveraging LLMs for QA under incomplete KG (IKGQA), which is closer to real-world scenarios and can evaluate LLMs\u2019 ability better, and construct relevant datasets. 2. We propose a method called Generate-onGraph (GoG), which uses the selectinggenerating-answering framework, to address IKGQA. 3. Experimental results on two datasets show the superiority of GoG, and demonstrate that an incomplete KG can still help LLMs answer complex questions by providing related structured information, even without directly providing the answers. 2 Related Work Question Answering Under Incomplete KG. Some previous works (Saxena et al., 2020; Zan et al., 2022) attempt to train KG embeddings to predict answers by similarity scores under incomplete KG. Compared to these previous KGE-based works, we propose leveraging LLMs for QA under incomplete KG to study whether LLMs can integrate internal and external knowledge well. Unifying KGs and LLMs for KGQA. Various methods have been proposed to unify KGs and LLMs to solve KGQA, these methods can be classified into two categories: Semantic Parsing (SP) methods (Li et al., 2023c; Nie et al., 2023) and Retrieval Augmented (RA) methods (Luo et al., 2023b; Sun et al., 2023). SP methods transform the question into a structural query using LLMs. These queries can then be executed by a KG engine to derive answers based on KGs (Sun et al., 2020). KB-BINDER (Li et al., 2023c) generates the drafts as preliminary logical forms first, and then binds the drafts to the executable ones with entity and relation binders. However, the effectiveness of these methods relies heavily on the quality of the generated queries and the completeness of KGs. RA methods retrieve related information from the KG to improve the reasoning performance (Li et al., 2023b). ToG (Sun et al., 2023) treats the LLM as an agent to interactively explore relation paths stepby-step on KGs and perform reasoning based on the retrieved paths. RoG (Luo et al., 2023b) first generates relation paths as faithful plans, and then use them to retrieve valid reasoning paths from the KGs for LLMs to reason. Our GoG belongs to retrieval augmented methods, we also utilize the knowledge modeling ability of LLMs, as well as the semantic parsing ability and reasoning ability. LLM reasoning with Prompting. Many works have been proposed to elicit the reasoning ability of LLMs to solve complex tasks through prompting (Wei et al., 2023; Khot et al., 2023). Complex CoT (Fu et al., 2023) creates and refine rationale examples with more reasoning steps to elicit better reasoning in LLMs. Self-Consistency (Wang et al., 2023b) fully explores various ways of reasoning to improve their performance on reasoning tasks. DecomP (Khot et al., 2023) solves complex tasks by instead decomposing them into simpler sub-tasks and delegating these to sub-task specific LLMs. ReAct (Yao et al., 2023) treats LLMs as agents that interact with the environment and make decisions to retrieve information from external source. GoG can be viewed as a fusion of ReAct and DecomP, thereby enabling a more comprehensive utilization of the diverse capabilities inherent in LLMs for addressing complex questions. 3 Preliminary In this section, we firstly introduce Knowledge Graph (KGs). Then, we use symbols of KGs to define relation path and Knowledge Graph Question Answering (KGQA). Knowledge Graphs (KG) is a set of factual triples, i.e., G = {(h, r, t) \u2208V \u00d7 R \u00d7 V}, where h, r \u2208V denote the head and tail entity, r \u2208R represents the relation. Knowledge Graph Question Answering (KGQA) is a reasoning task that aims to predict answer entities ea \u2208Aq based on G. Following previous work (Sun et al., 2019), we call entities mentioned in question q as topic entities, denoted as et \u2208Tq. Many datasets (Talmor and Berant, 2018; Yih et al., 2016b) give the standard SPARQL query of each question, which demonstrates a relation path from topic entity et to answer entity ea. We call this path as gold relation path, denote it as wg = eq r1 \u2212 \u2192e1 r2 \u2212 \u2192... rl \u2212 \u2192ea. For example, the gold relation path of question in Figure 1 is wg = Apple Inc headquartered \u2212 \u2212 \u2212 \u2212 \u2212 \u2212 \u2212 \u2212 \u2212 \u2192 \fThought 1: I need to find out where is the Apple's headquarters. Act 1: Search[Apple Inc] Obs 1: Apple Inc, Headquartered, Cupertino Thought 2:\u00a0 The\u00a0headquarters of Apple Inc is located in Cupertino, now I need to find the time zone of Cupertino. Act 2: Search[Cupertino] Obs 2: Cupertino, Located In, California Cupertino, Adjoin, Palo Alto Thought 3: There is no information about the time zone of Cupertino, I need to search some related information about California and Palo Alto. Act 3: Search[California, Palo Alto] Obs 3: California, Timezone, Pacific Standard Time Palo Alto, Timezone, Pacific Standard Time Thought 4: I need to generate some new information abouth this question based on retrieve triples and my inherent knowledge. Act 4: Generate[the time zone of Cupertino.] Obs 4:\u00a0Cupertino, Timezone, Pacific Standard Time Thought 5: I know the timezone of Cupertino is\u00a0Pacific Standard Time. Act 5: Finish[Pacific Standard Time] (d) Generate-on-Graph Path retrieved:\u00a0 Apple Inc, headquartered, Cupertino Response: The\u00a0headquarters of Apple Inc is located in Cupertino, but the timezone of Cupertino is not provided, so I don't have enough information to answer the Question. (c) Path Retrieval Method\u00a0 (Prompt) Please generate a SPARQL query for this question. Response: SELECT ?x WHERE { Apple Inc ns:headquartered ?place . ?place\u00a0ns:timezone ?x . } (b) Semantic Parsering Method SPARQL Server No Answer (CoT Prompt): Let\u2019s think step by step. Response: Apple's headquarters is located in\u00a0Wall Street, New York.\u00a0The time zone of\u00a0\u00a0New York is Eastern Standard Time. (a) LLM only lives In Apple Inc Cupertino headquartered\u00a0 California Tim Cook CEO Steve Jobs founder located In Pacific Standard Time timezone timezone Palo Alto timezone adjoin works in born in Incomplete Knowledge Graph Question:\u00a0What is the time zone of the area\u00a0where Apple headquarters is located? Gold Relation Path: Figure 3: Comparison of four methods in solving IKGQA: (a) Standard CoT prompting (closed-book, without KG), (b) Semantic parsing based method (e.g., KB-BINDER (Li et al., 2023c)), (c) Path retrieval method (e.g., ToG (Sun et al., 2023)), (d) The proposed GoG with selecting-generating-answering framework. Cupertino timezone \u2212 \u2212 \u2212 \u2212 \u2212 \u2212 \u2192Pacific Standard Time. In KGQA, \u2200i \u2208[1, l], (ei\u22121, ri, ei) \u2208G. That is, it is guaranteed that all triples in gold path are contained by G. 4 Incomplete Knowledge Graph Question Answering (IKGQA) 4.1 Task Introduction IKGQA differs from KGQA in that, in IKGQA, \u2203i \u2208[1, l], (ei\u22121, ri, ei) / \u2208G. That is, it doesn\u2019t guarantee that all triples in gold path are contained by G. For example, the triple (Cupertino, timezone, Pacific Standard Time) in wg may not be contained by G. Therefore, models need to recall their inherent knowledge or reasoning from subgraph information. 4.2 Datasets Construction We construct two IKGQA datasets based on two widely used KGQA datasets: WebQuestionSP (WebQSP) (Yih et al., 2016b) and Complex WebQuestion (CWQ) (Talmor and Berant, 2018). Both datasets use Freebase (Bollacker et al., 2008) as their background KG. To simulate incomplete KG, we delete some crucial triples, which appear in the gold relation path, of each question from the original KG. By doing this, simple semantic parsing methods almost fail to obtain the correct answers (except for some scenarios with multiple golden paths). In order to save computational cost, we selected the first 1,000 samples of these two datasets for constructing IKGQA questions. For simplicity, we only consider one topic entity here. The process of generating crucial triples of a question is as follows: 1. Extract the topic entity eq from the question q by LLMs. 2. Execute the SPARQL question sq (given in the datasets) on the background KG G, and get all involved triples. 3. Filter property node (e.g., time, text, height), then convert the involved triples into a subgraph g. 4. Utilize breadth first search (BFS) to find the \fshortest path p, from topic entity eq to answer entity aq. 5. Sample k edges in the path p as the crucial triples in the question. 5 Generate-on-Graph (GoG) In this section, we introduce our method Generateon-Graph (GoG), which can integrate the knowledge of KGs and LLMs, as well as utilize the reasoning ability of LLMs. The comparison between GoG and other previous methods is illustrated in Figure 3. LLM as Agent. Motivated by ReAct (Yao et al., 2023), we consider the LLM as an agent interacting with an environment to solve tasks. As shown in Figure 3 (d), for each step i, the agent first generates a thought ti \u2208L, where L is the language space, to decompose the original question (Thought 1) or decide which next sub-question should be solved (Thought 2). Then, based on the thought ti, the agent generates an action ai \u2208A, where A is the action space, to search information by calling graph database API (Act 1, 2) or generate more information by reasoning and inherent knowledge (Act 4). Action Space. GoG uses the selecting-generatinganswering framework, which consists of three main actions: Search, Generate and Answer. 1. Search[target entity], which aims to find the most relevant top K neighbors of the target entity e. It is possible to search multiple entities at one time (Act 3 in Figure 3), for simplicity, we only consider searching one entity at one search action here. As there could be numerous neighbor entities of the target entity. We use the same strategy in ToG (Sun et al., 2023) to filter unrelated neighbor entities. First, we retrieve all neighbor relations r \u2208Re linking to the target entity. This process is completed by pre-defined SPARQL queries. Then, we utilize the LLMs to select the top K relations that most related to the current sub-question (last thought). As shown in Act 2 of Figure 3 (d), given the target entity Cupertino, LLMs select the two relation {Located_in, Adjoin} from all neighbor relations. In the end, triples {(Cupertino, located_in, California), (Cupertino, adjoin, Palo Alto)} are appended to context as Obs 3. 2. Generate[sub-question], which make the agent generate new factual triples based on retrieval information and inherent knowledge. As shown in Act 4 of Figure 3 (d), although there is no triple directly representing the timezone of Cupertino, the agent can still infer the timezone of Cupertino based on {(Cupertino, located_in, California), (California, timezone, Pacific Standard Time)}. This process is similar to knowledge graph completion (KGC) (Wang et al., 2017). It is also possible for the agent directly generates an entity, which is not explored before, based on its inherent knowledge. Therefore, we have to link the entity to its corresponding MID in the KG. This entity linking process is divided into two steps: (1) We retrieve some similar entities and their corresponding types based BM25 scores. (2) We utilize the LLM to select the most relevant entity based on the types. 3. Finish[answer], indicates that the agent finishes the task with answer. It should be noticed that the agent would also generate \"Finish[unknown]\", which means that there is not enough information for the agent to answer the question. In this case, we would roll back and search one more hop neighbors of the last target entity. 6 Experiments 6.1 Experiments Setup Evaluation Metrics Following previous works (Li et al., 2023d; Jiang et al., 2023; Sun et al., 2023), we use Hits@1 as our evaluation metric, which measures the proportion of questions whose top-1 predicted answer is correct. Baselines The baselines we compare can be divided into two groups: (1) LLM only methods, including standard prompting (IO prompt) (Brown et al., 2020), Chain-of-Thought (CoT) prompting (Wei et al., 2023) and Self-Consistency (SC) (Wang et al., 2023b). (2) Semantic Parsing (SP) methods, including KB-BINDER (Li et al., 2023c) and ChatKBQA (Luo et al., 2023a). (3) Retrieval Augmented (RA) methods, including StructGPT (Jiang et al., 2023), RoG (Luo et al., 2023b) and ToG (Sun et al., 2023), where RoG is the SOTA among all models requiring fine-tuning. All these methods are evaluated in both complete incomplete KGs. Experiment Details We use two LLMs as the backbone in our experiments: GPT-3.5 and GPT-4. We do not use Llama-2-70b-chat-hf (Touvron et al., 2023), as we found that Llama\u2019s output sometimes did not follow the format we defined in few-shot. We use OpenAI API to call GPT-3.5 and GPT-4. The maximum token length for each generation is set to 256. The temperature parameter is set to \fMethod CWQ WebQSP without external knowledge IO prompt 37.6 63.3 CoT 38.8 62.2 CoT+SC 45.4 61.1 RoG w/o planning 43.0 66.9 with external knowledge CKG IKG-1 CKG IKG-1 w training RoG 64.5 51.1 88.7 70.1 ChatKBQA 76.5 35.0 78.1 42.6 w/o training KB-BINDER 50.7 34.4 StructGPT 76.4 53.7 ToG 47.2 36.7 76.9 60.6 GoG w/GPT-3.5 (Ours) 55.7 43.4 78.7 64.9 GoG w/GPT-4 (Ours) 75.2 61.0 84.4 74.8 Table 1: The Hits@1 scores of different models over two datasets in different settings (%). CKG and IKG-1 denote using complete and incomplete KG (dropping one crucial triple for each question), respectively. We use GPT-3.5 as backbone of KB-BINDER, StructGPT and ToG. Results of the other baselines were re-run by us, more details can be found in Appendix C. The boldface indicates the best result in the same setting. IKG-1 IKG-2 IKG-3 IKG-4 CWQ 2.3 4.3 5.9 6.8 WebQSP 2.1 3.6 4.6 5.4 Table 2: The average number of edges deleted under different incompleteness degrees. 0.7 in all experiments. We use 3 shots in GoG prompts for all the datasets. The prompts we use are listed in Appendix B. The details of re-running other baselines can be found in Appendix C. Datasets Details For each dataset, we generate four incomplete KGs with varying degrees of completeness: IKG-1/2/3/4, representing randomly dropping 1/2/3/4 crucial triples in the KG. In addition to the crucial triples themselves, all relations between these two entities will also be deleted. The statistics of these incomplete KGs are shown in Table 2. Besides, we also ensure that after deleting these crucial triples, the number of neighbor nodes of the topic entities will not be zero, more details can be found in Appendix D. 6.2 Main Results Table 1 shows the Hits@1 scores of GoG and all baselines on two datasets in different settings. From the table, we can find that, compared with other prompt based methods, GoG can achieve the state-of-the-art performance on CWQ and WebQSP in both complete and incomplete KG settings. In the CKG setting, the excellent performance of GoG mainly comes from its dynamic subgraph expansion strategy, which performs better than ToG in question involving compound value types (CVTs), an example of CVT is demonstrated in Figure 4. ToG is likely to think CVT nodes are not worthy to further explore and ignore them, as they do not offer information directly. Our GoG can easily solve this problem by expanding subgraph dynamically, that means if there is not enough information provided by the current subgraph, GoG would search one more hop, so the neighbors of CVT nodes is taken into consideration in this way. In the IKG setting, the performance of SP methods, such as ChatKBQA and KB-BINDER, significantly declines. This is expected, as these SP methods don\u2019t interact with the KGs, which means they have no idea of the absence of some triples. The performance of RoG, StructGPT and ToG also \fMethod WebQSP CKG IKG-1 IKG-2 IKG-3 IKG-4 StructGPT 76.4 52.5 49.1 47.9 46.4 ToG 76.9 60.6 57.8 58.0 57.3 GoG 78.7 62.2 60.9 59.6 57.4 CWQ CKG IKG-1 IKG-2 IKG-3 IKG-4 ToG 47.2 36.7 33.1 32.2 31.7 GoG 55.7 41.6 37.2 36.7 36.5 Table 3: The Hits@1 scores of prompt based methods (w/ GPT-3.5) under different numbers of missing triples (%). CKG represent using the complete KG. IKG-1/2/3/4 represent randomly dropping 1/2/3/4 crucial triples in the KG. Brad Paisey m.03gr7w CVT m.0h3d7qj education 1993 Belmont University Bachelor degree institution start time m.019v9k m.01qdhx Figure 4: An example of compound value types (CVTs) in Freebase dataset. Blue, green and orange nodes denote normal entities, CVT node and property node. drop significantly. The performance of ToG and StructGPT on IKG is even worse than that without KG (IO prompt and CoT). That means, these methods still play a role of parsing to find answers rather than effectively integrating internal and external knowledge sources. Besides, in the IKG setting, these methods are even likely to retrieve wrong or unrelated paths which disturb LLMs. Our GoG can alleviate the problem by using the generate action, which utilizes the LLM to generate new factual triples when no direct answer is found after multiple rounds of searches on the KGs. Detailed analysis of answers generated by GoG can be checked in Appendix E. 6.3 Performance under Different Numbers of Missing Triples In order to explore the impact of different degrees of KG incompleteness on different methods, we evaluate the performance of methods (w/ GPT-3.5) under different numbers of missing triples, the results are demonstrated in Table 3. It can be found that our GoG outperforms other prompt based methods consistently in different Method WebQSP CKG IKG-1 NKG GoG w/GPT-3.5 78.7 64.9 62.2 GoG w/GPT-4 84.4 74.8 65.6 CWQ CKG IKG-1 NKG GoG w/GPT-3.5 55.7 43.4 38.8 GoG w/GPT-4 75.2 61.0 55.6 Table 4: The Hits@1 scores of GoG using different backbone models (%). CKG, IKG and NKG denote using complete, incomplete and no KG. numbers of missing triples. Especially on the CWQ dataset, our GoG has a significant improvement on Hits@1 score, achieving average 7.5% improvement under all settings. That emphasizes the importance of integrate the external and inherent knowledge of LLMs. On the contrary, the performance of ToG on IKG is even much lower than that without KG, which indicates the performance of ToG still depends heavily on the completeness of KGs. Furthermore, even though the majority of questions in the WebQSP dataset are single-hop questions, GoG can still demonstrate its advantages and perform better than ToG and StructGPT. This is because GoG can leverage the neighboring information of the topic entities to predict the tail entities while other methods can not make full use these information. More details can be found in Appendix F. 6.4 Performance with Different LLMs We evaluate how different backbone models affect GoG performance. Table 4 demonstrates that the performance of GoG using GPT-4 as backbone improves significantly. Especially under com\fIKG-1 IKG-2 IKG-3 IKG-4 40 45 50 55 60 65 70 EM score (a) WebQSP w/o subgraph w subgraph IKG-1 IKG-2 IKG-3 IKG-4 20 25 30 35 40 45 50 (b) CWQ w/o subgraph w subgraph Figure 5: The Hits@1 scores of GoG with different generation strategies on the CWQ (a) and WebQSP (b) (%), w subgraph and w/o subgraph represent generating new factual triples with and without explored subgraph as context in the Generate action, respectively. 0 5 10 15 20 62 64 EM score (a) WebQSP 0 5 10 15 20 #related triples 42.5 45.0 EM score (b) CWQ Figure 6: The Hits@1 scores of GoG with different number of related triples in the Generate action (%). plete KGs setting, GoG (w/GPT-4) achieves 84.4 and 75.2 Hits@1 score on the WebQSP and CWQ datasets respectively, which achieve SOTA performance in prompt based methods and outperforms most fine-tuned methods. In addition, we can also find that, the more powerful the backbone model, the better it utilizes the incomplete KGs. For example, on the WebQSP dataset, the performance of GoG (w/GPT3.5) using incomplete KG is only 2.5% higher than that without using KG, while the improvement increases to 9.2% when using GPT-4 as backbone. 6.5 Ablation Study The Effect of Explored Subgraphs To explore the influence of explored subgraphs on the performance of GoG, we conduct experiments under different two Generate action (introduced in section 5) strategies: (1) Utilizing explored subgraphs, which is obtained in Search action, as context to generate new factual triples. (2) Generating new factual triples directly without explored subgraphs. As shown in Figure 5, GoG\u2019s performance improves significantly with the help of explored subgraphs. This implies that, even incomplete KGs don\u2019t provide answers directly, the related knowledge they provide is still helpful for models generating corresponding knowledge. There are two potential reasons: (1) Utilizing related subgraphs as context can activate LLMs\u2019 memory corresponding to this knowledge. (2) LLMs can reason new factual triples based on the related subgraphs, as shown in Figure 3 (d). The Effect of the Number of Related Triples Aiming to find out how many related triples is required in the Generate action, we perform additional to find out how the number of related triples effect GoG\u2019s performance. We select the most relevant k triples based on BM25. The results are shown in Figure 6. It can be observed that, GoG\u2019s performance first increases and then decreases as the number of related triples increases. This is mainly because noisy and unrelated knowledge are introduced when the number of related triples is large. How to filter valuable knowledge from the explored subgraph could be a future direction. 7"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14743v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14743v1",
|
| 3 |
+
"title": "Gradient Guidance for Diffusion Models: An Optimization Perspective",
|
| 4 |
+
"abstract": "Diffusion models have demonstrated empirical successes in various\napplications and can be adapted to task-specific needs via guidance. This paper\nintroduces a form of gradient guidance for adapting or fine-tuning diffusion\nmodels towards user-specified optimization objectives. We study the theoretic\naspects of a guided score-based sampling process, linking the gradient-guided\ndiffusion model to first-order optimization. We show that adding gradient\nguidance to the sampling process of a pre-trained diffusion model is\nessentially equivalent to solving a regularized optimization problem, where the\nregularization term acts as a prior determined by the pre-training data.\nDiffusion models are able to learn data's latent subspace, however, explicitly\nadding the gradient of an external objective function to the sample process\nwould jeopardize the structure in generated samples. To remedy this issue, we\nconsider a modified form of gradient guidance based on a forward prediction\nloss, which leverages the pre-trained score function to preserve the latent\nstructure in generated samples. We further consider an iteratively fine-tuned\nversion of gradient-guided diffusion where one can query gradients at newly\ngenerated data points and update the score network using new samples. This\nprocess mimics a first-order optimization iteration in expectation, for which\nwe proved O(1/K) convergence rate to the global optimum when the objective\nfunction is concave.",
|
| 5 |
+
"authors": "Yingqing Guo, Hui Yuan, Yukang Yang, Minshuo Chen, Mengdi Wang",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "stat.ML",
|
| 9 |
+
"cats": [
|
| 10 |
+
"stat.ML",
|
| 11 |
+
"cs.LG"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Diffusion AND Model",
|
| 15 |
+
"gt": "Diffusion models have demonstrated empirical successes in various\napplications and can be adapted to task-specific needs via guidance. This paper\nintroduces a form of gradient guidance for adapting or fine-tuning diffusion\nmodels towards user-specified optimization objectives. We study the theoretic\naspects of a guided score-based sampling process, linking the gradient-guided\ndiffusion model to first-order optimization. We show that adding gradient\nguidance to the sampling process of a pre-trained diffusion model is\nessentially equivalent to solving a regularized optimization problem, where the\nregularization term acts as a prior determined by the pre-training data.\nDiffusion models are able to learn data's latent subspace, however, explicitly\nadding the gradient of an external objective function to the sample process\nwould jeopardize the structure in generated samples. To remedy this issue, we\nconsider a modified form of gradient guidance based on a forward prediction\nloss, which leverages the pre-trained score function to preserve the latent\nstructure in generated samples. We further consider an iteratively fine-tuned\nversion of gradient-guided diffusion where one can query gradients at newly\ngenerated data points and update the score network using new samples. This\nprocess mimics a first-order optimization iteration in expectation, for which\nwe proved O(1/K) convergence rate to the global optimum when the objective\nfunction is concave.",
|
| 16 |
+
"main_content": "Introduction Diffusion models have emerged as a significant advancement in the field of generative artificial intelligence, offering state-of-the-art performance in image generation (Song and Ermon, 2019; Song et al., 2020a; Dhariwal and Nichol, 2021). These models operate by gradually transforming a random noise distribution into a structured output, by using a score function trained from large amounts of data. Such a transforming process is typically modeled as a stochastic differential equation, offering a mathematically grounded approach for sampling. One of the key advantages of diffusion models is their ability to be guided or fine-tuned for specific tasks, which allows them to excel in a wide range of applications (Kong et al., 2020; Ajay et al., 2022; Gruver et al., 2023). Guidance-based diffusion, a nuanced extension of diffusion models, stands at the forefront of controlled generation in generative AI. This approach involves steering the noise transformation process of a diffusion model towards desired outcomes by incorporating additional \u201cguidance signals\u201d. This guidance can manifest in various forms, such as text prompts, class labels, or even \u2217\u2020 Equal contribution. Emails: {yg6736, huiyuan, yy1325, minshuochen, mengdiw}@princeton.edu. 1 arXiv:2404.14743v1 [stat.ML] 23 Apr 2024 \fconditioning on specific attributes and rewards. The core principle behind this technique is to influence the probabilistic pathway of the noise transformation process at each time step, thereby steering the final output towards predefined criteria or objectives. This controlled generation capability opens up opportunities for generative AI in a broad range of tasks, such as in targeted image synthesis, content creation with specific themes, or even in drug design where molecular structures need to meet specifications. A notable example is the classifier-based diffusion model introduced by Song et al. (2020c); Dhariwal and Nichol (2021), which generates data conditioned on a class label, via guidance signals that are computed from conditional likelihoods from a classifier. Building on this concept, Bansal et al. (2023) extend the classifier-guidance method to a form of \u201cuniversal guidance\u201d. Such guidance allows the generation process to be influenced by gradient obtained from some external loss function, effectively tailoring the diffusion process to meet specific objectives (Chung et al., 2022a,b; Graikos et al., 2022; Kawar et al., 2022; Lugmayr et al., 2022; Wang et al., 2022). Despite of numerous empirical successes, there remain significant gaps in the theoretical understanding and guarantees associated with guided diffusion models. Problem and Challenges Suppose we have a pre-trained diffusion model that can generate new samples faithfully from the pre-training data\u2019s distribution and maintain the data\u2019s latent structure. The goal is to adapt this diffusion model to generate new samples that optimize task-specific objectives, while maintaining the learned structure in new samples. Compared to classic optimization, the guided diffusion model offers new possibilities to optimize complex design variables such as images, videos, proteins, and genomes (Black et al., 2023; Watson et al., 2023; Liu et al., 2024). Interested readers may refer to recent surveys for a more comprehensive exposure (Yang et al., 2023; Chen et al., 2024; Guo et al., 2023). To adapt pre-trained diffusion models, existing practical methods largely rely on empirical heuristics and hyperparameter tuning. There remain critical theoretical questions: (i) Why does naively guiding diffusion models using gradient never work in practice? (ii) How to add a guidance signal to improve the target objective without compromising the quality of the generated output? (iii) Can one guarantee the properties of new samples generated by guided diffusion? (iv) What are the limits of adaptability in these guided models? This paper aims to answer these questions from an optimization perspective. Scope of This Paper We investigate the role of guidance in diffusion models from an optimization perspective. The goal is to generate samples that optimize a given objective function f. Drawing inspiration from gradient-based optimization methods, we construct a guidance signal based on the gradient vector, \u2207f. Then we use the gradient signal, in addition to the pre-trained score function, to guide the sampling process towards generating structured output with higher function values. See Figure 1 for illustration our algorithmic framework. Our main results are summarized as follows: \u2022 We focus on structured data. Assume that pre-trained data belongs to a latent low-dimensional subspace, thus the trained score function is capable of discerning and maintaining the latent subspace structure of data during (unguided) generation. To guide the generation, we introduce a gradient-like guidance based on a forward prediction loss (Definition 1). This gradient guidance can be computed based on a pre-trained score network, and it provably preserve any learned low-dimensional structure in the generated output (Lemma 1). 2 \fNoise Pre-trained Diffusion <latexit sha1_base64=\"OhVjuL2UuksxRGnetmEa4wL3BCw=\">ACHicbVDLSsNAFL3xWe ur6tLNYBFclUR8dFnQhcsK9gFtKJPJpB06mcSZiVBCfsAfcKt/4E7c+hf+gN/hpM3Cth64cDjnXu7heDFnStv2t7Wyura+sVnaKm/v7O7tVw4O2ypKJKEtEvFIdj2sKGeCtjTnHZjSXHocdrx xje53miUrFIPOhJTN0QDwULGMHaSG4/xHpEME9vs8F4UKnaNXsKtEycglShQHNQ+en7EUlCKjThWKmeY8faTbHUjHCalfuJojEmYzykPUMFDqly02noDJ0axUdBJM0Ijabq34sUh0pNQs9s5iH VopeL/3m9RAd1N2UiTjQVZPYoSDjSEcobQD6TlGg+MQTyUxWREZYqJNT3NfJVHy8qmGexhmXSPq85V7XL+4tqo15UVIJjOIEzcOAaGnAHTWgBgUd4gVd4s56td+vD+pytrljFzRHMwfr6B XxmrU=</latexit>Dk Guided Diffusion Noise Weighted Fine-tuning via all past generated data <latexit sha1_base64=\"y5+B4UdWOZ+PfrBSs9ugb/X6ZI=\">ACJXicbVDLSsNAFJ3Ud31VXboZLIglER8LUXuqxgVWhKmUxu2qGTBzM3Ygn 5BX/DH3Crf+BOBFfu/A4naRdqPTBw5tzHuRwvkUKjbX9Ylanpmdm5+YXq4tLymptbf1ax6ni0OKxjNWtxzRIEUELBUq4TRSw0JNw4w3OivrNHSgt4ugKhwl0QtaLRCA4QyN1azu6m7nYB2Q53aUuwj2WSzMFfp6Vfx1k53nerdXthl2CThJnTOpkjGa39uX6MU9DiJBLpnXbsRPsZEyh4BLyqptqSBgfsB60D Y1YCLqTleY53TaKT4NYmRchLdWfExkLtR6GnukMGfb131oh/ldrpxgcdzIRJSlCxEdGQSopxrSIh/pCAUc5NIRxJcytlPeZYhxNiL9cfF2cldNM7fGCbJ9V7DOWwcXO7XT07HEc2TbJFdohDjsgJuSBN0iKcPJAn8kxerEfr1Xqz3ketFWs8s0F+wfr8Bp3xpw0=</latexit>s\u2713+ G <latexit sha1_base64=\"HMa6LYaTUXy3E6aoJl84q96txDY=\">ACLX icbVDLSsNAFJ34rPUVdelmsAhuLIlIdVnUhcsK9gFNCJPJpB06mYSZiVBCfsPf8Afc6h+4EMSl/oaTNos+vD4Zx7ueceP2FUKsv6NFZW19Y3Nitb 1e2d3b198+CwI+NUYNLGMYtFz0eSMpJW1HFSC8RBEU+I1/dFvo3SciJI35oxonxI3QgNOQYqQ05ZmWEyE1xIhld7lnQenif6CWMkSz8jZ6NzOPb Nm1a1JwWVgl6AGymp5o8TxDiNCFeYISn7tpUoN0NCUcxIXnVSRKER2hA+hpyFBHpZpPLcniqmQCGsdCPKzhZycyFEk5jnzdWRiVi1pB/qf1UxVe uxnlSaoIx9NFYcqgimEREwyoIFixsQYIC6q9QjxEAmGlw5zbEsjCWl7VwdiLMSyDzkXdbtQbD5e15k0ZUQUcgxNwBmxwBZrgHrRAG2DwDF7BG3g3Xo wP48v4nrauGOXMEZgr4/cPq7yo5w=</latexit>D0 [ \u00b7 \u00b7 \u00b7 [ Dk\u22121 Gradient-Guided Diffusion for Generative Optimization <latexit sha1_base64=\"6pexyF+KX2Kl39GP0TBaRnShkjU=\">A ACN3icbVDLSsNAFJ3UV42vqks3g63gxpIUfOCq6MZlBWuFpoTJ5LYOnUzCzEQpIf/ib/gDbnXryl1x6x84bSP4OjBwOdc7p0TJwp7Ti vVmlufmFxqbxsr6yurW9UNreuVZxKCm0a81jeBEQBZwLamkON4kEgUcOsHwfOJ37kAqFosrPUqgF5GBYH1GiTaSXzn1AhgwkVEQGmRu1 +59p4Y9z65d2Gs1Yzf+9nwM1rtgci/Mr6lapTd6bAf4lbkCoq0PIrYy+MaRqZcqJUl3XSXQvI1IzyiG3vVRBQuiQDKBrqCARqF42/W O94wS4n4szRMaT9XvExmJlBpFgUlGRN+q395E/M/rprp/0suYSFINgs4W9VOdYwnheGQSaCajwhVDJzK6a3RBJqOvi5JVST03LbFOP+ ruEvuW7U3aP64Wj2jwrKiqjHbSL9pGLjlETXaAWaiOKHtATekYv1qP1Zo2t91m0ZBUz2+gHrI9PvamrMw=</latexit> w0 . . . wk\u22121 (optional) update <latexit sha1_base64=\"BoqCalhzOuziVXznzoDFT3GXjT4=\">ACGHicbV DLSsNAFJ3UV62vqstugkVwVZKCD1wVXOiygm2FtpTJ5KYdOnkwcyOWkIW/4Q+41T9wJ27d+QN+h9M0C9t6YODMuY9zOU4kuEL+jYK6tr6xvFzdLW9s7uXn/ oK3CWDJosVCE8t6hCgQPoIUcBdxHEqjvCOg46tpvfMAUvEwuMNJBH2fDgPucUZRS4NypYfwiNmeRIKbJtlfecl1mg7KVatmZTCXiZ2TKsnRHJR/em7IYh8CZI Iq1bWtCPsJlciZgLTUixVElI3pELqaBtQH1U8y89Q81opreqHUL0AzU/9OJNRXauI7utOnOFKLtan4X60bo3fRT3gQxQgBmxl5sTAxNKeJmC6XwFBMNKFMcn2r yUZUoY6tzkXV01PS0s6GHsxhmXSrtfs9rpb3auMwjKpIKOSInxCbnpEFuSJO0CNP5IW8kjfj2Xg3PozPWvByGcOyRyMr1+tIKHa</latexit>G <latexit sha1_base64=\"+a+XvKO9+e/Tk76tXPL9VPri6AY=\">ACIXicbVDJSgNBEO2Je9xGPXpjEJECDPidhQ9KHhRMEZIwtDTqUkaexa6a8QwzA/4G /6AV/0Db+JNvPsdpaDJj5o+vFeFVX1/EQKjY7zaRUmJqemZ2bnivMLi0vL9srqjY5TxaHKYxmrW59pkCKCKgqUcJsoYKEvoebfnfb82j0oLeLoGrsJNEPWjkQgOEMjefam9rIGdgAZLQ9+72I7pzu0gfCAOsjOcu/Cs0tOxemDjhN3SEpkiEvP/m60Yp6GECGXTOu6yTYzJhCwSXkxUaqIWH8jrWhbmjEQtDNrH9NTreM0qJ BrMyLkPbV3x0ZC7Xuhr6pDBl29KjXE/z6ikGR81MREmKEPHBoCVFGPai4a2hAKOsmsI40qYXSnvMU4mgD/TGnp3mp50QTjsYwTm52K+5BZf9qr3R8MoxolqyTDVImLjkx+ScXJIq4eSRPJMX8mo9W/Wu/UxKC1Yw5418gfW1w+f9KOx</latexit>s\u2713(\u2713K) + GK <latexit sha1_base64=\"AP2GAHoY KxMVT0aDSGkmNO0QvZU=\">ACA3icbVDLSsNAFJ34rPVdelmsAiuSiJS XRbduKxgH9CGMpnctEMnD2ZuhBK69Afc6h+4E7d+iD/gdzhps7CtBwYO59z LPXO8RAqNtv1tra1vbG5tl3bKu3v7B4eVo+O2jlPFocVjGauxzRIEUELBU roJgpY6EnoeO73O8gdIijh5xkoAbsmEkAsEZGqmrB30cAbJBpWrX7Bno KnEKUiUFmoPKT9+PeRpChFwyrXuOnaCbMYWCS5iW+6mGhPExG0LP0IiFoN1 slndKz43i0yBW5kVIZ+rfjYyFWk9Cz0yGDEd62cvF/7xeisGNm4koSREiP j8UpJiTPU18o4CgnhjCuhMlK+YgpxtFUtHDF13m0adkU4yzXsEralzWn Xqs/XFUbt0VFJXJKzsgFcg1aZB70iQtwokL+SVvFnP1rv1YX3OR9esYue ELMD6+gWPOJiW</latexit>s\u2713 Adapted Diffusion Noise <latexit sha1_base64=\"EZETYmX9nRyL1Nkln4gi+uYkcWE=\">A ACXicbVDLSsNAFJ3UV62vqks3g0VwVRKR6rLoxmUF+4A2hslk2g6dTMLMjVBCvsAfcKt/4E7c+hX+gN/hpM3Cth64cDjnXu7h+LHgGmz7 2yqtrW9sbpW3Kzu7e/sH1cOjo4SRVmbRiJSPZ9oJrhkbeAgWC9WjIS+YF1/cpv73SemNI/kA0xj5oZkJPmQUwJGetReOoAxA+Klkyzqj W7bs+AV4lTkBoq0PKqP4MgoknIJFBtO47dgxuShRwKlhWGSaxYROyIj1DZUkZNpNZ6kzfGaUA8jZUYCnql/L1ISaj0NfbMZEhjrZS8X/ /P6CQyv3ZTLOAEm6fzRMBEYIpxXgAOuGAUxNYRQxU1WTMdEQqmqIUvgc6jZRVTjLNcwyrpXNSdRr1xf1lr3hQVldEJOkXnyEFXqInuUAu 1EUKvaBX9GY9W+/Wh/U5Xy1Zxc0xWoD19Qvg5JuM</latexit>s\u2713k Compute Gradient Guidance <latexit sha1_base64=\"BoqCalhzOuziVXznzoDFT3GXjT4=\">ACGHicbVDLSsNAFJ3UV62vqstugkVwVZKCD1wVXOiygm 2FtpTJ5KYdOnkwcyOWkIW/4Q+41T9wJ27d+QN+h9M0C9t6YODMuY9zOU4kuEL+jYK6tr6xvFzdLW9s7uXn/oK3CWDJosVCE8t6hCgQPoIUcBdxHEqjvCOg46tpvfMAUvEwuMNJBH2fDgPucUZRS4NypYfwiNmeRIKbJtlfecl1mg7KVatmZTCXiZ2TKsnR HJR/em7IYh8CZIq1bWtCPsJlciZgLTUixVElI3pELqaBtQH1U8y89Q81opreqHUL0AzU/9OJNRXauI7utOnOFKLtan4X60bo3fRT3gQxQgBmxl5sTAxNKeJmC6XwFBMNKFMcn2ryUZUoY6tzkXV01PS0s6GHsxhmXSrtfs9rpb3auMwjKpIKOSInxCbnpE FuSJO0CNP5IW8kjfj2Xg3PozPWvByGcOyRyMr1+tIKHa</latexit>G Weights <latexit sha1_base64=\"qEXaESVr1fTBbnNbrKvEPvC+E8A=\">ACGHicbVDLSsNAFJ34rPVdnNYBFclUSkuiyK4LKCfUAawmQybYdOHszcSEvMwt/wB9zqH7gTt+78Ab/DSduFb T0wcDjnXu6Z48WCKzDNb2NldW19Y7OwVdze2d3bLx0ctlSUSMqaNBKR7HhEMcFD1gQOgnViyUjgCdb2hte535gUvEovIdxzJyA9EPe45SAltxSuTsgkHYDAgPS2+yzB65Jn7EIxct1Qxq+YEeJlYM1JBMzTc0k/Xj2gSsBCoIErZlhmDkxIJnAqWFbuJYjGhQ9JntqYhCZhy0sknMnyiFR/3IqlfCHi/t1ISaDUOPD0ZJ5WLXq5+J9nJ9C7dFIexgmwkE4P9RKBIcJ5I9jnklE QY0IlVxnxXRAJKGge5u74qs8WlbUxViLNSyT1lnVqlVrd+eV+tWsogIqo2N0ix0geroFjVQE1H0hF7QK3ozno1348P4nI6uGLOdIzQH4+sXngagnw=</latexit>\u02c6 E[x0|xt] <latexit sha1_base64=\"j/KiU24Qs2OvaXioqDjIz7NBJQ=\">ACNHicbVDLSsNAFJ34tr6qLt0MFkEXlqSIuhRFcKlgVWhiuJlO28HJMzciCXmU/w Nf8CtfoDgTnTpNzipXfg6MHA4517umROlUh03WdnZHRsfGJyaroyMzs3v1BdXDozSaYZb7JEJvoiAsOlULyJAiW/SDWHOJL8PLo6KP3za6NSNQp9lMexNBVoiMYoJXC6o6vIJIQ5jchFnS9Tzdp9LHJKV+DzD3Y8BeFOWHRdG6CV16S+1csHZCKs1t+4OQP8Sb0hqZIjsPrutxOWxVwhk2BMy3NTDHLQKJjkRcXPD E+BXUGXtyxVEHMT5IMPFnTNKm3aSbR9CulA/b6RQ2xMP47sZBnY/PZK8T+vlWFnN8iFSjPkin0d6mSYkLtmhbaM5Q9i0BpoXNSlkPNDC0nf640jZltKJi/F+1/CXnDXq3nZ9+2Srtrc/rGiKrJBVsk48skP2yBE5Jk3CyB15I/kybl3XpxX5+1rdMQZ7iyTH3A+PgFg86su</latexit> rxt(y \u2212g>\u02c6 E[x0|xt])2 Pre-trained Diffusion Gradient Query <latexit sha1_base64=\"8RbS92UirR97/cna4GH7idu+Q=\">AB/HicbVBLSgNBFHwTfzH+oi7dNAbBVZgRiS6DblwmYD6QDKGn503SpOdDd48Q ryAW72BO3HrXbyA57AnmYVJLGgoqt7jVZeXCK60bX9bhY3Nre2d4m5pb/g8Kh8fNJWcSoZtlgsYtn1qELBI2xprgV2E4k09AR2vPF95neUCoeR496kqAb0mHEA86oNlJzOChX7Ko9B1knTk4qkKMxKP/0/ZilIUaCapUz7ET7U6p1JwJnJX6qcKEsjEdYs/QiIao3Ok86IxcGMUnQSzNizSZq383pjRUahJ6Zj KkeqRWvUz8z+ulOrh1pzxKUo0RWxwKUkF0TLJfE59LZFpMDKFMcpOVsBGVlGnTzdIVX2XRZiVTjLNawzpX1WdWrXWvK7U7/KinAG53AJDtxAHR6gAS1gPACr/BmPVv1of1uRgtWPnOKSzB+voF8EOVcw=</latexit>g <latexit sha1_base64=\"D0sht2uGXguHU 9h/RBQWcv/7Mqg=\">AC0HicdVFLb9NAEF6bVwmvAEcuKyKkokAUV1UpB6RKHOBYUNE io21Xo/jVdcP7Y5Lo9UKceXvceIP8DtYO0FKExhptd98M6P5ZiapdA4Hv/y/Bs3b92+s 3e3d+/+g4eP+o+fnOuqURwmvJKVmiVMgxQlTFCghFmtgBWJhGly8b6NTy9BaVGVZ7isIS rYohSZ4AwdFfd/hgXDXBUmtXQW4xcTSsiQKV9te86PA8zxbgJrDnYTRnqOMQckHXc/nb 4FT17jaESixfDkOEK+wUGwWpNZ2vM/PB/q/4b6ld/RHdEIvDSes3IztCszUxhj3B+PR uDO6C4I1GJC1ncb932Fa8aAErlkWs+DcY2RYQoFl2B7YaOhZvyCLWDuYMkK0JHpRrH0h WNSmlXKvRJpx25WGFZovSwSl9kK1tuxlvxXbN5gdhwZUdYNQslXjbJGUqxoe0maCgUc5d IBxpVwWinPmbsVuntf65LqVprtucUE2vYBecHo+BodPTpcHByuF7RHnlGnpN9EpA35I R8JKdkQrj31ou93BP+Z/K/+Z/X6X63rmKblm/o8/nPDnwA=</latexit> dX t = \uf8ff1 2X t + s\u2713(X t , T \u2212t) + G (X t , t) \" dt + dW t Figure 1: Gradient-guided diffusion model for generative optimization, with or without adaptive finetuning. A pre-trained diffusion model is guided with an additional gradient signal from an external objectives function towards generating near-optimal solutions. \u2022 We formalize a mathematical framework of using a gradient-guided diffusion model for generative optimization. While retaining the pre-trained score function, the generation process is iteratively refined and guided using new gradient queries (Algorithm 1; Figure 1 without fine-tuning). Under proper assumptions, we demonstrate that this adapted model generates novel samples whose expectation converges to a solution that is regularized with respect to the original problem (Theorem 2). The regularization ensures that the generated samples remain proximal to the training data. In other words, gradient guidance cannot shift data distribution unboundedly towards higher objective values, revealing a fundamental limit for adapting pre-trained diffusion models. \u2022 Furthermore, we explore an adaptive variant of gradient-guided diffusion, where both the score function and gradient guidance are iteratively fine-tuned using self-generated samples (Algorithm 2; Figure 1 with fine-tuning). Although slightly increasing the computational demand, we provide evidence that this approach generates new samples whose expectation converges to global optima, within the latent subspace, at a rate of O(1/K) (Theorems 3 and 4), where K denotes the number of iterations and gradient evaluations, matching classical convergence theory of convex optimization. Our findings suggest that this novel gradient guidance not only preserves the latent subspace structure of the data but also ensures fast convergence towards the optimal solution. Numerical experiments with a pre-trained U-network score function are provided in Section 7 to support these theoretical findings. 2 Related Work Our study is motivated by recent empirical progress of guidance-based diffusion model fine-tuning for steering sample generation towards specific needs (Dhariwal and Nichol, 2021; Bansal et al., 2023). Upon modeling the specific needs as a reward function, the relevant methods can be summarized into two categories in the sequel. 3 \fGuided Generation and Fine-tuning Given an auxiliary reward function judging the sample property of interests, existing research explored diverse mechanisms to guide generation from diffusion models. There are mainly two types of methods. The first type of method incorporates an additive so-called \u201cguidance\u201d term into the score function of pre-trained diffusion models at inference time. For example, classifier guidance (Song et al., 2020a; Dhariwal and Nichol, 2021) defines the guidance term as the gradient of an externally trained classifier on noise corrupted data. Classifier-free guidance (Ho and Salimans, 2022) simultaneously trains conditional and unconditional diffusion models, circumventing the training of an external classifier. After the training, the score functions of the conditional and unconditional models are combined together to achieve guided generation. Bansal et al. (2023) draw motivation from classifier guidance and generalize the idea to a \u201cuniversal guidance\u201d for adapting unconditioned score functions to various external rewards. The second type of method attempts to directly fine-tune the weight parameters in a pretrained diffusion model by interacting with the target reward function. For example, Clark et al. (2023) fine-tune diffusion models by directly backpropagating the gradient of the reward function. Recently, a line of works utilizes Reinforcement Learning (RL) techniques for fine-tuning diffusion models (Black et al., 2023; Fan et al., 2023). They formulate the sample generation process of diffusion models as a finite-horizon Markov chain. The score function can be viewed as a policy, the generated samples are the state of the Markov chain, and the target reward function defines the terminal reward. In this way, fine-tuning diffusion models is equivalent to policy optimization and allows the use of policy gradient methods. Sampling and Statistical Theory of Diffusion Model In contrast to the fruitful empirical advances, the theory of diffusion models is still limited. To the best of our knowledge, a theoretical understanding of fine-tuning diffusion models is absent. Existing results mainly focus on the sampling ability and statistical properties of unconditional diffusion models. In particular, for sampling ability, a line of works shows that the distribution generated by a diffusion model is close to the data distribution, as long as the score function is accurately estimated (De Bortoli et al., 2021; Albergo et al., 2023; Block et al., 2020; Lee et al., 2022a; Chen et al., 2022; Lee et al., 2022b,a; Chen et al., 2022; Lee et al., 2022b). The accuracy of the estimated score function is measured in terms of an L\u221eor L2-norm distance. More recently, Chen et al. (2023c,b); Benton et al. (2023) develop refined and tighter analyses using Taylor expansions of the discretized backward process and localization method. It is worth mentioning that the analysis in Chen et al. (2023c,b); Benton et al. (2023) extends to broader sample generation processes such as deterministic ones based on probabilistic ODEs. Going beyond distributions in Euclidean spaces, De Bortoli (2022) analyzes diffusion models for sampling distribution supported on a low-dimensional manifold. Moreover, Montanari and Wu (2023) consider sampling from symmetric spiked models, and El Alaoui et al. (2023) study sampling from Gibbs distributions using diffusion processes. Turning towards the statistical theory of diffusion models, Song et al. (2020b) and Liu et al. (2022) provide asymptotic analyses, assuming a parametric form of the score function. Unfortunately, asymptotic analysis does not lead to concrete sample complexities. Later, concurrent works, Oko et al. (2023) and Chen et al. (2023a), establish sample complexity bounds of diffusion models for estimating nonparametric data distributions. In high dimensions, their results highlight a curse of dimensionality issue without further assumptions, which also appears in Wibisono et al. (2024) considering kernel methods. More interestingly, these works demonstrate that diffusion models can 4 \fcircumvent the curse of dimensionality issue if the data has low-dimensional structures. In the same spirit, Mei and Wu (2023) investigate learning high-dimensional graphical models using diffusion models, without the curse of dimensionality. For conditional diffusion models, Yuan et al. (2023); Fu et al. (2024) establish sample complexity bounds for learning generic conditional distributions. We refer readers to Chen et al. (2024) for an overview of contemporary theoretical progress. Novelty of This Paper Despite the existing theoretical underpinnings of diffusion models, our paper provides the first rigorous study of adapting and fine-tuning diffusion models using gradient guidance from an optimization perspective. Specifically, we first understand why naive gradient guidance does not lead to meaningful optimization performance. Built upon the insights gained from the analysis, we propose gradient guidance that is proven to preserve generated data structures and simultaneously achieve strong optimization guarantees on adapted variants of diffusion models. We are aware of two recent works (Uehara et al., 2024; Marion et al., 2024) studying adapting the output distribution of diffusion models to a target reward function. In particular, they define a reward function with respect to the output distribution of the diffusion model. Given a pre-trained diffusion model, for instance, Uehara et al. (2024) utilizes a KL-divergence regularizer penalizing the deviation to the pre-trained model for preventing overfitting in fine-tuning. Through some explicit computation, Uehara et al. (2024); Marion et al. (2024) identify the proper guidance term to adapt the pre-trained model. Yet a sophisticated estimation procedure is needed to find the guidance term in Uehara et al. (2024); our gradient guidance enjoys much simplicity and efficacy, as we demonstrated in both theory and experiments. 3 Preliminaries: Diffusion Models Score-based diffusion models capture the distribution of pre-training data by learning a sequence of transformations to generate new samples from noise (Song et al., 2020c). A forward stochastic process progressively adds noise to data, whose sample trajectories are used to train the score function. To generate new samples, a backward denoising process starts from sampling pure noise and gradually transforms the noise guided by the learned score function. Forward Process The forward process of diffusion models initializes with X0 \u2208RD, a random variable drawn from the pre-training data D. It introduces noise to via an Ornstein-Uhlenbeck process, i.e., dXt = \u22121 2q(t)Xt dt + p q(t) dWt for q(t) > 0, (1) where (Wt)t\u22650 is a standard Wiener process, and q(t) is a non-decreasing weighting function. Xt represents the noise-corrupted data distribution at time t. Given X0 = x0, the conditional distribution Xt|X0 = x0 is Gaussian, i.e., N(\u03b1(t)x0, h(t)ID) with \u03b1(t) = exp(\u2212 R t 0 1 2q(s)ds) and h(t) = 1 \u2212\u03b12(t). In practice, the forward process will terminate at a large time T so that the marginal distribution of XT is close to N(0, ID). In our analysis, we take q(t) \u22611 without loss of generality, where \u03b1(t) := exp(\u2212t/2) and h(t) := 1 \u2212exp(\u2212t). Backward Process If reversing the time of the forward process, we can reconstruct the original distribution of the data from pure noise. With (W t)t\u22650 being another independent Wiener process, 5 \fthe backward SDE below (Anderson, 1982) reverses the time in the forward SDE (1), dX\u2190 t = \uf8ee \uf8f01 2X\u2190 t + \u2207log pT\u2212t(X\u2190 t ) | {z } score \uf8f9 \uf8fbdt + dW t. (2) Here pt(\u00b7) denotes the marginal density of Xt in the forward process. In the forward SDE (2), the score function \u2207log pt(\u00b7) plays a crucial role, but it has to be estimated from data. Score Matching To learn the unknown score function \u2207log pt(\u00b7), it is common to train a score network s\u03b8(x, t) using samples generated by the forward process. Let D denote the data for training. Then the score network is learned by minimizing the following loss: mins\u2208S Z T 0 Ex0\u2208DExt|x0 h \u2225\u2207xt log \u03d5t(xt|x0) \u2212s(xt, t)\u22252i dt, (3) where S is a given function class, ED denotes the empirical expectation over training data D and Ext|x0 denotes condition expectation over the forward process, \u03d5t(xt|x0) is the Gaussian transition kernel, i.e., 1 (2\u03c0h(t))D/2 exp(\u2212\u2225xt\u2212\u03b1(t)x0\u22252 2h(t) ). Generation and Guided Generation Given a pre-trained score function s\u03b8, one generates new samples by simulating the backward process (2) with the true score replaced by s\u03b8. Further, one can add additional guidance to the backward SDE to steer its output distribution towards specific properties of interest. Module 1 formalizes the generation process and guided generation process using a pre-trained diffusion model. Module 1 Guided BackwardSample(s\u03b8, G) 1: Input: Score s\u03b8, guidance G default to be zero for unguided generation. 2: Hyper-parameter: T. 3: Initialized at X\u2190 t \u223cN(0, I), simulate the following SDE till time T: dX\u2190 t = \u00141 2X\u2190 t + s\u03b8 (X\u2190 t , T \u2212t) + G (X\u2190 t , T \u2212t) \u0015 dt + dW t. 4: Output: Sample X\u2190 T . Conditional Generation Suppose the goal is to generate X with a desired property Y = y from the distribution P(X|Y = y). To this end, one needs the conditional score function \u2207xt log pt(xt | y), as a replacement of the unconditioned score \u2207xt log pt(xt). The Bayes rule gives \u2207xt log pt(xt | y) = \u2207log pt(xt) | {z } est. by s\u03b8(xt,t) + \u2207xt log pt(y | xt) | {z } to be est. by guidance . (4) When a pre-trained score network s\u03b8(xt, t) \u2248\u2207log pt(xt), the remaining task is to estimate \u2207xt log pt(y | xt) and add it as a \u201cguidance\u201d G to the backward process (Module 1). 6 \fClassifier and Classifier-Free Guidance Classifier guidance (Song et al., 2020c; Dhariwal and Nichol, 2021) is a approach for sampling from P(X|Y = y) when Y is a discrete label. This method estimates \u2207xt log pt(y | xt) by training auxiliary classifiers, denoted as \u02c6 p(y | xt, t), and then computing the gradient of the classifier logits as the guidance, i.e., G(xt, t) = \u2207xt log \u02c6 p(y | xt, t). An alternative is the classifier-free guidance method (Ho and Salimans, 2022), which jointly trains a conditional and an unconditional diffusion model, and combine the two score estimates via a form of guidance to generate samples. Notations For a random variable X, Px represents its distribution, and p(x) denotes its density function. For X, Y jointly distributed, P(X | Y = y) denotes the conditional distribution, and p(x | y) denotes its density function. We use the notation E[x | y] for the conditional expectation. Let D be the pre-training data, and let ED be the empirical expectation over D. Let \u00af \u00b5 and \u00af \u03a3 denote the data\u2019s empirical mean and covariance matrix, i.e., \u00af \u00b5 := Ex\u2208D[x] and \u00af \u03a3 := Ex\u2208D \u0002 (x \u2212\u00af \u00b5)(x \u2212\u00af \u00b5)\u22a4\u0003 . For a matrix A, we denote by Span(A) the subspace spanned by its column vectors. For a square matrix A, we denote by A\u22121 its inverse or Moore\u2013Penrose inverse. For any differentiable function f : Rn \u2192Rm, \u2207f \u2208Rm\u00d7n denotes Jacobian matrix, i.e., (\u2207f)ij = \u2202fi(x) \u2202xj . 4 A Primer on Gradient Guidance Suppose we have a pre-trained diffusion model where the score network s\u03b8(xt, t) provides a good approximation to the true score function log p(xt). Then this diffusion model is viewed as an implicit density estimator of the pre-training data\u2019s distribution. Its backward process (2) generates samples from this estimated distribution (Oko et al., 2023; Chen et al., 2023a). Now suppose we want to generate novel samples with desired properties that can be measured by a differentiable function f. We will refer to f as a reward or objective function later on, and it is often user-specified. Motivated by the gradient methodology in optimization, a natural, intuitive way for adding guidance is to steer the generated samples towards the steepest ascent direction of f (Bansal et al., 2023; Clark et al., 2023). This motivates the following guided backward process (Module 1): dX\u2190 t = \u00141 2X\u2190 t + s\u03b8(X\u2190 t , T \u2212t)+G(X\u2190 t , t) \u0015 dt + dW t. Here the guidance term G is what we focus on and wish to design. Specifically, we want to construct this guidance term G based on the gradient \u2207f of a general objective f. 4.1 Subspace Data and Score Decomposition Real-world data often has rich intrinsic structures. These structures can be induced by local regularities, global symmetries, and repetitive patterns (Tenenbaum et al., 2000; Roweis and Saul, 2000) and are often low-dimensional (Pope et al., 2021). The power of diffusion models is to model the latent distribution and generate novel samples that preserve important characteristics of real-world data. If we blindly improve f at the cost of losing these characteristics, the quality of new samples would degrade dramatically. This quality degradation, also known as \u201creward overoptimization\u201d, is a common challenge for adapting diffusion models towards an external reward (Yuan et al., 2023; Uehara et al., 2024). 7 \fWe aim to design gradient guidance to improve objective function while mitigating the risk of over-optimization. To this end, we focus on data that admits a low-dimensional latent subspace. Let us make the following assumption. Assumption 1 (Subspace Data). Data X \u2208RD can be represented as X = AU, where A \u2208RD\u00d7d is an unknown matrix and the latent variable U \u2208Rd follows some distribution Pu with a density pu. Here d \u226aD. We assume the empirical covariance of U is full rank. Under Assumption 1, the score function \u2207log pt(x) decomposes to two orthogonal parts: an on-support component belonging to the subspace; and an orthogonal component. We recall this key result in Proposition 1. Proposition 1 (Score Decomposition for Subspace Data (Chen et al. (2023a) Lem. 1, Thm. 3)). Under Assumption 1, the score function \u2207log pt(x) decomposes as \u2207log pt(x) = A\u2207log pLD t (A\u22a4x) | {z } s\u2225(A\u22a4x,t): on-support score \u2212 1 h(t) \u0010 ID \u2212AA\u22a4\u0011 x | {z } s\u22a5(x,t): ortho. score . (5) where pLD t (u\u2032) = R \u03d5t(u\u2032|u)pu(u) du with \u03d5t(\u00b7|u) being the density of N(\u03b1(t)u, h(t)Id) for the same \u03b1(t) and h(t) in the forward process (1). According to Chen et al. (2023a), pre-training a score function on subspace data takes advantage of the decomposition given by (5) and learns the latent subspace. When the pre-trained score network is used to generate new samples, the backward sampling process also decomposes into two orthogonal processes due to (5). Analysis of this backward process proves that the generated output would remain proximal to the latent subspace. This explains why diffusion models can learn and preserve data\u2019s underlying characteristics. We refer interested readers to Chen et al. (2023a) for more discussions. In the rest of this section, we investigate the principles for designing a guidance based on the gradient of f that ensures generated samples (i) improve the value of f, and at the same time, (ii) adhere to the subspace structure, i.e. generated samples being close to the subspace spanned by A. 4.2 Naive Gradient Does\u2019t Work as Guidance Motivated by the gradient optimization methodology, a natural, intuitive way for adding guidance is to steer the generated samples towards the steepest ascent direction of f (Bansal et al., 2023; Clark et al., 2023). Therefore, a tempting simple choice of the guidance G is the steepest ascent direction, which we refer to as naive gradient guidance i.e., G(X\u2190 t , t) \u221d\u2207f(X\u2190 t ). (6) This naive choice of guidance signal G would steer the movement of the original backward process towards the direction that increases f. However, the naive gradient guidance (6) is never adopted in practice; existing methods have to resort to more sophisticated forms of guidance or more computationally demanding fine-tuning methods; for example Bansal et al. (2023); Uehara et al. (2024); Marion et al. (2024). Introducing gradient information indiscriminately into the backward SDE has the risk of potentially leading the 8 \f<latexit sha1_base64=\"bcQ/eNp79YODvDvdj6LzPoTKPj0=\">A AB/HicbVBLSgNBFHwTfzH+oi7dNAbBVZgRiS6DblwmYD6QDKGnp5M06fnQ/UYIQ7yAW72BO3HrXbyA57AnmYVJLGgoqt7jVZcXS6HRtr+tws bm1vZOcbe0t39weFQ+PmnrKFGMt1gkI9X1qOZShLyFAiXvxorTwJO8403uM7/zxJUWUfiI05i7AR2FYigYRSM1cVCu2FV7DrJOnJxUIEdjU P7p+xFLAh4ik1TrnmPH6KZUoWCSz0r9RPOYsgkd8Z6hIQ24dtN50Bm5MIpPhpEyL0QyV/9upDTQehp4ZjKgONarXib+5/USHN6qQjBHnIF oeGiSQYkezXxBeKM5RTQyhTwmQlbEwVZWi6Wbri6yzarGSKcVZrWCftq6pTq9a15X6XV5REc7gHC7BgRuowM0oAUMOLzAK7xZz9a79WF9 LkYLVr5zCkuwvn4BQqVgA=</latexit>t Pre-trained Random Noise Large Reward Region Gradient Direction Subspace Naive Gradient Guidance O\ufb00 Subspace Figure 2: Directly adding the gradient of the objective function to the backward sampling process sabotages the subspace structure. Left: When gradients are pointing out of the data subspace, adding them directly to the backward SDE will make samples go off the subspace. Right: Numerical experiments show that naive gradients lead to substantially larger off-subspace error compared to our gradient guidance Gloss(Definition 1); see Section 7 for experiment details. stochastic denoising process to divergence, and compromising the data structures learned during pre-training. Let us suppose the data distribution is supported on a low-dimensional subspace as in Assumption 1. We explain why naive gradients do not work as guidance. With subspace data, the score function would steer the distribution towards concentrating onto the latent subspace, due to its special decomposition form given by Proposition 1. We refer interested readers to Chen et al. (2023a) for detailed analysis of this phenomenon. However, naive gradient vectors can be pointing towards any direction, not limited to within the latent subspace. Thus directly adding gradient guidance to the backward process could jeopardize the decomposition form of the score function, and it would also jeopardize the latent structure in the generated output. See Figure 2 for illustration and experiment results. The failure of naive gradient motivates us to seek robust alternatives. 4.3 Motivating Gradient Guidance from Conditional Score Function We want to study how to add guidance to the sampling process utilizing the gradient of f. To motivate our design of guidance, we start with the most elementary Gaussian probabilistic model. Later we will drop this assumption and consider general data distributions and general f. Assumption 2 (Gaussian model). Let data follow a Gaussian distribution, i.e., X \u223cN(\u00b5, \u03a3), and let f(x) = g\u22a4x be a linear function for some g \u2208RD. Let Y = f(X) + \u03f5 with independent, identically distributed noise \u03f5 \u223cN(0, \u03c32) for some \u03c3 > 0. To generate samples from P(X|Y = y), we need to train a diffusion model with a conditional score function. By the Bayes\u2019 rule, the conditional score function takes the form of a sum given by \u2207xt log pt(xt | y) = \u2207log pt(xt) | {z } est. by s\u03b8(xt,t) + \u2207xt log pt(y | xt) | {z } to be est. by guidance . (recall (4)) Now if we already have a pre-trained score function s\u03b8, the remaining task is to estimate the second 9 \fterm log pt(y | xt). Under the Gaussian assumption, we derive the following closed-form conditional score. The proof is provided in Appendix B.1. Lemma 1 (Conditional score gives a gradient-like guidance). Under Assumption 2, we have \u2207xt log pt(y|xt) = \u03b2(t) h y \u2212g\u22a4E[x0|xt] i \u00b7 \u0000\u03b12(t)\u03a3 + h(t)ID \u0001\u22121 \u03a3g, (7) where E[x0|xt] denotes the conditional expectation of x0 given xt in the forward process (1), \u03b1(t) = e\u2212t/2, h(t) = 1 \u2212e\u2212t as in (1), and \u03b2(t) = \u03b1(t)/(\u03c32 + g\u22a4\u03a3\u22121 \u0000ID + \u03b12(t)/h(t) \u00b7 \u03a3 \u0001\u22121 g). Observe that, when \u03a3 = I, (7) suggests the following form of guidance that is aligned with the naive gradient, i.e., the steepest ascent direction: G(xt, t) \u221d h y \u2212g\u22a4E[x0|xt] i \u00b7 g. However, even for Gaussian distributions, as long as \u03a3 \u0338= I, the term of (7) is no longer proportional to g but becomes a pre-conditioned version of the gradient. Figure 3: Plot of \u03b2(t), \u03b1(t), h(t) for t \u2208[0, 10] when \u03a3 = I. Another observation is that this guidance scales with a residual term y \u2212g\u22a4E[x0 | xt]. In particular, the residual term y \u2212g\u22a4E[x0 | xt] tunes the strength of guidance. Recall E[x0 | xt] denotes the posterior expectation of clean data x0 given xt in the forward process. Thus, in a backward view, E[x0 | xt] coincides with the expected sample to be generated conditioned on xt. In this sense, the quantity y \u2212g\u22a4E[x0 | xt] measures a look-ahead gap between the expected reward of generated samples and the target value. A larger absolute value of the residual means stronger guidance in the backward generation process. We plot the theoretical choice of \u03b2(t) and \u03b1(t), h(t) to t in Figure 3. In practice, the choice of \u03b1(t), h(t) can vary and they are determined by the forward process used for pre-training; and \u03b2(t) can be treated as a tuning parameter to adjust the strength of guidance. 4.4 Construct Gradient Guidance to Preserve Latent Subspace When the data distribution is supported on a latent subspace, directly adding gradient guidance to the backward sampling process could jeopardize the data\u2019s latent structure. We saw that this would lead to over-optimization, as illustrated in Figure 2. To remedy such an issue, we propose the following modification to the gradient guidance. This modified gradient guidance takes advantage of a given score function. Definition 1 (Gradient Guidance of Look-Ahead Loss). Given a gradient vector g, define the gradient guidance of look-ahead loss as Gloss(xt, t) := \u2212\u03b2(t) \u00b7 \u2207xt \u0010 y \u2212g\u22a4E[x0|xt] \u00112 , (8) where \u03b2(t) > 0, y \u2208R are tuning parameters, and E[x0|xt] is the conditional expectation of x0 given xt in the forward process (1), i.e., dXt = \u22121 2q(t)Xt dt + p q(t) dWt. 10 \fThe formula of (8) generalizes the intuition of a conditional score to work with any data distribution and objective function. The look-ahead loss (y \u2212g\u22a4E[x0|xt])2 resembles the proximal term commonly used in first-order proximal optimization methods. It is worth noting that Gloss coincides with the forward universal guidance \u2207xt\u2113(y, f(\u02c6 E[x0|xt])) proposed by Bansal et al. (2023) ((8) in their paper) when \u2113is the square loss and f = g\u22a4x. When the pre-training data distribution is Gaussian, the gradient guidance (8) is equivalent to Lemma 1 equation (7). This equivalence is a side-product from the proof of Lemma 1 and we provide a sketch here (see details in Appendix B.1). Given the probabilistic model Assumption 2, \u2207xt log pt(y|xt), the quantity to be estimated by guidance, is the score of a Gaussian distribution N \u0000my(xt), \u03c32 y(xt) \u0001 , with my(xt) and \u03c32 y(xt) being mean and variance of the conditional distribution Y | Xt = xt respectively, i.e., \u2207xt log pt(y | xt) = \u2212\u2207xt \" 1 2 \u0012y \u2212my(xt) \u03c3y(xt) \u00132# \u2212\u2207xt log \u03c3y(xt), (9) with my(xt) = g\u22a4E[x0 | xt] and \u03c3y(xt) not depending on xt. Thus we see Gloss is equivalent to (7). A key advantage of Gloss is that it enables preserving the subspace structure, for any data distribution under Assumption 1. This result is formally stated in the following theorem, we provide a proof sketch here and the full proof is in Appendix B.2. Theorem 1 (Faithfulness of Gloss to the Low-Dimensional Subspace of Data). Under Assumption 1, it holds for any data distribution and g \u2208RD that Gloss(xt, t) \u2208Span(A). (10) Proof Sketch We have \u2207xt \u0010 y \u2212g\u22a4E[x0|xt] \u00112 \u221d\u2207xtE[x0|xt]\u22a4g. Note here that \u2207xtE[x0|xt] is the Jacobian matrix of E[x0|xt], which is a mapping from RD to RD. We will show that the Jacobian \u2207xtE[x0|xt] maps any vector g \u2208RD to Span(A). To see this, we utilize the score decomposition result of Proposition 1 which is \u2207log pt(xt) = A\u2207log pLD t (A\u22a4xt) \u2212 1 h(t) \u0010 ID \u2212AA\u22a4\u0011 xt. (recall (5)) Plugging (5) into the equality E[x0|xt] = 1 \u03b1(t) (xt + h(t)\u2207log pt(xt)) (Tweedie\u2019s formula (Efron, 2011)), we have E[x0|xt] = 1 \u03b1(t) \u0012 xt + h(t) \u0014 Am(A\u22a4xt) \u2212 1 h(t)xt \u0015\u0013 = h(t) \u03b1(t)Am(A\u22a4xt), (11) here we denote for short m(u) := \u2207log pLD t (u) + 1 h(t)u. From (11), we see that \u2207xtE[x0|xt]\u22a4maps any vector to Span(A) because m(\u00b7) takes A\u22a4xt as input in the expression of E[x0|xt]. \u25a0 We highlight that the faithfulness of Gloss holds for arbitrary data distribution supported on the latent subspace. It takes advantage of the score function\u2019s decomposition (5), having the effect of automatically adapting g onto the latent low-dimensional subspace of data. 11 \f4.5 Estimation and Implementation of Gloss Theorem 1 asserts that the gradient guidance given by Definition 1 provably preserves the subspace structure of data. However, Gloss is not immediately available to compute and it involves the unknown quantity E[x0|xt]. Next, we discuss the estimation and computation of Gloss based on a pre-trained score function s\u03b8 in practice. First, we need to estimate the quantity E[x0|xt]. It is the conditional expectation of x0 given xt in the forward process, thus it depends on the pre-training data distribution. One can construct estimate E[x0|xt] based on the pre-trained score network s\u03b8, by using the Tweedie\u2019s formula (Efron, 2011): \u2207log pt(xt) = \u2212E \u0014xt \u2212\u03b1(t)x0 h(t) \f \fxt \u0015 . (12) Suppose we have a given pre-trained score network that approximates the ground truth, i.e., s\u03b8(xt, t) \u2248\u2207log pt(xt). Then a natural estimator of \u02c6 E[x0|xt] is given by \u02c6 E[x0|xt] := 1 \u03b1(t) (xt + h(t)s\u03b8(xt, t)) , (13) and we refer to it as the look-ahead estimator. The estimator (13) is widely adopted in practice (Song et al., 2020a; Bansal et al., 2023). Here \u03b1(t) and h(t) are the noise scheduling used in the forward process (1). Thus, we have obtained an implementable version of the gradient guidance Gloss, given by Gloss(xt, t) = \u2212\u03b2(t) \u00b7 \u2207xt \u0012 y \u2212g\u22a4 \u0012 1 \u03b1(t) (xt + h(t)s\u03b8(xt, t)) \u0013\u00132 , (14) With a slight abuse of notation, we use Gloss to refer to this implementable formula (14) in the remainder of this paper. \u2026\u2026 Square Loss <latexit sha1_base64=\"MCfCylmUav/6OdNRyRNfCVSfv8=\">AB/3icbVDLSsNAFJ34rPVdelmsAh1UxLxtSy6cVnBPqANZTKZNEMnkzBzI5TQhT/gVv/Anbj1U/wBv8NJm4VtPTBwOde7pnjJYJrsO1va2V1bX1js7RV3t7Z3duvHB y2dZwqylo0FrHqekQzwSVrAQfBuoliJPIE63iju9zvPDGleSwfYZwNyJDyQNOCeRSWIOzQaVq1+0p8DJxClJFBZqDyk/fj2kaMQlUEK17jp2AmxEFnAo2KfdTzRJCR2TIeoZKEjHtZtOsE3xqFB8HsTJPAp6qfzcyEmk9jwzGREI9aKXi/95vRSCGzfjMkmBSTo7FKQCQ4zj2OfK0ZBjA0hVHGTFdOQKELB1DN3xd5tEnZFOMs1rBM2ud156p+XBRbdwWFZXQMTpBNeSga9RA96iJWoiEL2gV/RmPVv1of1ORtdsYqdIzQH6+sXnImWVg=</latexit>h(t) <latexit sha1_base64=\"Ogxow3Zrphfic4L4LQYhmBz4QaU=\">ACXicbVDLSsNAFJ3UV62vqks3g0WoC0sivpZFNy4r2Ae0aZlMJu3QyYOZG6GEfIE/4Fb/wJ249Sv8Ab/DSZuFbT1w4XDOvdzDcSLBFZjmt1FYWV1b3yhulra2d3b3yv sHLRXGkrImDUoOw5RTPCANYGDYJ1IMuI7grWd8V3mt5+YVDwMHmESMdsnw4B7nBLQUr9HRDQi/eTMSqtwOihXzJo5BV4mVk4qKEdjUP7puSGNfRYAFUSprmVGYCdEAqeCpaVerFhE6JgMWVfTgPhM2ck0dYpPtOJiL5R6AsBT9e9FQnylJr6jN30CI7XoZeJ/XjcG78ZOeBDFwAI6e+TFAkOIswqwyWjICaECq5zorpiEhCQRc198VWbS0pIuxFmtYJq3zmnVu3y4qNRv84qK6Agdoyqy0DWqo3vUQE1EkUQv6BW9Gc/Gu/FhfM5WC0Z+c4jmYHz9Agzbmg=</latexit> \u21b5\u22121(t) <latexit sha1_base64=\"MXp+DKiSlYDt69Es0RlC16jzLc=\">AB/nicbVDLSsNAFL3xWeur6tJNsAiuSiK+lkU3LivaB7ShTCaTduhkEmZuxFIK/oBb/QN3 4tZf8Qf8DidtFrb1wMDhnHu5Z46fCK7Rcb6tpeWV1bX1wkZxc2t7Z7e0t9/Qcaoq9NYxKrlE80El6yOHAVrJYqRyBes6Q9uMr/5yJTmsXzAYcK8iPQkDzklaKT7py52S2Wn4kxgLxI3J2XIUeuWfjpBTNOISaSCaN12nQS9EVHIqWDjYifVLCF0QHqsbagkEdPeaBJ1bB8bJbDWJkn0Z6ofzdGJNJ6GPlmMiLY1/NeJv7ntVMr7 wRl0mKTNLpoTAVNsZ29m874IpRFENDCFXcZLVpnyhC0bQzcyXQWbRx0RTjztewSBqnFfeicn53Vq5e5xUV4BCO4ARcuIQq3EIN6kChBy/wCm/Ws/VufVif09ElK985gBlYX7+msJZq</latexit>xt Gradient Compute <latexit sha1_base64=\"qEXaESVr1fTBbnNbrKvEPvC+E8A=\">ACGHicbVDLSsNAFJ34rPVdnNYBFclUSkuiyK4LKCfUAawmQybYdOHszcSEvMwt/wB9zqH7gTt+78Ab/DS duFbT0wcDjnXu6Z48WCKzDNb2NldW19Y7OwVdze2d3bLx0ctlSUSMqaNBKR7HhEMcFD1gQOgnViyUjgCdb2hte535gUvEovIdxzJyA9EPe45SAltxSuTsgkHYDAgPS2+yzB65Jn7EIxct1Qxq+YEeJlYM1JBMzTc0k/Xj2gSsBCoIErZlhmDkxIJnAqWFbuJYjGhQ9JntqYhCZhy0sknMnyiFR/3IqlfCHi/t1ISaDUOPD0ZJ5WLXq5+J9nJ9C7dFIexgmwkE4P9R KBIcJ5I9jnklEQY0IlVxnxXRAJKGge5u74qs8WlbUxViLNSyT1lnVqlVrd+eV+tWsogIqo2N0ix0geroFjVQE1H0hF7QK3ozno1348P4nI6uGLOdIzQH4+sXngagnw=</latexit>\u02c6 E[x0|xt] Gradient w.r.t <latexit sha1_base64=\"MXp+DKiSlYDt69Es0RlC16jzLc=\">AB/nicbVDLSsNAFL3xWeur6tJNsAiuSiK+lkU3LivaB7ShTCaTduhkEmZuxFIK/oBb/QN3 4tZf8Qf8DidtFrb1wMDhnHu5Z46fCK7Rcb6tpeWV1bX1wkZxc2t7Z7e0t9/Qcaoq9NYxKrlE80El6yOHAVrJYqRyBes6Q9uMr/5yJTmsXzAYcK8iPQkDzklaKT7py52S2Wn4kxgLxI3J2XIUeuWfjpBTNOISaSCaN12nQS9EVHIqWDjYifVLCF0QHqsbagkEdPeaBJ1bB8bJbDWJkn0Z6ofzdGJNJ6GPlmMiLY1/NeJv7ntVMr7 wRl0mKTNLpoTAVNsZ29m874IpRFENDCFXcZLVpnyhC0bQzcyXQWbRx0RTjztewSBqnFfeicn53Vq5e5xUV4BCO4ARcuIQq3EIN6kChBy/wCm/Ws/VufVif09ElK985gBlYX7+msJZq</latexit>xt + <latexit sha1_base64=\"JjNjoy08E2STahQ+0GXQtFmlqw=\">ACDnicbVDLSsNAFJ34rPWV6tJNsAgVpCTia1l047KCfUAbwmQyaYdOHszcqCXkH/wBt/oH7sStv+A P+B1O2ixs64ELh3Pu5R6OG3MmwTS/taXldW19dJGeXNre2dXr+y1ZQIQlsk4pHoulhSzkLaAgacdmNBceBy2nFHN7nfeaBCsi8h3FM7QAPQuYzgkFJjl6RTtqHIQWc1Z4cOIFjR6+adXMCY5FYBamiAk1H/+l7EUkCGgLhWMqeZcZgp1gAI5xm5X4iaYzJCA9oT9EQB1Ta6SR6ZhwpxTP8SKgJwZiofy9SHEg5Dly1GWAYynkvF/zegn4V3bKwjgBG pLpIz/hBkRG3oPhMUEJ8LEimAimshpkiAUmoNqa+eLJPFpWVsVY8zUskvZp3bqon9+dVRvXRUldIAOUQ1Z6BI10C1qohYi6BG9oFf0pj1r79qH9jldXdKm30A+3rF54PnFQ=</latexit>s\u2713(xt, t) <latexit sha1_base64=\"8RbS92UirR97/cna4GH7idu+Q=\">AB/HicbVBLSgNBFHwTfzH+oi7dNAbBVZgRiS6DblwmYD6QDKGn503SpOdDd48QryAW72BO3HrXbyA57AnmYVJL Ggoqt7jVZeXCK60bX9bhY3Nre2d4m5pb/g8Kh8fNJWcSoZtlgsYtn1qELBI2xprgV2E4k09AR2vPF95neUCoeR496kqAb0mHEA86oNlJzOChX7Ko9B1knTk4qkKMxKP/0/ZilIUaCapUz7ET7U6p1JwJnJX6qcKEsjEdYs/QiIao3Ok86IxcGMUnQSzNizSZq383pjRUahJ6ZjKkeqRWvUz8z+ulOrh1pzxKUo0RWxwKUkF0TLJfE59LZFpMDKFMcpOVsBGVlGnTzdIVX2XRZ iVTjLNawzpX1WdWrXWvK7U7/KinAG53AJDtxAHR6gAS1gPACr/BmPVv1of1uRgtWPnOKSzB+voF8EOVcw=</latexit>g <latexit sha1_base64=\"O0NxyODe2aQyeBYzgsnxedhThE=\">ACJ3icbVDLSsNAFJ3UV62vqEs3g0VQwZKIr2VRBJcKVgtNDJPptB06eTBzI4aYf/A3/AG3+gfuRJdu/A4nt QtbPTBwOde7pnjx4IrsKwPozQxOTU9U56tzM0vLC6ZytXKkokZQ0aiUg2faKY4CFrAfBmrFkJPAFu/b7J4V/fcuk4lF4CWnM3IB0Q97hlICWPHN7M8U7uHvjQBRjp0cgcwICPd/PTvO8dedZ+B7feBu3ex6ZtWqWQPgv8Qekioa4twzv5x2RJOAhUAFUaplWzG4GZHAqWB5xUkUiwntky5raRqSgCk3G/wpxtaeNOJPULAQ/U3xsZCZRKA19PFoHVuFeI/3mtBD pHbsbDOAEW0p9DnURgiHBREG5zySiIVBNCJdZMe0RSjoGkeutFURLa/oYuzxGv6Sq92afVDbv9ir1o+HFZXRGlpHm8hGh6iOztA5aiCKHtATekYvxqPxarwZ7z+jJWO4s4pGYHx+A16DpY8=</latexit> (y \u2212g>\u02c6 E[x0|xt])2 Figure 4: Computation of Gradient Guidance Gloss. The gradient guidance (14) has a light-weighted implementation. Suppose the pre-trained score function s\u03b8 is given in the form of a neural network with pre-trained weights. Computing (14) involves calculating the squared loss \u0010 y \u2212g\u22a4\u02c6 E[x0|xt] \u00112 via a forward pass of the network s\u03b8 and a backward pass utilizing the auto-gradient feature of deep-leaning frameworks such as PyTorch and TensorFlow. See Figure 4 for illustration. Note that the value of y in Gloss is a target reward value, inherited from the conditional score analysis under a Gaussian model. In practice, we treat y as a tuning parameter. In our theoretical analysis, we will specify the choices of y, \u03b2(t) and provide guarantees for general optimization beyond the Gaussian model. So far, we have finally obtained a gradient guidance (14) that is both implementable and faithful to data\u2019s latent subspace. The next step is to apply this gradient guidance and use it to adapt the generation process of a pre-trained diffusion model. Let us find out what one can obtain using gradient-guided diffusion models. 12 \f5 Gradient-Guided Diffusion Model as Regularized Optimizer In this section, we study whether gradient guidance steers a pre-trained diffusion model to generate samples of near-optimal objective values. We provide a positive answer and our results are twofold: 1) We demonstrate that iteratively applying gradient guidance improves the generated samples towards higher objective values; 2) The pre-trained diffusion model acts as a form of regularization from an optimization perspective. 5.1 Gradient-Guided Generation with A Pre-trained Score Assume access to a pre-trained score network s\u03b8 and gradient information of the objective function f. Let us present our Algorithm 1 that adapts the pre-trained diffusion model and iteratively updates the gradient guidance (14). The gradient guidance is able to steer the backward sampling process towards generating new samples with higher values of f. See Figure 1 for illustration. Algorithm 1 takes as input any pre-trained score function s\u03b8(x, t) and adapts the backward sampling process with gradient guidance. In each iteration, it evaluates \u2207f(\u00b7) at samples generated from the previous iteration (Line 5(i)), and then computes the gradient guidance Gloss using the newly queried gradient (Line 5(ii)). Using the updated gradient guidance, the backward process then generate new samples with improved objective values (Module 1). At the end of iterations, the algorithm outputs an adapted version of the diffusion model, specified by (s\u03b8, GK), which generates samples with near-optimal objective values. Algorithm 1 Gradient-Guided Diffusion for Generative Optimization 1: Input: Pre-trained score network s\u03b8(\u00b7, \u00b7), differentiable objective function f. 2: Tuning Parameter: Strength parameters \u03b2(t), {yk}K\u22121 k=0 , number of iterations K, batch sizes {Bk}. 3: Initialization: G0 = NULL. 4: for k = 0, . . . , K \u22121 do 5: Generate: Sample zk,i \u223cGuided BackwardSample(s\u03b8, Gk) using Module 1, for i \u2208[Bk]. 6: Compute Guidance: (i) Compute the sample mean \u00af zk := (1/Bk) PBk i=1 zk,i. (ii) Query gradient gk = \u2207f(\u00af zk). (iii) Update gradient guidance Gk+1(\u00b7, \u00b7) = Gloss(\u00b7, \u00b7) via (8), using s\u03b8, gradient vector gk, and parameters yk and \u03b2(t). 7: end for 8: Output: (s\u03b8, GK). It is worth highlighting that Algorithm 1 works with any pre-trained score network s\u03b8(xt, t). It retains the original score network and only updates the guidance term. The gradient guidance changes the generation process by an additive term to the backward SDE, without having to re-train the score network. Therefore, the algorithm is computationally efficient and easy to implement. We experimented with Algorithm 1 using a pre-trained score network with about 15M parameters; see Section 7 for details. In our experiment, a single run of the backward sampling process (Module 1) takes 4.6s, and Algorithm 1 takes 76min overall. Thus it is a rather light-weighted algorithm to implement and run. 13 \f5.2 Gradient-Guided Diffusion Converges to Regularized Optima We analyze the convergence properties of Algorithm 1 and show that in final iterations, generated samples center around a regularized solution of the optimization objective f. Our theorems allow the pre-training data to have arbitrary distribution. Assumption 3 (Concave smooth objective). The objective f : RD \u2192R is concave and L-smooth with respect to the (semi-)norm \u2225\u00b7\u2225\u00af \u03a3\u22121, i.e., \u2225\u2207f(x1) \u2212\u2207f(x2)\u2225\u00af \u03a3 \u2264L \u2225x1 \u2212x2\u2225\u00af \u03a3\u22121 for any x1, x2. While Algorithm 1 works with any pre-trained score network, we study its optimization properties focusing on the class of linear score functions given by S = \b s(x, t) = Ctx + bt : Ct \u2208RD\u00d7D, bt \u2208RD\t . (15) Here (15) is a general linear function class. For comparison, a recent related paper Marion et al. (2024) assumes a more restricted class with Ct \u2261I for when studying parameter optimization in diffusion models. With a linear score function (15), pre-training a diffusion model is essentially the same as using a Gaussian model to estimate the pre-training data distribution and then sampling from this estimated Gaussian. In this case, the guidance Gloss is also linear in xt, therefore the final output of the guided diffusion model also follows a Gaussian distribution; see (27) in Appendix C. Recall we aim for an adapted diffusion model (s\u03b8, GK) to generate samples with high values of f. Thus, we focus on the mean of the generated distribution (taking T \u2192\u221ein the backward sampling process of (s\u03b8, GK)), denoted by \u00b5K, and establish its optimization guarantee. Theorem 2 (Convergence to Regularized Maxima in Mean). Let Assumption 3 hold, and let the pre-training data D have arbitrary distribution with covariance matrix \u00af \u03a3 \u227b0. Suppose the score function s\u03b8 is pre-trained via minimizing the score matching loss (3) over the linear function class (15). Let Alg. 1 take s\u03b8(\u00b7, \u00b7) and f as the input. For any \u03bb > L, there exists {\u03b2(t)}, {yk}, {Bk} such that, with probability \u22651 \u2212\u03b4 , the mean of the output distribution \u00b5K converges to be near x\u2217 \u03bb, and f (x\u2217 \u03bb) \u2212f(\u00b5K) = \u03bb \u0012L \u03bb \u0013K O \u0012 D log \u0012K \u03b4 \u0013\u0013 , (16) where D is the ambient dimension of data, and x\u2217 \u03bb is a regularized maximizer of f given by x\u2217 \u03bb = argmax x\u2208RD \u001a f(x) \u2212\u03bb 2 \u2225x \u2212\u00af \u00b5\u22252 \u00af \u03a3\u22121 \u001b , (17) where \u00af \u00b5, \u00af \u03a3 are empirical mean and covariance of pre-training data D. Proof Sketch Solving the score matching problem (3) with a linear function class (15) yields a pre-trained score as follows s\u03b8(xt, t) = \u2212 \u0000\u03b12(t)\u00af \u03a3 + h(t)ID \u0001\u22121 (xt \u2212\u03b1(t)\u00af \u00b5) . With proper choices of \u03b2(t), gradient guidance Gloss leads to the following output distribution at the end of round k: N \u0012 \u00af \u00b5 + yk \u2212g\u22a4 k \u00af \u00b5 \u03c32 + g\u22a4 k \u00af \u03a3gk \u00af \u03a3gk, \u00af \u03a3 \u2212 \u00af \u03a3gkg\u22a4 k \u00af \u03a3 \u03c32 + g\u22a4 k \u00af \u03a3gk \u0013 . 14 \fThus, we obtain the mean of the above distribution, i.e., \u00b5k+1 = \u00af \u00b5 + \u03b7k \u00af \u03a3\u2207f(\u00af zk), where \u00af zk is the empirical mean of previous samples, \u03b7k is a stepsize determined by yk. By a rearrangement, we obtain a recursive formula \u00b5k+1 = \u00af zk + \u03b7k \u00af \u03a3 \u0002 \u2207f(\u00af zk) \u2212\u03b7\u22121 k \u00af \u03a3\u22121 (\u00af zk \u2212\u00af \u00b5) \u0003 . (18) We observe that (18) resembles a gradient ascent update from \u00b5k \u2248\u00af zk to \u00b5k+1 corresponding to a regularzed optimization problem (17). In this regularized objective, the original objective f(x) incorporates an additional proximal term with \u03bb := 1/\u03b7k. Therefore we can analyze the convergence of \u00b5k by following the classical argument for gradient optimization. The full proof is provided in Appendix C.1 Remarks. This view of regularized optimization gives the following insights on gradient-guided diffusion models: (i) The regularization term \u03bb 2 \u2225x \u2212\u00af \u00b5\u22252 \u00af \u03a3\u22121 in (17) is centered at the data\u2019s mean \u00af \u00b5. It penalizes samples that are far away from the pre-training data. The norm \u2225\u00b7\u2225\u00af \u03a3\u22121 suggests the regularization is strong in the direction where the original data distribution has low variance. In other words, it reveals that the pre-trained score function acts as a form of \u201cprior\u201d in the guided generation process. This prior favors samples that are proximal to its pre-training data distribution, even when additional guidance are present. (ii) The regularization term cannot be made arbitrarily small. In particular, our theorem requires that \u03bb \u2265L. This demonstrates a limit of adapting diffusion models with guidance. As long as the score function stays unchanged, one cannot extrapolate from the pre-training data unlimitedly by solely adding gradient guidance. As a consequence, we cannot simply add gradient guidance to a diffusion model in order to reach the global maxima of any objective function. If the goal is to reach global optima, one has to update the pre-trained score network and refine it with newly collected data, we explore this approach in Section 6. (iii) The linear convergence rate (16) is determined jointly by the smoothness of the objective function and strength of the regularization. We also pay a linear factor in the dimension D. In the following subsection, we will show that the gradient guidance Gloss can reduce the dimension dependence from D to d if the data admits a latent low-dimensional subspace. 5.3 Gradient Guidance for Optimization in Latent Spaces Next we focus on data with latent subspace as in Assumption 1. In the next theorem, we show that the generated distribution of our adapted model would converge, in expectation, to the maxima of a regularized version of f within the subspace Span(A). Theorem 3 (Convergence to Regularized Maxima in Latent Subspace in Mean). Let Assumptions 1 and 3 hold. Suppose we use the score function class (15) for pre-training and computing guidance. Then Alg.1 gives an adapted diffusion model that generates new samples that belong to Span(A). Further, for any \u03bb > L, there exists \u03b2(t), {yk} and batch size Bk, such that with high probability 1 \u2212\u03b4, the mean of the output distribution \u00b5K converges to be near x\u2217 A,\u03bb, and it holds f \u0000x\u2217 A,\u03bb \u0001 \u2212f(\u00b5K) = \u03bb \u0012L \u03bb \u0013K O \u0012 d log \u0012K \u03b4 \u0013\u0013 , 15 \fwhere x\u2217 A,\u03bb is an optimal solution of the regularized objective: x\u2217 A,\u03bb = argmax x\u2208Span(A) \u001a f(x) \u2212\u03bb 2 \u2225x \u2212\u00af \u00b5\u22252 \u00af \u03a3\u22121 \u001b . (19) Recall that the gradient guidance Gloss is faithful to the data\u2019s latent subspace, as proved in Theorem 1. As a result, the gradient-guided backward process maintains this latent subspace structure in the generated output. Therefore, all the generated samples and optimization iterates of Algorithm 1 belong to the latent subspace Span(A). In other words, the entire optimization process happens in the latent low-dimensional subspace. This facilitates a coherent and more efficient exploration in the solution space. Comparing to Theorem 2, the optimization gap in Theorem 3 is substantially smaller, reduced from O (D) to O (d). It means that the optimization process leverages the latent subspace and converges much faster. Finally we note that Theorem 3 only establishes convergence in mean. The final output distribution of Algorithm 1, with a linear score function, is a Gaussian distribution supported on the latent subspace; see Appendix C equation (27). 6 Gradient-Guided Diffusion with Adaptive Fine-Tuning for Global Optimization In the previous section, we have seen that adding guidance to a pre-trained diffusion model cannot improve the objective function unlimitedly. The pre-trained score function would act as a form of prior to keep the generated output proximal to the original data\u2019s distribution. This leads to a regularization term in the optimization formulation. Further, we consider adaptively fine-tuning the pre-trained diffusion model for generating samples to attain the unregularized global optima. The idea is not only to update the guidance in the backward sampling process but also to use generated samples to fine-tune the pre-trained score network. Empirically, fine-tuning diffusion models utilizing self-generated samples has been explored by Black et al. (2023); Clark et al. (2023). 6.1 Adaptive Fine-Tuning Algorithm with Gradient Guidance We propose an adaptive version of the gradient-guided diffusion, where both the gradient guidance and the score networks are iteratively updated utilizing self-generated samples. The full algorithm is given in Algorithm 2. We introduce a weighting scheme to fine-tune the score network using a mixture of pre-training data and newly generated samples. In Round k, let D1, . . . , Dk be sample batches generated from the previous rounds. Let {wk,i}k i=0 be a set of weights. Conceptually, at Round k, we update the model by minimizing the weighted score matching loss: min s\u2208S Z T 0 k X i=0 wk,iEx0\u2208DiExt|x0 h \u2225\u2207xt log \u03d5t(xt|x0) \u2212s(xt, t)\u22252 2 i dt, (20) where D0 := D is the pre-training data. For illustration of this algorithm, please see also Figure 1. In practice, to update the score network incorporating newly generated data, one does not have to exactly solve (20) by re-training the full model from scratch. Instead, (20) can be viewed as a 16 \fguideline that motivates more computationally efficient ways for updating the pre-trained score. It is a common practice to only fine-tune the weights of the old model by performing gradient descent over a few batches of newly generated data, which is similar to the spirit of (20). In our experiment, we implemented Algorithm 2 using a pre-trained U-net score function with 15M parameters and tested its performance on synthetic objectives. We implement the finetuning step by making one single Adam step over the new data. In our experiment, the iterated finetuning process of Algorithm 2 takes 91min overall, only slightly longer than the 76min taken by Algorithm 1. For details on the experiment results, please see Section 7. Algorithm 2 Gradient-Guided Diffusion with Adaptive Fine-tuning 1: Input: Pre-trained score s\u03b8(\u00b7, \u00b7), differentiable objective function f. 2: Tuning Parameter: strength parameter \u03b2(t), {yk}K\u22121 k=0 , weights {{wk,i}k i=0}K\u22121 k=0 , number of iterations K, batch sizes {Bk}. 3: Initialize: s\u03b80 = s\u03b8, G0 = NULL. 4: for k = 0, \u00b7 \u00b7 \u00b7 , K \u22121 do 5: Generate: Sample a batch Dk = {zk,i}Bk i=1 from Guided BackwardSample(s\u03b8k, Gk) (Module 1). 6: Compute Guidance: (i) Compute sample mean \u00af zk = (1/Bk) PBk i=1 zk,i, and query gradient gk = \u2207f(\u00af zk). (ii) Update s\u03b8k to s\u03b8k+1 by minimizing the re-weighted objective (20). (iii) Compute Gk+1(\u00b7, \u00b7) = Gloss(\u00b7, \u00b7) in (8), using s\u03b8k+1 and gk, with parameter yk, \u03b2(t). 7: end for 8: Output: (s\u03b8K, GK). 6.2 Guided Generation Finds Unregularized Global Optima Finally, we analyze the optimization properties for gradient-guided diffusion model with iterative finetuning. We establish that the process of Algorithm 2 yields a final output distribution whose mean, denoted by \u00b5K, converges to the global optimum of f. For simplicity of analysis, we study the following function class S\u2032 = n s(x, t) = \u02c6 Ctx + bt : bt \u2208RDo , (21) where \u02c6 Ct is set to stay the same as in the pre-trained score and only bt gets updated during iterative fine-tuning. Marion et al. (2024) studied a similar function class where \u02c6 Ct is freezed to be \u02c6 Ct \u2261I. Theorem 4 (Convergence to Unregularized Maxima in Latent Subspace in Mean). Let Assumptions 1 and 3 hold, and assume there exists M > 0 such that \r \r \rx\u2217 A,\u03bb \r \r \r < M for all \u03bb \u22650. Suppose we use the score function class (15) for pre-training s\u03b8 and the class (21) for finetuning it. Then Algorithm 2 gives an adapted diffusion model that generates new samples belonging to Span(A). Further, there exists {\u03b2(t)}, {yk} , {Bk} and {wk,i}, such that with probability 1 \u2212\u03b4, f\u2217 A \u2212f(\u00b5K) = O \u0012dL2 log K K \u00b7 log \u0012K \u03b4 \u0013\u0013 , (22) where f\u2217 A = max{f(x)|x \u2208Span(A)}. The proof idea is similar to the proof of Theorem 2. For simplicity, we analyze the case where only the most recent sample batch Dk is merged with D0 for finetuning the score function. More 17 \fspecifically, we let wk,i = 0 for 0 < i < k and wk,0 = 1 \u2212wk,k. Similar to the proof of Theorem 2, we obtain a recurisve update rule given by \u00b5k+1 = \u00af zk + \u03b7k \u00af \u03a3 \u0002 \u2207f(\u00af zk) \u2212(1 \u2212wk,k) \u03b7\u22121 k \u00b7 \u00af \u03a3\u22121 (\u00af zk \u2212\u00af \u00b5) \u0003 , (23) where \u00af zk \u2248\u00b5k is the empirical mean of previous samples. This update rule also closely resembles the gradient ascent iteration for maximizing a regularized objective. A key difference here is that we can control the weights wk,i to reduce the impact of D0 and make the regularization term vanish to zero. Thus the mean \u00b5k eventually converges to the global maxima. For the detailed arguments and proof of convergence, we refer readers to Appendix C.3. Theorem 4 illustrates the effect of finetuning a diffusion model using self-generated data. For comparison, Theorem 3 showed that without finetuning the diffusion model can only generate new samples proximal to the pre-training distribution. Now if we allow finetuning using self-generated samples, the diffusion model can iteratively refines itself and reaches global optima, while preserving the latent subspace structure in its generated output. Now let us we take on an optimization view. The convergence rate suggested by Theorem 4 matches with that of standard convex optimization, in terms of their dependence on K the number of gradient evaluations. Further, if we compare the guided diffusion model with a standard gradient solver, the optimality gap of our algorithm scales with the small intrinsic dimension O(d), while standard gradient ascent converges much more slowly due to the large ambient dimension O(D). This comparison highlights the merits of \u201cgenerative optimization\u201d. More specifically, diffusion models leverage pre-training data to learn their intrinsic characteristics. Therefore, when we add gradient guidance to the pre-trained score function and use it for generation, it means that we are solving an optimization problem in its own intrinsic low-dimensional space. This leads to substantially more efficient exploration and faster convergence. This theoretical insight explains the practical successes of guided diffusion models on complex optimization problems, such as video creation, image synthesis and protein AI, where traditional methods do not work at all. 7 Numerical Experiments We experiment with our design of the gradient guidance as well as Algorithm 1 and Algorithm 2. Going beyond our theoretical assumptions, we adopt a 15M-parameter U-Net as the score function class for training and fine-tuning our diffusion model. 7.1 Experiment Setup We set the data\u2019s ambient dimension as D = 64 and the linear subspace dimension as d = 16. The linear subspace is represented by an orthogonal matrix A \u2208RD\u00d7d. We randomly generate a matrix A and fix it once generated. After that, we sample a data point X by first randomly sampling a latent variable U \u223cN(0, Id) and computing X = AU. We independently sample a total of 65536 data points as our pre-training data set. The objective functions considered in our experiments are f1(x) = 10\u2212(\u03b8\u22a4x\u22123)2 and f2(x) = 5\u22120.5\u2225x\u2212b\u2225. Here, \u03b8 and b are randomly generated and fixed afterward. Since our data assumes a low-dimensional subspace representation, it is convenient to decompose \u03b8 into \u03b8\u22a5= (I \u2212AA\u22a4)\u03b8 and \u03b8\u2225= AA\u22a4\u03b8, representing the off-support and on-support components. We refer to \u2225\u03b8\u22a5\u2225 \u2225\u03b8\u2225\u2225as the off/on-support ratio. Analogously, for a generated sample, we can also define its off/on-support ratio. Clearly, a small off/on-support ratio indicates close vicinity to the subspace. 18 \fScore Network Pre-training We utilize a version of the U-Net (Ronneberger et al., 2015), with 14.8M trainable parameters. Note that this is a complicated network going beyond the linear score function class considered in our theories. Following the implementation of Denoising Diffusion Probabilistic Models (DDPM, Ho et al. (2020)), we train the U-Net o estimate the score function \u2207log pt, via minimizing the score matching loss introduced in Eqn. (3). We discretize the backward process to have 200 time steps as in Nichol and Dhariwal (2021), and the U-Net is trained using our generated data set for 20 epochs. We use Adam as the optimizer, set the batch size as 32, and set the learning rate to be 10\u22124. After the pre-training phase, we confirmed that the data subspace structure is well learned, as the generated samples using the pre-trained diffusion model have an average off/on-support ratio of 0.039. Implementation of Algorithm 1 In each iteration of Algorithm 1, we need to compute the gradient guidance Gloss. We set the targeted y value at the k-th iteration as yk = \u03b4 + g\u22a4 k zk, where \u03b4k specifies the increment per iteration. The choice on \u03b4k is instance-dependent and we set it via tuning for near-optimal in different experiments. For comparing naive gradient with gradient guidance in Figure 5, we set \u03b4 = 0.2 and 0.9, respectively for using naive gradient G and gradient guidance Gloss. In Figure 6, we choose \u03b4 to be (a) 0.05, (b) 0.2, (c) 1, and (d) 1, corresponding to each panel. We initialize Algorithm 1 with a batch of 32 samples generated by the pre-trained model. Each sample determines an optimization trajectory. We repeat Algorithm 1 for 5 times with different random seeds and report the error bars. Implementation of Algorithm 2 Algorithm 2 differs from Algorithm 1 in that it allows additional fine-tuning of the pre-trained score network. We adopt a computationally lightweight finetuning strategy: We only perform one Adam optimization step using the re-weighted loss given by Eqn. (20) with a batch of 32 generated samples. We set the learning rate as 10\u22126. This simple strategy already demonstrates good performances as shown in Figure 7. Other implementation details are kept the same as those of Algorithm 1. We run all experiments using one NVIDIA A100 GPU. Module 1 takes 4.6 seconds to generate a sample. Algorithm 1 takes 76 minutes, and Algorithm 2 takes 91 minutes. 7.2 Results We first demonstrate our gradient guidance Gloss preserves the subspace structure learned from the pre-trained model. For comparison, we also tested the naive guidance G defined following Lemma 1 (with \u03a3 = I). For a quick reference, we repeat the definition here: G(xt, t) := \u03b2(t) \u0010 y \u2212g\u22a4E[x0|xt] \u0011 g, where \u03b2(t) > 0 and y \u2208R are tuning parameters, and E[x0|xt] is the conditional expectation of x0 given noise corrupted data xt. For implementation, we replace E[x0|xt] by its look-ahead estimator \u02c6 E[x0|xt] based on the Tweedie\u2019s formular. Comparing G and Gloss on Preserving Subspace Structure Figure 5(a), (c) verify that the naive gradient G performs much worse than Gloss in preserving the linear subspace structure. It is consistent with our theoretical finding that the gradient guidance Gloss keeps the generated sample close to the latent subspace, with substantially smaller off-support errors. When allowing adaptive 19 \fscore fine-tuning in Algorithm 2, Figure 5(b), (d) show that the off-support error increases as the model gets fine-tuned using self-generated data, due to increasing distribution shift. Even in this case, the naive gradient G leads to much more severe off-support errors as compared to Gloss. (a) Algorithm 1 (b) Algorithm 2 (c) 300-350 round of (a) (d) 1000-1200 round of (b) Figure 5: Comparison between two types of gradient guidance G and Gloss. We plot the off/on support ratio of the generated samples, denoted by roff = \u2225x\u22a5\u2225 \u2225x\u2225\u2225. The objective function is f1(x), with \u03b8 having an off/on-support ratio of 9. Algorithm 1 Converges to Regularized Optima We plot the convergence of Algorithm 1 in terms of the objective value in Figure 6. Figure 6 (a),(b) are for the objective function f1 = 10\u2212(\u03b8\u22a4x\u22123)2 as the objective function, while Figure 6(c),(d) are for the objective f2 = 5\u22120.5\u2225x\u2212b\u2225. We observe that the algorithm converges to reach some sub-optimal objective value, but there remains a gap to the maximal value. This is consistent with our theory that the pre-trained model essentially acts as a regularization in addition to the objective function. Adding gradient guidance alone cannot reach global maxima. This coincides with our theoretical findings in Theorem 3. (a) \u03b8 = A\u03b2\u2217 (b) \u2225\u03b8\u22a5\u2225 \u2225\u03b8\u2225\u2225= 9 (c) b = 4 \u00b7 1D (d) b \u223cN(4 \u00b7 1D, 9 \u00b7 ID) Figure 6: Convergence of Algorithm 1 under different objectives. Objectives are f1(x) for (a) and (b), and f2(x) for (c) and (d). Parameters \u03b8 and b are specified as (a) \u03b8 = A\u03b2\u2217with \u03b2\u2217being sampled from the unit ball in Rd; (b) the off/on-support ratio of \u03b8 being 9 (same as Figure 5); (c) and (d) choosing b as a homogeneous vector or randomly from a Gaussian distribution. All the experiments adopt the gradient guidance Gloss. Algorithm 2 Converges to Global Optima Algorithm 2 converges to the maximal value of the objective function f1 = 10 \u2212(\u03b8\u22a4x \u22123)2 as shown in Figure 7(a). In Figure 7(b), we visualize the distribution of generated samples of Algorithm 1 (blue) and 2 (red), respectively, as the iteration evolves. We see that samples from Algorithm 1 mostly stay close to the pre-training data distribution (area described by the dotted contour). In constrast, samples of Algorithm 2 move outside the contour, as the diffusion model gets finetuned using self-generated data. 20 \f(a) Convergence of Algorithm 2 (b) Distribution of generated samples Figure 7: Convergence of Algorithm 2. Panel (a) plots the objective values achieved by Algorithm 2 as a function of iterations. Here \u03b8 is chosen the same as in Figure 6(b) with off/on-support ratio \u2225\u03b8\u22a5\u2225 \u2225\u03b8\u2225\u2225= 9. Panel (b) visualizes the distribution of the generated samples of Algorithm 2 (red) across the iterations. For comparison, we also visualize the distribution of generated samples of Algorithm 1 (blue). 8"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14745v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14745v1",
|
| 3 |
+
"title": "TAAT: Think and Act from Arbitrary Texts in Text2Motion",
|
| 4 |
+
"abstract": "Text2Motion aims to generate human motions from texts. Existing datasets rely\non the assumption that texts include action labels (such as \"walk, bend, and\npick up\"), which is not flexible for practical scenarios. This paper redefines\nthis problem with a more realistic assumption that the texts are arbitrary.\nSpecifically, arbitrary texts include existing action texts composed of action\nlabels (e.g., A person walks and bends to pick up something), and introduce\nscene texts without explicit action labels (e.g., A person notices his wallet\non the ground ahead).\n To bridge the gaps between this realistic setting and existing datasets, we\nexpand the action texts on the HumanML3D dataset to more scene texts, thereby\ncreating a new HumanML3D++ dataset including arbitrary texts. In this\nchallenging dataset, we benchmark existing state-of-the-art methods and propose\na novel two-stage framework to extract action labels from arbitrary texts by\nthe Large Language Model (LLM) and then generate motions from action labels.\nExtensive experiments are conducted under different application scenarios to\nvalidate the effectiveness of the proposed framework on existing and proposed\ndatasets. The results indicate that Text2Motion in this realistic setting is\nvery challenging, fostering new research in this practical direction. Our\ndataset and code will be released.",
|
| 5 |
+
"authors": "Runqi Wang, Caoyuan Ma, GuoPeng Li, Zheng Wang",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "LLM Fairness",
|
| 14 |
+
"gt": "Text2Motion aims to generate human motions from texts. Existing datasets rely\non the assumption that texts include action labels (such as \"walk, bend, and\npick up\"), which is not flexible for practical scenarios. This paper redefines\nthis problem with a more realistic assumption that the texts are arbitrary.\nSpecifically, arbitrary texts include existing action texts composed of action\nlabels (e.g., A person walks and bends to pick up something), and introduce\nscene texts without explicit action labels (e.g., A person notices his wallet\non the ground ahead).\n To bridge the gaps between this realistic setting and existing datasets, we\nexpand the action texts on the HumanML3D dataset to more scene texts, thereby\ncreating a new HumanML3D++ dataset including arbitrary texts. In this\nchallenging dataset, we benchmark existing state-of-the-art methods and propose\na novel two-stage framework to extract action labels from arbitrary texts by\nthe Large Language Model (LLM) and then generate motions from action labels.\nExtensive experiments are conducted under different application scenarios to\nvalidate the effectiveness of the proposed framework on existing and proposed\ndatasets. The results indicate that Text2Motion in this realistic setting is\nvery challenging, fostering new research in this practical direction. Our\ndataset and code will be released.",
|
| 15 |
+
"main_content": "INTRODUCTION Text2Motion [1\u20133, 5, 9, 12, 14, 25, 31, 32, 36, 37] denotes generating motions from natural language, which has proven useful in reducing \u2217Equal contribution Figure 2: HumanML3D++ Dataset Structure. We expand the action texts in the HumanML3D dataset to multiple scene texts. Taking a set of data as an example, HumanML3D provides 3-5 action texts for each motion data. Building upon this, we provide two scene texts for each action text. labor costs in industries requiring motion capture actors and manual editings, such as movie production and game development. In these arXiv:2404.14745v1 [cs.CV] 23 Apr 2024 \fRunqi Wang, Caoyuan Ma, GuoPeng Li, and Zheng Wang\u2020 entertainment industries, the motion editing of characters is limited to the development stage, and motion patterns are fixed after release. However, the target needs to interact with users in more flexible applications, which brings various unrestricted scenes, such as embodied intelligence [33] and interactive Non-Player Characters (NPCs) in open-world games. Therefore, exploring the generation of potential motions from arbitrary texts is important. However, as shown in Figure 1, existing datasets [10, 13, 23, 26, 27, 30] simply assume that motions are from specific action labels or action texts (i.e. inputs with action labels). We argue this is impractical for some flexible applications that need scene inputs (i.e. inputs without action labels). For example, when we describe an event \u201cA person picks up something\u201d, Action2Motion [4, 6, 10, 16, 20, 22, 24, 35] (the left figure in Figure 1) can only generate motions from specific action labels rather than a sentence, such as \u201cwalk, bend, and pick\u201d. More flexibly, Text2Motion(the middle figure in Figure 1) generates motions from action texts, such as \u201cA person walks and bends to pick up something\u201d. Compared to them, it is more practical to generate motions from arbitrary texts (the right figure in Figure 1), such as \u201cA person notices his wallet on the ground ahead\u201d. In this case, perfect action labels or action texts are not guaranteed, hindering the applications of existing methods and datasets. Therefore, a natural question arises: can we generate reliable motions from arbitrary texts? In light of the novelty of this problem, we propose a new dataset to evaluate Text2Motion in a more realistic setting. Briefly, given the action texts of the HumanML3D dataset, the introduced scene texts are generated by LLM in a one-to-many manner. In total, our dataset includes 44,970 action texts, 134,910(about)scene texts, and 14,616 motions (see details in Table 1). The new dataset, called HumanML3D++, gives rise to two fundamental differences between this work and prior research. Beyond Action Texts. Previous methods mainly focus on specific action texts because existing datasets consider perfectly aligned action texts and motions as default. However, HumanML3D++ introduces many scene texts based on the action texts of HumanML3D and enables us to explore the effect of more flexible scene texts in real-life applications. As a result, we need to align multiple arbitrary texts with the same motions, breaking the limited action texts. Beyond Text2Motion. Previous frameworks generate motions from action texts in a one-stage manner because they have perfectly aligned action texts and motions. However, the introduced scene texts of our HumanML3D++ have vague relationships with motions. Therefore, we split the Text2Motion into Text2Action and Action2Motion. In the Text2Action stage, we use the emergent abilities of the LLM to extract the action texts and corresponding scene texts to understand the inherent means of scene texts, hereby extracting the complete and potential action labels. In the Action2Motion stage, we use the sequential abilities of the Transformer to ensure the coherence from action labels to final motions. As a result, our two-stage framework can extract the action labels from arbitrary texts and generate final motions from the extracted action labels, breaking the limited Text2Motion. Our main contributions can be summarized as follows: \u2022 We conduct a new dataset that contains over 80,000 scene text annotations to help infer the potential actions from scene texts (texts without action labels), which has not been explored in the past. \u2022 We propose a more practical two-stage framework, which extracts semantic information with LLMs from arbitrary texts and then generates motions from extracted information. \u2022 Compared with existing methods, our method is better able to understand scene texts and generate motions that align more closely with scene texts. 2 RELATED WORK 2.1 Human Motion Generation Human motion generation supports diverse multimodal inputs, including text [5, 8, 25, 32, 36, 38], action lable [10, 20, 24], incomplete posture sequences [7, 11, 32], music [15, 17, 18], images [29], and more. In all conditional tasks, text-to-motion [5, 8, 25, 32, 36, 38] has consistently propelled and dominated the forefront of research, given that linguistic descriptors remain the most user-friendly and convenient means of representation. In the realm of tasks conditioned on natural language inputs, the generation of actions predominantly relies on deterministic, action textual prompts. Our endeavor diverges by placing emphasis on scene textual inputs, aimed at comprehending natural language interactions and generating appropriate responsive actions. 2.2 Text-to-motion Generation According to the survey [40], tasks utilizing natural language as a conditional input can be categorized into two main classes: Action2motion and text2motion. The core objective of the Action2motion task is to generate human motion sequences corresponding to specific action categories. [5, 6, 10, 21, 22, 24, 32, 35] serves as a typical representative in the Action2motion task. PoseGPT [22]employed an autoencoder to map human motion into a latent index sequence in discrete space. Actor [24] utilized a Transformer-based architecture for encoding and decoding parameterized SMPL human body model sequences estimated from action recognition datasets. INR [4] introduced a motion-conditioned human motion generation method utilizing Variational Implicit Neural Representations. Kinetic-GAN [6] leveraged the advantages of generative adversarial networks and graph convolutional networks to synthesize a new architecture for human body dynamics. These methods demonstrate certain effectiveness. However, existing Action2motion methods suffer from limitations where input action categories are predetermined, thus unable to continuously generate multiple motion sequences, leading to restricted generative capabilities. Nevertheless, despite this limitation, given the relatively short length of textual input, these methods are capable of faithfully generating information relevant to the corresponding action category. Based on this, our design leverages the precision of action2motion generation. In contrast, text-to-motion tasks focus on generating human motion sequences from natural language descriptions. T2M-GPT [36] utilized a simple CNN-based VQ-VAE to obtain high-quality discrete representations of motion. MotionGPT [39] generated continuous human body motion by treating multimodal signals as special input tokens in a large language model (LLM). MLD [5] introduced the \fTAAT: Think and Act from Arbitrary Texts in Text2Motion Table 1: Dataset comparison. #Sub refers to the number of humans included in the dataset. #Act. Class denotes the number of action classes present in the dataset, representing the variety of actions captured (this metric is not applicable to motion datasets annotated with action texts). Our dataset stands out as the most abundant in terms of annotated text content among existing datasets, particularly due to the incorporation of a significant volume of scene texts. Name #Sub. #Motion #Text #Act. Class Scene Action Supervision AMASS [23] 344 11,000 NTU-120RGB+D[19] 106 114,000 120 UESTC [13] 118 25,600 40 NTU RGB+D [30] 56,000 60 BABEL [27] 344 66,000 250 HumanAct12 [10] 12 1,191 12 Text Sup. KIT-ML [26] 111 3,911 6,278 HumanML3D [8] 344 14,616 44,970 Ours 344 14,616 134,910 \u2713 diffusion model into the field of motion generation, diffusing the motion latent space and reducing computational expenses during both the training and inference stages. The use of natural language input aligns more with users\u2019 interaction habits. However, when receiving textual inputs containing multiple actions, due to the inherent complexity of textual content, these models often struggle to faithfully generate all actions in sequence. Our work, also relying on natural language input to align with user habits, addresses the issue of poor performance in multi-action motion generation through the implementation of a precision generator. By leveraging the strengths of both tasks, our model achieves more accurate and flexible motion generation. 3 DATASET: HUMANML3D++ Motion data is pivotal in the advancement of motion generation tasks. As our task relies on scene input, we primarily focus on datasets commonly used in text-to-motion tasks. KIT MotionLanguage (KIT-ML) [26] provides sequence-level annotations for motions, while HumanML3D [8] offers additional textual annotations for some motions in AMASS [23]. It also serves as a focal point in our text-to-motion task. For datasets mapping action labels to actions, Babel [27] collects actions from AMASS [23] and provides annotations for actions and behaviors. ACTOR [24] utilizes two action recognition datasets, HumanAct12 [10] and UESTC [13], employed for action-to-action tasks. However, existing datasets only encompass action texts. To adapt to our task, the modification and enhancement of existing textual data become issues of concern. As shown in Figure 2, we have enhanced the scene textual input component of the dataset built upon HumanML3D [8], named HumanML3D++. As illustrated in Table 1, it can be observed that we have provided the first dataset with scene textual annotations to date. Data composition. As shown in Figure 2, HumanML3D++ is expanded based on HumanML3D [8]. Specifically, HumanML3D [8] annotates 3-5 action texts for each motion. We use LLM to understand action texts and generate two different scene texts for each action text. We test many prompts to claim scene data, here are some examples: Template 1: Here is an example where the action sentence is \"a person takes a few steps forward and then bends down to pick up something.\" and the corresponding scene sentence is \"a person discovers his long lost wallet.\" The causal relationship between the two sentences is very close. I am now giving you some action sentences, hoping that you can complete some scene sentences, which should be the antecedents of the corresponding action sentence actions. The action sentence I am giving you now is <>, I hope you can generate two sentences for each action sentence. Template 2: Here is an example where the action sentence is \"a person takes a few steps forward and then bends down to pick up something,\" and the corresponding scene sentence is \"a person discovers his long lost wallet\". The causal relationship between the two sentences is very close. I am now giving you some action sentences, hoping that you can complete some scene sentences, When completing scene sentences, please try not to use verbs in action sentences. The action sentence I am giving you now is <>. Template 3: Here are some events, and I hope you can summarize in one sentence what happened that could have caused such a reaction. For example, the action sentence is \"a person takes a few steps forward and then bends down to pick up something\", and the corresponding scene sentence is \"a person discovers his long lost wallet\". I am now giving you some action sentences, hoping that you can complete some scene sentences, When completing scene sentences, please try not to use verbs in action sentences. The action sentence I am giving you now is <>. We conduct multiple experiments and evaluate the effectiveness of the generated outcomes, Template 1 can effectively generate scene texts that match the action texts. We ultimately chose the first one as the prompt to be used in our data generation process. Data validation. All the meta versions of scene texts in HumanML3D++ are generated by LLM. Despite having a good prompt, there still exists a certain level of uncertainty in the generation process. To validate the data reliability, we invite 20 participants to evaluate randomly selected data (which accounts for 15% of the total amount). Since different motions may be responses to the same scene text, and the same motion may also be responses to different scene texts, we set the evaluation criteria that as long as the action text is one of the possible reactions for a given scene text, we will mark it as reasonable. The results show that about 94% of the selected data is considered reasonable. At the same time, we have cleaned up or manually corrected the abnormal data. 4 METHOD Our objective is to comprehend scene and action textual inputs and generate lifelike human motion responses. As illustrated in Figure 3, the entire framework comprises two main components. The LLM accepts action and scene inputs and produces corresponding action labels. The generation module uses VQ-VAE to learn the mapping between motion data and discrete encoding sequences and generates code indices based on the corresponding action descriptions. Leveraging the decoder in the motion VQ-VAE, we are able to reconstruct motion from the code indices. In Section 4.1, we presented our comprehension module and introduced a new dataset provided for novel tasks. Subsequently, in Section 4.2, we outlined our universal generation module. \fRunqi Wang, Caoyuan Ma, GuoPeng Li, and Zheng Wang\u2020 Figure 3: Our pipeline overview. Our approach consists of two main parts. a) Understanding natural language and decoupling it into a sequence of actions. We use LLM to obtain possible action labels from action texts or scene texts. b) Generating action sequences corresponding to the obtained action labels. Action X represents the \ud835\udc65-th acquired action label. \ud835\udc50\ud835\udc65 \ud835\udc59represents the \ud835\udc59-th discrete representation ( pose ID) of the motion generated by the \ud835\udc65-th action label. \ud835\udc4erepresents the number of smoothing pose IDs we use. We use the sequential abilities of the Transformer and use the last few actions of the previous action as part of the input for the next action. 4.1 Think Model 4.1.1 Dataset. The existing datasets contain only action text inputs without scene texts, we need to expand the scene text on the existing dataset. We selecte our foundational dataset based on the following considerations. First, when it comes to addressing the issue of generating quality motion, it has been demonstrated that the amount of motion data has an impact on the results. A greater amount of motion data allows for the learning of more poses, consequently leading to improved generation performance. Therefore, our foundational dataset should contain as many motion actions as possible. Secondly, the textual component of the dataset must include annotations of action text to reduce the workload of data labeling. Additionally, this facilitates the supplementation of scene text sections. Based on these criteria, we have chosen the largest dataset with textual annotations, the HumanML3D dataset, as our foundational dataset. However, the textual component of HumanML3D comprises solely action annotations of motion. To meet the requirements of our task, we adopt a comprehensive approach, combining large-scale models with manual processing. Figure 2 displays the representation of the data relationships in our dataset. For each motion data point in the source dataset, which includes 3-5 action descriptions of the motion, we refine the promotion of the large model to generate two scene descriptions corresponding to each data point. After the model completes the supplementation of scene text, we manually filter and clean the data. Then, the data is utilized to train the model, enabling it to perform specific tasks. We compared several datasets utilized in the current field, and according to Table1, it is evident that we possess the largest annotated (action and scene) three-dimensional motion dataset available. 4.1.2 LLM. In the realm of situational comprehension modules, LLM emerges as the paramount choice for delving into textual inputs, owing to its adeptness in modeling intricate language structures and its extraordinary comprehension prowess. Leveraging LLM, we endeavor to generate action representations corresponding to predefined scenarios. Illustrated in Figure 3, our think module ingests scene texts as input and subsequently yields corresponding action labels. Our extraction methodology unfolds in two distinct phases: initially, we harness LLM to procure action texts in response to the provided scene texts; thereafter, we capitalize on the language model\u2019s proficiency to distill action labels from the acquired action texts. Notably, we encounter impracticality in retraining or fine-tuning LLM for our purposes. Firstly, the endeavor to retrain large-scale models entails formidable demands on computational resources and time, rendering it unfeasible in many practical scenarios. Secondly, direct fine-tuning of large models on the paired text inputs of scene texts and action texts encounters the predicament of \u201clective forgetting\u201d. By contrast, the direct adaptation of prompts utilizing existing LLM presents a viable workaround to circumvent these challenges. The utilization of LLM to generate response action labels for scene texts entails a degree of uncertainty; namely, the action label generated from scene texts may not necessarily correspond to the ground truth (GT) action. We have taken this issue into consideration and implemented certain measures to address it, which are elaborated upon in Section 5.2. 4.2 ACT Model 4.2.1 CodeBook. The incorporation of VQ-VAE [34] into the model framework facilitates the acquisition of discrete representations within generative models. Herein, we denote the encoder and decoder components of the autoencoder as E and D, respectively. Consider a human motion sequence \ud835\udc4b= [\ud835\udc651,\ud835\udc652, ...,\ud835\udc65\ud835\udc47], with \ud835\udc47 denoting the total number of frames. The latent feature \ud835\udc4dcan be \fTAAT: Think and Act from Arbitrary Texts in Text2Motion derived as \ud835\udc4d= \ud835\udc38(\ud835\udc4b), where \ud835\udc4d= [\ud835\udc671,\ud835\udc672, ...,\ud835\udc67\ud835\udc47/\ud835\udc59], and \ud835\udc59signifies the temporal downsampling rate of the encoder \ud835\udc38. Quantization of each latent feature \ud835\udc67\ud835\udc56entails its mapping to the nearest centroid \ud835\udc50\ud835\udc58within the codebook \ud835\udc36, as delineated by the equation: \u02c6 \ud835\udc67\ud835\udc56= arg min \ud835\udc50\ud835\udc58\u2208\ud835\udc36 \u2225\ud835\udc67\ud835\udc56\u2212\ud835\udc50\ud835\udc58\u22252 (1) In the optimization of VQ-VAE, the standard objective function [34] Lvq encompasses three pivotal components: a reconstruction loss Lre, an embedding loss Lembed, and a commitment loss Lcommit. L\ud835\udc63\ud835\udc5e= L\ud835\udc5f\ud835\udc52+ \u2225\ud835\udc4d\u2212sg[ \u02c6 \ud835\udc4d]\u22252 | {z } Lembed +\ud835\udefd\u2225sg[\ud835\udc4d] \u2212\u02c6 \ud835\udc4d\u22252 | {z } Lcommit (2) In our organizational refinement framework, we introduce a hyper-parameter \ud835\udefdto govern the impact of the commitment loss and denote the stop-gradient operator as sg. Let Xre represent the reconstructed motion derived from X, specifically defined as Xre = \ud835\udc37(Z). Additionally, denote V(X) as the velocity vector corresponding to X, where V = [\ud835\udc631, \ud835\udc632, ..., \ud835\udc63\ud835\udc47\u22121] and each \ud835\udc63\ud835\udc56denotes the difference between consecutive elements in X, i.e., \ud835\udc63\ud835\udc56= \ud835\udc65\ud835\udc56+1 \u2212\ud835\udc65\ud835\udc56. Hence, the overarching objective guiding our reconstruction process can be articulated as follows: Lre = Lsmooth 1 (\ud835\udc4b,\ud835\udc4bre) + \ud835\udefcLsmooth 1 (\ud835\udc49(\ud835\udc4b),\ud835\udc49(\ud835\udc4bre)) (3) where \ud835\udefcis a hyper-parameter to balance the two losses. A rudimentary implementation of VQ-VAE training encounters a notable challenge known as codebook collapse, as discussed in literature [28, 34]. However, to mitigate this issue and enhance codebook utilization, two prominent training methodologies have been devised [28]. The first approach involves the utilization of exponential moving average (EMA) and the second is referred to as codebook reset (Code Reset). The EMA method facilitates a smooth evolution of the codebook C over iterations. On the other hand, the Code Reset strategy identifies inactive codes during the training process and dynamically reassigns them based on input data, thereby revitalizing the codebook and optimizing its utility throughout the training regimen. 4.2.2 Generativate Transfomer. Utilizing a learned motion VQVAE, a motion sequence \ud835\udc4b= [\ud835\udc651,\ud835\udc652, ...,\ud835\udc65\ud835\udc47] can be converted into a sequence of indices \ud835\udc3c= [\ud835\udc561,\ud835\udc562, ...,\ud835\udc56\ud835\udc47/\ud835\udc59, End], where \ud835\udc56\ud835\udc61\u2208 [1, 2, ...,\ud835\udc60\ud835\udc47/\ud835\udc59] denotes indices from the learned codebook. It\u2019s important to note that a special \"End\" token is appended to signify the end of the motion sequence. By projecting \ud835\udc3cback to their corresponding codebook entries, we obtain \u02c6 \ud835\udc4d= [\u02c6 \ud835\udc671, \u02c6 \ud835\udc672, ..., \u02c6 \ud835\udc67\ud835\udc47/\ud835\udc59] , which can then be decoded into a motion sequence \ud835\udc4bre using the decoder \ud835\udc37. Consequently, text-to-motion generation can be formulated as an autoregressive next-index prediction task: given previous \ud835\udc61\u22121 indices (i.e., \ud835\udc3c< \ud835\udc61) and text condition \ud835\udc50, our objective is to predict the distribution of possible next indices \ud835\udc5d(\ud835\udc56\ud835\udc61|\ud835\udc50, \ud835\udc3c< \ud835\udc61), a task well-suited for Transformer-based models. The overview of our Transformer model is depicted in Figure3. Optimization Goal. The optimization goal is defined by denoting the likelihood of the full sequence as \ud835\udc5d(\ud835\udc46|\ud835\udc50) = \u00ce\ud835\udc47/\ud835\udc59 \ud835\udc56=1 \ud835\udc5d(\ud835\udc46\ud835\udc56|\ud835\udc50,\ud835\udc46< \ud835\udc56). We directly maximize the log-likelihood of the data distribution: L\ud835\udc61\ud835\udc5f\ud835\udc4e\ud835\udc5b\ud835\udc60= E\ud835\udc46\u223c\ud835\udc5d(\ud835\udc46) [\u2212log\ud835\udc5d(\ud835\udc46|\ud835\udc50)] (4) 4.2.3 full motion generation. In the training phase of the generative module, our input comprises textual labels paired with corresponding sequences of discrete actions. This design allows the generative module to learn various actions and transitional actions between two actions, thereby establishing a discrete representation of actions and mappings between them. Nevertheless, this does not completely faithfully generate all actions. When visualizing, we adopt a new approach to help us generate all actions. \u001a clip_feature_action0,\ud835\udc5b\ud835\udc62\ud835\udc59\ud835\udc59 if action = action0 clip_feature_action\ud835\udc56, action\ud835\udc56\u22121[\u2212\ud835\udc4e:] otherwise (5) Specifically, when the input label is the first in the sequence, we utilize the corresponding action label along with an empty ID list as input. When the input label is not the first, we employ the corresponding label and the last a IDs of the preceding action as input to generate the next index under the given label condition. For each action label, we initiate the generation process from the text embedding, proceeding in an autoregressive manner. This generation process continues until the model predicts the End token, signifying the completion of action sequence generation. Subsequently, upon obtaining all action label indices, we concatenate them. This concatenated sequence is then passed through the VAE decoder, facilitating the formation of a cohesive and smooth sequence of actions. 5 EXPERIMENT In the experiments, We select R-Precision, Frechet Inception Distance (FID), Multimodal Distance (MM-Dist), Diversity, and Multimodality (MModality) as our evaluation metrics. In Section 5.1 we introduce standard datasets as well as evaluation metrics. We report the accuracy of text2Action in Section 5.2. We compare our results to competitive approaches in Section 5.3-5.5. 5.1 Dataset and evaluation metric Due to the current lack of standardized datasets suitable for extracting motions from arbitrary texts, we supplement the textual portion of the largest annotated dataset, HumanML3D, to meet our task requirements. Following Section 4.1.1, we reorganize the dataset and conduct multiple experiments. Implementation details. For the codebook from VQ-VAE, its size is set to 512 \u00d7 512. The downsampling rate \ud835\udc59is 4. For the HumanML3D++ dataset, the motion sequences are cropped to \ud835\udc47= 64 for training. We use AdamW optimizer with [\ud835\udefd1, \ud835\udefd2] = [0.9, 0.99], batch size of 256, and exponential moving constant \ud835\udf06= 0.99. We train the first 200K iterations with a learning rate of 2 \u00d7 10\u22124, and 100K with a learning rate of 1\u00d710\u22125. \ud835\udefdand \ud835\udefcin L\ud835\udc63\ud835\udc5eand L\ud835\udc5f\ud835\udc52are set to 1 and 0.5, respectively. For the GPT, we employ 20 Transformer layers with a dimension of 1,024 and 16 heads. Following Guo et al [8], the maximum length of Motion is 196 on HumanML3D++ and HumanML3D, and the minimum length is 40 for HumanML3D++. The maximum length of the code index sequence is \ud835\udc47\u2032 = 50. We train an extra End token as a signal to stop index generation. The \fRunqi Wang, Caoyuan Ma, GuoPeng Li, and Zheng Wang\u2020 Table 2: Experiment results on HumanML3D. The training is conducted on the HumanML3D dataset, and testing is also performed on the HumanML3D dataset. Compared to them, our TAAT uses the sequential abilities of the Transformer and works well in FID, Diversity, and MModality, proving that our model generates high-quality motion. Methods R-Precision \u2191 FID \u2193 MM-Dist \u2193 Diversity \u2191 MModality\u2191 Top-1 Top-2 Top-3 Real motion 0.511\u00b1.003 0.703\u00b1.003 0.797\u00b1.002 0.002\u00b1.000 2.974\u00b1.008 9.503\u00b1.065 TM2T [9] 0.457\u00b1.002 0.639\u00b1.003 0.740\u00b1.003 1.067\u00b1.002 3.340\u00b1.008 9.188\u00b1.002 2.090\u00b1.083 MDM [32] 0.611\u00b1.007 0.544\u00b1.044 5.566\u00b1.027 9.599\u00b1.086 2.799\u00b1.072 MLD [5] 0.481\u00b1.003 0.673\u00b1.003 0.772\u00b1.002 0.473\u00b1.013 3.196\u00b1.010 9.724\u00b1.082 2.413\u00b1.079 MotionDiffuse [37] 0.491\u00b1.001 0.681\u00b1.001 0.782\u00b1.001 0.630\u00b1.001 3.113\u00b1.001 9.410\u00b1.049 1.553\u00b1.042 T2M-GPT [36] 0.417\u00b1.003 0.589\u00b1.002 0.685\u00b1.003 0.140\u00b1.006 3.730\u00b1.009 9.844\u00b10.095 3.285\u00b1.070 Ours 0.329\u00b1.003 0.489\u00b1.002 0.696\u00b1.003 0.461\u00b1.006 5.050\u00b1.009 10.038\u00b1.095 2.929\u00b1.070 Table 3: Experiment results on model generalization ability. The training is conducted on the HumanML3D dataset, while testing is performed using the HumanML3D++ dataset. We observe a certain degree of decline in metrics across all models when they are subjected to new scene text inputs. Compared to other methods, TAAT exhibits lesser degradation in metrics, proving the enhanced comprehension capability of our method when confronted with new scene text inputs. Methods R-Precision \u2191 FID \u2193 MM-Dist \u2193 Diversity \u2191 MModality\u2191 Top-1 Top-2 Top-3 Real motion 0.397\u00b1.003 0.568\u00b1.003 0.665\u00b1.003 0.006\u00b1.000 3.945\u00b1.000 8.435\u00b1.069 TM2T [9] 0.337\u00b1.002 0.496\u00b1.002 0.593\u00b1.002 2.201\u00b1.020 4.265\u00b1.008 7.286\u00b1.075 2.600\u00b1.094 MDM [32] 0.322\u00b1.004 0.481\u00b1.007 0.579\u00b1.007 0.827\u00b1.053 4.539\u00b1.019 8.249\u00b1.058 2.804\u00b1.052 MLD [5] 0.373\u00b1.002 0.534\u00b1.002 0.626\u00b1.002 0.897\u00b1.026 3.893\u00b1.010 9.289\u00b1.096 3.018\u00b1.028 MotionDiffuse [37] 0.366\u00b1.000 0.546\u00b1.000 0.637\u00b1.000 1.514\u00b1.000 3.965\u00b1.000 7.907\u00b1.000 1.813\u00b1.000 T2M-GPT [36] 0.389\u00b1.009 0.544\u00b1.009 0.633\u00b1.002 0.516\u00b1.042 4.035\u00b1.004 9.396\u00b1.232 2.499\u00b1.348 Ours 0.225\u00b1.003 0.315\u00b1.002 0.413\u00b1.003 0.488\u00b1.006 5.109\u00b1.009 8.552\u00b1.095 2.957\u00b1.070 Table 4: Experiment results on HumanML3D++. The training is conducted on the HumanML3D++ dataset, and testing is also performed on the HumanML3D++ dataset. Despite the constraints imposed by the evaluated metrics, our TAAT performs favorably in terms of FID, Diversity, and MModality, demonstrating that our model can generate high-quality and diverse motion Methods R-Precision \u2191 FID \u2193 MM-Dist \u2193 Diversity \u2191 MModality\u2191 Top-1 Top-2 Top-3 Real motion 0.397\u00b1.003 0.568\u00b1.003 0.665\u00b1.003 0.006\u00b1.000 3.945\u00b1.000 8.435\u00b1.069 TM2T [9] 0.337\u00b1.000 0.508\u00b1.000 0.616\u00b1.000 1.394\u00b1.000 4.229\u00b1.000 8.181\u00b1.000 2.701\u00b1.000 MDM [32] 0.314\u00b1.006 0.482\u00b1.008 0.588\u00b1.009 0.435\u00b1.029 4.340\u00b1.026 8.634\u00b1.057 2.901\u00b1.055 MLD [5] 0.165\u00b1.002 0.281\u00b1.002 0.368\u00b1.003 9.408\u00b1.060 5.564\u00b1.013 6.962\u00b1.063 3.086\u00b1.130 MotionDiffuse [37] 0.286\u00b1.000 0.442\u00b1.000 0.540\u00b1.000 2.688\u00b1.000 4.638\u00b1.000 7.703\u00b1.000 3.191\u00b1.000 T2M-GPT [36] 0.371\u00b1.005 0.543\u00b1.004 0.645\u00b1.005 0.316\u00b1.015 3.994\u00b1.034 8.627\u00b1.080 2.620\u00b1.067 Ours 0.235\u00b1.003 0.358\u00b1.002 0.427\u00b1.003 0.448\u00b1.006 4.712\u00b1.009 8.950\u00b1.095 3.046\u00b1.070 Transformer is optimized using AdamW with [\ud835\udefd1, \ud835\udefd2] = [0.5, 0.99] and batch size 128. The initialized learning rate is set to 1\u00d710\u22124 for 150K iterations and decayed to 5 \u00d7 10\u22126 for another 150K iterations. Since our method takes the label group of the action label as input, we follow the instructions [8] and retrain the Motion&Text Feature Extractors for Evaluation on the HumanML3D dataset, where the text part is replaced by the action label extracted from the HumanML3D dataset. In the experiment on Motion Generation on HumanML3D++, we follow the same guidance [8] and retrain Motion &Text Feature Extractors for Evaluation on the HumanML3D++ dataset. Metrics. When calculating indicators, we use a consistent evaluation method [36], input action label combinations, and corresponding actions. \fTAAT: Think and Act from Arbitrary Texts in Text2Motion Figure 4: Visual results on Action texts and scene texts. The first row displays the visual results of different models in Action texts, while the second row presents the visual results of different models in scene texts. Compared with other models, under action texts, our TAAT faithfully generates three actions in sequence when given three actions as input. Under scene texts, TAAT generates reactive actions to the situation (running away), while other models generate textual content (driving). \u2022 R-Precision: Given one motion sequence and 32 text descriptions (1 ground-truth and 31 randomly selected mismatched descriptions), we rank the Euclidean distances between the motion and text embeddings. Top-1, Top-2, and Top-3 accuracy of motion-to-text retrieval are reported. \u2022 Frechet Inception Distance (FID): We calculate the distribution distance between the generated and real motion using FID on the extracted motion features. \u2022 Multimodal Distance (MM-Dist): The average Euclidean distances between each text feature and the generated motion feature from this text. \u2022 Diversity: From a set of motions, we randomly sample 300 pairs of motion. We extract motion features and compute the average Euclidean distances of the pairs to measure motion diversity in the set. \u2022 Multimodality (MModality): For one text description, we generate 20 motion sequences forming 10 pairs of motion. We extract motion features and compute the average Euclidean distances of the pairs. We finally report the average over all the text descriptions. 5.2 Text2Action Accuracy In the task we proposed, using LLM to understand and respond to scene texts is the core of generating reasonable motion for arbitrary texts. However, there is uncertainty in generating action texts from scene texts. Specifically, one scene text may correspond to multiple reactive actions, although the results are usually reasonable, the direct use of LLM\u2019s single result does not always correspond to the ground truth action texts, which is not conducive to the existing evaluation criteria. The illusion phenomenon of LLM may have a negative impact on our setting. To test the above concerns, we generate multiple actions for each scene text. As shown in Figure 6, we evaluate the rationality of the results: we generate ten action texts for each scene text and use an evaluator to compute the similarity between each action text and Ground truth to choose the most similar action text we generated. we set the evaluation criteria that If the action texts and ground truth are extremely matched, such as both actions that are \"kick\", we determine that they are \"match\". If the action texts and ground truth actions are similar but not exactly matched, we determine that they are \"similar\". If the action texts and ground truth actions do not match at all, we determine that they are \"mismatch\". We randomly sample 10% of the results and find that 66% of the data can be similar to the ground truth. For the actions used in the second part of the test, we use a discriminator to select the result closest to the original action texts as the input for the second part. 5.3 Motion Generation on HumanML3D In Table 2, both model training and testing are performed on the HumanML3D dataset. The results data for other models are directly obtained from the respective papers. Compared to the original action texts to motion task, our TAAT demonstrates good performance in Diversity and shows promising results in metrics such as FID and MModality.This also demonstrates the efficacy of our TAAT in the original action texts to motion tasks. Our TAAT can also generate improved and more diverse motions when presented with action text inputs.TAAT combines the accuracy of generation with the diversity of generated actions. \fRunqi Wang, Caoyuan Ma, GuoPeng Li, and Zheng Wang\u2020 Figure 5: E1, E2, and E3, respectively, represent the result in table 2, table 3, and table 4. We opt for the FID metric (lower values indicating better performance) to illustrate the variations among different models under various experimental settings. Most models exhibit a decline in metrics when directly subjected to scene inputs without prior training (E2), indicating a lack of generalization capability in the preceding models. Upon retraining the models on the new task (E3), there is a noticeable improvement in metrics for most models, proving that the majority of models also possess a certain learning capability for more complex scene texts. Our method has the smallest change in indicators among the three experiments and maintains a leading level, proving that our method is more suitable for the input of arbitrary texts. 5.4 From HumanML3D To HumanML3D++ Table 3 illustrates our testing on the model\u2019s generalization capabilities. All models are trained on the HumanML3D dataset and tested on the HumanML3D++ dataset to test whether the relevant models have the generalization ability to understand and generate motion from scene texts. We conduct testing using official pre-trained models provided by each paper. Table 3 shows that preceding models demonstrate a decrease in metrics when directly subject to scene text inputs without prior training. This indicates a lack of generalization capability in the preceding models, showing them not directly applicable to the new task. Despite not being specifically trained on scene texts, our model exhibits a comparatively minor decrease in performance metrics when presented with scene text inputs. Furthermore, it achieves the best FID and satisfactory Diversity, demonstrating the ability to generate high-quality and diverse human motions. 5.5 Motion Generation on HumanML3D++ Table 4 shows the model\u2019s ability to learn scene texts and generate corresponding responsive actions. All models are trained on the HumanML3D++ dataset and tested on the HumanML3D++ dataset. All models are trained according to guidelines provided in their respective official repositories. It can be observed that our TAAT Figure 6: Accuracy of action labels generated by LLM. It can be observed that the action texts generated in our think stage closely approximate real action texts at a rate of 66%. can learn and understand the input of scene text well, generate corresponding actions, and does not produce particularly poor metrics as some models do. Despite the constraints imposed by the evaluated metrics, our TAAT performs favorably in terms of FID, Diversity, and MModality, demonstrating that our model can generate high-quality and diverse motion. 6 DISSCUSION Since the LLMs have randomness in producing action texts from scene texts, the existing methods mainly focus on aligning motion and text. This leads to our quantitative results not showing a significantly superior performance. We believe the main cause is that a scene text has various reasonable motions, and a motion may occur in various scenes, we need a better evaluation method to judge the rationality of the generated results.. Although we have already provided 6-10 scene texts for each motion, it is still insufficient for the task. 7"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14755v1.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14755v1",
|
| 3 |
+
"title": "SkinGEN: an Explainable Dermatology Diagnosis-to-Generation Framework with Interactive Vision-Language Models",
|
| 4 |
+
"abstract": "With the continuous advancement of vision language models (VLMs) technology,\nremarkable research achievements have emerged in the dermatology field, the\nfourth most prevalent human disease category. However, despite these\nadvancements, VLM still faces \"hallucination\" in dermatological diagnosis, and\ndue to the inherent complexity of dermatological conditions, existing tools\noffer relatively limited support for user comprehension. We propose SkinGEN, a\ndiagnosis-to-generation framework that leverages the stable diffusion (SD)\nmethod to generate reference demonstrations from diagnosis results provided by\nVLM, thereby enhancing the visual explainability for users. Through extensive\nexperiments with Low-Rank Adaptation (LoRA), we identify optimal strategies for\nskin condition image generation. We conduct a user study with 32 participants\nevaluating both the system performance and explainability. Results demonstrate\nthat SkinGEN significantly improves users' comprehension of VLM predictions and\nfosters increased trust in the diagnostic process. This work paves the way for\nmore transparent and user-centric VLM applications in dermatology and beyond.",
|
| 5 |
+
"authors": "Bo Lin, Yingjing Xu, Xuanwen Bao, Zhou Zhao, Zuyong Zhang, Zhouyang Wang, Jie Zhang, Shuiguang Deng, Jianwei Yin",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.MM",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.MM",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.CV",
|
| 13 |
+
"cs.HC"
|
| 14 |
+
],
|
| 15 |
+
"label": "Original Paper",
|
| 16 |
+
"paper_cat": "Diffusion AND Model",
|
| 17 |
+
"gt": "With the continuous advancement of vision language models (VLMs) technology,\nremarkable research achievements have emerged in the dermatology field, the\nfourth most prevalent human disease category. However, despite these\nadvancements, VLM still faces \"hallucination\" in dermatological diagnosis, and\ndue to the inherent complexity of dermatological conditions, existing tools\noffer relatively limited support for user comprehension. We propose SkinGEN, a\ndiagnosis-to-generation framework that leverages the stable diffusion (SD)\nmethod to generate reference demonstrations from diagnosis results provided by\nVLM, thereby enhancing the visual explainability for users. Through extensive\nexperiments with Low-Rank Adaptation (LoRA), we identify optimal strategies for\nskin condition image generation. We conduct a user study with 32 participants\nevaluating both the system performance and explainability. Results demonstrate\nthat SkinGEN significantly improves users' comprehension of VLM predictions and\nfosters increased trust in the diagnostic process. This work paves the way for\nmore transparent and user-centric VLM applications in dermatology and beyond.",
|
| 18 |
+
"main_content": "INTRODUCTION In recent years, large language models (LLMs) [44, 46, 51, 56] and visual language models (VLMs) [4, 10, 22, 27, 49, 58] has witnessed remarkable and swift advancements. Several excellent VLMs such as miniGPT4 [58], openFlamingo [4], cogVLM [49], otter [22] have shown extraordinary multi-model abilities of vision-language understanding and generation. In the healthcare field, VLMs have the potential to revolutionize the entire healthcare continuum by significantly optimizing and improving disease screening and diagnostic procedures, treatment planning, and post-treatment surveillance and care[5]. These advancements offer a profound opportunity to transform healthcare practices, leading to improved patient outcomes and efficiency in healthcare delivery. Existing medical VLMs, such as MedViLL [31], PubMedCLIP [13], LLaVa-Med [23], Med-Flamingo [32], XrayGPT [45], are tailored for visual question answering and report generation on extensive medical datasets. Adapting VLMs for medical visual question-answering is particularly noteworthy, empowering healthcare professionals to pose queries regarding medical images such as CT scans, MRIs, X-rays, and more [17]. Skin diseases are the fourth most common cause of all human diseases, affecting almost one-third of the world\u2019s population [15]. SkinGPT-4 [57], an interactive dermatology diagnostic system trained on a vast repository of skin disease images, totaling 52,929 images encompassing both publicly available and proprietary sources, supplemented by clinical concepts and physicians\u2019 arXiv:2404.14755v1 [cs.MM] 23 Apr 2024 \fACM MM, 2024, Melbourne, Australia Bo Lin, Yingjing Xu, Xuanwen Bao, Zhou Zhao, Zuyong Zhang, Zhouyang Wang, Jie Zhang, Shuiguang Deng, and Jianwei Yin (a) Dermatology Diagnosis Diagram How can I trust your diagnosis? What about other possible skin disease? Could you diagnose the skin disease in this image for me? Why not Psoriasis? Other possible skin diseases that could be considered based on this image include acne vulgaris\uff0callergic contact dermatitis\uff0cdrug eruption\uff0c rosacea\uff0cseborrheic dermatitis. However, given the appearance of pimples and blackheads, acne vulgaris is the most likely diagnosis. I can show you the demonstrations of other possible diseases. Acne vulgaris. After examining the image carefully, I'm confident in my diagnosis of acne vulgaris. However, it's possible that it could also be psoriasis, as both conditions can cause red, scaly patches on the skin. However, the pimples and blackheads visible in the image are more typical of acne vulgaris. (b) Dermatology Masked Image Generation Diagram Explainable Case 2 Explainable Case 1 Prompt Image Masked Image Diagnosis Results Other Possible Diagnosis Results Alignment Layer Vision Encoder SkinGPT skinSAM GroundingDino langSAM Drug Eruption Allergic Seborrheic Dermatitis Rosacea Fuse caption reference label SD Inpaint Recaption Case Retrieval Adapter Manager Masked Image Other Possible Diagnosis Results Other Possible Diagnosis Results Datasets Generated \u2028 Image Image (c) Dermatology Demonstration Generation Diagram skinGEN Chatbot skinGEN Chatbot User User LLM Figure 1: SkinGEN Explainable Framework: (a) Dermatology Diagnosis Diagram: analyzes the user\u2019s image and provides a diagnosis along with potential alternatives.(b) Dermatology Masked Image Generation Diagram: generate a mask of the affected skin area (c) Dermatology Demonstration Generation Diagram: The Adapter Manager uses LoRA and/or Ip-adapter to generate visual examples of the diagnosed and possible conditions. Case 1: SkinGEN\u2019s diagnosis is questioned by the user. SkinGEN clarifies its reasoning and presents visual examples of similar conditions for comparison. Case 2: The user is unfamiliar with the diagnosis. SkinGEN provides visualizations of similar conditions to facilitate understanding and differentiation. notes. Through fine-tuning, the model demonstrated comprehensive efficacy across the diagnostic process. However, the issue of reliability has increasingly come under scrutiny in these models, particularly in their capacity to deliver accurate and credible information. Frequent occurrences of incorrect or misleading outputs from VLMs, a phenomenon commonly referred to as \"hallucination\" underscores the paramount importance of ensuring safety in the context of large-scale modeling endeavors [6, 30]. Dermatological conditions may present similar symptoms in their early stages [33], thus complicating accurate diagnosis. The diagnosis of certain dermatological conditions is more challenging compared to other fields, owing to the potential similarity in symptoms and clinical manifestations despite potentially disparate etiologies, which poses significant challenges for patients lacking knowledge about dermatological knowledge. Solely focusing on a model\u2019s predicted diagnosis limits the confidence in the model for clinical decision-making and lacks visual interpretation [38]. It is widely recognized that vision, as an intuitive and easily understandable mode of expression, plays a crucial role in enhancing user interpretability. This characteristic is particularly critical in the medical domain, where healthcare information often entails high levels of complexity and specialization, necessitating its communication to non-professionals in a manner that is both intuitive and comprehensible to ensure accurate understanding and effective utilization of the information. In this context, the emergence of image generation methods such as SD [37] holds significant importance, offering new possibilities for privacy protection and the generation of illustrative explanations within medical scenarios. Prior work integrating SD [2, 11, 25, 26] with skin-related research primarily focused on expanding datasets for dermatological conditions, without delving into the realm of user interaction. We introduce SkinGEN, an innovative diagnostic tool designed to enhance the interpretability of VLM through the utilization of the SD method. Users have the capability to upload images depicting dermatological conditions and pose corresponding medical inquiries. SkinGEN, in turn, provides tailored diagnoses or other medical suggestions. In instances where users harbor doubts or encounter confusion regarding the diagnosis, SkinGEN introduces \fSkinGEN: an Explainable Dermatology Diagnosis-to-Generation Framework with Interactive Vision-Language Models ACM MM, 2024, Melbourne, Australia a feature for demonstrating skin diseases, providing illustrative images depicting alternative dermatological diagnoses similar to the current diagnosis, thereby aiding users in distinguishing between them. Medical information can be transmitted and shared in a more secure and controlled manner through SD, while also enabling the creation of visually intuitive graphical representations. The SkinGEN framework comprises three diagrams: the dermatology diagnosis diagram, the dermatology masked image generation diagram, and the dermatology demonstration generation diagram. By investigating Low-Rank Adaptation (LoRA) within our framework, we established effective techniques for generating realistic and informative skin condition images, improving user comprehension and trust in VLM diagnoses. We recruited 32 participants for our user study. Through comparative experiments, we demonstrate that SkinGEN received positive recognition regarding perceived trust, ease of understanding, and cognitive effort, thereby validating its explainability. Furthermore, in the comprehensive evaluation of the system, participants also provided positive feedback, indicating that the system possessed attributes of being informative, useful, and easy to comprehend. Our contributions are as follows: (1) SkinGEN, innovatively uses both interactive VLMs and image generation to improve user understanding and trust. By visualizing the predicted skin condition and other possibilities, SkinGEN makes VLM diagnosis clearer and more reliable for users. (2) Through extensive exploration of various training strategies and image synthesis methods, including fine-tuning SD with LoRA and incorporating both text and image prompts, we developed a highly effective solution for generating realistic and informative skin disease images. (3) User studies confirm that SkinGEN significantly improves user comprehension and trust in VLM diagnoses. This improvement is achieved by generating personalized visualizations of potential skin conditions directly from user-uploaded images, offering a clear and intuitive understanding of the diagnostic results while preserving user privacy. 2 RELATED WORK 2.1 Image Generation Diffusion models, particularly Stable Diffusion(SD) [39], have revolutionized the field of image generation with their ability to synthesize high-quality images aligned with textual prompts. Trained on a massive dataset of images and text descriptions (LAION-5B) [42], SD leverages a latent diffusion process to progressively denoise an initial noise map into the desired image. This process can be further conditioned on various elements, including text prompts, class labels, or low-resolution images, enabling controlled and versatile image generation. The desire for personalized image-generation experiences has driven the exploration of model customization techniques. Fine-tuning SD on domain-specific datasets with designated concept descriptors allows for tailoring the model to specific concepts or styles [21, 41]. This involves minimizing the original loss function of SD on the new data, enabling the model to learn and represent the unique features of the target concepts. LoRA [18] has emerged as a powerful tool for enhancing the efficiency and effectiveness of model customization. By constraining the fine-tuning process to a low-rank subspace within the original parameter space of SD, LoRA significantly reduces the number of parameters that require updating while preserving the foundational knowledge of the pre-trained model. Building upon the success of text-to-image diffusion models like SD, research has explored efficient and controllable image generation methods, such as Ip-Adapter [54], which leverages the power of both text and image prompts through a decoupled cross-attention mechanism. 2.2 Medical VLM In recent years, significant advancements have been made in the field of LLMs [44, 46, 51, 56] and VLMs [4, 10, 22, 27, 49, 58]. The progress of VLMs has resulted in substantial enhancements in both the quantity and quality of visual instructional data. For instance, MiniGPT4 [58], a generative visual-language model, trained through fine-tuning tasks on specialized datasets, leading to subsequent follow-up endeavors such as PatFig [3], SkinGPT-4 [57], and ArtGPT-4 [55]. These models are designed to address corresponding vision-language tasks across diverse domains. In the medical domain, vision language diagnostic models are regarded as an extremely promising direction for medical advancement, capable of addressing issues related to healthcare resource scarcity and the automation of intelligent diagnosis. Li etc proposed LLaVa-Med [23], an adaptation of the LLava [27], specifically tailored for the medical domain through training on three standard biomedical visual question-answering datasets, which exhibits excellent multimodal conversational capability about a biomedical image. Micheal etc proposed Med-Flamingo [32], a multimodel few-shot learner that pre-trained on paired and interleaved medical image-text data from publications and textbooks based on OpenFlamingo-9B [4]. These medical VLMs are fine-tuned on generative models using biomedical datasets, allowing the models to assimilate knowledge pertinent to the medical domain, thereby facilitating tasks such as medical diagnostics. The dataset utilized for these medical VLMs is mainly derived from in-vivo diagnostics, such as X-ray and CT scans. Due to the domain gap inherent in a visual model, their diagnostic capabilities for extracorporeal images such as dermatology are relatively limited. Zhou etc al. presented SkinGPT-4[57], which is the world\u2019s first interactive dermatology diagnostic system powered by an advanced visual language model MiniGPT-4. SkinGPT-4 was trained on an extensive collection of skin disease images(comprising 52,929 publicly available and proprietary images) along with clinical concepts and doctor\u2019s notes. The fine-tuned model shows a comprehensive performance in the diagnostic process, user comprehension enhancement, human-centered care, and healthcare equity promotion. 2.3 Explainable AI To satisfy the stringent interpretability requirements of Explainable Artificial Intelligence(XAI), some prior works focus on data explanation so that humans can easily understand them[7, 9, 52, 53]. For example, Chen et al. [9] provided explanatory comments to increase the readability and understandability of the generated code. Wekkeck et al. [52] proposed to explain math theorems by providing detailed derivations. However, these efforts aim to enhance user explainability in specific scenarios by leveraging the language \fACM MM, 2024, Melbourne, Australia Bo Lin, Yingjing Xu, Xuanwen Bao, Zhou Zhao, Zuyong Zhang, Zhouyang Wang, Jie Zhang, Shuiguang Deng, and Jianwei Yin generation capabilities of large language models. Visual information can enhance user interpretability, and SD possesses powerful visual generation capabilities. Therefore, utilizing the strong visual generation abilities of SD is an important approach to enhancing user interpretability. Trust, alignment with clinical needs, and ethical deployment are critical components for successfully integrating these models into healthcare workflows [17]. The medical field prioritizes interpretability, while VLM\u2019s inherent lack of interpretability poses significant challenges to healthcare applications. Previous work in dermatoscopic synthetic data generation through SD to mitigate challenges associated with limited labeled datasets, thereby facilitating more effective model training [2, 11, 25, 26]. Akrout et al. [2] proposed text to image synthesis method for generating high-quality synthetic images of macroscopic skin diseases. Farooq et al. [14] proposed Derm-T2IM that uses natural language text prompts as input and produces high-quality malignant and benign lesion imaging data as the output. 3 DERMATOLOGY DEMONSTRATION GENERATION METHOD 3.1 Dataset This study utilizes two relevant datasets for training the skin disease generation model: Fitzpatrick17k [16] and the recently released SCIN Dataset [50]. Fitzpatrick17k comprises 16,577 clinical images encompassing 114 skin conditions annotated by dermatologists. It also includes discrete labels such as the Fitzpatrick scale, which describes various aspects of skin disease conditions. In contrast, the SCIN Dataset is crowdsourced, collected from 5,000 volunteers, and contains over 10,000 images. SCIN employs a weighted condition labeling system, where a case may be associated with up to 3 skin diseases (conditions). Both datasets exhibit an imbalanced distribution of labels. Fitzpatrick17k\u2019s most frequent condition is psoriasis\u2019 with 653 cases, while the least frequent ispilomatricoma\u2019 with only 52 cases. SCIN demonstrates a similar imbalance. To address this and prepare the data for model training, we sampled three subsets of varying scales: 5-shot, 30-shot, and all. The 5-shot and 30-shot subsets contain random samples across all labels, while the \"all\" dataset encompasses the entirety of the data. For the training data, we extracted primary skin condition labels and associated features from image-caption pairs, as illustrated in Figure 2. We then employed the Blip2 model [24] to augment the captions with detailed descriptions while also retaining an original dataset with only the extracted labels as captions for comparison purposes. As Table 1 illustrates, this data preprocessing resulted in 12 subsets (3 scales x 2 datasets x 2 captioning methods), allowing us to investigate the following: (1) Labeling Method: We compare the effectiveness of single-label annotations (Fitzpatrick17k) versus multi-weight labels (SCIN). (2) Scaling Effect: We analyze the performance across 5-shot, 30-shot, and all datasets to understand the impact of the data scale. (3) Blip Captioning: We assess whether the addition of detailed descriptions through Blip2 improves model performance. Figure 2: Example of an image-caption pair from the training data, where the caption is augmented with a detailed description generated by Blip2 [24]. 3.2 Model Training Adapter-based Fine-tuning. To facilitate skin disease image generation conditioned on specific skin conditions, we employed two adapter-based fine-tuning techniques: LoRA [18] and Image Prompt Adapters (Ip-adapter) [54]. Both methods introduce additional trainable layers that integrate seamlessly into the U-Net [40] and CrossAttention [48] layers of the SD v1.5 [37] image generation pipeline. LoRA Configuration. To investigate the impact of training data volume on model performance, we trained LoRA models using three datasets with varying numbers of samples, as detailed in Table 1. We adjusted the LoRA dimension (dim) according to the dataset size while maintaining consistent hyperparameters across all experiments. These hyperparameters included 20 epochs, a batch size of 2, the AdamW optimizer with 8-bit precision [29], a learning rate of 1\ud835\udc52\u22124, a text encoder learning rate of 5\ud835\udc52\u22125, mixed precision (FP16), and dataset image resolution resized to 512 \u00d7 512 pixels. Table 1: Table of dataset and LoRA parameters Dataset Image counts LoRA dim f17k-5-shot 570 32 f17k-5-shot-blip f17k-30-shot 3470 64 f17k-30-shot-blip f17k-All 16576 128 f17k-All-blip SCIN-5-shot 1547 32 SCIN-5-shot-blip SCIN-30-shot 3341 64 SCIN-30-shot-blip SCIN-All 7798 128 SCIN-All-blip Ip-adapter. Due to limited computational resources, we initially trained LoRA models using all 12 datasets. We conducted experiments to identify the top-performing LoRA model and its corresponding dataset. Subsequently, we trained an Ip-adapter model using the dataset selected from the LoRA training phase. This allowed us to evaluate the skin disease image generation performance of the Ip-adapter model in comparison to the LoRA approach. \fSkinGEN: an Explainable Dermatology Diagnosis-to-Generation Framework with Interactive Vision-Language Models ACM MM, 2024, Melbourne, Australia 3.3 LoRA Evaluation Quantitative analysis. The test dataset consists of 100 imagecaption pairs sampled from the original training dataset. To evaluate the quality and effectiveness of generated skin disease images, we employed three key metrics to measure the similarity between the original and generated image (using only caption paired with original image): (1) CLIP score [36] for assessing semantical similarity, DINOv2 score [34] for evaluating image structure and quality similarity, and Mean Squared Error (MSE) for measuring pixel-level fidelity. Additionally, we calculated the \"blip gain\" as the difference in scores between models utilizing blip captions and those without, providing a direct measure of the impact of blip captions on image generation performance. Evaluation metrics presented in Table 2 reveal that the incorporation of blip captions yields only marginal improvements in skin disease image generation. While the Fitzpatrick17k dataset shows a slight average gain of 0.02 in CLIP score and a 0.2 decrease in MSE (indicating better image quality), DINOv2 scores exhibit a decline, suggesting inconsistencies in the benefits across different metrics. Similarly, the SCIN dataset demonstrates a more pronounced average blip gain of 0.09 in CLIP score and a 0.1 reduction in MSE, but DINOv2 scores remain relatively unchanged. Furthermore, analysis of scaling effects reveals no significant positive trends across either dataset. In fact, models trained on the full datasets, particularly within the Fitzpatrick17k set, exhibit a decline in both CLIP and DINOv2 scores compared to the 30-shot models. This suggests potential issues related to data imbalance or overfitting when utilizing the entire dataset, highlighting the need for further investigation and refinement of training strategies to effectively harness the potential of blip captions and larger datasets in this image generation context. Table 2: Evaluation Metrics for trained LoRA models Model CLIP \u2191 DINOv2 \u2191 MSE \u2193 0-shot 0.61 0.69 2.09 f17k_5shot 0.76 0.81 1.31 f17k_5shot_blip 0.77 0.82 1.32 f17k_30shot 0.76 0.82 1.33 f17k_30shot_blip 0.76 0.82 1.31 f17k_all 0.71 0.77 1.25 f17k_all_blip 0.72 0.76 1.25 blip gain 0.02 -0.1 0.2 scaling effect -0.01 -0.01 -0.25 0-shot 0.63 0.71 2.02 SCIN_5shot 0.71 0.76 1.64 SCIN_5shot_blip 0.75 0.77 1.61 SCIN_30shot 0.74 0.76 1.58 SCIN_30shot_blip 0.76 0.77 1.53 SCIN_all 0.72 0.75 1.62 SCIN_all_blip 0.74 0.76 1.54 blip gain 0.09 0.02 -0.1 scaling effect 0.01 -0.01 -0.01 Qualitative Analysis of Semantic Understanding. To further explore the influence of blip captions on the semantic understanding of our trained models, we conducted a qualitative analysis of generated skin disease images. Figure 3 showcases the results of this analysis. We observed that LoRA models trained with longer training steps (i.e., using larger datasets) exhibited evidence of developing a more nuanced understanding of skin conditions and their presentation. For instance, when generating images using only the label \"Psoriasis\" as the caption, both the \"f17k-30shotblip\" and \"fk17k-all-blip\" LoRA models produced similar outcomes, depicting psoriasis symptoms on the body. However, when the caption was augmented with the additional description \"on her face,\" the models\u2019 behavior diverged. The \"f17k-all-blip\" LoRA model, trained on the full Fitzpatrick17k dataset, seemingly learned from the data distribution that psoriasis is less likely to occur on the face. Consequently, it generated an image with clear skin on the face, aligning with the typical presentation of the condition. In contrast, the \"f17k-30shot-blip\" model, trained on a smaller subset of the data, adhered more directly to the provided caption and generated psoriasis symptoms on the girl\u2019s face, albeit with a milder appearance. These observations suggest that larger models, exposed to a broader range of examples, develop a more comprehensive understanding of disease characteristics and potential variations, enabling them to generate images that are both realistic and consistent with the provided captions. Input Image Masked Image Generated Image (Image2Image Inpaint) Original f17k-30-shot-blip f17k-30-shot-blip f17k-all-blip f17k-all-blip Prompt:{Psoriasis} Prompt:{Psoriasis} Prompt:{Psoriasis, } on her face Prompt:{Psoriasis, } on her face Figure 3: Comparison of skin disease image generation using LoRA models with and without blip captions, showcasing the influence of textual descriptions and training data size on the models\u2019 semantic understanding of disease presentation. Evaluation of Ip-adapter and Adapter Fusion. To assess the efficacy of Ip-adapter and the potential benefits of adapter fusion, we designed a comparative experiment with four conditions, as visualized in Figure 4: (1) LoRA (f17k_30shot_blip), (2) Ip-adapter (0-shot), (3) Ip-adapter (30-shot) fine-tuned on the f17k_30shot_blip dataset for 20,000 steps, and (4) Ip-adapter (30-shot) + LoRA (30shot) representing adapter fusion. Our findings indicate that the fused adapter configuration (condition 4) yielded the most favorable outcomes, generating disease patterns that closely resembled the reference images. Notably, the 0-shot Ip-adapter demonstrated an inherent ability to grasp the task and synthesize skin disease patterns, albeit with less accuracy compared to the fine-tuned and fused models. Surprisingly, the fine-tuned Ip-adapter (30-shot) produced the least desirable results, suggesting potential challenges related to overfitting or optimization during the fine-tuning process. 4 IMPLEMENTATION 4.1 Explainable Framework SkinGEN is a diagnosis assistant in the field of dermatology, which provides a dermatology diagnosis-to-generation solution to increase VLM\u2019s visual explainability to users. For skin diseases that \fACM MM, 2024, Melbourne, Australia Bo Lin, Yingjing Xu, Xuanwen Bao, Zhou Zhao, Zuyong Zhang, Zhouyang Wang, Jie Zhang, Shuiguang Deng, and Jianwei Yin {Irritincontinentia} {Irritincontinentia} Reference Image CAPTION {Irritincontinentia} {Irritincontinentia} {Irritincontinentia} SD Inpaint Ip-adapter 0-shot SD Inpaint Ip-adapter 30-shot SD Inpaint Lora f17k-30shot-blip SD Inpaint Ip-adapter 30-shot Lora f17k-30shot-blip Figure 4: Comparison of Skin Disease Image Generation using Different Adapter Configurations. The figure showcases example outputs from four experimental conditions: (1) LoRA model, (2) 0-shot Ip-adapter, (3) fine-tuned Ip-adapter, and (4) fused Ip-adapter and LoRA model. The results highlight the advantages of adapter fusion in generating disease patterns that closely resemble the reference images. are difficult to distinguish, it utilizes SD to provide visual demonstrations for similar skin diseases to help patients better distinguish between them. As illustrated in Fig. 1, the solution consists of three diagrams: dermatology diagnosis diagram, dermatology masked image generation diagram, and dermatology demonstration generation diagram. In the dermatology diagnosis diagram, we employ SkinGPT-4 to diagnose the uploaded image, obtaining diagnostic outcomes and other potential skin disease results. In the dermatology masked image generation diagram, we first utilize the GroundingDINO model to identify the location of skin disease within the image based on the prompt of skin conditions. Subsequently, the skinSAM model is employed to segment the regions affected by skin diseases, generating a masked image. In the dermatology demonstration generation diagram, Our exploration of adapter methods led to the development of a robust image generation approach. In the subsequent sections, we will delve into the technical details of implementing these three diagrams. 4.2 Dermatology Diagnosis SkinGPT-4 is an interactive system in the field of dermatology designed to provide a natural language-based diagnosis of skin disease images [57]. It was trained on an extensive collection of skin disease images(comprising 52,929 publicly available and proprietary images) along with clinical concepts and doctors\u2019 notes. The architecture of SkinGPT-4 comprises three modules: the visual encoder, the projection layer, and an advanced large language decoder. The visual encoder includes the Vision Transformer(VIT)[12] and Q-Transformer[8], which can encode the input image into image embedding account for the image\u2019s context. The function of the alignment layer is to align the semantics of the text space with the semantics of the image space. The SkinGPT-4 utilizes the Vicuna[51] and Llama[46] as the language decoder, which can perform a wide range of complex linguistic tasks. We utilize SkinGPT-4 to accept dermatology images and questions from users. Upon receiving a query from the user, SkinGPT-4 provides corresponding answers. Fig. 1 shows two examples of SkinGPT-4, it can be observed that SkinGPT-4 possesses knowledge and understanding of dermatological conditions, enabling it to assist patients in making preliminary diagnoses and providing relevant suggestions. Due to the inherent complexity in diagnosing skin diseases, SkinGPT-4 may not always provide entirely accurate diagnostic outcomes; however, it is also capable of generating other possible diagnoses for the given image. The pipeline of skin disease is in Fig. 5. The user uploads an image of skin disease and poses questions, the process by which SkinGPT-4 handles user prompts can be divided into two steps: encoding and decoding. In the process of encoding, the visual encoder extracts vital features and generates an embedding of the image based on the features. The alignment layer synchronizes the visual information and natural language, thus the visual embedding is transformed into an embedding with textual semantics. The input prompt is tokenized by the tokenizer and then it concatenates with the transformed visual embedding. In the processing of decoding, we input the concatenated embedding into Vicuna, which generates the text-based diagnosis. To obtain both the diagnostic result and other possible skin results for the current dermatological image, we designed two tasks as shown in Fig. 5. The first task aims to obtain the diagnostic result of the skin disease in the input image, the prompt designed for the first task is \"Could you diagnose the skin disease in this image for me?\". We aim to obtain the diagnostic result of a skin disease, such as \"acne\". The second task aims to identify other possible skin diseases, the prompt designed for the second task is \"What\u2019s the other possible skin disease in this picture?\". We expect to receive a list containing possible skin disease outcomes, for instance, [\"Atopic dermatitis\", \"Hives or urticaria\", \"Psoriasis\", \"Contact dermatitis\", \"Eczema\"]. 4.3 Dermatology Masked Image Generation To generate masked images of skin disease, we apply the langsegment-anything(lang-SAM) pipeline. Different from the global segmentation tasks the segment anything model(SAM) [20] provided, the lang-SAM can identify and segment the dermatological area by prompt in the skin image. Fig. 6 illustrates the process of dermatology masked image generation. First, we use the GroudingDino model to identify the skin disease region in the uploaded image. GroundingDINO [28] is an object identification model that requires a prompt input, when the prompt is set to a specific skin disease, the GroundingDINO is capable of returning the bounding box indicating the location of the specific skin disease within the current image. After obtaining the bounding box position of the skin disease, we proceed to generate the mask of this image. We \fSkinGEN: an Explainable Dermatology Diagnosis-to-Generation Framework with Interactive Vision-Language Models ACM MM, 2024, Melbourne, Australia Dermatology Diagnosis Diagram SkinGPT-4 Answer2: Sure! Based on the image and possible symptoms visible, here are the other possible skin diseases: atopic dermatitis, hives or urticaria, psoriasis, contact dermatitis, eczema. MiniGPT-4 Vision Encoder Alignment Layer LLM Large Dermatology Dataset Diagnosis VIT & Q-Former Llama or Vicuna Answer1: neutrophilic dermatoses Question1: Could you diagnose the skin disease in this image for me? Question2: What\u2019s the other possible skin disease in this pictures? Figure 5: Dermatology Diagnosis with SkinGPT-4 [57]. input the current skin disease image along with the bounding box information into the skinSAM, it subsequently returns a masked image of the skin disease. GroundingDINO Image with Bounding Box Prompt: neutrophilic dermatoses SkinSAM SAM Diagnosis Large Dermatology Dataset Dermatology Masked Image Generation Diagram Masked Image Figure 6: Dermatology masked image generation diagram with object identification and mask generation. It is noteworthy that the SAM is trained on the SA-1B dataset of 11 million images and 1.1 billion masks, which can understand the visual concepts deeply. To adapt the SAM for skin cancer segmentation tasks better, we employed the skinSAM [19], which is a fine-tuned version of the SAM validated on HAM10000 dataset [47] specifically designed for skin diseases which includes 10015 dermatoscopic images. We downloaded the weights of the skinSAM from Huggingface for our use. Figure 6 provides masked image examples generated by lang-SAM. 4.4 Dermatology Image Generation Building upon the generative model experiments in Section 3, we propose a tailored image generation diagram for dermatology applications, addressing the challenge of generating skin disease images Original Image Masked Image Figure 7: Example of masked images generated by lang-sam from dermatological images. based on user-provided input. The pipeline comprises three key components: (1) Recaptioning: We employ BLIP2 [24] to automatically generate descriptive captions for user-provided images. This step enhances the input information and provides a more informative context for subsequent stages. (2) Case Retrieval: A case retrieval module searches for relevant skin disease cases within a curated database based on the input image label and BLIP2-generated caption. This module aims to identify existing cases with similar characteristics to guide the image generation process. (3) Adapter Manager: This module dynamically selects the appropriate image generation strategy based on the case retrieval results. If relevant cases are found, we utilize a combination of LoRA and IP-Adapter to leverage both textual and visual information from the retrieved cases. In the absence of similar cases, we employ LoRA with a standard text-to-image generation approach using the BLIP2 caption as input. Figure 8 illustrates the overall architecture of the proposed dermatology image generation pipeline. 5 USER STUDY 5.1 Experiment Design To evaluate the effectiveness of different skin disease explanation systems, we conducted an online user study with 32 participants recruited through social media. All participants had agreed to collect data and record the experiment process. The study employed a within-subjects design where each participant interacted with three distinct systems: (1) System 1 (SkinGPT): This system provided plain text explanations of skin conditions generated by the SkinGPT. (2) System 2 (Reference Case Retrieval): This system retrieved and presented visually similar cases from a database of skin disease images along with their corresponding diagnoses. (3) System 3 (SkinGEN): Our proposed SkinGEN system, diagnosed skin conditions based on user-uploaded images and generated personalized visualizations of the identified diseases. The experiment was implemented using a multi-modal chatbot application built with Gradio [1]. Participants engaged in conversations with the chatbot, providing information about their skin \fACM MM, 2024, Melbourne, Australia Bo Lin, Yingjing Xu, Xuanwen Bao, Zhou Zhao, Zuyong Zhang, Zhouyang Wang, Jie Zhang, Shuiguang Deng, and Jianwei Yin Masked Image Psoriasis, a women with red spot on face Psoriasis, a women with red spot on face Dermatology Masked Image Generation Diagram Case retrieval No Caption Caption Reference Image Single LoRA LoRA+Ip-adapter Fitzpatrick17k ... Yes Adapter Manager SD Inpaint Lora f17k-30shot-blip Ip-adapter 30-shot Lora f17k-30shot-blip Found case? BLIP2 Recapting Figure 8: Dermatology image generation diagram with recaptioning, case retrieval, and adapter management modules. concerns and receiving explanations from each system in a randomized order. 5.2 Evaluation of Chatbot Explainability To assess user perceptions of the chatbot system\u2019s explainability, we employed established trust-related metrics inspired by prior work [35, 43]. These metrics focus on evaluating both system and user interface explainability through the lens of user trust. Following interactions with each system, participants completed a questionnaire designed to measure three key constructs: (2) Perceived Trust: The extent to which users felt they could rely on the system\u2019s information and recommendations. (2) Ease of Understanding: The clarity and comprehensibility of the system\u2019s explanations and conversational flow. (3) Cognitive Effort: The mental effort required by users to understand and process the information provided by the system. All participants engaged in interactions with each of the three chatbot systems in a randomized order. During each system test, participants selected a skin disease image online (restricted to 114 labels within the Fitzpatrick17k dataset) and input it into the SkinGEN user interface to initiate a conversation with the chatbot. After each interaction, users rated their experience based on the questions presented in Table 3. 5.3 Result Explainability The user study results, as visualized in Figure 9, provide insights into user perceptions of trust, ease of understanding, and cognitive effort associated with different skin disease explanation systems. System 1, which represents the plain SkinGPT explanation, achieved a moderate level of perceived trust and ease Table 3: System Explainability Evaluation Question Repeated measure (3 conditions) Perceived Trust: I can trust the system. Ease of Understanding: The conversation with the system is easy to understand. Cognitive Effort: I easily found the information I was asking for. Rated once SkinGEN\u2019s diagnosis is correct or relevant. The description provided by SkinGEN is informative. The suggestions offered by SkinGEN are useful. I would be willing to use SkinGEN in the future. The generated skin disease image looks realistic. I find SkinGEN to be a useful system. q1_sys1 q1_sys2 q1_sys3(ours) 1 2 3 4 5 5 Point Likert Scale 3.69 \u00b1 0.74 4.03 \u00b1 0.69 4.09 \u00b1 0.93 Perceived Trust q2_sys1 q2_sys2 q2_sys3(ours) 1 2 3 4 5 3.62 \u00b1 0.87 4.12 \u00b1 0.71 4.38 \u00b1 0.75 Perceived Easy Understanding q3_sys1 q3_sys2 q3_sys3(ours) 1 2 3 4 5 3.59 \u00b1 1.04 4.06 \u00b1 0.67 4.41 \u00b1 0.71 Perceived Cognitive Effort Figure 9: Perceived explainability ratings (Mean \u00b1 SD) for the three explanation systems: SkinGPT (sys1), SkinGPT + reference case retrieval (sys2), and SkinGEN (sys3, ours). of understanding. System 2, based on finding reference cases in a database, showed slightly higher scores in both categories. Notably, System 3 (SkinGEN), our proposed method for diagnosis and skin disease image generation based on user-uploaded images, outperformed both baseline systems across all three metrics. Users perceived SkinGEN explanations as significantly more trustworthy, easier to understand, and requiring less cognitive effort to interpret. This suggests that the ability to generate personalized visualizations of skin conditions based on individual cases resonates with users and enhances their comprehension of the provided information. System Performance. The results of the user questionnaire, summarized in Table 4, demonstrate positive user perceptions of SkinGEN\u2019s performance. Participants generally agreed that SkinGEN\u2019s diagnoses were accurate or relevant (mean = 4.16), the provided descriptions were informative (mean = 4.41), and the suggestions offered were useful (mean = 4.31). Furthermore, users expressed a willingness to utilize SkinGEN in the future (mean = 4.31) and perceived the system as useful overall (mean = 4.38). The visual fidelity of the generated skin disease images also received positive feedback (mean = 4.16), indicating that users found the images to be realistic. These findings suggest that SkinGEN effectively addresses user needs in understanding and visualizing skin conditions, fostering trust and confidence in the system\u2019s capabilities. 6 DISCUSSION&"
|
| 19 |
+
}
|
abs_9K/validation_abstract_short_2404.14757v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14757v1",
|
| 3 |
+
"title": "Integrating Mamba and Transformer for Long-Short Range Time Series Forecasting",
|
| 4 |
+
"abstract": "Time series forecasting is an important problem and plays a key role in a\nvariety of applications including weather forecasting, stock market, and\nscientific simulations. Although transformers have proven to be effective in\ncapturing dependency, its quadratic complexity of attention mechanism prevents\nits further adoption in long-range time series forecasting, thus limiting them\nattend to short-range range. Recent progress on state space models (SSMs) have\nshown impressive performance on modeling long range dependency due to their\nsubquadratic complexity. Mamba, as a representative SSM, enjoys linear time\ncomplexity and has achieved strong scalability on tasks that requires scaling\nto long sequences, such as language, audio, and genomics. In this paper, we\npropose to leverage a hybrid framework Mambaformer that internally combines\nMamba for long-range dependency, and Transformer for short range dependency,\nfor long-short range forecasting. To the best of our knowledge, this is the\nfirst paper to combine Mamba and Transformer architecture in time series data.\nWe investigate possible hybrid architectures to combine Mamba layer and\nattention layer for long-short range time series forecasting. The comparative\nstudy shows that the Mambaformer family can outperform Mamba and Transformer in\nlong-short range time series forecasting problem. The code is available at\nhttps://github.com/XiongxiaoXu/Mambaformerin-Time-Series.",
|
| 5 |
+
"authors": "Xiongxiao Xu, Yueqing Liang, Baixiang Huang, Zhiling Lan, Kai Shu",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.LG",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.LG",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Mamba",
|
| 15 |
+
"gt": "Time series forecasting is an important problem and plays a key role in a\nvariety of applications including weather forecasting, stock market, and\nscientific simulations. Although transformers have proven to be effective in\ncapturing dependency, its quadratic complexity of attention mechanism prevents\nits further adoption in long-range time series forecasting, thus limiting them\nattend to short-range range. Recent progress on state space models (SSMs) have\nshown impressive performance on modeling long range dependency due to their\nsubquadratic complexity. Mamba, as a representative SSM, enjoys linear time\ncomplexity and has achieved strong scalability on tasks that requires scaling\nto long sequences, such as language, audio, and genomics. In this paper, we\npropose to leverage a hybrid framework Mambaformer that internally combines\nMamba for long-range dependency, and Transformer for short range dependency,\nfor long-short range forecasting. To the best of our knowledge, this is the\nfirst paper to combine Mamba and Transformer architecture in time series data.\nWe investigate possible hybrid architectures to combine Mamba layer and\nattention layer for long-short range time series forecasting. The comparative\nstudy shows that the Mambaformer family can outperform Mamba and Transformer in\nlong-short range time series forecasting problem. The code is available at\nhttps://github.com/XiongxiaoXu/Mambaformerin-Time-Series.",
|
| 16 |
+
"main_content": "INTRODUCTION Time series forecasting is an important problem and has been widely used in many real-world scenarios, including weather forecast [1], stock market [27], and scientific simulations [38]. For example, in scientific simulation, researcher are interested in building a surrogate model built on machine leaning model to forecast behaviors of supercomputer across timescales to accelerate simulations, thus bypassing billion even trillion events [9]. Deep learning models, especially Transformer-based models, have achieved progress in time series forecasting. Benefiting from the attention mechanism, Transformers can achieve great advantages and depict pairwise dependencies in time series data. However, recent research [41] has questioned the validity of Transformerbased forecaster with a linear model. Although the effectiveness of Transformer-based models are proven in later work [20, 22], the quadratic complexity of attention mechanism is still computationally challenging. When inferring next-token, the transformer has to find relationships in sequences from all past tokens. Albeit effective, such expensive computation is prohibitive for long distance and limit Transformers to short-range time series forecasting. An emerging body of research suggests that State Space Models (SSMs) [11\u201314, 33] have shown promising progress in sequence modeling problem. As a representative SSM model, Mamba achieves comparable performance with Transformer in language modeling while enjoys a linear-time complexity. On the performance side, Mamba introduces a selective mechanism to remember relevant information and filter out irrelevant information indefinitely. On the computation side, Mamba implements a hardware-aware algorithm for parallel training like a CNN and can be regarded as a RNN for linear-time inference. Considering the above two advantages, Mamba is exceptional in handling long-range time series data. Recent findings show that SSMs and Transformers are complementary for language modeling [10, 17, 23]. We are interested in if the observation is consistent in time series data. In this work, we propose to leverage a hybrid architecture Mambaformer [23] that internally integrates strengths of Transformer and Mamba for long-short range series forecasting. The comparative experiments demonstrate that the Mambaformer family can integrate advantages of Mamba and Transformer, thus facilitating time series forecasting. To summarize, our contributions are as follows: \u2022 We are the first to explore the potential of the integration of Mamba and Transformer in time series. \u2022 We propose to adopt a hybrid architecture Mambaformer to capture long-short range dependencies in time series. \u2022 We conduct a comparative study to demonstrate the superiority of Mambaformer family compared with Mamba and Transformer in long-short range time series forecasting. 2 RELATED WORK 2.1 Time Series Forecasting Time series forecasting research has existed for a long time. The earlier researchers leverage statistical and traditional machine learning methods such as ARIMA [3], simple neural network [6], and support vector machine [15], to forecast road traffic. However, these approaches are relatively weak due to their oversimplified assumptions and limited representation capabilities. Although more expressive deep leaning models including RNN [8] and LSTM [40] are utilized to model time series data, they fall short into gradient vanishing problem [30] when dealing with long-range sequences. Inspired from the success of Transformer [31] models in text data, a variety of variants of Transformer [16, 19, 20, 22, 35, 36, 42, 43] have proven effective in time series data. For example, the latest iTransformer [20] that simply applies the attention and feed-forward network on the inverted dimensions achieve SOTA performance. arXiv:2404.14757v1 [cs.LG] 23 Apr 2024 \fAdditionally, recent work [2, 24, 28, 34] based on SSMs proposes to leverage Mamba for time series forecasting. For instance, TimeMachine [2] utilize four Mamba blocks to capture long range dependency in multivariate time series data. Different from the previous work, our paper makes the first attempt to combine transformer and Mamba for time series forecasting. 2.2 State Space Models and Mamba State Space Models (SSMs) [11\u201314, 33] emerge as a promising class of architectures for sequence modeling. S4 is a structured SSM where the specialized Hippo [12] structure is imposed on the matrix A to capture long-range dependency. Building upon S4, Mamba [11] designs a selective mechanism to filter out irrelevant information, and a hardware-aware algorithm for efficient implementation. Benefiting from the designs, Mamba has achieve impressive performance across modalities such as language, audio, and genomics while requiring only linear complexity on the sequence length, thus potentially an alternative of Transformer. Benefiting form its modeling capability and scalability, Mamba has recently shown significant progress in various communities, such as computer vision [29, 44], medical [21, 37], graph [4, 32] and recommendation [18, 39]. A noteworthy line of research is to combine the Transformer and Mamba for the purpose of language modeling [10, 17, 23]. A comparative study [23] shows Mambaformer is effective in in-context learning tasks. Jamba [17] is the first production-grade attention-SSM hybrid model with 12B active and 52B total available parameters, and shows desirable performance for long context. We are interested in if the observation is consistent in time series data and propose to adapt Mambaformer for time series forecasting. 3 PRELIMINARIES 3.1 Problem Statement In the long-short range time series forecasting problem, given historical time series samples with a look-back window L = (x1, x2, .., x\ud835\udc3f) with length \ud835\udc3f, where each x\ud835\udc61\u2208R\ud835\udc40at time step \ud835\udc61is with \ud835\udc40variates, we aim to forecast \ud835\udc39future values F = (x\ud835\udc3f+1, x\ud835\udc3f+2, .., x\ud835\udc3f+\ud835\udc39) with length \ud835\udc39. Besides, the associated temporal context information (c1, c2, .., c\ud835\udc3f) with dimension \ud835\udc36is assumed to be known [16], e.g. day-of-the-week and hour-of-the-day. Note that the work is under the rolling forecasting setting [42] where upon the completion of a forecast for F , the look-back window B moves forward \ud835\udc39steps towards the future so that models can do a next forecast. 3.2 State Space Models The State Space Model (SSM) is a recent class of sequence modeling framework that are broadly related to RNNs, and CNNs, and classical state space models [14]. S4 [13] and Mamba [11] are two representative SSMs, and they are inspired by a continuous system that maps an input function or sequence \ud835\udc65(\ud835\udc61) \u2208R to an output function or sequence \ud835\udc66(\ud835\udc61) \u2208R through an implicit latent state \u210e(\ud835\udc61) \u2208R\ud835\udc41as follows: \u210e\u2032(\ud835\udc61) = A\u210e(\ud835\udc61) + B\ud835\udc65(\ud835\udc61) \ud835\udc66(\ud835\udc61) = C\u210e(\ud835\udc61) (1) \ud835\udc3f\u00d7 Mambaformer Layer Mamba Pre-Processing Block Forecasting Layer Outputs Embedding Layer Masked Multi-head Attention Add & Norm Mamba Block Add & Norm Mamba Block SSM Linear Conv \ud835\udf0e \u00d7 \ud835\udf0e Linear Linear Inputs Temporal Encoding Token Encoding Mamba Block Add & Norm Figure 1: The overview of the Mambaformer. where A \u2208R\ud835\udc41\u00d7\ud835\udc41, B \u2208R\ud835\udc41\u00d71, and C \u2208R1\u00d7\ud835\udc41are learnable matrices. SSM can be discretized from continuous signal into discrete sequences by a step size \u0394. The discretized version is as follows: \u210e\ud835\udc61= A\u210e\ud835\udc61\u22121 + B\ud835\udc65\ud835\udc61 \ud835\udc66= C\u210e\ud835\udc61 (2) where discrete parameters (A, B) can be obtained from continuous parameters (\u0394, A, B) through a discretization rule, such as zeroorder hold (ZOH) rule A = exp(\u0394A), B = exp(\u0394A)\u22121(exp(\u0394A) \u2212 I)\u00b7\u0394B. After discretization, the model can be computed in two ways, either as a linear recurrence for inference as shown in Equation 2, or as a global convolution for training as the following Equation 3: K = (CB, CAB, ..., CA\ud835\udc58B, ...) \ud835\udc66= \ud835\udc65\u2217K (3) where K is a convolutional kernel. 4 METHODOLOGY 4.1 Overview of Mambaformer Inspired by advantages of the hybrid architectures in language modeling [23], we propose to leverage Mambaformer to integrate Mamba and Transformer to capture long-short range dependencies in time series data, leading to enhanced performance. Mambaformer adopts a decoder-only style as GPT [5, 25, 26] family. 4.2 Embedding Layer We utilize an embedding layer to map the low-dimension time series data into a high-dimensional space, including token embedding 2 \fand temporal embedding. Token Embedding. To convert raw time series data into highdimensional tokens, we utilize a one-dimensional convolutional layer as a token embedding module because it can retain local semantic information within the time series data [7]. Temporal Embedding. Besides numerical value itself in the sequence, temporal context information also provides informative clues, such as hierarchical timestamps (week, month and year) and agnostic timestamps (holidays and events) [41]. We employ a linear layer to embed temporal context information. Formally, let X \u2208R\ud835\udc35\u00d7\ud835\udc3f\u00d7\ud835\udc40denote input sequences with batch size \ud835\udc35and C \u2208R\ud835\udc35\u00d7\ud835\udc3f\u00d7\ud835\udc36denote the associated temporal context. The embedding layer can be expressed as follows: E = \ud835\udc38\ud835\udc61\ud835\udc5c\ud835\udc58\ud835\udc52\ud835\udc5b(X) + \ud835\udc38\ud835\udc61\ud835\udc52\ud835\udc5a(C) (4) where E \u2208R\ud835\udc35\u00d7\ud835\udc3f\u00d7\ud835\udc37is output embedding, \ud835\udc37is the dimension of the embedding, \ud835\udc38\ud835\udc61\ud835\udc5c\ud835\udc58\ud835\udc52\ud835\udc5band \ud835\udc38\ud835\udc61\ud835\udc52\ud835\udc5adenote toke embedding layer and temporal embedding layer, respectively. Note that we do not need a positional embedding typically existing in Transformer model. Instead, a Mamba pre-processing block introduced in the next subsection is leveraged to internally incorporate positional information to the embedding. 4.3 Mamba Pre-Processing Layer To endow the embedding with positional information, we preprocess the sequence by a Mamba block to internally embed order information of input tokens. Mamba can be regarded as a RNN where the hidden state \u210e\ud835\udc61at current time \ud835\udc61is updated by the hidden state \u210e\ud835\udc61\u22121 at previous time \ud835\udc61\u22121 as shown in the Equation 2. Such recurrence mechanism to process tokens enables Mamba naturally consider order information of sequences. Therefore, unlike positional encoding being an essential component in Transformer, Mambaformer replace positional encoding by a Mamba pre-processing block. The Mamba pre-processing block can be expressed as follows: H1 = \ud835\udc40\ud835\udc4e\ud835\udc5a\ud835\udc4f\ud835\udc4e(E) (5) where H1 \u2208R\ud835\udc35\u00d7\ud835\udc3f\u00d7\ud835\udc37is a mixing vector including token embedding, temporal embedding, and positional information. 4.4 Mambaformer Layer The core Mambaformer layer interleaves Mamba layer and selfattention layer to combine advantages of Mamba and Transformer to facilitate long-short range time series forecasting. Attention Layer. To inherit impressive performance of depicting short-range time series dependencies in the transformer, we leverage masked multi-head attention layer to obtain correlations between tokens. In particular, each head \ud835\udc56= 1, 2, ...,\u210ein the attention layer transforms the embedding H1 into queries Q\ud835\udc56= H1W\ud835\udc44 \ud835\udc56, keys K\ud835\udc56= H1W\ud835\udc3e \ud835\udc56, and values V\ud835\udc56= H1W\ud835\udc49 \ud835\udc56, where W\ud835\udc44 \ud835\udc56 \u2208R\ud835\udc37\u00d7\ud835\udc51\ud835\udc58, W\ud835\udc3e \ud835\udc56\u2208R\ud835\udc37\u00d7\ud835\udc51\ud835\udc58\u2208, and W\ud835\udc49 \ud835\udc56\u2208R\ud835\udc37\u00d7\ud835\udc51\ud835\udc63are learnable matrices. Afterwards, a scaled dot-product attention is utilized: O\ud835\udc56= \ud835\udc34\ud835\udc61\ud835\udc61\ud835\udc52\ud835\udc5b\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b(Q\ud835\udc56, K\ud835\udc56, V\ud835\udc56) = \ud835\udc60\ud835\udc5c\ud835\udc53\ud835\udc61\ud835\udc5a\ud835\udc4e\ud835\udc65( Q\ud835\udc56K\ud835\udc47 \ud835\udc56 \u221a\ufe01 \ud835\udc51\ud835\udc58 )Vi (6) where the outputs O\ud835\udc56of each head are concatenated into a output vector O with the embedding dimension \u210e\ud835\udc51\ud835\udc63. Following a learnable projection matrix W\ud835\udc42\u2208R\u210e\ud835\udc51\ud835\udc63\u00d7\ud835\udc37, the output of attention layer H2 = OW\ud835\udc42\u2208R\ud835\udc35\u00d7\ud835\udc3f\u00d7\ud835\udc37. We adopt the masking mechanism to prevent positions from attending to subsequent positions, and set \ud835\udc51\ud835\udc58= \ud835\udc51\ud835\udc63= \ud835\udc37/\u210efollowing vanilla Transformer setting [31]. Mamba Layer. To overcome computational challenges of the Transformer and be beyond the performance of Transformer, we incorporate the Mamba layer into the model to enhance the capability of capturing long-range time series dependency. As shown in Figure 1, Mamba block is a sequence-sequence module with the same dimension of input and output. In particularly, Mamba takes an input H2 and expand the dimension by two input linear projection. For one projection, Mamba processes the expanded embedding through a convolution and SiLU activation before feeding into the SSM. The core discretized SSM module is able to select input-dependent knowledge and filter out irrelevant information. The other projection followed by SiLU activation, as a residual connection, is combined with the output of the SSM module through a multiplicative gate. Finally, Mamba delivers output H3 \u2208R\ud835\udc35\u00d7\ud835\udc3f\u00d7\ud835\udc37through an output linear projection. 4.5 Forecasting Layer At this layer, we obtain forecasting resulting by a linear layer to convert high-dimension embedding space into original dimension of time series data as follows: b X = \ud835\udc3f\ud835\udc56\ud835\udc5b\ud835\udc52\ud835\udc4e\ud835\udc5f(H3) (7) where b X \u2208R\ud835\udc35\u00d7\ud835\udc3f\u00d7\ud835\udc40denotes forecasting results. 5 EXPERIMENTS 5.1 Datasets and Evaluation Metrics Datasets. To evaluate the Mambaformer family, we adopt three popular real-world datasets [41], including ETTh1, Electricity, and Exchange-Rate. All of them belong to multivariate time series. The statistics of the datasets are summarized in Table 1. Table 1: The statistics of three real-world time series datasets. Datasets ETTh1 Electricity Exchange_Rate Variates 7 321 8 Timestamps 17,420 26,304 7,588 Metrics. We use the MSE (Mean Square Error) and MAE (Mean Absolute Error) metrics [41] to assess the Mambaformer family. 5.2 Mambaformer Family As shown in Figure 2, we conduct a comparative study to investigate hybrid structures of Mamba and Transformer [23]. Particularly, we interleave Mamba layer and attention layer in different orders and compare them with Mamba and transformer. The structures of Mambaformer family are as follows: \u2022 Mambaformer utilizes a pre-processing Mamba block and Mambaformer layer without a positional encoding. \u2022 Attention-Mamba Hybrid leverages a Attention-Mamba layer where an attention layer is followed by a Mamba layer with a positional encoding. 3 \fTemporal Encoding Token Encoding \u00d7\ud835\udc3f Mamba Layer Attention Layer Mamba Layer (a) Mambaformer \u00d7\ud835\udc3f Temporal Encoding Token Encoding Positional Encoding Attention Layer Mamba Layer (b) Attention-Mamba Hybrid \u00d7\ud835\udc3f Temporal Encoding Token Encoding Mamba Layer Attention Layer (c) Mamba-Attention Hybrid \u00d7\ud835\udc3f Temporal Encoding Token Encoding Mamba Layer Mamba Layer (d) Mamba \u00d7\ud835\udc3f Temporal Encoding Token Encoding Positional Encoding Attention Layer Feed Forward (e) Transformer Figure 2: The structures of Mambaformer family and Mamba and Transformer. For illustration, we ignore the residual connections and layer normalization associated with Mamba layer, attention layer, and feed forward layer in the figure. \u2022 Mamba-Attention Hybrid adopts a Mamba-Attention layer where a Mamba block layer is followed by an attention layer without a positional encoding. The other models in Figure 2 are as follows: \u2022 Mamba leverages two Mamba block as a layer. \u2022 Transformer is a decoder-only Transformer architecture. Positional encoding is optional in the above architectures because Mamba layer internally consider positional information while Transformer does not. For Mambaformer family, if a Mamba layer is before an attention layer, the model does not need a positional encoding; if not, the model needs a positional encoding. 5.3 Comparative Performance We shown the comparative performance of Mambaformer and Mamba and Transformer in Table 2. Accordingly, we have the following observations: \u2022 Mambaformer achieves superior performance compared to Mamba and Transformer. It demonstrates Mambaformer can integrate the strength of Mamba and Transformer, and capture both shortrange and long-range dependencies in time series data, thus outperforming them. The observations are consistent with a largescale hybrid mamba-transformer language model Jamba [17]. \u2022 Mambaformer obtains the best performance in Mambaformer family. It further shows the reasonable design of Mambaformer. Compared to the attention-mamba hybrid architecture, Mambaformer can get the better performance. It demonstrates Mamba layer can pre-process time series data and internally provide positional information, eliminating explicit positional encoding. \u2022 The performance of attention-mamba hybrid is comparable to mamba-attention hybrid. It indicates the order to interleave Mamba layer and attention layer does not cause significant impact on performance of long-short range time series forecasting. Table 2: Multivariate time series forecasting results of the comparative study. The values are averaged for multiple forecasting lengths \ud835\udc39\u2208{96, 192, 336, 720} where 96 and 192 correspond to short-range forecasting, and 336 and 720 correspond to long-range forecasting. The length of look-back window is fixed at \ud835\udc3f= 196. The best results are in bold and the second best results are underlined. Methods ETTh1 Electricity Exchange MSE MAE MSE MAE MSE MAE Mambaformer 0.962 0.721 0.317 0.386 1.878 1.123 Attention-Mamba 0.995 0.792 0.349 0.409 2.029 1.126 Mamba-Attention 0.973 0.727 0.327 0.404 2.317 1.238 Mamba 1.417 0.914 0.322 0.400 2.423 1.174 Transformer 0.991 0.790 0.355 0.414 2.173 1.165 6 DISCUSSION This paper first investigates the potential of hybrid Mamba-Transformer architecture in time series data. We propose to utilize a Mambaformer architecture for long-short range time series forecasting. We conduct a comparative study to investigate various combinations of Mamba and Transformer. The results show Mambaformer family can integrate advantages of Mamba and Transformer, thus outperforming them in long-short range time series forecasting. This work adapts Mambaformer for time series data, but does not compare with SOTA methods in time series forecasting. Future directions include (1) proposing a new hybrid Mamba-Transformer architecture specifically for long-short range time series forecasting and achieving SOTA results on comprehensive datasets, (2) scaling to large-scale hybrid Mamba-Transformer architecture specifically for long-short range time series forecasting, and (3) investigating combinations of Transformer and other sequence modeling frameworks with subquadratic complexity in time series data. 4"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14759v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14759v1",
|
| 3 |
+
"title": "Unified Unsupervised Salient Object Detection via Knowledge Transfer",
|
| 4 |
+
"abstract": "Recently, unsupervised salient object detection (USOD) has gained increasing\nattention due to its annotation-free nature. However, current methods mainly\nfocus on specific tasks such as RGB and RGB-D, neglecting the potential for\ntask migration. In this paper, we propose a unified USOD framework for generic\nUSOD tasks. Firstly, we propose a Progressive Curriculum Learning-based\nSaliency Distilling (PCL-SD) mechanism to extract saliency cues from a\npre-trained deep network. This mechanism starts with easy samples and\nprogressively moves towards harder ones, to avoid initial interference caused\nby hard samples. Afterwards, the obtained saliency cues are utilized to train a\nsaliency detector, and we employ a Self-rectify Pseudo-label Refinement (SPR)\nmechanism to improve the quality of pseudo-labels. Finally, an adapter-tuning\nmethod is devised to transfer the acquired saliency knowledge, leveraging\nshared knowledge to attain superior transferring performance on the target\ntasks. Extensive experiments on five representative SOD tasks confirm the\neffectiveness and feasibility of our proposed method. Code and supplement\nmaterials are available at https://github.com/I2-Multimedia-Lab/A2S-v3.",
|
| 5 |
+
"authors": "Yao Yuan, Wutao Liu, Pan Gao, Qun Dai, Jie Qin",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Distillation",
|
| 14 |
+
"gt": "Recently, unsupervised salient object detection (USOD) has gained increasing\nattention due to its annotation-free nature. However, current methods mainly\nfocus on specific tasks such as RGB and RGB-D, neglecting the potential for\ntask migration. In this paper, we propose a unified USOD framework for generic\nUSOD tasks. Firstly, we propose a Progressive Curriculum Learning-based\nSaliency Distilling (PCL-SD) mechanism to extract saliency cues from a\npre-trained deep network. This mechanism starts with easy samples and\nprogressively moves towards harder ones, to avoid initial interference caused\nby hard samples. Afterwards, the obtained saliency cues are utilized to train a\nsaliency detector, and we employ a Self-rectify Pseudo-label Refinement (SPR)\nmechanism to improve the quality of pseudo-labels. Finally, an adapter-tuning\nmethod is devised to transfer the acquired saliency knowledge, leveraging\nshared knowledge to attain superior transferring performance on the target\ntasks. Extensive experiments on five representative SOD tasks confirm the\neffectiveness and feasibility of our proposed method. Code and supplement\nmaterials are available at https://github.com/I2-Multimedia-Lab/A2S-v3.",
|
| 15 |
+
"main_content": "Introduction Salient object detection (SOD) aims to identify the most visually significant objects in images. Supervised SOD methods have achieved excellent results, but due to their heavy reliance on pixel-level annotations for salient objects, unsupervised SOD (USOD) has been gaining increasing attention. USOD not only eliminates the need for annotated data but also exhibits strong generalization performance when applied to other tasks [Niu et al., 2021; Wu et al., 2021]. Traditional SOD methods rely heavily on hand-crafted features, such as color and contrast, for saliency extraction. Although these methods prove effective for simple scenes, they encounter difficulties in complex scenes due to the absence of high-level semantic information. Existing \u2217Corresponding author Deep Network Pre-trained Saliency Cue Extractor Knowledge Transfer RGB/D/T SOD Video/Remote Sensing SOD Knowledge Transfer Figure 1: The proposed framework includes two types of knowledge transfer: (1) From pre-trained deep network to saliency cue extractor; (2) From Natural Still Image (NSI) SOD to non-NSI SOD. deep learning-based USOD methods [Nguyen et al., 2019; Zhang et al., 2018] mostly utilize the predictions generated by traditional SOD methods as saliency cues and incorporate semantic information to generate refined saliency predictions. Recently, based on the observation that CNNs pre-trained on large-scale data usually produce high activations on some primary objects, A2S [Zhou et al., 2023a] have developed a method to distill saliency from the activation maps of deep networks and generate high-quality pseudo-labels. However, we found that during the initial training phase, the presence of hard samples in complex scenes or along object boundaries results in the accumulation of irreparable errors. Unsupervised SOD is generally considered to exhibit strong generalization and transferability due to its annotationfree nature. However, prevailing USOD methodologies predominantly focus on the Natural Still Image (NSl) domain, exemplified by RGB, RGB-D, and RGB-T. Consequently, USOD on non-NSI domain, encompassing video SOD and Remote Sensing Image (RSI) SOD, remains largely unexplored, presenting a notable research gap in the field. We believe that different SOD tasks share common knowledge, and exploiting this shared knowledge can benefit transfer performance. On the other hand, compared to NSI SOD, the available datasets for video SOD or RSI SOD are relatively small arXiv:2404.14759v1 [cs.CV] 23 Apr 2024 \fand burdensome to obtain. As a result, training models from scratch on these tasks to obtain satisfactory performance is currently deemed impractical. Therefore, we advocate for the investigation of a more universally applicable unsupervised saliency knowledge transfer method. To address the aforementioned issues, we design a unified framework for generic unsupervised SOD tasks. Firstly, we propose the Progressive Curriculum Learning-based Saliency Distilling (PCL-SD) mechanism to guide the extraction of saliency cues. At the early stages of training, we only extract preliminary saliency cues from easy samples. As the training progresses, we progressively incorporate hard samples to mine deeper saliency knowledge. The employment of PCL-SD effectively mitigates the initial accumulation of errors, leading to a more stable and robust training process. Next, we utilize the obtained saliency cues to train a saliency detector and design a Self-rectify Pseudo-label Refinement (SPR) mechanism to improve the quality of pseudo-labels. On one hand, the proposed SPR employs the saliency predictions of the model during training to rectify incorrect predictions within the pseudo-labels. On the other hand, it incorporates the prior knowledge of the input image to prevent the model from becoming complacent. The SPR mechanism demonstrates a strong capability in self-supervised learning, resulting in improved pseudo-label quality. Finally, we devise an adapter-tuning method to transfer the acquired saliency knowledge to non-NSI SOD tasks, such as video SOD and RSI SOD. Specifically, we selectively fine-tune the deep features, ensuring effective adaptation of the model to the target task while mitigating the risk of model degradation. Our main contributions can be summarized as follows: \u2022 We propose the Progressive Curriculum Learning-based Saliency Distilling (PCL-SD) mechanism to extract saliency cues from easy samples to hard ones. \u2022 We design the Self-rectify Pseudo-label Refinement (SPR) mechanism to gradually improve the quality of pseudo-labels during the training process. \u2022 We devise an adapter-tuning method to transfer saliency knowledge from NSI SOD to non-NSI SOD tasks, achieving impressive transfer performance. Note that we are the first to consider knowledge transfer from NSI domain to non-NSI domain, and develop a unified framework for generic USOD tasks. Experiments on RGB, RGBD, RGB-T, video SOD and RSI SOD benchmarks confirm the state-of-the-art USOD performance of our method. 2 Related Works 2.1 Unsupervised Salient Object Detection Traditional SOD methods rely on hand-crafted features to extract saliency cues. For instance, [Perazzi et al., 2012] estimates saliency by evaluating the contrast in uniqueness and spatial distribution within the image. [Jiang et al., 2011] employ a combination of bottom-up salient stimuli and objectlevel shape prior to segment salient objects. Although these approaches perform well in simple scenes, they face challenges in handling complex scenes due to the lack of highlevel semantic information. Existing deep learning-based methods for USOD typically involve two stages. In the first stage, pseudo-labels are obtained, while in the second stage, a network is trained using these pseudo-labels. For instance, [Zhang et al., 2017] fuses multiple noisy saliency cues to generate supervisory signals for training the deep salient object detector. In [Nguyen et al., 2019], a set of refinement networks are initially trained to enhance the quality of these saliency cues, and the refined pseudo-labels are subsequently utilized to train a saliency detector. A more recent approach, A2S [Zhou et al., 2023a], proposes a method to distill saliency from the activation maps of deep networks, achieving high-quality pseudo-labels. 2.2 Knowledge Transfer in SOD Knowledge transfer involves applying models or features trained in one task or domain to another related task or domain. A typical example is fine-tuning a deep network that was pre-trained on large-scale data for a specific target task. However, the exploration of knowledge transfer across different SOD tasks remains insufficient. Among the limited studies, [Fu et al., 2022] addresses the RGB-D SOD task as a few-shot learning problem and enhances performance by incorporating knowledge from RGB SOD. [Zhou et al., 2023b] employs data from multiple SOD tasks to train a generalized saliency detector. Nevertheless, when extending to generic SOD tasks, the inherent gap between various SOD tasks can impede effective model training. Consequently, it becomes crucial to devise a knowledge transfer approach that is rooted in shared knowledge. 3 Proposed Method Figure 2 illustrates the proposed two-stage framework. In stage 1, we train a saliency cue extractor (SCE) to transfer saliency knowledge from a pre-trained deep network. The proposed Progressive Curriculum Learning-based Saliency Distilling is employed to mitigate the initial accumulation of errors in training and ensure the stability and robustness of the training process. In stage 2, we utilize the obtained saliency cues as initial pseudo-labels to train a saliency detector (SD). CRF [Kr\u00a8 ahenb\u00a8 uhl and Koltun, 2011] is adopted to enhance the initial pseudo-labels, and we employ the proposed Self-rectify Pseudo-label Refinement mechanism to improve pseudo-labels quality during the training process gradually. Initially, we train our base model on Natural Still Image (NSI) SOD and subsequently transfer the model to non-NSI SOD tasks. Throughout the training of the base model, we combine all the NSI data for training. However, during the transfer process, we only employ task-specific data for training. For example, when migrating to video SOD, we solely utilize video frames and optical flow as input. The transfer process also follows a two-stage training approach, while we applied the proposed fine-tuning method to optimize the SCE instead of training it from scratch. Besides, ResNet-50 [He et al., 2016] pre-trained by MoCo-v2 [Chen et al., 2020], A2S [Zhou et al., 2023a] and MIDD [Tu et al., 2021] are employed as the pre-trained deep network, SCE, and SD, respectively. A more detailed description and explanation can be found in supplementary materials. \fSaliency Cue\u00a0 Extractor Saliency Detector Stage 1: Saliency Cue Distilling Stage 2: Saliency Detector Training RGB RGB/D/T MoCo Pre-trained Saliency Cue\u00a0 Extractor MoCo Pre-trained Adapter trained weights NSI SOD video SOD/ RSI SOD PCL-SD SPR Saliency Detector video frame/RSI optical flow/RSI MoCo Pre-trained MoCo Pre-trained MoCo Pre-trained MoCo Pre-trained Learnable Frozen CRF Figure 2: Overview of the proposed method. The left side represents the training process on NSI SOD, while the right side shows the training process of transferring to non-NSI SOD tasks. Saliency Cue\u00a0 Extractor easy samples hard samples Training process discard discard Gradient Feedback Gradient Feedback Gradient Feedback Figure 3: Illustration of the proposed PCL-SD. Hard samples are progressively incorporated as the training progresses. 3.1 Progressive Curriculum Learning-based Saliency Distilling The problem of obtaining saliency cues or extracting salient information from scratch has always been a challenge for unsupervised salient object detection methods. Earlier deep learning-based methods [Zhang et al., 2017] relied on noisy saliency cues generated by traditional SOD methods, while approaches like A2S [Zhou et al., 2023a] employ the activation maps produced by a pre-trained network as saliency cues. This method effectively extracts the saliency information embedded in the pre-trained network. However, at the early stages of training, hard samples in complex scenes may corrupt the fragile saliency patterns in the network, leading to irreparable accumulation errors and the risk of pattern collapse. To address this issue, we introduce the concept of curriculum learning into saliency distilling and propose Progressive Curriculum Learning-based Saliency Distilling (PCL-SD). As can be seen in Figure 3, the proposed PCL-SD rigidly excludes hard samples at the early stages of training and gradually incorporates them as training progresses. As a result, the model progressively extracts saliency knowledge from easy to hard samples, and the entire training process becomes more robust and stable. The process of saliency distilling can be formulated as: Lsal = 0.5 \u22121 N N X i \u2225S(i) \u22120.5| (1) Here, N represents the number of pixels, and S(i) denotes pixel i in the saliency prediction S output by the saliency cue extractor (SCE). To be intuitively described, Lsal pulls the predicted values of each pixel towards either 0 or 1. However, during the early stages of training, Lsal may pull hard samples with values close to 0.5 in the wrong direction, which we refer to as the problem of error accumulation. The proposed PCL-SD strategy focuses on two essential aspects: (1) how to define hard samples, and (2) how to gradually incorporate them. Firstly, the determination of a pixel in the saliency prediction S as a hard sample is based on its prediction value. Specifically, a pixel S(i) is classified as a hard sample if |S(i) \u22120.5| < p. (2) Here, p is the threshold for dividing hard samples, with a larger p indicating more hard samples are divided. Secondly, the value of p is initially set as 0.2 and progressively decreased during the training process until all samples are included. This decrease is governed by the formula: p = Max(0, 0.2 \u22120.6 \u00d7 Ec/Et), (3) where Ec and Et denote current epoch and total epoch, respectively. Finally, we define PCL-SD as: M(i) = \u001a 0 if |S(i) \u22120.5| < p, 1 otherwise, Lpcl\u2212sd = 0.5 \u22121 N N X i |M(i) \u2299S(i) \u22120.5| (4) where \u2299denotes the Hadamard product for matrices. 3.2 Self-rectify Pseudo-label Refinement Obtaining high-quality pseudo-labels is crucial for training a saliency detector (SD). On the other hand, as shown in Figure 4, the saliency prediction S output by SD can partially rectify errors within the pseudo-labels. We define saliency prediction as posterior rectification: Rpost = S. However, while this posterior rectification can rectify errors in initial pseudo-labels, it also introduces the risk of the model becoming overly confident and stagnant. To overcome this, we introduce prior information from the input image to optimize saliency prediction, in order to avoid the model falling into a self-complacent trap. Previous approaches primarily rely on CRF for prior rectification, which entails significant computational costs. Inspired by [Ru et al., 2022], we employ a real-time pixel refiner to provide efficient prior rectification based on the input image. To start, we define the feature distance di,j f and position distance di,j p between pixels as follows: di,j f = \u2212\u2225I(i) \u2212I(j)\u2225 \u03c91\u03c3f , dij p = \u2212\u2225P(i) \u2212P(j)\u2225 \u03c92\u03c3p (5) \fImage GT Initial Saliency Piror Figure 4: The comparison between initial pseudo-label, saliency prediction, and prior rectification. Here, I and P represent the input image and position information, while \u03c3f and \u03c3p denote the standard deviation of feature values and position differences, respectively. The parameters \u03c91 and \u03c92 control the smoothness. The refiner R(\u00b7) is then defined as: R(I) = X j\u2208N (i) ( exp(dij f ) P k\u2208N (i) exp(dik f ) + \u03c93 exp(dij p ) P k\u2208N (i) exp(dik p )) (6) Here, N(\u00b7) represents the set of neighboring pixels in an 8way manner. Finally, the prior rectification can be defined as: Rpri = R(I) \u2299S (7) where \u2299denotes the Hadamard product for matrices. At last, the refined pseudo-label is defined as: Gref = \u03bb1Rpri + \u03bb2Rpost + \u03bb3Gpre (8) Here, Gref refers to the pseudo-labels after refinement, and Gpre refers to the previous pseudo-labels. The introduction of Gref aims to improve the stability of the refinement process. \u03bb1, \u03bb2, \u03bb3 are empirically assigned as 0.2, 0.6, and 0.2, respectively. As shown in Figure 4, prior rectification has effectively compensated for the considerable loss of local details. The proposed SPR mechanism combines prior and posterior rectification, gradually improving the quality of pseudo labels during the training process, demonstrating strong selfsupervised performance. 3.3 Knowledge Transfer to non-NSI SOD tasks We investigate the transferability of the proposed method to video SOD and Remote Sensing Image (RSI) SOD. Figure 5 illustrates the varying degrees of relevance between different SOD tasks. The tasks within NSI SOD benefit from a greater amount of shared knowledge, allowing for the joint training of multiple tasks to achieve a better generalization performance. However, as we broaden our focus to generic SOD tasks, the inherent gap between tasks becomes the primary influencing factor. Joint training becomes more challenging RGB RGB-D RGB-T NSI SOD Generic SOD NSI Video RSI Figure 5: The relevance between different SOD tasks. The overlaps can be seen as shared common knowledge. and poses risks of model degradation. More discussions on this topic can be found in supplementary materials. We posit that identifying an appropriate fine-tuning method can effectively address the issue of model degradation. Inspired by recent studies on Adapter-tuning [Houlsby et al., 2019], we design a simple but effective fine-tuning method for knowledge transfer from NSI SOD to non-NSI SOD tasks. Specifically, for end-to-end tasks in SOD, the prevailing methods and models employ the U-net [Ronneberger et al., 2015] structure and utilize multi-scale feature aggregation to achieve accurate saliency predictions. We contend that shallow features primarily contribute to local details and possess a degree of cross-task generality, while deep features play a pivotal role in salient object localization and exhibit task-specific characteristics. Hence, we suppose that finetuning solely the network layers or modules responsible for deep feature handling allows the model to adapt to the target task while circumventing degradation. Technically, we define the deep feature handling process in the model as \u02c6 F = T(F) (9) Here, F represents the deep features extracted by the backbone, \u02c6 F denotes the processed features, and T signifies the network layer or module performing the processing. In specific end-to-end SOD models, T can comprise a convolutional layer that modifies the number of feature channels or a network module that enhances the features. Our adapter-tuning approach can be defined as: \u02c6 F = T(F) + Ta(F) (10) In this equation, Ta refers to the adapter, which possesses a structure consistent with T. Following the processing, Ta is connected to the original network through a residual connection. During fine-tuning, we exclusively optimize the weights of Ta while keeping the remaining weights of the model frozen. The detailed description can be found in supplementary materials. It is worth mentioning that this fine-tuning method is universal for any kind of SOD method or task. 3.4 Supervision Strategy We initially train the saliency cue extractor (SCE) in the first stage, followed by training the saliency detector (SD) in the second stage. In the training of the first stage, we also incorporate Boundary-aware Texture Matching (BTM) [Zhou et al., 2023b] to introduce extra structural cues, and is formulated as: Lbtm = P i biT s i (T a i )T P i bi . (11) \fHere, T s i represents the saliency texture vector, T a i denotes the input image texture vector, and bi represents the binary boundary mask of the saliency prediction. Moreover, a structural consistency loss is employed to achieve transformationinvariant predictions, and is formulated as: Lsc = N X i \u2225S(i) \u2212\u02c6 S(i)\u2225. (12) Here, \u02c6 S denotes saliency prediction after transformation. To ensure training stability, only random scaling is adopted. The total loss for training SCE can be defined as: Lsce = Lpcl\u2212sd + \u03b3Lbtm + Lsc. (13) \u03b3 is empirically assigned as 0.05. We train the saliency detector (SD) with IoU loss, which is defined as: LIoU = 1 \u2212 PN i=1(S(i)G(i)) PN i=1(S(i) + G(i) \u2212S(i)G(i)) , (14) G refers to the pseudo-labels, and the total loss for training SD can be defined as: Lsd = LIoU + Lsc. (15) 4 Experiments 4.1 Implementation Details Training Settings The batch size is set to 8 and input images are resized to 320\u00d7320. Horizontal flipping is employed as our data augmentation. We train the saliency cue extractor for 20 epochs using the SGD optimizer with an initial learning rate of 0.1, which is decayed linearly. We train the saliency detector for 10 epochs using the SGD optimizer with a learning rate of 0.005. All experiments were implemented on a single RTX 3090 GPU. Datasets We follow the prevalent settings of SOD and relevant tasks. Here are some details about the datasets we used. (1) RGB SOD: We use the training subsets of DUTS [Wang et al., 2017] to train our method. ECSSD [Yan et al., 2013], PASCALS [Li et al., 2014], HKU-IS [Li and Yu, 2015], DUTSTE [Wang et al., 2017] and DUT-O [Yang et al., 2013] are employed for evaluation. (2) RGB-D SOD: We choose 2185 samples from the training subsets of NLPR [Peng et al., 2014] and NJUD [Ju et al., 2014] as the training set. RGBD135 [Cheng et al., 2014], SIP [Fan et al., 2020] and the testing subsets of NJUD and NLPR are employed for evaluation. (3) RGB-T SOD: 2500 images in VT5000 [Tu et al., 2022a] are for training, while VT1000 [Tu et al., 2019], VT821 [Wang et al., 2018] and the rest 2500 images in VT5000 are for testing. (4) Video SOD: We choose the training splits of DAVIS [Perazzi et al., 2016] and DAVSOD [Fan et al., 2019] to train our method. SegV2 [Li et al., 2013], FBMS [Brox and Malik, 2010] and the testing splits of DAVIS and DAVSOD are employed for evaluation. (5) Remote Sensing Image SOD: We choose the training splits of ORSSD [Li et al., 2019] and EORSSD [Zhang et al., 2020c] to train our method. The testing splits of ORSSD and EORSSD are employed for evaluation. Metrics We employ three metrics to evaluate our model and the existing state-of-the-art methods, including Mean Absolute Error M, average F-measure (F\u03b2) [Achanta et al., 2009] and E-measure (E\u03be) [Fan et al., 2018]. Specifically, (M) measures the average pixel-wise difference between the prediction P and the ground truth G, and is calculated as M = 1 N PN i=1 |P(i) \u2212G(i)|. F\u03b2 considers both precision and recall values of the prediction map, and can be computed as F\u03b2 = (1+\u03b22)\u00d7P recision\u00d7Recall \u03b22\u00d7P recision+Recall , with \u03b22 set to 0.3. E\u03be takes into account the local pixel values along with the image-level mean value, and is defined as E\u03be = 1 N PN i=1 \u03d5\u03be(i, j), where \u03d5\u03be represents the enhanced alignment matrix. 4.2 Comparisons With State-of-the-Art We report the performance of our method on five representative SOD tasks, and more qualitative results are provided in supplementary materials. Results on RGB SOD Table 1 presents a quantitative comparison between the proposed method and recent fully-supervised, weaklysupervised, and unsupervised methods. The fully-supervised methods include MINet [Pang et al., 2020] and VST [Liu et al., 2021], the weakly-supervised methods contain WSSA [Zhang et al., 2020b] and MFNet [Piao et al., 2021], and the unsupervised methods comprise SBF [Zhang et al., 2017], EDNS [Zhang et al., 2020a], DCFD [Lin et al., 2022], SelfMask [Shin et al., 2022], TSD [Zhou et al., 2023b] and STC [Song et al., 2023]. Our results are presented under different settings: (1) Training our method using task-specified data, denoted as \u201cOurst.s.\u201d, for a fair comparison; (2) Training our method using Nature Still Image (NSI) data, including RGB, RGB-D, and RGB-T datasets, referred to as \u201cOurs\u201d. The results presented in Table 1 clearly indicate that the proposed method outperforms existing USOD methods, leading to significant improvements in performance. Additionally, our unsupervised approach demonstrates competitive performance in comparison to recent weakly-supervised and fully-supervised methods. Notably, our method, referred to as \u201cOurs\u201d, exhibits a slight superiority over \u201cOurst.s.\u201d. We suppose that this advantage stems from the utilization of a more extensive training dataset, which enhances the model\u2019s generalization ability and leads to improved performance when applied to unseen images. A qualitative comparison is presented in Figure 6. As can be seen, our method has achieved more accurate and complete saliency prediction. Moreover, our approach exhibits remarkable performance in dealing with multiple objects (row 2). Results on RGB-D and RGB-T SOD Table 2 and 3 present a comparison between the proposed method and recent methods on RGB-D and RGB-T benchmarks, respectively. For a fair comparison, we also train our method using task-specified data, denoted as \u201cOurst.s.\u201d. VST [Liu et al., 2021], CCFE[Liao et al., 2022], DSU [Ji et al., 2022], TSD, MIDD [Tu et al., 2021] and SRS [Liu et al., 2023] are employed for comparison. Our method has \fImage GT MiNet VST WSSA MFNet SBF A2S TSD Ours Fully-supervised Weakly-supervised Unsupervised Figure 6: Visual comparison between the proposed method and other state-of-the-art SOD methods on RGB SOD datasets. dataset DUT-O DUTS-TE ECSSD HKU-IS PASCAL-S Method Year Sup. M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 MINet 2020 F .055 .756 .873 .037 .828 .917 .033 .924 .953 .028 .908 .961 .064 .842 .899 VST 2021 F .058 .756 .872 .037 .818 .916 .033 .92 .957 .029 .9 .96 .061 .829 .902 WSSA 2020 W .068 .703 .845 .062 .742 .869 .047 .860 .932 .059 .870 .917 .096 .785 .855 MFNet 2021 W .098 .621 .784 .079 .693 .832 .058 .839 .919 .084 .844 .889 .115 .756 .824 EDNS 2020 U .076 .682 .821 .065 .735 .847 .068 .872 .906 .046 .874 .933 .097 .801 .846 SelfMask 2022 U .078 .668 .815 .063 .714 .848 .058 .856 .920 .053 .819 .915 .087 .774 .856 DCFD 2022 U .070 .710 .837 .064 .764 .855 .059 .888 .915 .042 .889 .935 .090 .795 .860 TSD 2023 U .061 .745 .863 .047 .810 .901 .044 .916 .938 .037 .902 .947 .074 .830 .882 STC 2023 U .068 .753 .852 .052 .809 .891 .050 .903 .935 .041 .891 .942 .076 .827 .881 Ourst.s. U .063 .749 .864 .046 .814 .906 .038 .922 .95 .034 .905 .953 .068 .841 .898 Ours U .062 .759 .868 .047 .816 .906 .038 .923 .951 .033 .908 .954 .069 .844 .899 Table 1: Quantitative comparison on RGB SOD benchmarks. \u201cSup.\u201d indicates the supervised signals used to train SOD methods. \u201cF\u201d, \u201cW\u201d and \u201cU\u201d mean fully-supervised, weakly-supervised and unsupervised, respectively. The best results are shown in bold. dataset RGBD-135 NJUD NLPR SIP Method Year Sup. M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 VST 2021 F .017 .917 .979 .034 .899 .943 .023 .886 .956 .04 .895 .941 CCFE 2022 F .020 .911 .964 .032 .914 .953 .021 .907 .962 .047 .889 .923 DSU 2022 U .061 .767 .895 .135 .719 .797 .065 .745 .879 .156 .619 .774 TSD 2023 U .029 877 .946 .060 .862 .908 .034 .852 .931 .051 .873 .925 Ourst.s. U .027 .882 .945 .053 .862 .915 .034 .853 .935 .042 .876 .935 Ours U .025 .888 .94 .049 .876 .923 .028 .871 .945 .04 .879 .931 Table 2: Quantitative comparison on RGB-D SOD benchmarks. dataset VT5000 VT1000 VT821 Method Year Sup. M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 MIDD 2021 F .043 .801 .899 .027 .882 .942 .045 .805 .898 CCFE 2022 F .030 .859 .937 .018 .906 .963 .027 .857 .934 SRS 2023 W .042 .817 .905 .027 .899 .95 .036 .84 .909 TSD 2023 U .047 .807 .903 .032 .881 .939 .044 .805 .899 Ourst.s. U .041 .809 .907 .024 .886 .948 .057 .789 .883 Ours U .038 .843 .924 .023 .904 .956 .041 .846 .918 Table 3: Quantitative comparison on RGB-T SOD benchmarks. dataset DAVSOD DAVIS SegV2 FBMS Method Year Sup. M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 STVS 2021 F .080 .563 .764 .022 .812 .940 .016 .835 .950 .042 .821 .903 WSVSOD 2021 W .103 .492 .710 .036 .731 .900 .031 .711 .909 .084 .736 .840 TSD 2023 U .085 .547 .762 .037 .756 .908 .021 .808 .927 .060 .795 .876 Ours U .092 .572 .754 .041 .764 .897 .018 .842 .92 .052 .822 .891 Oursf U .084 .576 .764 .030 .793 .917 .019 .83 .936 .051 .82 .896 Table 4: Quantitative comparison on video SOD benchmarks. \fdataset ORSSD EORSSD Method Year Sup. M \u2193 F\u03b2 \u2191 E\u03be \u2191 M \u2193 F\u03b2 \u2191 E\u03be \u2191 LVNet 2019 F .021 .751 .92 .015 .628 .845 MJRB 2022 F .016 .802 .933 .010 .707 .890 Ours U .057 .669 .83 .053 .545 .755 Oursf U .053 .726 .874 .064 .625 .808 Table 5: Quantitative comparison on RSI SOD benchmarks. Method RGB RGB-D RGB-T video RSI M \u2193F\u03b2 \u2191M \u2193F\u03b2 \u2191M \u2193F\u03b2 \u2191M \u2193F\u03b2 \u2191M \u2193F\u03b2 \u2191 Ourst.s. .033 .928 .052 .854 .019 .949 Ours .033 .927 .047 .87 .020 .953 .068 .696 .074 .634 Oursf .070 .698 .051 .743 Table 6: Evaluation on Pseudo-label Quality. achieved state-of-the-art performance on both RGB-D and RGB-T SOD. Moreover, our proposed approach, referred to as \u201cOurs\u201d, exhibits a substantial performance improvement compared to \u201cOurst.s.\u201d. We attribute this improvement to the limited size of the training datasets for these specific tasks. In contrast, \u201cOurs\u201d was trained on a diverse range of datasets encompassing RGB, RGB-D, and RGB-T SOD, effectively utilizing shared common knowledge across different SOD tasks. Results on video SOD and RSI SOD Table 4, 5 present a comparison between the proposed method and recent methods on video SOD and RSI SOD benchmarks, respectively. STVS [Chen et al., 2021], WSVSOD [Zhao et al., 2021], LVNet [Li et al., 2019], MJRB [Tu et al., 2022b] and TSD are employed for comparison. We consider video SOD and RSI SOD as two types of target transfer tasks. Thus, in the table, \u201cOurs\u201d represents zero-shot transfer results, while \u201cOursf\u201d refers to the outcomes obtained by finetuning the transferred model on the target task using our proposed knowledge transfer approach. Note that the transfer for video SOD and RSI SOD is conducted separately. Our model exhibits excellent adaptability to the target task following fine-tuning, and exhibits remarkable performance. 4.3 Ablation study Evaluation on Pseudo-label Quality We assessed the quality of the pseudo-labels generated by models trained on different datasets. As previously mentioned, \u201cOurst.s.\u201d denotes the model trained using taskspecific data, whereas \u201cOursf\u201d refers to the model transferred to the target task. The results are presented in Table 6. In comparison to \u201cOurst.s.\u201d, \u201cOurs\u201d exhibits slightly inferior performance on the RGB training set, but displays a notable improvement on the RGB-D and RGB-T training sets, which possess a comparatively limited amount of training data. This indicates that a larger training dataset yields superior model performance and enhanced generalization ability. FurtherRefine Settings RGB RGB-D RGB-T Gres Rpri Rpost M \u2193 F\u03b2 \u2191 M \u2193 F\u03b2 \u2191 M \u2193 F\u03b2 \u2191 \u2713 \u2717 \u2717 .04 .918 .064 .825 .03 .923 \u2713 \u2717 \u2713 .034 .925 .048 .868 .022 .951 \u2713 \u2713 \u2713 .033 .927 .047 .87 .020 .953 Table 7: Evaluation on Self-rectify Pseudo-label Refinement. Loss Settings RGB DUTS-TE NLPR M \u2193 F\u03b2 \u2191 M \u2193 F\u03b2 \u2191 M \u2193 F\u03b2 \u2191 w/o PCL-SD .044 .895 .077 .7 .05 .757 w/ PCL-SD .044 .896 .074 .713 .047 .77 Lbce .034 .924 .050 .784 .033 .84 Liou .034 .926 .049 .806 .029 .866 Liou+Lbce .033 .928 .049 .799 .032 .851 Liou+Lms .033 .927 .047 .816 .028 .871 Table 8: Evaluation on Supervision Strategy. \u201cRGB\u201d denotes the training set of RGB SOD. more, \u201cOursf\u201d shows a slight improvement in video SOD, whereas it exhibits a substantial enhancement in RSI SOD. This indicates that video SOD and NSI SOD share more common knowledge, while RSI SOD requires greater fine-tuning and adaptation. More analysis on the adaptation to target tasks is presented in supplementary materials. Evaluation on SPR We evaluated the influence of various rectifications on the pseudo-labels, and the results are presented in Table 7. The posterior rectification Rpost effectively corrects the erroneous predictions present in pseudo-labels, while the prior rectification Rpri adequately compensates for the lack of local details in pseudo-labels. Through the combination of posterior correction and prior correction, the proposed SPR gradually enhances the quality of pseudo-labels, thereby improving the model\u2019s performance. Evaluation on Supervision Strategy We evaluated the effectiveness of the proposed supervision strategy, as shown in Table 8. We treat all samples as easy samples to examine the effectiveness of PCL-SD. Upon applying PCL-SD, the model exhibits a slight improvement on the training set. Nonetheless, an impressive enhancement in performance can be observed on the test set. This improvement substantiates the model\u2019s heightened generalization capability. More experiments on the PCL-SD can be found in supplementary materials. Additionally, we explored the training of the saliency detector using different loss functions. The results indicate that the commonly employed binary crossentropy (bce) in supervised SOD did not lead to effective performance enhancement. We hypothesize that this ineffectiveness may be attributed to the errors and interference stemming from incorrect predictions in pseudo-labels. In contrast, the self-supervised loss Lms delivered a noteworthy improvement. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14768v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14768v1",
|
| 3 |
+
"title": "Enhancing Prompt Following with Visual Control Through Training-Free Mask-Guided Diffusion",
|
| 4 |
+
"abstract": "Recently, integrating visual controls into text-to-image~(T2I) models, such\nas ControlNet method, has received significant attention for finer control\ncapabilities. While various training-free methods make efforts to enhance\nprompt following in T2I models, the issue with visual control is still rarely\nstudied, especially in the scenario that visual controls are misaligned with\ntext prompts. In this paper, we address the challenge of ``Prompt Following\nWith Visual Control\" and propose a training-free approach named Mask-guided\nPrompt Following (MGPF). Object masks are introduced to distinct aligned and\nmisaligned parts of visual controls and prompts. Meanwhile, a network, dubbed\nas Masked ControlNet, is designed to utilize these object masks for object\ngeneration in the misaligned visual control region. Further, to improve\nattribute matching, a simple yet efficient loss is designed to align the\nattention maps of attributes with object regions constrained by ControlNet and\nobject masks. The efficacy and superiority of MGPF are validated through\ncomprehensive quantitative and qualitative experiments.",
|
| 5 |
+
"authors": "Hongyu Chen, Yiqi Gao, Min Zhou, Peng Wang, Xubin Li, Tiezheng Ge, Bo Zheng",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Diffusion AND Model",
|
| 14 |
+
"gt": "Recently, integrating visual controls into text-to-image~(T2I) models, such\nas ControlNet method, has received significant attention for finer control\ncapabilities. While various training-free methods make efforts to enhance\nprompt following in T2I models, the issue with visual control is still rarely\nstudied, especially in the scenario that visual controls are misaligned with\ntext prompts. In this paper, we address the challenge of ``Prompt Following\nWith Visual Control\" and propose a training-free approach named Mask-guided\nPrompt Following (MGPF). Object masks are introduced to distinct aligned and\nmisaligned parts of visual controls and prompts. Meanwhile, a network, dubbed\nas Masked ControlNet, is designed to utilize these object masks for object\ngeneration in the misaligned visual control region. Further, to improve\nattribute matching, a simple yet efficient loss is designed to align the\nattention maps of attributes with object regions constrained by ControlNet and\nobject masks. The efficacy and superiority of MGPF are validated through\ncomprehensive quantitative and qualitative experiments.",
|
| 15 |
+
"main_content": "Introduction Adding image conditions to text-to-image (T2I) models [19, 26, 51] for accurate layout and shape control has attracted significant attention. Notably, ControlNet [51] stands out as a widely adopted solution for its effectiveness in producing high-quality images with diverse visual controls such as Canny Edge [6], Depth Map [36], and other form images. Though many training-free methods [1, 2, 4, 7, 8, 14, 20, 22, 27, 29, 47] have been proposed to make generated images consistent with text prompts in T2I models, addressing the *Both authors contributed equally to this work. \u201cPrompt Following\u201d issue [5], research on this issue within ControlNet is rare. This paper delves into this unexplored area, labeled as \u201cPrompt Following Under Visual Control\u201d. Visual Control Prompt Ours ControlNet Method Training-Free MGPF Object Masks Prompt Following Under Visual Control Aligned prompt/visual control Misaligned prompt/visual control and yellow flowers in a grassy park. ControlNet Method a blue bowl , a white cup , Figure 1. The input prompt and visual control are only partially aligned as the left part displays. The ControlNet method result omits yellow flowers and a grassy park, inaccurately painting the cup as blue not white. While our approach MGPF can utilize object masks and produce images with these desired features. The key challenge lies in ensuring the generated images match not only the text prompts but also the layouts and shapes specified by the visual controls. This task becomes more crucial when users can only provide partially aligned prompt-image pairs since it is hard to find visual controls exactly matching their prompts. For example, as Fig. 1 shows, the canny edge condition derived from an indoor setting only partially aligns with the prompt. This misalignment influences the effectiveness of the prompt and results in missing elements like flowers and grass in the generated image (termed as \u201cObject Missing\u201d). Moreover, the attributes of objects are incorrect, such as the color of the cup being blue instead of white (termed as \u201cAttribute Mismatch\u201d). This issue may arise from the inconsistency between the attention maps of the attribute words and that of the corresponding object during the denoising process [43]. 1 arXiv:2404.14768v1 [cs.CV] 23 Apr 2024 \fDirectly transferring prompt following methods from T2I to the ControlNet scenario does not yield satisfactory results. Specifically, in optimizing Object Missing, some works [2, 4, 8, 14, 27, 47] focus on augmenting the attention values of object words in the prompt during cross-attention, proving effective in T2I scenarios. However, when applied to ControlNet [51], these methods still suffer from the misalignment of prompts and visual controls, leading to a weakened effect. In addressing Attribute Mismatch, some studies[8, 20, 37] suggest bringing the attention maps of attribute words and object words within U-net closer to each other. This process may affect the original layout distribution of objects. Such approaches are effective in T2I scenarios without layout and shape constraints, but may conflict with the visual controls in ControlNet. To address these issues, we introduce additional masks for objects aligned with prompts, and propose a novel training-free approach named Mask-guided Prompt Following (MGPF). Regarding the \u201cObject Missing\u201d challenge, we introduce Masked ControlNet to replace the original ControlNet branch and mitigate conflicts between prompts and the misaligned part of visual controls. Specifically, we employ object masks to divide ControlNet features into two parts, only integrating features aligned with the prompt into the U-net. We note that partial ControlNet features can effectively control particular spatial compositions in the generated image without disrupting non-adjacent regions or introducing artifacts. This is likely because the U-net remains fixed during training, preserving its ability to generate images. Also, combining ControlNet features with U-net features maintains spatial information in the ControlNet features. Additionally, ControlNet features are combined with U-net features through element-wise addition, preserving the spatial information from visual controls. Furthermore, we propose Attribute Matching loss for binding attributes to objects and avoid disturbing visual controls. As depicted in Fig. 2, we give different prompts to U-net and ControlNet and find that the cross-attention between U-net and text features determines the attribute of objects while ControlNet predominantly determines the layout and shape of objects. Inspired by this, we utilize classifier guidance [9] and minimize the divergence distance between attention maps of attribute words in Stable Diffusion and those of object words in ControlNet. Additionally, we impose a constraint to ensure that the regions of highest attention for attribute words and corresponding object words within the object mask regions. For the misaligned prompt and visual control, we just make the attention maps for attributes and objects within the U-net consistent. To evaluate our method, we extract various visual control and object masks from the COCO dataset [21] and design paired prompts that include a variety of attributes and objects. The experiments demonstrate that our model outPrompt: a yellow dog and a purple bench Canny Edge w/o Text prompt U-net ControlNet Text prompt Text prompt w/o Text prompt Figure 2. Under visual control, the prompt is respectively fed into or unfed into the U-net and ControlNet. If U-net does not received the prompt, regardless of whether ControlNet has received it or not, the image lacks yellow and purple as mentioned. But if Unet gets the prompt, it is the opposite. This reveals that attribute words mostly work through the cross-attention between U-net and the prompt features. performs state-of-the-art methods. In summary, our works can be summarized as: (i) We explore the challenge of prompt following under visual control and introduce object masks for better semantic expression. (ii) We propose a training-free method called Maskedguided Prompt Following, including Masked ControlNet and Attribute-matching Loss for precise object and attribute control. (iii) Extensive comparisons show that our method is simple yet effective for controllable text-to-image generation within multiple conditions. 2. Related Works Text-to-Image Generation. Early research in text-toimage generation primarily utilized Generative Adversarial Networks (GANs), as demonstrated in studies by Tao Tang et al. [44], Xu et al. [48], and Zhang et al. [50]. However, recent advancements have shifted focus towards diffusion models [3, 10, 15, 28, 34, 35, 42], gaining prominence for their exceptional capabilities in generating highquality and high-resolution images. A notable example in this domain is the Denoising Diffusion Probabilistic Model (DDPM) [15], which introduces standard noise in its forward process and reconstructs the original image from the noisy data in the reverse process. In this reverse process, a U-Net-based model [39] is employed to estimate the noise at each step. This era is further marked by groundbreaking large-scale text-to-image architectures such as Stable Diffusion [38], Imagen by Saharia et al. [40], and DALL\u00b7E 3 by OpenAI [5]. Besides, these models have been applied to a diverse range of tasks beyond those initially mentioned, including 3D generation [12, 17, 30], video editing [13, 23, 25, 31, 49] and motion generation [32, 45]. 2 \fBuilding upon these state-of-the-art models, our work aims to enhance the prompt-following capabilities of these systems under controlled conditions. Prompt Following. Generating images that precisely align with complex text prompts remains a formidable challenge, as proved in recent studies [8, 11, 14, 46]. This issue is particularly pronounced in scenarios involving complex scenes or multi-object compositions [8, 11, 24]. StructureDiffusion [11] attempts to address this by leveraging linguistic structures to guide cross-attention maps in the generation process but falls short in resolving semantic discrepancies at the sample level. Composable Diffusion [22] decomposes complex texts into simpler segments and then composes the image from these segments, though its effectiveness is limited to simpler conjunctions. Additionally, A&E [8] aims to enhance object presence in generated images by optimizing cross-attention maps during inference. However, it struggles with intricate prompts, particularly those with complex backgrounds, and does not address attributerelated issues effectively. In response, Linguistic Diffusion [37] introduces a specialized KL-divergence loss to fine-tune the cross-attention maps of modifiers and entities, making significant progress. Despite these advancements, existing methods primarily focus on general text-to-image model improvements. In contrast, our paper targets enhancing prompt following under visual control, an area where previous approaches have shown limitations. Controlling Text-to-Image Diffusion Models. The stateof-the-art diffusion models primarily discussed earlier are geared towards text-to-image generation, relying heavily on text prompts for control. However, achieving precise control solely through text prompts presents inherent challenges. Recent developments have introduced methods to exert additional visual control over existing text-toimage models. Innovations like ControlNet [51] and T2I Adapter [26] facilitate this enhanced control, enabling models such as Stable Diffusion [38] (SD) to adapt to various image contexts with minimal additional training. ControlNet [51] integrates supplementary features from diverse image settings into the core SD U-Net model, while T2I Adapters [26] employ a different approach in incorporating these features and managing inputs. Our research focuses on scenarios using ControlNet [51], where we observe a notable decline in the quality of prompt following compared to general scenarios. To the best of our knowledge, ours is the first work addressing this specific challenge. We propose a novel training-free method to resolve this issue without compromising flexibility. 3. Method This section elaborates on the proposed Mask-guided Prompt Following (MGPF). As illustrated in Fig. 3, this method adopts SD for achieving high-quality text-to-image generation and ControlNet to integrate diverse visual controls. MGPF consists of two key components: 1. Masked ControlNet, which leverages object masks to control the layout and shape of specific regions, thereby eliminating conflicts with misaligned portions of the prompt and enhancing object generation; 2. Attribute-matching Loss, which employs related loss functions to bind attributes within the prompt to their corresponding objects. The text promptP = {p}L i=1and image condition I serve as fundamental inputs for controlled image synthesis, where L denotes the length of prompt. In addition, object masks M = {m}N i=1 are provided, where mi denotes pixel indices associated with the ith object described in P and I. 3.1. Masked ControlNet To address the challenge of generating objects in areas where the prompt and visual controls are misaligned, We propose the Masked ControlNet, which is then integrated with Stable Diffusion(SD) [38]. SD, built on a U-net architecture, includes an encoder, a middle block and a decoder, all interconnected via skip connections. It utilizes the prompt as a basis condition for text-to-image generation. To incorporate more visual controls, ControlNet [51] is developed using a trainable copy of the 12 encoding blocks and 1 middle block of SD. The outputs from ControlNet are subsequently merged into the 12 skip connections and the middle block of the U-net, thereby serving as supplementary conditions for the generation process. Consequently, when presented with a textual prompt P and an image condition I, the computation of the score for classifier-free guidance [16] in multi-conditions proceeds as follows: \u03f5CF G(zt, P, I) = \u03f5\u03b8(zt, \u2205, \u2205)+ w \u00b7 (\u03f5\u03b8(zt, P, I) \u2212\u03f5\u03b8(zt, \u2205, \u2205)), (1) where zt is the latent and w is the interpolation coefficient which improves the alignment of generated samples with their conditioning. The output yc of the ControlNet \u03d5 can be simplified as follows: yc = J X j=1 \u03d5(zt, P, I; \u03b8bj), (2) where J is the number of blocks in ControlNet and \u03b8bj is the parameter of the j \u2212th block. During the training of the ControlNet, visual and textual controls are perfectly alignment. However, When the prompt contains objects that are not spatial compositions of the visual control, the generated result may fail to depict these objects. To address this issue, we initially generate object mask OM, indicating the specific region in visual control that follows the textual prompt. Then we apply this mask to guide the ControlNet [51] to focus to this region, 3 \fa yellow dog, a green skateboard, and huge rocks on the mountaintop yellow dog green skateboard yellow dog green skateboard Attribute-matching Loss \ud835\udc67! Union & Reshape 8\u00d78 U-net Encoder U-net Decoder ControlNet update \ud835\udc67! to \ud835\udc67\u2032! dog skateboard 16\u00d716 32\u00d732 64\u00d764 8\u00d78 16\u00d716 32\u00d732 64\u00d764 \u00d7 \u00d7 \u00d7 \u00d7 Canny Edge Masked Control Features Prompt Parser Figure 3. Overview of the proposed Mask-guided Prompt Following (MGPF) method. Given a prompt and a canny edge condition with misaligned elements such as door edges, along with two object masks indicating \u201cdog\u201d and \u201cskateboard\u201d, our approach involves two modules to enhance prompt following. In Masked ControlNet, We union all object masks into a single composite, being reshaped and element-wise multiplied to corresponding ControlNet features, effectively eliminating the influence of undesired visual clues. Incorporated with Attribute-matching Loss, we parse the prompt into attribute-object pairs like \u201cyellow dog\u201d and \u201cgreen skateboard\u201d, obtaining their cross-attention maps from U-net and ControlNet. Subsequently, specific loss functions shift these attention maps in U-net and ControlNet for better attribute binding. ensuring the extra prompt guidance such as a new object beyond the region is effective. Concretely, we calculated the union of all object masks and obtained OM = (m1 \u222am2... \u222amN). Then We recalculated yc with the below equation: yc = J X j=1 dmj \u00b7 \u03d52(zt, P, I; \u03b8bj), (3) where dmj is the reshape form of OM and is adapted to the resolution of the j \u2212th block. Through this approach, ControlNet [51] selectively disregards features associated with misaligned visual elements outside of OM. This exclusion facilitates precise spatial control by ControlNet [51] over specific image components and enables SD to generate objects as per the misaligned text descriptions. Our experimental results show that the application of masks to ControlNet features substantially mitigates conflicts between mismatched textual and visual controls, effectively addressing the problem of object missing in generated images 3.2. Attribute-Matching Loss To improve attribute matching under visual controls, we employ various loss functions that iteratively denoise and update the noise map zt at each time step t = (T, T \u22121, ..., 1) in the denoising process. We use spaCy\u2019s transformer-based dependency parser to analyze the text prompt P, extracting a set of attribute-object pairs S = PNo i=1(ai, oi), where No is the total number of objects, and oi and ai denote the word indices of the i \u2212th object and its corresponding attribute, respectively. The set S is then divided into two subsets: s1 which aligns with the visual control containing N objects, and s2, corresponding to the remaining No \u2212N objects in the misaligned portion of the prompt. Our aim is to achieve semantic alignment between attribute words ai and their corresponding objects oi, while maintaining the integrity of the image condition\u2019s control.To this end, as shown in Fig. 3, we design two specific attribute-matching-loss functions: Language-guided loss and Mask-guided loss. These functions facilitate the alignment of oi and ai through cross-attention maps. Specifically, during the forward process, we can obtain the cross4 \fattention maps A in SD and ControlNet named As and Ac respectively. For the i \u2212th prompt token pi, the crossattention map Ai is calculated as follows: Ai = softmax(QK\u22a4 i \u221a d ), (4) where the query Q is derived from zt, the key Ki is derived from the word embedding of pi, and d is the latent dimension of of Q and Ki. As and Ac indicate the relevance between the given text prompt words and visual pixels. Moreover, Ac extra indicates the relevance between the visual control and visual pixels. Our main idea is to maximize the overlap of the attentive areas of the attribute-object pairs (ai, oi) in s, on the condition of I and object masks OM. To this end, we have formulated a loss function, designated as LI. This function refines the attribute cross-attention maps in For pairs in As and object cross-attention maps in Ac for pairs in subset s1. The goal is to progressively align these maps more closely, while distancing them from unrelated cross-attention maps, represented as \u00af Ac. For the pairs in subset s2, our approach primarily aligns their cross-attention maps within As ensuring effective semantic alignment. LI = X (ai,oi)\u2208s1 dist(Ac(oi), As(ai)) \u2212 X (ai,oi)\u2208s1 X w\u2208(ai,oi) X Au\u2208\u00af Ac 1 | \u00af Ac|dist(Au, As(w)) + X (ai,oi)\u2208s2 dist(As(oi), As(ai)), (5) dist(Ai, Aj) = 1 2DKL(Ai||Aj) + 1 2DKL(Aj||Ai), (6) where dist is a measure function indicating the distance between the attention maps and DKL(Ai||Aj) = P pixelsAilog(Ai/Aj). Furthermore, to meet the condition M, another loss termed LM is designed to constrain the target objects and attributes attentive area to the predefined object masks. LM = \u2212 N X i=1 X w\u2208s1,i X m\u2208Mi (As(w, m) \u2212As(w, \u00af m)), (7) where As(w, m) is a value of a cross-attention map in As for word w in s1,i at pixel m in the i \u2212th object mask. Then, all the losses are aggregated and back-propagation is computed to update the zt as follows: zt \u2032 \u2190zt \u2212\u03b1\u2207zt(lI, lM). (8) Our algorithm can be summarized as Algorithm 1, which requires no training. Algorithm 1 MGPF: Training-Free Prompt Following with Visual Controls Input: A prompt P, a visual control I, corresponding semantic masks M, the source and target initial latent noise maps zs T and zT . Output: Latent map zs 0, updated latent map z0 corresponding to all the inputs. 1: S = {(ai, oi)}N i=1 \u2190Prompt Parser(P) 2: for t = T, T \u22121, ..., 1 do 3: \u03f5s, As \u2190\u03f5\u03b8(zs t , P, t), Ac \u2190\u03f5\u03d5(zs t , P, I, t); 4: zs t\u22121 \u2190Sample(zs t , \u03f5s); 5: zt\u2032\u2190MGPF(As, Ac, M, S); 6: \u03f5 = \u03f5\u03b8,\u03d5(zt\u2032, P, I, t); 7: zt\u22121 \u2190Sample(zt, \u03f5); 8: end for Return zs 0, z0 4. Experiments In this section, we evaluate the effectiveness of our method in enhancing prompt following, focusing on object generation and attribute matching under visual controls. In Sec. 4.1, we delve into the specifics of our implementation details, the datasets, and evaluation metrics utilized in our experiments. Additionally, we demonstrate the efficiency of our method with both quantitative and qualitative results. Extensive experiments prove that our method can significantly boost the semantic alignment in text-to-image generation. 4.1. Evaluation Setup Benchmarks. Considering the absence of established benchmarks for the evaluation of object missing and attribute mismatch under diverse visual controls, we construct a new benchmark. Our experiments involve four widelyused image conditions: depth, canny edge, soft edge, and segmentation. Following A&E\u2019s approach [8, 37], we select images from the COCO dataset including 80 object types categorized into general, fruit, and animal groups. To compose our prompts, these objects are combined with 11 color-related attributes. The prompts are constructed with 1 or 2 objects in the image and randomly selected attributes. Additionally, to evaluate object generation capabilities beyond visual controls, we incorporated textual prompts from the COCO dataset into our prompts. Moreover, we consider two types of prompt: (1) a [color A] [object A], [text prompt beyond visual control], and (2) a [color A] [object A] and a [color B] [object B], [text prompt beyond visual control] and yield a total of 1384 samples. Details of different objects, attributes, and construction methods can be found in the supplementary material. 5 \fTable 1. Quantitative results of all baseline models. We give results under four conditions (soft edge, canny edge, depth, segmentation). VQA-F, VQA-B, text-text, image-text represent LLM foreground VQA score, LLM background VQA score, clip text similarity between input text prompt and blip captions, clip image-text similarity respectively. Our method achieves the best results in all metrics. Method Soft edge Canny edge VQA-AM VQA-OG Text-text Image-text Aesthestic VQA-AM VQA-OG Text-text Image-text Aesthetic SD [38] 0.6321 (-22.8%) 0.4901 (-27.0%) 0.5816 (-10.11%) 0.2737 (-9.4%) 5.24 (+0.9%) 0.6561 (-23.2%) 0.4600 (-30.9%) 0.5778 (-11.5%) 0.2738 (-10.3%) 5.20 (+0.3%) SD(mask) [38] 0.5596 (-31.6%) 0.4513 (-32.7%) 0.5872 (-9.2%) 0.2793 (-7.5%) 5.24 (+0.9%) 0.6423 (-24.8%) 0.4917 (-26.2%) 0.6151 (-5.8%) 0.2878 (-5.7%) 5.31 (+2.5%) A&E [8] 0.7136 (-12.8%) 0.5316 (-20.8%) 0.5624 (-13.1%) 0.2717 (-10.0%) 5.08 (-2.1%) 0.7033 (-17.6%) 0.4903 (-26.4%) 0.5675 (-13.1%) 0.2716 (-11.0%) 5.02 (-3.1%) BoxDiff [47] 0.6426 (-21.5%) 0.5104 (-23.9%) 0.5655 (-12.6%) 0.2717 (-10.0%) 5.21 (+0.4%) 0.6647 (-22.1%) 0.4841 (-27.3%) 0.5710 (-12.6%) 0.2741 (-10.2%) 5.15 (-0.6%) Structure [11] 0.6501 (-20.6%) 0.4899 (-27.0%) 0.5685 (-12.1%) 0.2733 (-9.5%) 5.24 (+0.9%) 0.6535 (-23.5%) 0.4594 (-31.0%) 0.5767 (-11.7%) 0.2730 (-10.5%) 5.20 (+0.4%) Linguistic [37] 0.7556 (-7.7%) 0.5171 (-23.0%) 0.5854 (-9.5%) 0.2786 (-7.8%) 5.16 (-0.6%) 0.7482 (-12.4%) 0.4946 (-25.7%) 0.5869 (-10.2%) 0.2777 (-9.0%) 5.15 (-0.6%) Ours 0.8186 0.6710 0.6470 0.3020 5.19 0.8537 0.6658 0.6532 0.3051 5.18 Method Depth Segmentation VQA-AM VQA-OG Text-text Image-text Aesthetic VQA-AM VQA-OG Text-text Image-text Aesthetic SD [38] 0.6638 (-20.8%) 0.5790 (-11.7%) 0.5963 (-9.1%) 0.2849 (-6.7%) 5.30 (+1.1%) 0.6265 (-20.3%) 0.5613 (-16.6%) 0.6051 (-7.8%) 0.2870 (-5.3%) 5.36 (+0.9%) SD(mask) [38] 0.5953 (-28.9%) 0.4454 (-32.1%) 0.5992 (-8.7%) 0.2828 (-7.4%) 5.27 (+0.6%) 0.5910 (-24.8%) 0.5159 (-23.3%) 0.6135 (-6.6%) 0.2896 (-4.4%) 5.36 (+0.9%) A&E [8] 0.7150 (-14.6%) 0.5960 (-9.2%) 0.5775 (-12.0%) 0.2817 (-7.8%) 5.07 (-3.2%) 0.7195 (-8.5%) 0.5794 (-13.9%) 0.6001 (-8.6%) 0.2889 (-4.7%) 5.22 (-1.7%) BoxDiff [47] 0.6556 (-21.7%) 0.5986 (-8.8%) 0.5863 (-10.7%) 0.2831 (-7.3%) 5.24 (0.0%) 0.6574 (-16.4%) 0.6007 (-10.7%) 0.6043 (-8.0%) 0.2879 (-5.0%) 5.31 (0.0%) Structure [11] 0.6630 (-20.9%) 0.5784 (-11.8%) 0.5950 (-9.3%) 0.2850 (-6.7%) 5.30 (1.1%) 0.6254 (-20.4%) 0.5602 (-16.7%) 0.6053 (-7.8%) 0.2864 (-5.5%) 5.35 (0.8%) Linguistic [37] 0.7477 (-10.7%) 0.6031 (-8.1%) 0.6042 (-7.9%) 0.2869 (-6.1%) 5.26 (0.4%) 0.7734 (-1.6%) 0.6703 (-0.4%) 0.6493 (-1.1%) 0.3004 (-0.9%) 5.31 (0.0%) Ours 0.8376 0.6560 0.6562 0.3055 5.24 0.7861 0.6728 0.6565 0.3030 5.31 Evaluation Metrics. To quantitatively evaluate the performance of our method, we follow existing works [8] by utilizing text-text similarity and CLIP [33] image-text distances. Considering these two metrics are insufficient for evaluating object generation beyond visual control and attribute matching, we adopt the recently introduced VQAbased metric [18]. This metric use task-related information as questions and evaluate the probability of a \u201cyes\u201d response from our VQA model. For attribute matching, the question is designed as \u201cA [attribute] [object]?\u201d for each pair in the text prompt, with the cumulative \u201cyes\u201d probability serving as the metric. With respect to object generation beyond visual control, the question is \u201c[text prompt beyond visual condition]?\u201d, and its \u201cyes\u201d probability is also computed. We refer to these metrics as VQA-AM (Attribute Matching) and VQA-OG (Object Generation), respectively. Additionally, based on concerns that some attention based methods might degrade image quality, we employ an aesthetic metric [41] to evaluate the aesthetics of the generated images. We also conduct human evaluations for further validation. Baselines. We compare our method with several trainingfree methods that intend to improve object generation and attributes matching. We re-implement these methods integrated with ControlNet [51], including: Stable diffusion [38], A&E [8], Structure [11], Lingustic [37], BoxDiff [47] and Stable Diffusion&mask [38]. For BoxDiff, we calculate object bounding boxes from their masks, as an additional input. In Stable Diffusion&mask, we utilize object masks to directly modify visual controls, integrating these with prompts for image generation. 4.2. Results Quantitative Results. We evaluated the effectiveness of every competing method using the aforementioned texttext, text-image, VQA-AM, VQA-OG, and aesthetic metrics. We demonstrate superior performance of our method across depth, soft edge, canny edge, and segmentation conditions, as detailed in Tab. 1. For the widely used texttext and image-text similarity metrics, our approach significantly outperforms all baseline models in all four conditions, demonstrating unparalleled prompt consistency. Considering that these two metrics do not entirely capture the ability of attribute matching and object generation beyond visual control, we further calculate the VQA-AM and VQA-OG metrics. For VQA-AM, our method remains superior to all baselines. Specifically, it outperforms the SD [38]+ControlNet and the most robust Linguistic [37] baseline by 22.78% and 7.7% under the soft edge condition, respectively. (23.15% and 12.36% for canny edge; 20.75% and 10.73% for depth; 20.30% and 1.62% for segmentation). This demonstrates the superiority of our method to align attributes in the text prompt with corresponding objects in visual controlled scenarios. Regarding VQA-OG, which reflects object generation beyond visual control, our approach also achieved the best performance, surpassing the strongest baseline by 22.94% under soft edge conditions (25.71% for canny edge; 8.06% for depth; 0.37% for segmentation). Additionally, to address concerns that crossattention based methods might affect image quality, we evaluate the aesthetic scores and find that all baseline methods exhibit comparable aesthetic scores and our method do not degrade the image quality. Qualitative Results. Fig. 4 illustrates a qualitative comparison of all baseline methods. Our analysis focuses on two aspects: the quality of attribute matching and the effectiveness of object generation beyond visual control. Regarding attribute matching, we can see that most baseline methods fail to achieve precise binding of attributes. While the Linguistic+ControlNet [37] baseline occasionally facilitates attribute matching, it also produces artifacts, owing to the at6 \fPrompt Visual control SD Structure A&E Linguistic Ours SD (mask) a blue dog and a purple skateboard, the huge rocks on the mountain a gray umbrella and a brown cat, beach near the sea a white umbrella and a yellow chair, on the beach near the sea BoxDiff a white cup and a red mouse, yellow flowers in a grassy park Figure 4. Qualitative comparison using prompts from our dataset. We show images generated by all our baseline methods. We use the same seed across all approaches. a black clock and a pink cat, on the white floor Prompt Visual control Baseline +MC +MC +LL +MC +LL +ML a red bird, next to a tree in the park Figure 5. Qualitative ablation results. MC, ML, and LL denote Masked Controlnet, Mask Loss, and Language-Guided Loss respectively. tention map shifting for both attributes and objects in the U-Net. In contrast, our method effectively binds attributes to their corresponding objects while preserving image quality, demonstrating the effectiveness of our attribute match losses. In terms of object generation beyond visual control, our method accurately produces objects in the misaligned portion of the prompt, outperforming other baselines. Notably, these models fail to maintain consistency with the text prompt, even when directly masking the misaligned part of the input visual control. Ablation Study. Initially, we quantify the impact of each component within our method as shown in Tab. 2. We perform experiments under the canny edge condition and use SD [38]+ControlNet as the baseline. The incorporation of Table 2. Ablation studies of each module in our method, we conduct experiments under canny edge condition and report texttext, image-text, VQA-AM, VQA-OG metrics. ML: Mask-guided Loss, MC: Masked ControlNet, LL: Language-Guided Loss. Method Canny edge VQA-AM VQA-OG Text-text Image-text Baseline 0.6561 0.4600 0.5778 0.2738 +ML 0.7715(+17.6%) 0.4792 (+4.2%) 0.5936 (+2.7%) 0.2783 (+1.6%) +MC 0.5845(-10.9%) 0.6139 (+33.5%) 0.5817(+0.7%) 0.2832(+3.4%) +LL 0.8453(+28.8%) 0.5218(+13.4%) 0.6067(+5.0%) 0.2822(+3.1%) +ML+LL 0.8554(+30.4%) 0.5175(+12.5%) 0.6080(+5.2%) 0.2828(+3.3%) +ML+MC 0.7791(+18.7%) 0.6529(+42.0%) 0.6367(+10.2%) 0.3017(+10.2%) +MC+LL 0.8492(+29.4%) 0.6738(+46.5%) 0.6524(+12.9%) 0.3040(+11.0%) +MC+LL+ML 0.8537(+30.1%) 0.6658(+44.7%) 0.6532(+13.1%) 0.3051(+11.4%) 7 \fBaseline Ours Prompt a yellow cat and a blue remote, on the lawn in front of trees a red bottle, yellow flowers in a grassy park Visual control brown cat, the light shines through the leaves on the ground a red cat, the light shines through the leaves on the ground Figure 6. Qualitative Comparison using ChilloutMix, we compare our method with baseline model. Language-guided Loss (LL) and Mask-guided Loss (ML) improves the baseline model across all metrics, particularly in VQA-AM, proving the effectiveness of these losses in enhancing attribute matching. Notably, Masked ControlNet (MC) improves the VQA-OG by a large margin(33.5%), but affected the VQA-AM (decreasing by 10.9%). We observed that combining LL and ML achieves the best results in VQA-AM, indicating superior attribute matching. Integrating LL with MC, we obtain the highest VQA-OG score. Finally, with all three components, our method achieves the balance results in both VQA-AM and VQA-OG metrics. Additionally, Fig. 5 shows the result of progressively integrating our modules into the base SD [38]+ControlNet model. The addition of MC improves object generation in the latter part of the text prompt. For instance, in the second row, the image distinctly features a tree in the park. Integrating LL enhances attribute matching (e.g., a pink cat and black clock in the first row, and a red bird in the second), though it introduced some artifacts in the generated images, such as an additional block in the first case and red color artifacts in the second. When further combining ML, we solve the artifacts, achieving the best performance in both attribute matching and object generation. 4.3. Robustness to Other Models: ChilloutMix Additionally, we have cooperated our method to other popular models, specifically ChilloutMix1. Fig. 6 shows the visualization results of our approach and the SD [38]+ControlNet models with a fixed random seed. Our method effectively generates objects that extend beyond visual control and matches attributes to their corresponding objects. For example, in the first column, our approach accurately binds the attribute \u201cblue\u201d to the \u201cremote\u201d, while the 1https://civitai.com/models/6424 Table 3. Human Evaluation results compared with all baseline methods. AM, OG, VC and aesthetic represents attributes matching, object generation beyond visual control, visual control following and aesthetic respectively. Model AM OG VC aesthetic Ours 129 67 170 118 Linguistic [37] 97 51 168 98 A&E [8] 76 35 156 60 Structure [11] 71 45 171 116 boxdiff [47] 82 38 161 88 SD [38] 72 42 172 111 SD(mask) [38] 74 54 172 109 No winner 38 102 2 17 baseline method fails. Moreover, our method consistently produces better scenarios that more closely to prompts such as \u201con the lawn in front of trees,\u201d thereby demonstrating the generalizability of our proposed approach. For more cases, please refer to the supplementary material. 4.4. Human Evaluations To further validate our approach, we conduct a user study with images generated by our method and compare them to those from various baseline methods. survey respondents are asked to select the image set that best aligned with the input prompt under visual controls, focusing on Attribute Matching (AM), Object Generation Beyond Control (OG), Visual Controls Following (VC), and Aesthetics. We randomly sample 200 prompts from our constructed dataset, covering all four kinds of visual controls, and generate images using all methods. The results, presented in Tab. 3, indicate the number of selections for each method. For AM and OG, the majority of survey respondents prefer the results produced by our method, thereby providing additional evidence for its effectiveness. Regarding VC and Aesthetics, we can see that our method neither disrupts the control of image conditions nor degrades the aesthetic quality of the generated images. Further details are available in the supplementary material. 5."
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14771v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14771v1",
|
| 3 |
+
"title": "Music Style Transfer With Diffusion Model",
|
| 4 |
+
"abstract": "Previous studies on music style transfer have mainly focused on one-to-one\nstyle conversion, which is relatively limited. When considering the conversion\nbetween multiple styles, previous methods required designing multiple modes to\ndisentangle the complex style of the music, resulting in large computational\ncosts and slow audio generation. The existing music style transfer methods\ngenerate spectrograms with artifacts, leading to significant noise in the\ngenerated audio. To address these issues, this study proposes a music style\ntransfer framework based on diffusion models (DM) and uses spectrogram-based\nmethods to achieve multi-to-multi music style transfer. The GuideDiff method is\nused to restore spectrograms to high-fidelity audio, accelerating audio\ngeneration speed and reducing noise in the generated audio. Experimental\nresults show that our model has good performance in multi-mode music style\ntransfer compared to the baseline and can generate high-quality audio in\nreal-time on consumer-grade GPUs.",
|
| 5 |
+
"authors": "Hong Huang, Yuyi Wang, Luyao Li, Jun Lin",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.SD",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.SD",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Diffusion AND Model",
|
| 15 |
+
"gt": "Previous studies on music style transfer have mainly focused on one-to-one\nstyle conversion, which is relatively limited. When considering the conversion\nbetween multiple styles, previous methods required designing multiple modes to\ndisentangle the complex style of the music, resulting in large computational\ncosts and slow audio generation. The existing music style transfer methods\ngenerate spectrograms with artifacts, leading to significant noise in the\ngenerated audio. To address these issues, this study proposes a music style\ntransfer framework based on diffusion models (DM) and uses spectrogram-based\nmethods to achieve multi-to-multi music style transfer. The GuideDiff method is\nused to restore spectrograms to high-fidelity audio, accelerating audio\ngeneration speed and reducing noise in the generated audio. Experimental\nresults show that our model has good performance in multi-mode music style\ntransfer compared to the baseline and can generate high-quality audio in\nreal-time on consumer-grade GPUs.",
|
| 16 |
+
"main_content": "INTRODUCTION The study of musical styles is important for the development of music. Incorporating different styles into compositions can lead to new and innovative music. Transferring musical styles can create works that pay homage to traditional styles while incorporating contemporary elements. By studying how different styles can be combined and transformed, musicians can create new forms of artistic expression. When discussing the transfer of musical style, it is typically believed that music can be broken down into two elements: content and style. The goal of music style transfer is to maintain the content of the music while modifying the style. With the rapid development of deep generative models, various models such as autoregressive models, generative adversarial networks, variational autoencoders, and stream-based models have actively promoted the development of speech synthesis and music generation. Furthermore, many academics have used these models to re*Corresponding author Copyright: \u00a92023 Hong Huang et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License 3.0 Unported, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. search musical style transfer. MIDI-VAE, a neural network model based on variational autoencoders, was used by Brunner et al. [1] to convert the style of polyphonic music with several instrumental tracks. The same year, Brunner et al. [2] offered a different approach that involved converting midi format audio into a piano rolling matrix, training CycleGAN with the matrix, and then producing converted midi audio. However, this method can only transfer the style from the playing dimension. Huang et al. [3] proposed Timbretron by extracting CQT features of the audio, then converting them into timbre through CycleGAN, and finally synthesizing CQT features into original audio waveforms using pre-trained WaveNet. Their method can capture higher resolution at lower frequencies and maintain equal variance of pitch energy, but the generated audio quality is still inadequate. Donahue et al. [4] enhanced the effect of multi-instrument music generation through cross-domain training based on Transformer, but the quality of synthesized audio is still inadequate. Hung et al. [5] proposed a deep learning model for rearranging any music, resulting in a \u201dstylistic shift\u201d without much impact on the tonal substance. Bonnici et al. [6] used a variational autoencoder combined with a generative adversarial network to construct a meaningful representation of source audio and generate a realistic generation of the target audio. Noam et al. [7] proposed a general music translation network that achieves timbre conversion by training a WaveNet encoder and multiple WaveNet decoders. This method can convert from one timbre domain to multiple timbre domains, but it requires training multiple decoders to adapt to different styles, which is computationally expensive, and the synthesized audio speed is slow. Denoising Diffusion Probability Models (DDPMs) [8] and Score Matching (SM) [9] are recently proposed methods that have achieved good results in the fields of speech synthesis and music generation. The aforementioned studies have achieved promising results in their respective research directions, but they mainly focus on transferring a single attribute of music (timbre, performance style, composition style), and previous methods suffer from artifacts in the generated spectrograms. Considering many-to-many style migration, previous methods have suffered from complex design structures, high computational overhead, and slow generation of audio. To overcome these limitations, this study uses DM, another type of generative model, whose synthesis process extracts the required generated samples from noise through arXiv:2404.14771v1 [cs.SD] 23 Apr 2024 \fiterative steps. As the number of iterations increases, the quality of the synthesis improves. However, directly extending DMs to audio generation requires a large amount of computational resources [10] and cannot solve the problem of slow generation speed. To address these issues, this study proposes a general and efficient music style transfer framework based on the latent diffusion model (LDM) [11]. Specifically, the framework consists of two parts: style transfer and audio generation. In the style transfer part, a conditional mechanism is introduced to learn different types of input styles and transfer their information to the latent space for guiding the generation of target spectrograms. This approach avoids the need for designing complex, disentangled transfer frameworks and enables manyto-many style transfer. Moreover, the transfer process takes place in latent space, greatly reducing computational costs and improving generation speed. For the audio generation part, this study proposes GuideDiff, a waveform audio generator based on DMs. It compresses and encodes spectrograms into the latent space to control and guide waveform generation, achieving fast inference speed and high-quality audio generation compared to baseline vocoders. This has practical significance for the real-time generation of highquality audio. In summary, the main works are as follows: (1) The paper introduces a music style transfer model that is based on DM and allows for many-to-many music styles to be transferred. This model is capable of performing real-time style transfer on audio, making it highly efficient and practical. (2) This study proposes a novel audio generation method called GuideDiff, which is based on the diffusion model. The GuideDiff method is designed to generate high-quality audio waveforms by utilizing spectrogram restoration techniques. (3) The experimental results show that the proposed model has good performance in both style transfer and audio quality compared to the baseline model. Moreover, it can achieve real-time conversion and generate target audio on consumergrade GPUs. In the remainder of this paper, we will organize the content as follows: Section 2 presents related work; Section 3 describes the architecture of the proposed method; Section 4 evaluates the effectiveness of the proposed method through experiments; and Section 5 provides the conclusion of this paper. 2. RELATED WORK 2.1 Music Style Transfer Numerous studies on musical style transfer have taken cues from models for transferring image styles. Musical style transfer can be categorized into three types: timbral style transfer, performance style transfer, and compositional style transfer. Among these, timbral-style transfer has received the most attention in recent years. This type of transfer involves altering the timbre of a musical composition in the audio domain. However, relatively little study has been done on the latter two types of musical style transfer: performance and compositional. Further study on these types of musical style transfers could lead to new and innovative ways of creating and transforming music. Researchers typically follow two different design patterns to achieve music style transfer. One involves symbolic music notation, and the other involves audio signals. For audio signals, researchers typically use time-frequency methods, which are more indirect and help reduce data complexity. They convert the abstract audio into spectrograms and use deep learning models for high-quality transfer. This method involves two deep learning models, with the first model involving the style transfer of the spectrogram of the audio and the second model involving the restoration of the generated spectrogram to real audio. Currently, researchers mainly use generative models such as CycleGAN [2], VAE [1], UNIT [12], and MusicVAE [13] for music style transfer. However, while these models have shown promising results, they also have limitations that hinder their practical application. Further research is needed to overcome these limitations and improve the effectiveness and efficiency of musical style transfer. The focus of this study is to explore a new generic music style transfer model that employs a time-frequency approach. This model is designed to enable three types of music style transfer: timbral, performance, and compositional. 2.2 Diffusion Models DM is a class of likelihood-based generative models, with its pioneering work being DDPM. Its core theoretical underpinnings are the Markov chain and Langevin dynamics. Due to its stable training and easy expansion, it has surpassed GANs [14] in image generation tasks and achieved higher sample quality. However, the sampling process is slow, and it needs to follow a Markov chain to generate a sample step by step. DDIM [15] accelerates the sampling process by iterative non-Markovian methods while keeping the training process unchanged. ADM [14] ultimately outperforms GAN-based methods through a welldesigned architecture and classifier guidance. A latent diffusion model [11] has also been proposed recently for image synthesis. This model compresses the image from pixel space to latent space for diffusion, resulting in significantly reduced computational complexity while achieving highquality image generation. However, the application of this model in the field of music generation has not been extensively studied. In this study, we propose a generic music style transfer framework based on the latent diffusion model, using spectrograms as an intermediate representation of music. In this respect, our work has something in common with riffusion [28], as both utilize Fourier transforms to process audio waveforms in order to obtain a spectrogram. This spectrogram is then diffused using a diffusion model. 2.3 Neural Vocoder Deep generative models have achieved significant success in modeling audio generation, with common methods including autoregressive models, flow-based models, and diffusion models. WaveNet [16] is an autoregressive model that generates high-fidelity audio, but its synthesis is slow, and the synthesized audio contains audible noise. WaveRNN [17] is another autoregressive model that reduces computational complexity by using sparse recurrent neu\fral networks. Stream-based models, such as WaveFlow [18], WaveGlow [19], and FloWaveNet [20], improve the quality of audio synthesis by maximizing the likelihood of training the model. Recently, DM-based audio generation models have been proposed, such as DiffWave [21] and WaveGrad [22], which are able to generate higher-quality audio and synthesize it faster than common models. In this work, we propose a new neural vocoder called GuideDiff based on DM. This vocoder is mainly used in the style transfer model to restore high-quality audio from generated spectrograms. Moreover, its synthesis speed is several orders of magnitude faster than baseline models like WaveNet. 3. METHOD Figure 1. Piano to violin style transfer. Music style transfer is accomplished in three steps in this work, as illustrated in Figure 1. Firstly, a spectrogram is obtained from the input audio waveform using the Short Time Fourier Transform (STFT), which represents time and frequency. The phase information is discarded, and only the amplitude is processed as an image. Secondly, the transfer of musical styles is performed by completing the domain conversion on the spectrogram using a latent diffusion model. Lastly, GuideDiff is utilized to convert the transformed spectrograms into audio waveforms. The section following this introduction will focus on the second part of the music style transfer process, which involves the conversion of the input spectrogram to a target spectrogram using a latent diffusion model. The subsequent section will cover the third part of the process, which is the conversion of the target spectrogram into a highquality audio waveform using the proposed neural coder, GuideDiff. 3.1 Time-Frequency Analysis The audio signal is often more challenging to capture compared to image signals. As a result, an audio spectrogram, which provides a visual representation of the frequency content of sound, is commonly used. In Figure 2, the x-axis represents time, while the y-axis represents frequency. The color of each pixel corresponds to the frequency and volume of the audio in its corresponding rows and columns. To perform style transfer, we need to analyze the input audio in both the time and frequency domains to obtain a spectrogram. One of the most commonly used techniques in this area is the Short Time Fourier Transform (STFT), which is often discretized for computer calculations. The discrete STFT operation can be abbreviated as STFTx[n](m, \u03c9k) = \u221e X n=\u2212\u221e x[n]\u03c9[n \u2212m]e\u2212j\u03c9kn (1) Figure 2. Spectrogram. Where x[n] is the input time domain signal, m is the step size, \u03c9k is the frequency, and \u03c9 is a window function. The audio is divided into segments of 5 seconds for timefrequency analysis to make processing easier. By performing the STFT transform independently, the segmented audio is converted into a spectrogram. In this case, a Hanning window with a step size of 100 is used, and the phase information is discarded during processing because it is ambiguous and unpredictable. 3.2 Transfer Model Figure 3. Models of transfer. Figure 3 illustrates the three main components of the style transfer model: an autoencoder (AE) that compresses and restores the input and output spectrogram information in pixel space; a latent space diffusion model that is mainly used for style transfer, which incorporates a cross-attention mechanism that completes the domain transformation by transferring data from the conditional mechanism into the denoised UNet; the conditional mechanism is primarily used to convey information learned from various musical spectrograms into latent space. 3.2.1 Perceptual Compression By drawing on the work of Robin Rombach et al. [11], we introduced perceptual compression to lower the computing needs of training DM for producing high-quality spectrograms. The sampling is carried out in a low-dimensional space, which increases the DM\u2019s computing efficiency. A pre-trained self-encoder was employed for perceptual compression. This self-encoder is trained using a patchbased adversarial objective in conjunction with a perceptual loss. The blur created by relying simply on pixel space loss is effectively avoided, which enhances the reconstruction\u2019s realism. It offers a low-dimensional representation space that is analogous to the data space from a perceptual standpoint. The self-encoder consists of an encoder \u03b5 and a generator D. They are both composed of three layers of threedimensional convolution. Formally, given a sample spectrogram x \u2208RH\u00d7W \u00d73, the encoder \u03b5 encodes it into a potential representation z = \u03b5(x),where z \u2208Rh\u00d7w\u00d73. \fThe encoder downsamples the spectrogram by a factor f = H/h = W/w and the generator D reconstructs the potential representation back into a sample \u02dc x,i.e. \u02dc x = D(z). To avoid a high degree of dissimilarity in the potential representation space, we have adopted a KL-reg regularization, introducing a slight KL penalty term. A standard learning rate is obtained at the beginning, and the effect is very close to that of a variational autoencoder (VAE). The reconstruction loss Lrec consists of pixel-level mean squared error (MSE) and perceptual-level loss. In summary, the overall training objectives for encoder \u03b5 and generator D are LAE = min \u03b5,D (Lrec(x, D(\u03b5(x)))+KLreg(x||(\u03b5(x)))) (2) 3.2.2 Latent Diffusion Models With the perceptual compression model, we can obtain an effective, low-dimensional latent space in which high frequencies and some difficult-to-perceive details are abstracted. This is effective for the extraction of musical features such as pitch, loudness, timbre, etc. Recalling DM, we propose to diffuse and denoise the spectrogram in the latent space. Given a compressed latent code z0 \u223c q(z0). DM consists of a forward diffusion process and a backward denoising process. In the forward diffusion process, we train the diffusion model by iteratively adding T steps of diffusion Gaussian noise according to a fixed noise schedule, starting from data z0 to produce a set of noisy latent variables, i.e. z1, ..., zT . q(zt|zt\u22121) = N(zt; p 1 \u2212\u03b2tzt\u22121, \u03b2tI) (3) q(z1:T |z0) = T Y t=1 q(zt|zt\u22121) (4) where \u03b21, \u03b22, ..., \u03b2T is the noise scheduling that converts the data distribution z0 into a potential zT . Ultimately, data points zT are indistinguishable from pure Gaussian noise when mixed together. The diffusion model is employed in the reverse denoising process to recover zT to z0 by p(zt\u22121|zt) = N(zt\u22121; \u00b5\u03b8(zt, t), \u03c3\u03b8(zt, t)) (5) p\u03b8(z0:T ) = p(zT ) T Y t=1 p\u03b8(zt\u22121|zt) (6) where \u03b8 is a parameterized neural network that is defined by a Markov chain. The U-Net, commonly used in image synthesis, is used here to predict \u00b5\u03b8(zt, t) and \u03c3\u03b8(zt, t). In actuality, \u03c3\u03b8 is set to a time-dependent constant that is untrained depending on a noise schedule of \u03c3\u03b8(zt, t) = \u03c3t = 1 \u2212\u00af \u03b1t\u22121 1 \u2212\u00af \u03b1t \u03b2t (7) Where \u03b1t = 1 \u2212\u03b2t,\u00af at = Qt i=1 \u03b1i, we parameterize \u00b5\u03b8 = (zt, t) by \u00b5\u03b8(zt, t) = 1 \u221a\u03b1t (zt \u2212 \u03b2t \u221a1 \u2212\u00af \u03b1t \u03f5\u03b8(zt, t)) (8) Final \u03f5\u03b8(zt, t) was assessed. In practice, we use simplified training objectives. Lsimple(\u03b8) = E\u03b5(x),\u03f5\u223cN (0,1)||\u03f5\u03b8(zt, t) \u2212\u03f5||2 2 (9) where \u03f5 \u223cN(0, 1) . Since the forward process of the diffusion model is fixed, it can be efficiently obtained during training zt and the p(z) samples generated by the reverse process can be encoded once in perceptual space through the generator D into image space. Style transfer module. To model the generation of spectrograms in the latent space and to accomplish style transfer. We used a 2-dimensional convolutional layer to build the underlying U-Net capabilities, specifically a 2\u00d72 shaped convolutional layer. A cross-attention mechanism is added to augment the U-Net backbone, enabling it to generate spectrograms in the target domain conditional on the style transfer. And it ensures that style information can be shared across the potential space, which is essential for learning the style of audio and completing style transfer. 3.2.3 Conditioning Mechanisms In this module, we employ a domain-specific encoder \u03c4\u03b8 to preprocess the input conditional style spectrogram y and project the encoded y onto an intermediate representation \u03c4\u03b8(y) \u2208RM\u00d7d\u03c4 , which is then mapped to the intermediate layer of the U-Net via a cross-attention layer to enable the generation of the spectrograms according to condition y. The following equation carries out the cross-attention mechanism. Attention(Q, K, V ) = softmax(QKT \u221a d ) \u00b7 V (10) where Q = W (i) Q \u00b7 \u03c6i(zt) ,K = W (i) K \u00b7 \u03c4\u03b8(y),V = W (i) V \u00b7 \u03c4\u03b8(y). \u03c6i(zt) \u2208Rd\u00d7di \u03f5 denotes the intermediate U-Net representation that implements \u03b5\u03b8. W (i) V \u2208Rd\u00d7di \u03f5,W (i) K \u2208 Rd\u00d7di \u03f5 and W (i) Q \u2208Rd\u00d7di \u03f5 are projection matrices that are mainly used to learn and map styles from the target domain of the \u03c4\u03b8(y) representation, enabling style transfer. The objective function is rewritten as LCM(\u03b8) = E\u03b5(x),y,\u03f5\u223cN (0,1)||\u03f5 \u2212\u03f5\u03b8(zt, t, \u03c4\u03b8(y))||2 2 (11) Where \u03c4\u03b8 and \u03f5\u03b8 can be jointly optimized by means of an objective function. 3.3 Waveform Reconstruction We propose a novel encoder, called GuideDiff, to convert the spectrogram output from the model into audio. It can restore the spectrogram to generate high-quality audio. As shown in Figure 4, a 3 \u00d7 3 encoder \u03b5 = E\u03b8enc(mw) is first used to encode the spectrogram into the latent space, and then the information x from the latent space is sent as conditional information into the U-Net\u2019s cross-attention \fFigure 4. GuideDiff architecture. mechanism for conditioning and directing the creation of waveforms. The original waveform is then recreated by using the diffusion decoder D = D\u03b8dec(z, \u03b1, s) to decode the latent signal, where D\u03b8dec denotes the diffusion sampling method, \u03b1 denotes the noise, and s denotes the sample pace length. Target diffusion is used to train Decoder D while conditioning the latent 2D U-Net, which is repeatedly invoked during the decoding procedure. Figure 5 displays the model\u2019s primary network diagram. Where yn Figure 5. Model\u2019s primary network. denotes the n th round of noisy audio input and \u03f5\u03b8 denotes the simulated generated noise. FiLM is the characteristic linear modulation module, consisting of two 3 \u00d7 1 convolutional layers and the Leaky ReLU function. Here we condition on noise level \u221a\u00af \u03b1 and pass it to the position encoding function. Compared to the DM objective function, we can write the objective function as LGuideDiff(\u03b8) = E\u00af \u03b1,\u03b5[||\u03f5\u2212\u03f5\u03b8(\u221a\u00af \u03b1ny0+ \u221a 1 \u2212\u00af \u03b1n\u03f5, x, \u221a \u00af \u03b1)||1] (12) where \u03b1 = 1 \u2212\u03b2n,\u00af \u03b1n = Pn s=1 \u03b1s , in this case \u03b2n, is an equivariant sequence from 0 to 1. For the input spectrograms, we discarded the phase and used only the amplitude. By encoding the spectrograms in latent space, the computational load for the representation can be effectively reduced. Moreover, it enables the diffusion model to learn how to generate waveforms with true phase. The latent space obtained is used as the starting point for the next diffusion phase. The advantage of this is that our model only needs to be trained once. The latent trajectory space also allows for a large number of inference procedures to be performed without requiring retraining. Specifically, once this model is trained, it is only necessary to use a different number of iterations N in the inference process to determine the quality of the computational output. This is useful for rapidly bootstrapping the generation of high-quality raw audio. To ensure that the reduced latent space is available for latent diffusion, we apply the tanh function to the bottleneck, ensuring that the values remain within the range [-1, 1]. In summary, our overall objective function is L = LAE+Lsimple(\u03b8)+LCM(\u03b8)+LGuideDiff(\u03b8) (13) 4. EXPERIMENTS In Section 4.1, we provide details on the experimental setup, including data description and pre-processing, as well as evaluation metrics. Section 4.2 then provides a detailed description of the implementation. 4.1 Experimental Setup 4.1.1 Data Description And Preprocessing The model consumes a large amount of memory when generating an entire song at once. To mitigate this issue, we employed the Demucs model to separate the music into its constituent sources, such as vocals, bass, and drums. Furthermore, each song was divided into smaller segments, which were modeled individually and then reassembled. However, rearranging the segments was challenging, as they differed in downbeat, key, and pace. To address this, we smoothly interpolated cues and seeds in the model\u2019s latent space. In a diffusion model, the latent space is a feature vector that encompasses the entire space of possibilities that can be generated by the model. Items that are similar to each other are approached in the latent space, and each value in the latent space is decoded into a feasible output. This makes the audio sound natural. We require various types of music data to train our model to achieve music style migration. For all the experiments in this study, we used music datasets from multiple source domains collected from the web. This dataset includes over 100,000 WAV audio files of various instruments, genres, and compositional styles. The main instruments include piano, violin, guitar, and others, while the genres mainly consist of jazz, classical, and pop. The data was used for training (80%), testing (10%), and validation (10%). 4.1.2 Evalutaion Metrics The following measures were used to evaluate and analyze the model\u2019s performance: Fr\u00b4 echet Audio Distance (FAD) [23] The FAD calculates the Fr\u00b4 echet distance between the output generated audio samples and the real audio samples. The smaller the distance between the two data distributions, the more realistic the generated samples will be, which gives a reliable assessment of the difference between them. Accuracy In this research, five independent style assessment classifiers were trained in order to test the efficacy of the model style transfer. The percentage of styles accurately predicted in each song bar served as a measure of the classifiers\u2019 accuracy. \fMean Opinion Score(MOS) In this work, a 5-scale mean opinion score is used to evaluate the proposed model. Where the MOS value suggests that a higher value is preferable. Subjects were asked to rate each of the three questions for each transfer version on a scale of 1 to 5. 1. Success in style transfer (ST): whether the target domain is migrated in the generated audio after transfer compared to the original audio. 2. Content preservation (CT): the extent to which the migrated-generated audio matches the original audio content. 3. Sound quality (SQ): the generated audio has high or poor sound quality. A mean score will be used when comparing it to other baseline models. GuideDiff simply evaluates the quality of the generated sound. Inception Score (IS) [24] To evaluate the level of diversity and quality of the sample generation. IS is an evaluation metric employing a ResNeXT classifier [25] trained on our dataset and a 10-dimensional logit based on a 1024dimensional feature vector. To assess the effectiveness of the proposed audio generation model. IS is calculated as IS = exp(Ex\u223cpgenKL(PF(x)||Ex\u2032\u223cpgenPF(x \u2032))) (14) Where PF(x) is a multinomial distribution and Ex\u2032\u223cpgenPF(x \u2032) is an edge label distribution. 4.1.3 Implementation Details This work uses a UNet architecture consisting of 14 layers of stacked convolution blocks and attention blocks as a combination of upsampling and downsampling for the diffusion model, which is based on the work of Robin Rombach et al [11]. For the downsampling factor, a downsampling factor of 4 was used. The same hidden size and skip connection layers were set between the layers in the UNet model. The first six layers of the UNet model use 512 \u00d7 512 input and output channels, followed by two 256\u00d7256 and 128x128 input and output channels, respectively. After that, the input and output channels are halved layer by layer. The attention mechanism is used in this work at 16 \u00d7 16,8 \u00d7 8 and 4 \u00d7 4 resolutions. A ResBlock is also added to the UNet module, which receives two inputs: the image x and the embedding corresponding to the timestep. Two linear layers and the time emb layer make up the time-step embedding layer. Our compression ratio for the latent space is 64. The audio samples were sampled at a frequency of 16000 Hz, with a channel size of 2, and an amplitude of -10 dB. The model was trained using the Adam optimizer with 500k steps, a learning rate of 5e-5, and a batch size of 100. The batch size for GuideDiff was set to 256. Approximately 1M steps were trained using the Adam optimizer. The experiments in this research generated audio in less than 5 seconds, which can be regarded as real-time generation, and were trained on 3 NVIDA RTX3090Ti, a GPU capable of running 50 stable diffusion steps. 4.2 Experimental Analysis Four primary musical style transfer tasks were taken into consideration in the trials: 1. Stylistic transfer of instrument timbres. Mainly consider piano to guitar (p2g) and piano to violin transitions (p2v). Each transition will do a bilateral transformation. 2. transfer of musical genres. Genre conversions from jazz to pop (j2p) and jazz to class (j2c) are mainly considered. Each transition will do a bilateral transformation. 3. Music composition style conversion. Beethoven to Chopin (B2C), and Chopin to Beethoven (C2B) conversions are mainly considered. 4. Many-to-many style conversions. Conversion of classical piano pieces played mainly by Beethoven to jazz violin in the Chopin style (Bcp2Cjv). Figure 6. Style transitions for various tasks. The spectrograms of our model\u2019s inputs and outputs for the various tasks are shown in Figure 6. From the plots, it is clear that the target domain is shifted while the contents are kept intact. 4.2.1 Style Conversion Evaluation This study evaluates the proposed model through four different style transfer challenges. Subjective (MOS) and objective (FAD, accuracy) evaluations are used to compare the style conversions. Each score has its own limitations. Subjective measurements evaluate three main aspects of the model: the success of style transfer (ST), content preservation (CP), and sound quality (SQ). A 5-point scale is used for evaluation. Objective evaluations use FAD to measure individual aspects of the conversion, and accuracy is used to evaluate the accuracy of style transfer. Subjective evaluation Mean opinion scores (MOS) were collected from 200 testers for the listening test. These testers included both music lovers and non-musicians. In each mid-round score, testers first listened to the original audio clip and then to the style-shifted version. The results indicate that our model performs the best in the piano2violin task, which may be attributed to the relatively simple timbre conversion of a single instrument. \fTask ST CP SQ piano2Violin 4.27 4.13 4.3 piano2guitar 4.02 4.05 4.2 jazz2pop 3.95 3.8 4.0 jazz2class 3.96 4.0 4.12 Beethoven2Chopin 4.05 4.1 4.15 Bcp2Cjv 4.1 4.23 4.3 Table 1. 5-scale MOS with style Transfer. Our model\u2019s performance is slightly lower in the jazz2pop and jazz2class tasks, but it still achieves scores close to 4 in terms of successful style transfer and content retention. This suggests that our model is relatively successful in genre conversion. Additionally, the high scores for sound quality in all six tasks indicate that the proposed model is capable of generating high-quality music. Objective review Measures how well the converted version matches the original version and the accuracy of the style transfer. Task FAD\u2193 Accuracy\u2191 piano2Violin 7.52 94.5% piano2guitar 6.95 93.4% jazz2pop 11.76 86.2% jazz2class 10.55 87.2% Beethoven2Chopin 6.19 95.3% Bcp2Cjv 6.07 95.7% Table 2. FAD&Accuracy for the tasks. The accuracy of style transfer between the audio produced by the specified task and the original audio is presented in Table 2 along with the results of FAD calculations. The results indicate good performance in terms of the timbre transfer of instruments and the transfer of compositional styles. However, the performance is poor in terms of genre transfer, which is consistent with the results of the subjective evaluation. This is an area that requires improvement in future research. 4.2.2 Comparison With Other Models Our model was compared against a number of baseline models, including CycleGAN [2], UNIT [12], musicVAE [13], and autoencoder [26], in order to show the validity of the model described in this work. Table 3 presents the outcomes. Note that these baseline models for style transfer are all one-to-one mappings. In this work, the input transfers use the same music clip, and they are trained independently. Only the spectrogram form is considered for the intermediate representation of the music. The same model, GuideDiff, is used for the generation of the waveform. The comparison of the baseline models indicates that CycleGAN performs the best in terms of genre migration, which may be related to the fact that cycle consistency loss is taken into account in its direct matching of target domains at the feature level. However, our model achieved a result that is only about 0.1 points lower than the best. Additionally, our model outperforms the other baseline models in terms of the migration of musical instrument timbre and compositional style. Therefore, it can be conModel Task p2v p2g j2p j2c B2C CycleGAN 3.98 3.96 4.17 4.12 4.0 UNIT 3.7 3.75 3.5 3.62 3.71 musicVAE 3.86 3.91 3.7 3.68 3.89 autoencoder 3.5 3.56 3.4 3.45 3.52 ours 4.23 4.09 3.91 4.02 4.07 Table 3. MOS with the baseline comparison model. cluded that the proposed model demonstrates superior performance in terms of flexible many-to-many musical style migration compared to the other baseline models. 4.2.3 Evaluation of the audio generating model To demonstrate the performance and high-quality audio generation capabilities of GuideDiff, the proposed audio generation model, examples are presented in this section. Comparisons are made between the proposed model and WaveNet [16], WaveRNN [17], and WaveGAN [27]. All models use the same training set and are tested using the same spectrograms to generate audio. Both subjective and objective evaluation techniques are used to assess the quality of the generated audio. Testers will rate the audio quality on a scale of 1 to 5 for subjective evaluation. The results are presented in Table 4. Model MOS(\u2191) IS(\u2191) WaveNet 3.02 2.84 WaveGAN 3.82 4.53 WaveRNN 4.40 5.38 GuideDiff 4.41 5.40 Table 4. Comparison of audio generation models. The comparison demonstrates that our model performs similarly to the autoregressive model WaveRNN and surpasses the other baseline models. This suggests that the proposed model has excellent performance in producing high-quality audio. 5."
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14772v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14772v1",
|
| 3 |
+
"title": "Simulating Task-Oriented Dialogues with State Transition Graphs and Large Language Models",
|
| 4 |
+
"abstract": "This paper explores SynTOD, a new synthetic data generation approach for\ndeveloping end-to-end Task-Oriented Dialogue (TOD) Systems capable of handling\ncomplex tasks such as intent classification, slot filling, conversational\nquestion-answering, and retrieval-augmented response generation, without\nrelying on crowdsourcing or real-world data. SynTOD utilizes a state transition\ngraph to define the desired behavior of a TOD system and generates diverse,\nstructured conversations through random walks and response simulation using\nlarge language models (LLMs). In our experiments, using graph-guided response\nsimulations leads to significant improvements in intent classification, slot\nfilling and response relevance compared to naive single-prompt simulated\nconversations. We also investigate the end-to-end TOD effectiveness of\ndifferent base and instruction-tuned LLMs, with and without the constructed\nsynthetic conversations. Finally, we explore how various LLMs can evaluate\nresponses in a TOD system and how well they are correlated with human\njudgments. Our findings pave the path towards quick development and evaluation\nof domain-specific TOD systems. We release our datasets, models, and code for\nresearch purposes.",
|
| 5 |
+
"authors": "Chris Samarinas, Pracha Promthaw, Atharva Nijasure, Hansi Zeng, Julian Killingback, Hamed Zamani",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "LLM Fairness",
|
| 14 |
+
"gt": "This paper explores SynTOD, a new synthetic data generation approach for\ndeveloping end-to-end Task-Oriented Dialogue (TOD) Systems capable of handling\ncomplex tasks such as intent classification, slot filling, conversational\nquestion-answering, and retrieval-augmented response generation, without\nrelying on crowdsourcing or real-world data. SynTOD utilizes a state transition\ngraph to define the desired behavior of a TOD system and generates diverse,\nstructured conversations through random walks and response simulation using\nlarge language models (LLMs). In our experiments, using graph-guided response\nsimulations leads to significant improvements in intent classification, slot\nfilling and response relevance compared to naive single-prompt simulated\nconversations. We also investigate the end-to-end TOD effectiveness of\ndifferent base and instruction-tuned LLMs, with and without the constructed\nsynthetic conversations. Finally, we explore how various LLMs can evaluate\nresponses in a TOD system and how well they are correlated with human\njudgments. Our findings pave the path towards quick development and evaluation\nof domain-specific TOD systems. We release our datasets, models, and code for\nresearch purposes.",
|
| 15 |
+
"main_content": "Introduction Task-Oriented Dialogue (TOD) systems have become increasingly popular in various domains, such as customer support, personal assistants, e-commerce, and enterprise. These systems aim to assist users in accomplishing specific goals through natural language conversations. However, building effective TOD systems requires large amounts of diverse and high-quality training data, which can be expensive and time-consuming to collect (Zhang et al., 2020). Moreover, existing datasets often lack the complexity and richness needed to develop sophisticated TOD systems that can handle a wide range of user intents, perform slot filling, address information seeking requests, and generate contextually relevant and appealing responses (Mendonc \u00b8a et al., 2023; Zamani et al., 2023). Recent advancements in large language models (LLMs) have shown promising results in various NLP tasks. However, LLMs alone are not sufficient for building effective TOD systems, as they require a set of diverse task-specific training data to perform well in specialized domains (Hudecek & Dusek, 2023). We argue that trivial synthetic data generation approaches using LLMs (for example through single prompt engineering) may not provide the diverse training data required for training robust TOD systems. To address these challenges, we introduce SynTOD, a simple yet effective framework that takes a state transition graph for the target TOD system and translates it into a set of synthetically generated task-oriented dialogues using LLMs. The state transition graph defines \u2217Equal contribution 1 arXiv:2404.14772v1 [cs.CL] 23 Apr 2024 \fPaper under review the desired behavior of the TOD system and guides the generation of diverse, structured conversations. This approach allows for fine-grained control over the conversation structure, ensuring that the generated data covers a wide range of scenarios and edge cases. Based on our experiments, SynTOD leads up to 37% improvement in intent classification, 100% in slot filling and 30% in response relevance compared to naive single-prompt simulated conversations. By incorporating retrieval augmentation, SynTOD enables the development of TOD systems that can handle complex dialogues that involve navigation, search, result filtering, summarization, and question answering. In this work, we aim at answering the following research questions: RQ1: How does data generation for TOD with a single prompt compare to graph-guided multi-prompt generation? RQ2: How do different LLMs trained on synthetic data perform on end-to-end TOD tasks? RQ3: How much synthetic training data is required to build an effective LLM-based TOD system? and RQ4: How do various LLMs evaluate response relevance in this setting, and are they correlated with human judgments? Figure 1: Overview of an end-to-end retrievalaugmented TOD system. A LLM and a retriever are the main components. A conversation history is given as input, and response, intent, slots and documents comprise the output system state. To address these research questions, we conduct extensive experiments in two new defined domains: cooking and e-commerce assistance. Our Synthetic datasets surpass existing TOD and conversational recommendation datasets in terms of feature richness and diversity, covering 7 different types of interactions compared to other datasets that have up to 4 (see Table 7), and allow us to train and evaluate both state tracking and various types of response generation, including attribute-related questions, comparison questions, open-domain questions, result summarization and clarifying questions. We evaluate the performance of various LLM-based TOD systems trained on our synthetic data using both automatic and human evaluations. While there exist other approaches for generating synthetic data for TOD systems, our focus on fully automated graph-guided multiprompt generation using LLMs with minimal human input sets SynTOD apart. The only required human input is a transition graph and a set of response simulation prompts. Sampling of user intent paths using a state transition graph allows for more structured and diverse conversations. The main contributions of this work are as follows: \u2022 We propose SynTOD, a simple framework for generating synthetic training data for end-to-end TOD systems using state transition graphs and LLMs. \u2022 We demonstrate the effectiveness of SynTOD in two domains: cooking and ecommerce assistance, generating datasets that surpass existing TOD and conversational recommendation datasets in terms of feature richness and diversity. \u2022 We conduct extensive experiments to evaluate the performance of LLM-based endto-end TOD systems trained on our synthetic data, using both automatic and human evaluation, and provide insights into the four research questions posed above. \u2022 We release two synthetic datasets generated using SynTOD, along with a curated test split that can serve as a proxy benchmark for comparing complex TOD systems. We also make our models and implementation publicly available.1 By leveraging the power of LLMs and our synthetic data generation framework, SynTOD aims to simplify the development process of sophisticated TOD systems and enhance the user experience in real-world applications. Our approach offers a promising direction for building effective TOD systems in low-resource settings and specialized domains. 1Our data, models and code are available at https://github.com/algoprog/SynTOD. 2 \fPaper under review 2 Methodology In this section, we describe SynTOD, our new framework for synthetic data generation for TOD systems. SynTOD is based on the creation of a state transition graph and the simulation of retrieval-augmented responses using LLMs. The primary goal in TOD is to facilitate a user in accomplishing a specific goal through a conversational interface. Effective TOD systems should be capable of understanding the user\u2019s intent, filling in the necessary slots, and generating appropriate responses. Given a dialogue history H = {u1, r1, u2, r2, ..., ut}, where ui and ri represent the user\u2019s and system\u2019s utterances respectively at time i, a state transition graph G, and the parameters of an LLM M\u03b8, SynTOD should generate a system state St at time t: St = \u03d5(H, G, M\u03b8). St is a tuple of three components: the user\u2019s intent It with related attributes (slots) Vt, and optionally some documents Dt that might be retrieved to help generate a response: St = (It, Vt, Dt). Figure 2: The state transition graph we defined for the recipe assistant domain. On the right we see transitions to nodes that are possible from any other state. Figure 3: Overview of the SynTOD conversation simulation framework. State Transition Graph The first step in our framework involves defining a state transition graph G. This graph encapsulates the desired behavior of the TOD system. The nodes in this graph represent the various states of the system, while the edges symbolize the user\u2019s intents. The edges also have weights based on the transition probabilities between states. The probabilities can be defined empirically or based on some analysis of existing real 3 \fPaper under review Cooking Assistance E-commerce Assistance Train Test Train Test Total conversations 2000 300 2000 304 # utterances per conversation 35.89 (\u00b1 10.34) 29.08 (\u00b1 10.84) 23.19 (\u00b1 7.80) 22.30 (\u00b1 7.87) # tokens per conversation 1,416 (\u00b1 386) 1,448 (\u00b1 594) 2,220 (\u00b1 934) 1,972 (\u00b1 815) # tokens per user utterance 12.45 (\u00b1 7.18) 13.26 (\u00b1 9.06) 22.67 (\u00b1 14.45) 24.76 (\u00b1 23.26) # tokens per system utterance 57.39 (\u00b1 26.65) 74.98 (\u00b1 36.28) 89.57 (\u00b1 54.78) 81.73 (\u00b1 53.86) Table 1: Statistics of the graph-guided dataset for cooking and e-commerce domains. conversations in a given domain. The graph is designed to be comprehensive, covering all possible states and transitions that the system may encounter during a conversation and serves as the backbone of the SynTOD framework, guiding the generation of synthetic conversations. An example of a state transition graph for the e-commerce assistance domain can be seen in Figure 2. Data Generation The data generation process of SynTOD is summarized in Figure 3 and described in detail in Algorithm 1. We generate training examples Ti through a process f: Ti = f (Ds, M, P, G), where Ds a collection of seed items/documents with relevant metadata, M a pre-trained LLM, P a set of response simulation prompts, one or more per user and system intent, and a state transition graph G. The training example Ti generated through the process f includes both the dialogue history H and the corresponding system state St for each time step t. The algorithm starts with a set of random walks generated based on the graph G. Each random walk represents a potential conversation path, with each node and edge corresponding to a system state and user intent, respectively. For each node and edge in these random walks, a large language model with a custom prompt is used to simulate a response. A pre-trained LLM is used to generate responses from either the system or the user, depending on the node or edge it is simulating. This process allows for the creation of diverse and realistic synthetic conversations that adhere to the structure defined by the state transition graph. In addition to simulating responses, the SynTOD framework also incorporates retrieval-augmentation. For example, when a user searches for items, a retriever fetches some items from a document corpus, and the LLM selects a subset of them and summarizes them for the user. To simulate the retrieval augmented responses, we use a corpus of items as seed, and then each seed item is treated as the ground truth target for selection and simulation of future responses. This grounded response generation ensures that the responses are contextually accurate and have limited hallucinations, further enhancing the realism and diversity of the synthetic conversations. Moreover, the algorithm also simulates various state variables, such as step numbers, lists, and queries. These state variables are randomly generated to add more variety to the conversations. In particular, queries are generated using special prompts that guide the LLM to create realistic search queries based on the target item metadata. LLM Adaptation for end-to-end TOD Based on all the training examples Ti \u2208T, we learn the parameters \u03b8 of another LLM, denoted as M\u03b8, for generating the next system state in other real conversational contexts. For training we can employ parameter-efficient finetuning methods (PEFT) such as QLoRA (Dettmers et al., 2023). Figure 1 shows the simplified architecture of an end-to-end TOD system powered by a single fine-tuned LLM (M\u03b8). 3 Experimental Setup 3.1 Datasets For our experiments we generated datasets for two domains; cooking and e-commerce assistance. For each domain we have two splits, for training and testing. For the training split generation, we used GPT-4, while for the test split we used LLaMA 2 70B, Mistral Medium and Gemini Pro. For each domain, we generated 2000 conversations for training and 300 (100 from each model) for testing. The statistics of our synthetic dataset can be seen in Table 1. We can see that in both domains, the conversations tend to be long both in terms 4 \fPaper under review Algorithm 1 SynTOD Conversation Simulation Framework Require: State transition graph G, seed items Ds, pre-trained LLM M, response simulation prompts P, search intents Is, retrieval model R, query generation prompt Pq Define the state transition graph G Generate a set of random walks W based on G Initialize an empty set of training examples T for each random walk w \u2208W do Sample a target document dt \u2208Ds Initialize dialogue history list H, list of system states S and monitored state variables V for each node and edge (n, e) \u2208w do if previous edge eprev \u2208Is then Retrieve k relevant documents Dr for V(query) using retrieval model R D \u2190Dr \u222a{dt} else D \u2190\u2205 end if Generate system response rt using M and V, D, dt with prompt Pn Update dialogue history H \u2190H \u222a{rt} if e \u2208Is then Generate search query q using M with prompt Pq and target item dt Update monitored state variables V(query) = q end if Generate user utterance ut using M and V with prompt Pe Update dialogue history H \u2190H \u222a{ut} Update system state St = (Ie, V, D) Update list of states S \u2190S \u222a{St} Update other monitored state variables in V (e.g. step counter, lists) end for Create training example Ti = (H, S) T \u2190T \u222a{Ti} end for return T of conversation turns and total words, in contrast to existing conversational datasets that tend to be short in both aspects. While we used mostly commercial closed-source models to build our training and testing data with a small cost (around $300 for recipe and $500 for e-commerce), it might be possible to generate data of similar quality with recent open-source models such as Mixtral. Cooking Assistance For the cooking assistance domain, we defined a system that helps the user find relevant recipes from a corpus, answers questions about them and is able to go through the instructions step by step. The system supports two types of queries, generic, when asking for general recipe recommendations based on occasion or preferences (e.g., I want to make a dessert for Christmas) and specific, when searching for some specific recipe (e.g., I want to make fluffy pancakes). We used 4000 recipes from the Tasty dataset as our corpus (Sener & Yao, 2019). The supported intents can be seen in Table 8 and an example conversation in Table 10 in the appendix. E-commerce Assistance For the e-commerce assistance domain, we defined a system that helps users discover products from a corpus, compare, answer questions about them, add or remove them from the cart and finally buy the items in the cart. The system can handle two types of queries, generic and specific. Generic queries do not mention a specific product name (e.g., I want to buy a smartphone) and are followed by clarifying question from the system (e.g., what brand would you like?). To compile the product corpus, we combined the MAVE dataset (Yang et al., 2022) with Amazon reviews (He & McAuley, 2016), resulting in a dataset comprising 4000 products across 50 diverse categories such as Shoes and Headphones & Headsets. This dataset lacked critical information such as delivery locations. To address this, we introduced random location allocations for each product. Shopping often involves multiple simultaneous purchases or comparisons. Consequently, for the conversation simulations we included a primary product seed along with additional randomly selected products for comparison and cart additions. For cart additions we randomly sampled 5 \fPaper under review products across different categories, and for comparison lists we kept the same category with the seed product. The definition of the supported intents in this domain can be seen in Table 9 and an example conversation in Table 11 in the appendix. 3.2 Training and Inference Data Format For training an LLM for end-to-end TOD with our synthetic data, we convert the training examples to text format (similar to ChatML). In the conversations we have the following roles; system, user, suggestions, retriever and item information. The suggestions contain list of generated queries for LLM-assisted retrieval for generic queries (those queries are used to perform retrieval and append results in the retriever role), the retriever role contains result metadata such as item title, description and rating, and the item information role contains all the relevant metadata for a selected recipe or product. Each system and user utterance is separated in two segments. The first segment contains the text response while the second contains system state information in json format, which encompasses the current intent and related slots. Fine-tuning We fine-tune the language models using the QLoRA (Dettmers et al., 2023) parameter-efficient method until convergence. The training is performed with a batch size of 2 and 8 gradient accumulation steps, resulting in a total effective batch size of 16. There are 1000 steps in total, and we evaluate the model every 200 steps. For the LoRA weight, we start with r = 64 and \u03b1 = 16 as the default setting. In the recipe domain, we conduct a hyperparameter search for the LoRA parameters, exploring the following variations: (r = 128, \u03b1 = 16), (r = 64, \u03b1 = 32), and (r = 64, \u03b1 = 8). The best-performing settings for the e-commerce domain are \u03b1 = 32 and r = 64 at the step 600 (70.59% of the training data), while for the recipe domain, \u03b1 = 8 and r = 64 at the steps 100 (11.76% of the training data), yield the best results. Nearest-neighbor Intent Selection The intent prediction is performed by the LLM finetuned on our synthetic data. However, the generated intent text itself is not always consistent. For example, the \u201dadd to cart\u201d intent could be generated as \u201dADD TO CART\u201d or \u201dselect i add to cart\u201d. To address this issue and improve the stability of intent generation, we incorporate a dot product nearest neighbor approach on the generated intent,2 mapping it to the closest available intent in our predefined set. This ensures that the model produces the expected intent it intended to generate. 4 Results and Analyses RQ1: How does data generation with a single prompt compare to graph-guided multiprompt generation? To address the first research question, we compared the diversity and coverage of the generated data using a single prompt versus graph-guided multi-prompt generation. The results demonstrate that graph-guided multi-prompt generation leads to more diverse data and better coverage of intents. Figure 4 illustrates that without the graph, some intents have near-zero frequency while others have higher frequency than desired. Additionally, using a single prompt results in less diverse utterances, as evidenced by the higher Self-BLEU (Zhu et al., 2018) scores (see Table 2). These findings highlight the importance of the state transition graph in enforcing the desired distribution of user intents and promoting utterance diversity. The model trained with data generated from the transition graph significantly outperforms the model trained without the graph in all intent classification and slot filling metrics, including micro precision, recall, and F1 score (see Table 3). It is worth noting that for slot filling evaluation, the metrics might be misleading to an extent, because in some cases the predicted slots are correct but with small variations (e.g. \u2019pancake recipe\u2019 instead of \u2019pancake\u2019). Figures 5 and 6 in the appendix, further illustrate the improvement in accuracy across various intents when using graph-guided training data. These results demonstrate the effectiveness of the state transition graph in generating higher quality training data for intent classification and slot filling. Response relevance evaluation using human annotators, Mixtral and OpenChat 3.5 provides insights into the 2We used all-MiniLM-L6-v2 as our embedding model 6 \fPaper under review quality of the generated responses (see Table 4). We defined 3 relevance levels; 0 means the generated response is irrelevant or has major issues, 1 is relevant but worse than the ground truth and 2 means as good as the ground truth. For the human annotation, we asked 3 participants to give one of these labels for each response given the conversation history. We used majority voting and chose the lowest rating in case of ties. The results show that the model trained with graph-guided data achieves higher average relevance scores compared to the model trained without the graph, indicating the superiority of the graph-guided approach in generating high-quality responses. Dataset Graph Self-BLEU Cooking \u2713 0.7850 \u2717 0.8101 Ecommerce \u2713 0.8123 \u2717 0.8932 Table 2: Diversity of data generated with and without a graph. Figure 4: Frequency distribution of user intents for the recipe domain with and without state transition graph. Metric Cooking E-commerce no graph with graph no graph with graph intent accuracy 0.7620 0.9580* 0.6719 0.8296* intent precision 0.7087 0.9344* 0.6534 0.8030* intent recall 0.6591 0.9477* 0.6585 0.8435* intent f1 0.6830 0.9410* 0.6560 0.8228* slot precision 0.5682 0.7417* 0.3157 0.5693* slot recall 0.6001 0.7343* 0.2789 0.5882* slot f1 0.5561 0.7180* 0.2840 0.5690* Table 3: Performance comparison of models for intent classification and slot filling with and without a state transition graph. Statistical significance is denoted by \u2217(p < 0.01). RQ2: How do different LLMs perform on end-to-end TOD? To investigate the second research question, we tested three different LLMs with similar architecture and number of parameters (7B) on end-to-end TOD tasks. The results, as shown in Table 5, indicate that there is no significant difference in performance across different models (Llama 2 vs. Mistral). Furthermore, instruction-tuning, also known as alignment, does not seem to have a significant effect on performance. RQ3: How much synthetic training data is required? To address the third research question, we used the 2K generated examples (We saved 300 examples for validation and 1700 examples for training) for each domain and observed the model\u2019s convergence using different proportions of the generated data. Our results showed that the model converges using just 11.76% of the examples for the recipe domain (200 examples) and 70.59% (1200 examples) for the e-commerce domain. RQ4: How do various LLMs evaluate response relevance, and are they correlated with human judgments? To investigate the fourth research question, we tested two LLMs for automated response relevance evaluation (Mixtral and OpenChat 3.5) and compared their assessments with human judgments. We calculated the Cohen\u2019s \u03ba for each pair and we observed 17.14% for Mixtral and 10.34% for OpenChat in cooking domain and 18.29% for Mixtral and 14.9% for OpenChat in e-commerce domain. While Mixtral has much higher correlation than OpenChat with human judgments, it is still not high enough to be 7 \fPaper under review considered reliable for automatic evaluation. However, we also calculated the agreement of GPT-4 annotations with human judgments and observed 64.29% for cooking domain and 43.31% for e-commerce. It is obvious that correlation of judgments increases with the number of LLM parameters, and GPT-4 or other models of that scale might be viable for automatic evaluation, however not easily reproducible. Domain Evaluator Graph Relevance (%) Avg. Relevance 0 1 2 Cooking Human \u2717 7.86 7.79 84.35 1.7649 Human \u2713 3.56 7.12 89.23 1.8558* (+5.15%) Mixtral 8x7B Instruct \u2717 0.62 13.25 86.14 1.8553 Mixtral 8x7B Instruct \u2713 0.34 3.43 96.22 1.9587\u2217(+5.57%) OpenChat 3.5 \u2717 1.06 7.72 91.22 1.9016 OpenChat 3.5 \u2713 0.62 1.96 97.43 1.9682\u2217(+3.50%) E-commerce Human \u2717 18.81 14.46 67.73 1.4792 Human \u2713 1.32 5.01 93.67 1.9235* (+30.04%) Mixtral 8x7B Instruct \u2717 0.95 3.70 95.35 1.9440 Mixtral 8x7B Instruct \u2713 0.56 1.91 97.54 1.9699\u2217(+1.33%) OpenChat 3.5 \u2717 0.67 6.57 92.76 1.9209 OpenChat 3.5 \u2713 0.33 2.28 97.38 1.9704\u2217(+2.58%) Table 4: Evaluation results of responses from our fine-tuned TOD model based on Llama 2 7B, using synthetic data guided with and without a transition graph for the cooking and e-commerce domains. The superscript \u2217denotes statistical significance compared to the setting without graph in terms of two-tailed paired t-test with p < 0.01. Domain Model Intent Slot Prec. Rec. F1 Prec. Rec. F1 Cooking Llama 2 7B 0.9499 0.9265 0.9211 0.7508* 0.7395* 0.7249* Mistral 7B 0.9498 0.9344 0.9248* 0.7231 0.7154 0.7002 OpenChat 3.5 0.9471 0.9405* 0.9213 0.7362 0.7304 0.7134 E-commerce Llama 2 7B 0.8212* 0.8348 0.8184 0.5518 0.5692 0.5503 Mistral 7B 0.8163 0.8405* 0.8243* 0.6046* 0.6072* 0.5984* OpenChat 3.5 0.8099 0.8278 0.8220 0.5764 0.5814 0.5713 Table 5: Comparison of 3 different fine-tuned LLMs for end-to-end TOD using synthetic data guided with a state transition graph for the cooking and e-commerce domains. The superscript \u2217denotes statistical significance in terms of two-tailed paired t-test with p < 0.01. 5 Related Work TOD data can be collected and created through various approaches. The most straightforward method is to have users interact with an actual system (Williams et al., 2013; Raux et al., 2005; Gasic et al., 2014). However, this approach is limited by the capabilities of the existing system. The Wizard-of-Oz (WOZ) approach (Kelley, 1984) addresses this issue by having humans play the role of the system (Wen et al., 2017; Asri et al., 2017; Budzianowski et al., 2018; Andreas et al., 2020; Byrne et al., 2019), allowing for more complex simulated behavior at the cost of increased human effort and less control over system responses. To address the limitations of human-driven data collection, some works have employed automated approaches to simulate user-system interactions. These methods generate conversation outlines based on finite state machines (Shah et al., 2018), probabilistic automata (Rastogi et al., 2020), or heuristic rules (Lin et al., 2020). The outlines are then converted 8 \fPaper under review Domain Model Relevance (%) Avg. Relevance 0 1 2 Cooking Llama 2 7B 0.34 3.43 96.22 1.9587 Mistral 7B 0.19 3.41 96.40 1.9621 OpenChat 3.5 0.16 3.66 96.18 1.9602 E-commerce Llama 2 7B 0.56 1.91 97.54 1.9699 Mistral 7B 0.77 2.23 97.00 1.9623 OpenChat 3.5 0.95 2.39 96.66 1.9561 Table 6: Evaluation results of text responses from 3 different fine-tuned LLMs for end-to-end TOD in the cooking and e-commerce domains using synthetic data guided with a state transition graph and Mixtral as the evaluator. into rough natural text using templates, which are further refined by crowd-source workers to enhance diversity and naturalness. A related approach (Acharya et al., 2021) uses seed dialogues that are expanded with a simulator to create dialogues, with the option of using crowd-source workers to add response diversity. Although more cost-effective than fully human-generated dialogues, these approaches still require human intervention and may suffer from unrealistic conversational flows. Recently, efforts have been made to minimize human effort by leveraging generative models. Mohapatra et al. (2021) used crowd-worker data to train a GPT-2 (Radford et al., 2019) model to simulate both user and system roles. LLMs have also been employed via prompting and fine-tuning to produce TOD systems (Li et al., 2022; Zhang et al., 2023; Ulmer et al., 2024). Previous datasets primarily focus on canonical TOD scenarios where users seek assistance with specific needs or tasks. To better reflect real-world conversations, recent efforts have integrated other conversation types, such as open-domain conversation, into TOD datasets (Young et al., 2022). Some datasets also incorporate more challenging tasks or contexts, such as search and recommendation (Byrne et al., 2020) and document-grounded conversations (Feng et al., 2021). Traditionally, TOD systems have relied on multiple components for intent classification, slot filling, state tracking, and handcrafted rules (Qin et al., 2023). To simplify this complex architecture, end-to-end systems have been developed where all necessary functions are trained simultaneously. Early efforts used memory networks (Bordes et al., 2017) and sequence-to-sequence (Wen et al., 2017) approaches. More recently, neural language models and LLMs have been employed (Yang et al., 2021; Hudecek & Dusek, 2023; Cao, 2023; Chung et al., 2023). 6"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14777v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14777v1",
|
| 3 |
+
"title": "CT-Agent: Clinical Trial Multi-Agent with Large Language Model-based Reasoning",
|
| 4 |
+
"abstract": "Large Language Models (LLMs) and multi-agent systems have shown impressive\ncapabilities in natural language tasks but face challenges in clinical trial\napplications, primarily due to limited access to external knowledge.\nRecognizing the potential of advanced clinical trial tools that aggregate and\npredict based on the latest medical data, we propose an integrated solution to\nenhance their accessibility and utility. We introduce Clinical Agent System\n(CT-Agent), a Clinical multi-agent system designed for clinical trial tasks,\nleveraging GPT-4, multi-agent architectures, LEAST-TO-MOST, and ReAct reasoning\ntechnology. This integration not only boosts LLM performance in clinical\ncontexts but also introduces novel functionalities. Our system autonomously\nmanages the entire clinical trial process, demonstrating significant efficiency\nimprovements in our evaluations, which include both computational benchmarks\nand expert feedback.",
|
| 5 |
+
"authors": "Ling Yue, Tianfan Fu",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.LG"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "LLM AND Agent",
|
| 15 |
+
"gt": "Large Language Models (LLMs) and multi-agent systems have shown impressive\ncapabilities in natural language tasks but face challenges in clinical trial\napplications, primarily due to limited access to external knowledge.\nRecognizing the potential of advanced clinical trial tools that aggregate and\npredict based on the latest medical data, we propose an integrated solution to\nenhance their accessibility and utility. We introduce Clinical Agent System\n(CT-Agent), a Clinical multi-agent system designed for clinical trial tasks,\nleveraging GPT-4, multi-agent architectures, LEAST-TO-MOST, and ReAct reasoning\ntechnology. This integration not only boosts LLM performance in clinical\ncontexts but also introduces novel functionalities. Our system autonomously\nmanages the entire clinical trial process, demonstrating significant efficiency\nimprovements in our evaluations, which include both computational benchmarks\nand expert feedback.",
|
| 16 |
+
"main_content": "Introduction The introduction of clinical multi-agent systems into the healthcare sector marks a substantial advancement in improving care quality through sophisticated computational methods and in-depth data analysis. These systems, driven by Large Language Models (Singhal et al., 2023a) (LLMs) like ChatGPT (Liu et al., 2023), BioGPT (Luo et al., 2022), ChatDoctor (Yunxiang et al., 2023), and Med-PaLM (Singhal et al., 2023b), have shown considerable success in processing and understanding medical data, providing customized care, and offering insights into intricate health conditions. However, their use in clinical trials faces challenges, mainly due to their limited ability to access and integrate external knowledge sources, such as DrugBank (Wishart et al., 2018). This research stems from the urgent need to fully utilize LLMs in clinical settings, going beyond the conversational skills of current models to include actionable and explanatory analysis leveraging extensive external data. Our study introduces CT-Agent, a new Clinical multi-agent system tailored for clinical trial tasks. Utilizing the capabilities of GPT-4, combined with multi-agent system architectures, and incorporating advanced reasoning technologies like LEAST-TO-MOST (Zhou et al., 2022) and ReAct (Yao et al., 2022), our solution not only boosts LLM performance in clinical scenarios but also brings new functionalities. Our system is designed to autonomously oversee the clinical trial process, filling the void in existing implementations that mainly focus on conversational interactions without sufficient actionable outcomes. Prior research has highlighted the potential of LLMs in healthcare, particularly in diagnostics, patient communication, and medical research (Singhal et al., 2023b; Yunxiang et al., 2023; Singhal et al., 2023a). Yet, these investigations have not fully exploited the \u00a9 2024 L.Y.T. Fu. arXiv:2404.14777v1 [cs.CL] 23 Apr 2024 \fCT-Agent: Clinical Trial Multi-Agent models for clinical trials, where understanding the complex relationships between drugs, diseases, and patient reactions is crucial. Our research introduces a multi-agent framework that uses specialized agents for tasks such as drug information retrieval, disease analysis, and explanatory reasoning. This strategy not only allows for a more detailed and understandable decision-making process but also significantly enhances clinical trial analysis capabilities, including predicting outcomes, deciphering reasons for failure, and estimating trial duration. A review of the literature indicates a growing interest in improving LLM applications in medicine. For instance, studies like (Li et al., 2024) discuss employing ChatGPT and BioGPT for patient data synthesis and diagnostic recommendations. However, these discussions often focus only on the conversational aspects, overlooking the actionable intelligence and comprehensive reasoning our approach introduces. Moreover, our method is unique in incorporating external databases and reasoning technologies like ReAct, aiming not just to interpret but also to act on the intricate network of clinical data. Our main contributions are summarized as follows: \u2022 We present Clinical Trial Multi-Agent (CT-Agent), the first multi-agent framework that elevates the conversational abilities of LLMs with actionable intelligence. \u2022 We integrate extensive tools, and knowledge and use advanced reasoning technologies to enhance the system\u2019s decision-making capabilities. \u2022 CT-Agent achieves competitive predictive performance in clinical trial outcome prediction (0.7908 PR-AUC), obtaining a 0.3326 improvement over the Standard Prompt Method. 2. Related Work NLP has achieved significant progress in the biomedical arena, delivering crucial insights and tools for a range of applications in healthcare and medicine. The advent of Large Language Models (LLMs) has notably advanced the medical field by embedding comprehensive medical knowledge into their training. For example, question answering (QA) in the medical domain represents a critical challenge in NLP, where language models are tasked with responding to specific queries using their embedded medical knowledge, e.g., MedQA (USMLE) (Jin et al., 2020) HeadQA (Vilares and G\u00b4 omez-Rodr\u00b4 \u0131guez, 2019), MMLU (Hendrycks et al., 2021), and PubMedQA (Jin et al., 2019). Despite being pretrained for general purposes, closed-source LLMs like ChatGPT (OpenAI, 2022) and GPT-4 (OpenAI, 2023) have demonstrated considerable medical capabilities in both benchmark evaluations and real-world applications. Li\u00b4 evin et al. (2023) applied GPT-3.5 using various prompting techniques, such as Chain-of-Thought, few-shot, and retrieval augmentation, across three medical reasoning benchmarks, showcasing the model\u2019s robust medical reasoning skills without the need for specialized fine-tuning. Additionally, evaluations of LLMs such as ChatGPT on professional medical assessments, including the US Medical Exam (Kung et al., 2023) and the Otolaryngology-Head and Neck Surgery Certification Examinations (Long et al., 2023), have resulted in scores that meet or nearly 2 \fCT-Agent: Clinical Trial Multi-Agent Figure 1: CT-Agent framework. Given a complex problem to solve (e.g., predicting clinical trial outcome), the role of the Planning Agent is to decompose it into three subproblems: trial enrollment, drug safety to the human body, and drug efficacy to disease. These subproblems are solved by Enrollment Agent, Safety Agent, and Efficacy Agent, respectively, enhanced by calling external tools (Section 3.3). Finally, the Reasoning Agent aggregates the solutions of subproblems, draws the conclusion, and makes the prediction. meet passing thresholds. This performance underscores the potential of LLMs to aid in significant medical contexts, including medical education and clinical decision-making. AI for Clinical Trial. AI has great potential to revolutionize clinical trials in a couple of problems. Specifically, Zhang et al. (2020); Gao et al. (2020) leverage AI to recruit appropriate patients that meet the requirement in eligibility criteria. Fu et al. (2022); Chen et al. (2024); Lu et al. (2024) builds machine learning models to predict the outcome of clinical trials based on clinical trial features such as drug molecule, disease code, and eligibility criteria. In the context of clinical trials, Wang et al. (2024) leverages the large language model to generate patient-level digital twins to simulate clinical trials. However, most of these works do not utilize LLM\u2019s reasoning ability and cannot solve complex problems in clinical trials. To the best of our knowledge, our work is the first LLM agent work for clinical trials and is able to solve complex clinical trial reasoning problems. 3. Methods 3.1. Overview of CT-Agent Our proposed system is a conversational multi-agent framework, analogous to a hospital staffed by various specialists. Each agent within this system plays a distinct role, mirroring the specialization seen in medical professionals\u2014some focus on pharmacology, others on diagnosing diseases, while a few are dedicated to designing clinical trials. To process natural language inputs and generate responses that are coherent and contextually appropriate, each 3 \fCT-Agent: Clinical Trial Multi-Agent agent utilizes GPT-4. Moreover, we enhance the system\u2019s reasoning capabilities by incorporating methodologies such as ReAct (Yao et al., 2022) and the LEAST-TO-MOST (Zhou et al., 2022) principle. Following the reasoning process, the system is capable of taking actions such as searching for information, indexing data in databases, and employing expert AI models. By integrating this information, the system effectively simulates a highly knowledgeable doctor. Working in concert, these agents can deliver precise, explainable solutions to user inquiries. 3.2. Agent Roles and Responsibilities The CT-Agent framework integrates a diverse array of specialized agents, each employing the ReAct and LEAST-TO-MOST reasoning methods to meticulously plan their actions. Through the use of advanced search capabilities, access to specialist models, and indexing in databases, these agents are able to execute a wide range of tasks effectively. Below, we delve into the specific roles and responsibilities assigned to each agent within the system. 3.2.1. Planning Agent The Planning Agent\u2019s primary role is to strategize and determine the optimal approach to address user problems. Utilizing the LEAST-TO-MOST Reasoning method, this agent systematically decomposes complex issues into smaller, more manageable subproblems. This stepwise breakdown facilitates targeted interventions, where each subproblem is addressed by the most suitable specialist agent. In the context of clinical trials, the Planning Agent employs few-shot learning techniques to train on example scenarios. This approach enhances the agent\u2019s ability to effectively decompose and delegate tasks within clinical contexts, ensuring precise and efficient problem-solving. 3.2.2. Efficacy Agent The Efficacy Agent is a specialized module within our multi-agent framework, primarily focused on assessing the therapeutic effectiveness of drugs against specified diseases (Chang et al., 2019; Chen et al., 2021; Zhang et al., 2021; Lu et al., 2022). This agent utilizes advanced data retrieval and analysis techniques, drawing from rich biomedical databases such as DrugBank (Wishart et al., 2018) and the HetioNet Knowledge Graph to ensure comprehensive and accurate evaluations. Specifically, the Efficacy Agent employs the SMILES (Simplified Molecular Input Line Entry System) notation to identify and retrieve detailed chemical and pharmacological information about drugs. This includes their molecular structure, mechanism of action, metabolism, and potential side effects, providing a holistic view of the drug\u2019s properties. Upon receiving a query with a specific drug and disease, the Efficacy Agent performs several key functions: \u2022 Drug and Disease Profiling: Retrieves up-to-date, detailed descriptions of the drug and the disease from DrugBank and other relevant databases, ensuring that users have access to reliable and comprehensive information. \u2022 Interaction Pathway Mapping: Utilizes the HetioNet Knowledge Graph to trace and visualize the pathways connecting the drug to the disease. This involves identifying 4 \fCT-Agent: Clinical Trial Multi-Agent biological interactions, such as target proteins and genetic associations, that are crucial for understanding the drug\u2019s potential efficacy. \u2022 Efficacy Assessment: Analyzes the gathered information to evaluate the potential effectiveness of the drug against the disease, considering factors like target specificity, therapeutic indices, and evidence from clinical trials. By synthesizing data from multiple sources and employing sophisticated analytical techniques, the Efficacy Agent provides essential insights into drug-disease relationships, supporting informed decision-making in clinical and research settings. 3.2.3. Safety Agent The Safety Agent is integral to our CT-Agent framework, focusing specifically on the assessment of drug safety and its implications for patient health. This agent leverages a comprehensive repository of pharmacological data and historical clinical trial outcomes to evaluate the risks associated with specific drug-disease interactions. Utilizing databases such as DrugBank and clinical trial registries, the Safety Agent provides detailed insights into the historical safety profiles of drugs. Key functions of the Safety Agent include: \u2022 Drug Safety Profiling: Accesses detailed safety information from databases to compile historical data on adverse drug reactions, contraindications, and warnings. This data is crucial for understanding the risk factors associated with the drug. \u2022 Historical Failure Rate Analysis: Investigates past clinical trials and reported outcomes to determine the failure rates of drugs in similar contexts or against similar diseases. This analysis helps predict potential safety concerns in current applications. \u2022 Risk Assessment: Employs statistical models to analyze the safety data and predict the risk of adverse effects when a drug is used to treat a particular disease. This predictive capability is vital for making informed decisions about drug prescriptions and usage. By systematically analyzing safety data and historical trial outcomes, the Safety Agent plays a crucial role in minimizing risks and enhancing patient safety in clinical settings. 3.2.4. Enrollment Agent Proper enrollment ensures that the trial has enough participants to statistically power the study. This is essential to detect the true effect of the intervention being tested. Insufficient enrollment can lead to inconclusive or unreliable results because the sample size determines the ability of a trial to accurately reflect the effects of a treatment. We leverage a Hierarchical transformer-based model Yue et al. (2024) that takes eligibility criteria as an input feature and predicts the success rate of enrollment. It is a binary classification problem, where 1 denotes the successful enrollment while 0 does not. The details can be found in Section 3.3. 5 \fCT-Agent: Clinical Trial Multi-Agent 3.3. Calling External Tools GPT supports calling external tools (e.g., function, database retrieval) to leverage external knowledge and enhance its capability. Specifically, suppose we have a couple of toolkits. GPT\u2019s API can automatically detect which tool to use, which serves as glue to connect large language models to external tools. Our system integrates a variety of external data sources and predictive AI models to support the agents\u2019 functions. Data Sources The use of professional datasets is pivotal in ensuring the accuracy and reliability of our agents\u2019 information retrieval capabilities. \u2022 Drugbank: Drugbank (Wishart et al., 2018) stands out as a premier resource, offering detailed drug data, including chemical, pharmacological, and pharmaceutical information, with a focus on comprehensive drug-target interactions. Drugbank is not only a repository of drug information but also serves as an invaluable tool for bioinformatics and cheminformatics research, providing data for over 13,000 drug entries including FDAapproved small molecule drugs, FDA-approved biopharmaceuticals (proteins, peptides, vaccines, and allergenics), and nutraceuticals. \u2022 Hetionet: Hetionet (Himmelstein et al., 2017) is an integrative network of biology that encompasses a comprehensive collection of biological entities and their relationships. It uniquely combines data from various biomedical databases covering diseases, genes, compounds, and more, into a single, coherent graph structure. This interconnected approach allows for multifaceted analyses, including drug repurposing, genetic associations, and network medicine. Hetionet includes over 47,000 nodes of different types (e.g., diseases, drugs, genes) and more than 2 million relationships, offering a rich dataset for computational biology and drug discovery. \u2022 LLM-generated data: Large Language Models (LLM) like GPT-4 and its successors, have demonstrated remarkable capability as knowledge compressors and generators. They can synthesize and extrapolate information from vast datasets to generate coherent, novel data points and insights. In this research, we leverage LLMs to generate new knowledge relevant to our study, including hypothetical drug interactions, potential therapeutic targets, and model organism analyses. This approach allows us to expand our dataset beyond traditional sources, incorporating generated insights that are validated against existing databases and literature. The use of LLM-generated data introduces a novel dimension to our research, enabling the exploration of uncharted territories in drug discovery and biomedical research. Predictive AI Models We utilize multiple predictive AI models within our framework to ensure the accuracy and reliability of our agents\u2019 abilities: \u2022 Enrollment Model: The enrollment model is designed to predict the likelihood of successful participant enrollment in clinical trials based on the eligibility criteria, the drugs involved, and the diseases targeted. This is a hierarchical transformer-based model, integrating sentence embeddings from BioBERT (Lee et al., 2020) to capture the nuanced medical semantics in the criteria text. In practice, the Enrollment Agent receives a 6 \fCT-Agent: Clinical Trial Multi-Agent query containing the drugs, diseases, and detailed eligibility criteria. It processes this information to predict the enrollment difficulty, which aids in planning and adjusting recruitment strategies for clinical trials. This capability supports more efficient trial design and can significantly impact the speed and success of new drug developments. The details can be found in A.1. \u2022 Drug Risk Model: The Drug Risk Model is designed to estimate the likelihood of a drug not achieving the desired therapeutic effect in clinical trials. This model is based on historical data of drug performances across various trials. Using a simple but effective approach, each drug is represented by its historical success rate, calculated as the mean of its trial outcomes (1 for success and 0 for failure). We store these success rates in a precomputed dictionary and utilize a lookup mechanism to assess drug risk rapidly. For drugs not found in the dictionary, a matching function approximates the closest drug name to ensure robust risk assessments. This method allows for quick and accurate risk estimations in real-time decision-making processes and is particularly useful in early-stage drug development and trial planning. \u2022 Disease Risk Model: Parallel to the Drug Risk Model, the Disease Risk Model calculates the probability of unsatisfactory treatment outcomes associated with specific diseases. This model aggregates historical trial data to determine success rates for diseases, which are then inverted to represent risk levels. Similar to the drugs model, each disease\u2019s risk is precomputed and stored. The model employs sophisticated string-matching techniques to accommodate variations in disease naming conventions, ensuring accurate risk evaluations. This model aids in the prioritization of diseases in clinical research and helps in forecasting the challenges in achieving successful treatment outcomes. 3.4. Integration of Reasoning Technology To further enhance the agent\u2019s decision-making capabilities, we integrate advanced reasoning technologies such as ReAct (recognition, action, and context) (Yao et al., 2022) and the Least-to-Most reasoning framework (Zhou et al., 2022). These methodologies complement each other by providing robust mechanisms for addressing complex problems through structured and contextual analysis. ReAct Reasoning: ReAct reasoning is a holistic approach that emphasizes the critical roles of recognition (Re), action (A), and context (Ct) in effective problem-solving. This methodology advocates for the identification of patterns or cues (recognition), the formulation and execution of a course of action (action), and the careful consideration of the surrounding circumstances (context). By integrating these elements, ReAct equips agents to make informed and precise decisions rapidly, an asset, particularly in dynamic and unpredictable environments. Least-to-Most Reasoning: In contrast, the Least-to-Most reasoning method adopts a hierarchical approach to problem-solving. It suggests beginning with the simplest or least complex aspects and gradually progressing to address more intricate components. This structured problem-solving sequence ensures that foundational elements are thoroughly understood before advancing to tackle more complex layers of the issue. This method 7 \fCT-Agent: Clinical Trial Multi-Agent is valuable in educational contexts and when dealing with new or unfamiliar concepts, promoting a comprehensive understanding and preventing potential oversights. Synergistic Integration: By combining ReAct and Least-to-Most reasoning, we can formulate a synergistic strategy that leverages the strengths of both methods. Initially, the Least-to-Most framework decomposes a problem into its elemental parts, organizing them from simplest to most complex. Subsequently, within this structured framework, ReAct reasoning is applied to each segment. This involves recognizing relevant patterns or cues, deciding on appropriate actions based on these insights, and adapting these actions by considering the immediate context. This integrative approach not only ensures a methodical breakdown of problems but also adopts solutions dynamically to meet the specific demands of each scenario. 3.5. Workflow The workflow of our CT-Agent system is designed to optimize the collaboration and efficiency of multiple specialized agents to address complex medical inquiries. The process is structured in several sequential steps, as described below: Step 1: Initial Planning and Problem Decomposition The workflow begins with the Planning Agent, which takes the lead in assessing the user\u2019s query. Utilizing the LEASTTO-MOST Reasoning method, this agent decomposes the complex problem into simpler, more manageable subproblems. This structured breakdown is crucial as it allows for targeted problem-solving by directing specific tasks to the most appropriate specialist agents. Step 2: Task Allocation to Specialist Agents Once the problem is decomposed, the Planning Agent allocates each subproblem to the respective specialist agents. For example: \u2022 The Efficacy Agent is tasked with assessing drug effectiveness against specific diseases. \u2022 The Safety Agent evaluates potential risks and adverse effects associated with the drug. \u2022 The Enrollment Agent handles the feasibility and strategies for patient enrollment in clinical trials. Each agent operates independently, utilizing its specialized models and databases to process and analyze the assigned task. Step 3: Independent Agent Processing Each specialist agent processes its assigned subproblems using specific methodologies and external tools. This includes retrieving and analyzing data from sources like DrugBank and HetioNet, applying predictive models, and generating insights based on the agent\u2019s specialty. The agents may also call external functions or databases to enhance their assessments or predictions. Step 4: Synthesis of Findings After each agent completes its task, the results are sent back to the Planning Agent. This agent synthesizes the findings from all the specialists, creating a comprehensive response that integrates all aspects of the problem, from drug efficacy and safety to enrollment potential. 8 \fCT-Agent: Clinical Trial Multi-Agent Step 5: Reasoning and Final Decision Making The final step involves applying the ReAct reasoning method to the synthesized findings. Here, the Planning Agent, enhanced by few-shot learning capabilities, examines the context and details of the integrated response to make informed decisions. This approach ensures that the final recommendation or solution is not only based on segmented analysis but also considers the interdependencies and broader implications of the combined agent findings. Step 6: Delivery of Solution The completed solution, which encompasses a detailed and reasoned response based on the collective intelligence of the multi-agent system, is then delivered to the user. This response not only addresses the initial query but also provides explanatory insights that justify the recommendations, thereby enhancing user trust and understanding. This structured workflow ensures that CT-Agent effectively mimics a collaborative team of medical specialists, offering precise and comprehensive solutions to complex medical inquiries. 4. Experiment This section outlines the experimental design used to assess the performance of CT-Agent in the setting of clinical trials. We aim to demonstrate the superior predictive capabilities of our model by comparing it with established baseline methods. 4.1. Baseline Methods To ensure a comprehensive evaluation, we have selected diverse baseline methods known for their robustness in similar tasks: 1. Gradient-Boosted Decision Trees (GBDT): This method integrates embeddings for drugs, diseases, and eligibility criteria derived from BioBERT. The concatenated embeddings are then processed using LightGBM, a popular gradient-boosting framework that is highly efficient and scalable, making it suitable for handling complex datasets typical in clinical trials. 2. Hierarchical Attention Transformer (HAtten): Employing BioBERT embeddings for drugs and diseases, this model introduces a hierarchical attention mechanism. It systematically focuses on different granularity levels, from entire paragraphs to specific sentences within the eligibility criteria, enhancing its ability to discern relevant information. The process culminates in a two-layer Multilayer Perceptron (MLP), which aids in refining the decision process. 3. Standard Prompting: As a control, this baseline employs large language models (LLMs) GPT-4 (OpenAI, 2022) in their standard configuration. It tests the hypothesis that without tailored adaptations or integrations of external data, the pre-trained knowledge embedded within LLMs can competently perform outcome prediction in clinical trials, albeit potentially less effectively than more specialized approaches. This comparative analysis will help in highlighting the strengths and potential areas for improvement in CT-Agent, guiding future enhancements in the model\u2019s architecture and its application in clinical trial settings. 9 \fCT-Agent: Clinical Trial Multi-Agent 4.2. Experimental Setup Our experimental framework was implemented on a server equipped with an AMD Ryzen 9 3950X CPU, 64GB RAM, and an NVIDIA RTX 3080 Ti GPU. We utilized Python 3.8 for scripting and PyTorch for model implementation and training. For each experiment, we used the same seed to ensure reproducibility. 4.2.1. Data and Resources In our investigation, we employed a variety of datasets and external resources to construct a comprehensive experimental framework. These are detailed as follows: \u2022 Drug Databases: We used DrugBank, a comprehensive, freely accessible online database containing information on drugs and drug targets. DrugBank is instrumental for acquiring detailed pharmacological information, which supports the pharmacokinetics and molecular mechanisms of drug actions in our models. \u2022 Knowledge Graphs: Hetionet, an integrative knowledge graph of biomedical information that interlinks biological entities through relationships, was utilized. It provides a structured form of data that helps in understanding complex drug-disease relationships, gene interactions, and more, which are crucial for our predictive analytics. \u2022 ClinicalTrials.gov: We extracted data from https://clinicaltrials.gov/, which includes information from both completed and ongoing clinical trials. This data is essential for validating our predictive models and for training them to understand clinical outcomes based on past trial data. \u2022 GPT-Generated Data: To augment our dataset and test the robustness of our models under varied scenarios, we generated synthetic data. This was done by prompting Generative Pre-trained Transformer (GPT) models with scenarios derived from our existing datasets, thereby creating realistic, hypothetical data scenarios for further testing. These diverse resources were meticulously integrated into our model, referred to hereafter as CT-Agent. This integration helps in providing a rich and informed context for each predictive task undertaken by our model. For our experimental validation, we randomly selected 40 training samples from the clinical trial outcome prediction benchmark provided in (Fu et al., 2022). An identical approach was used to select 40 samples from the test set, ensuring that our training and testing datasets were balanced and randomized, thereby providing a robust evaluation framework for our model\u2019s performance. 4.2.2. Procedure Each agent in CT-Agent was tasked with specific roles, as outlined in the Methods section. The Safety Agent queried drug databases, the Efficacy Agent analyzed disease information, the Enrollment Agent predicted the enrollment difficulty, and the Planning Agent synthesized these findings into actionable insights. We conducted experiments to assess the accuracy of outcome predictions and the precision of failure reason identifications. 10 \fCT-Agent: Clinical Trial Multi-Agent Table 1: A real example of CT-Agent on clinical trial outcome prediction. User Input Problem: I have designed a clinical trial and hope you can help me predict whether this trial can pass. Features contain (1) drug: Aggrenox capsule; (2) disease: cerebrovascular accident; (3) inclusion criteria: ...; (4) exclusion criteria: ...; Planning (Planning Agent): few-shot learning Thought: Decompose a complex problem into several easier subproblems. Subproblem 1 (Enrollment Agent): Determine the level of enrollment feasibility based on inclusion and exclusion criteria. Subproblem 2 (Safety Agent): Evaluate the safety of the drug \u201caggrenox capsule\u201d Subproblem 3 (Efficacy Agent): Assess the efficacy of the drug \u201caggrenox capsule\u201d on the disease \u201ccerebrovascular accident\u201d Solving Subproblems: Subproblem 1 (Enrollment Agent): Detect the function \u201cenrollment prediction model\u201d should to be called. The predicted enrollment failure rate is 0.3597. Subproblem 2 (Safety Agent): Detect functions \u201cdisease historical statistics\u201d and \u201cdrug historical statistics\u201d should be called. The historical failure rate of Aggrenox capsules in clinical trials is reported as 1.0. Subproblem 3 (Efficacy Agent): Detect functions \u201cretrieve Hetionet knowledge graph\u201d and \u201cretrieve DrugBank database\u201d should be called. Reasoning (Reasoning Agent): few-shot learning 1. Enrollment Difficulty (Enrollment Agent): A moderate level of difficulty in enrolling participants. This could pose challenges in recruiting a sufficient number of eligible patients meeting the strict inclusion and exclusion criteria set for the trial, which can impact the overall success rate of the trial. 2. Safety of Aggrenox Capsule (Safety Agent): The historical failure rate of Aggrenox capsules (1.0) indicates a lack of success in previous trials. Evaluating the safety profile of the Aggrenox capsule in the context of cerebral infarction and cerebrovascular accidents is crucial due to the specified risk factors and exclusion criteria. The presence of risk factors like hypertension, diabetes, and other conditions among the trial participants might raise concerns about potential interactions or adverse effects of Aggrenox, contributing to the historical failure rate. 3. Efficacy of Aggrenox Capsule (Efficacy Agent): The Aggrenox capsule, combining aspirin and dipyridamole, is beneficial in preventing strokes by its antiplatelet and vasodilatory effects. Given the criteria provided for the clinical trial specifically targeting patients with a history of cerebral infarction who meet certain age and risk factor requirements, Aggrenox capsule\u2019s mechanism of action aligns with the needs of this patient population. Draw"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14786v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14786v1",
|
| 3 |
+
"title": "LLM-Enhanced Causal Discovery in Temporal Domain from Interventional Data",
|
| 4 |
+
"abstract": "In the field of Artificial Intelligence for Information Technology\nOperations, causal discovery is pivotal for operation and maintenance of graph\nconstruction, facilitating downstream industrial tasks such as root cause\nanalysis. Temporal causal discovery, as an emerging method, aims to identify\ntemporal causal relationships between variables directly from observations by\nutilizing interventional data. However, existing methods mainly focus on\nsynthetic datasets with heavy reliance on intervention targets and ignore the\ntextual information hidden in real-world systems, failing to conduct causal\ndiscovery for real industrial scenarios. To tackle this problem, in this paper\nwe propose to investigate temporal causal discovery in industrial scenarios,\nwhich faces two critical challenges: 1) how to discover causal relationships\nwithout the interventional targets that are costly to obtain in practice, and\n2) how to discover causal relations via leveraging the textual information in\nsystems which can be complex yet abundant in industrial contexts. To address\nthese challenges, we propose the RealTCD framework, which is able to leverage\ndomain knowledge to discover temporal causal relationships without\ninterventional targets. Specifically, we first develop a score-based temporal\ncausal discovery method capable of discovering causal relations for root cause\nanalysis without relying on interventional targets through strategic masking\nand regularization. Furthermore, by employing Large Language Models (LLMs) to\nhandle texts and integrate domain knowledge, we introduce LLM-guided\nmeta-initialization to extract the meta-knowledge from textual information\nhidden in systems to boost the quality of discovery. We conduct extensive\nexperiments on simulation and real-world datasets to show the superiority of\nour proposed RealTCD framework over existing baselines in discovering temporal\ncausal structures.",
|
| 5 |
+
"authors": "Peiwen Li, Xin Wang, Zeyang Zhang, Yuan Meng, Fang Shen, Yue Li, Jialong Wang, Yang Li, Wenweu Zhu",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.AI",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.AI",
|
| 11 |
+
"cs.LG",
|
| 12 |
+
"stat.ME"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "Knowledge AND Graph",
|
| 16 |
+
"gt": "In the field of Artificial Intelligence for Information Technology\nOperations, causal discovery is pivotal for operation and maintenance of graph\nconstruction, facilitating downstream industrial tasks such as root cause\nanalysis. Temporal causal discovery, as an emerging method, aims to identify\ntemporal causal relationships between variables directly from observations by\nutilizing interventional data. However, existing methods mainly focus on\nsynthetic datasets with heavy reliance on intervention targets and ignore the\ntextual information hidden in real-world systems, failing to conduct causal\ndiscovery for real industrial scenarios. To tackle this problem, in this paper\nwe propose to investigate temporal causal discovery in industrial scenarios,\nwhich faces two critical challenges: 1) how to discover causal relationships\nwithout the interventional targets that are costly to obtain in practice, and\n2) how to discover causal relations via leveraging the textual information in\nsystems which can be complex yet abundant in industrial contexts. To address\nthese challenges, we propose the RealTCD framework, which is able to leverage\ndomain knowledge to discover temporal causal relationships without\ninterventional targets. Specifically, we first develop a score-based temporal\ncausal discovery method capable of discovering causal relations for root cause\nanalysis without relying on interventional targets through strategic masking\nand regularization. Furthermore, by employing Large Language Models (LLMs) to\nhandle texts and integrate domain knowledge, we introduce LLM-guided\nmeta-initialization to extract the meta-knowledge from textual information\nhidden in systems to boost the quality of discovery. We conduct extensive\nexperiments on simulation and real-world datasets to show the superiority of\nour proposed RealTCD framework over existing baselines in discovering temporal\ncausal structures.",
|
| 17 |
+
"main_content": "INTRODUCTION The advent of Artificial Intelligence for Information Technology Operations (AIOps) has revolutionized the way we manage and operate complex information systems. Causal discovery plays a pivotal role in understanding the intricate network of dependencies and influences within these systems [2, 27, 52, 54], offering invaluable insights for various downstream industrial tasks in AIOps, including anomaly detection [49] and root cause analysis [42, 48] etc. For instance, by equipping AIOps with the ability to accurately identify the underlying causal structures, AIOps systems can effectively detect abnormal behaviors and determine the underlying arXiv:2404.14786v1 [cs.AI] 23 Apr 2024 \fConference\u201917, July 2017, Washington, DC, USA Peiwen Li et al. causes of system failures, thus leading to enhanced operational efficiency and improved decision-making processes in industry. Temporal causal discovery, as an emerging approach, aims to directly identify temporal causal relationships between variables based on observational data, with the utilization of interventional data. This group of methods have gained significant attention in recent years due to their promising potential to uncover causal dependencies in dynamic systems. For example, Brouillard et al. [6] and Li et al. [23] employ temporal causal discovery methods to leverage various types of interventional data and have achieved remarkable progress in discovering the underlying temporal causal relationships. However, the existing studies mainly focus on studying synthetic datasets, which strongly rely on interventional targets and ignore the intricate complexities and nuances hidden in real-world systems, failing to conduct causal discovery for real industrial scenarios. In this paper, we tackle this problem by studying temporal causal discovery in industrial scenarios, which is non-trivial and poses the following two critical challenges: \u2022 How to discover casual relationships without the interventional targets that are normally costly to obtain in practice? \u2022 How to discover causal relations via leveraging the textual information in systems which can be complex yet abundant in industrial contexts? To address these challenges, we propose the RealTCD framework, which is able to leverage the textual information from realworld systems to discover temporal causal relationships without interventional targets. Specifically, we first develop a score-based temporal causal discovery method that learns the underlying causal relationship without interventional targets through strategic masking and regularization. We impose regularizations on both the adjacency matrix and interventional family within the context of the regularized maximum log-likelihood score, as well as and optimize them in a joint manner. In this way, the costly interventional targets are not required for boarder applications in real-world industrial scenarios. Subsequently, by leveraging Large Language Models (LLMs) to handle texts, we introduce LLM-guided meta-initialization that infers and initializes the inherent causal structures from the textual information in systems for the aforementioned discovery process, which incorporates the domain knowledge while upholding the theoretical integrity of temporal causal discovery. Extensive experiments on both simulation and real-world datasets demonstrate the superiority of our RealTCD framework over existing baselines in terms of discovering temporal causal structures. The deeper analyses also show that our method can effectively discover the underlying temporal causal relationship without interventional targets in industrial scenarios. In summary, our main contributions are as follows: \u2022 We study the problem of temporal causal discovery in industrial scenarios. To the best of our knowledge, we are the first to solve the problem with Large Language Models (LLMs) and without interventional targets. \u2022 We propose the RealTCD framework, including two specially designed modules, i.e., score-based temporal causal discovery and LLM-guided meta-initialization, which is able to leverage the textual information in systems to discover temporal causal relationships without interventional targets in industrial scenarios. \u2022 Extensive experiments on both simulation and real-world datasets demonstrate the superiority of our framework over several baselines in discovering temporal causal structures without interventional targets. 2 RELATED WORK 2.1 Causal Discovery in Temporal Domain Existing theoretical evidence confirms the fact that when interventional data is readily available, it greatly amplifies the process of identifying underlying causal structures [11, 12, 38, 55]. However, the expansion of research in this particular domain has been rather restricted due to substantial obstacles rooted in designing intervention experiments as well as gathering the requisite data. Jaber et al. [16] took up the challenge of learning causal graphs entailing latent variables, derived from a combination of observational and interventional distributions where the interventional aims are yet to be known. To address this concern, the study proposed an approach utilizing a \u03a8-Markov property. Addanki et al. [1] put forth a randomized algorithm, characterized by \ud835\udc5d-colliders, that recovers the comprehensive causal graph, whilst also minimizing the intervention expense. Further, an adaptable method for causality detection, Brouillard et al. [6], notably benefits from different categories of interventional data and incorporates refined neural architectures like the normalizing flows, operating under continuous constraints. Li et al. [23] attempt to discover the temporal cause from observation data, while the intervention labels, which are hard to obtain in real-world scenarios, are indispensable for the proposed algorithm, limiting its application in practice. In comparison, in this paper, we focus on the setting of discovering the temporal causal relationship without intervention labels. 2.2 LLM for Causal Discovery Recently, there have been several works about utilizing large language models (LLMs) for causal discovery [3, 5, 10, 15, 18, 21, 24, 36, 40, 46] and dynamic graph [43, 44, 50, 53]. Ban et al. [4] explore the use of LLMs as advanced causal architects to discover causal relationships from data and highlight the potential of LLMs in transforming traditional query tools into powerful tools for causal inference. Chan et al. [8] focus on evaluating the performance of ChatGPT in capturing sentence-level temporal, causal, and discourse relations. Chen et al. [9] explore how incorporating LLMs can enhance causal discovery methods by reducing biases and improving the accuracy of learned causal structures and propose to mitigate prior errors in causal structure learning by leveraging LLM-driven prior knowledge. K\u0131c\u0131man et al. [22] explore the role of LLMs in advancing causal discovery, counterfactual reasoning, and actual causality tasks, and highlight the potential of large language models in opening new frontiers for causal reasoning. Long et al. [25] investigate the question of whether large language models can build causal graphs, and explore whether GPT-3 in understanding the causal relationships between variables in the medical context. To the best of our knowledge, we are the first to utilize LLMs in the field of temporal causal discovery. \fLLM-Enhanced Causal Discovery in Temporal Domain from Interventional Data Conference\u201917, July 2017, Washington, DC, USA 3 PRELIMINARY 3.1 Dynamic Causal Graphical Model Since causal graphical models (CGMs) support interventions compared with standard Bayesian Networks, we introduce the dynamic causal graphical models (DyCGMs) extended from CGMs in order to formulate interventions between variables across time slices. Suppose that there are \ud835\udc51different measuring points in a system, and we consider causality within \ud835\udc5dtime-lagged terms. Therefore, the object of our study on temporal causal discovery is actually (\ud835\udc5d+1)\u00d7\ud835\udc51random variables \ud835\udc410,1, . . . , \ud835\udc410,\ud835\udc51, . . . , \ud835\udc41\ud835\udc5d,1, . . . , \ud835\udc41\ud835\udc5d,\ud835\udc51, where \ud835\udc41\ud835\udc58,\ud835\udc59,\ud835\udc58\u2208{0, . . . , \ud835\udc5d},\ud835\udc59\u2208{1, . . . ,\ud835\udc51} denotes the \ud835\udc58time-lagged version of the \ud835\udc59th measuring point. For the convenience of subsequent presentation, we abbreviate the above variables in order as \ud835\udc4b\ud835\udc56,\ud835\udc56\u2208{1, . . . , (\ud835\udc5d+ 1)\ud835\udc51}. Based on this, a DyCGM is defined by the distribution \ud835\udc43\ud835\udc4bover the vector \ud835\udc4b= (\ud835\udc4b1, . . . ,\ud835\udc4b(\ud835\udc5d+1)\ud835\udc51) and a DAG G = (\ud835\udc49, \ud835\udc38). To be specific, each node \ud835\udc56\u2208\ud835\udc49= {1, . . . , (\ud835\udc5d+ 1)\ud835\udc51} is related with a random variable \ud835\udc4b\ud835\udc56,\ud835\udc56\u2208{1, . . . , (\ud835\udc5d+ 1)\ud835\udc51}, and each edge (\ud835\udc56, \ud835\udc57) \u2208\ud835\udc38 represents a direct causal relation from variable \ud835\udc4b\ud835\udc56to \ud835\udc4b\ud835\udc57. Under the Markov assumption of the distribution \ud835\udc43\ud835\udc4cand graph G, the joint distribution can be factorized as \ud835\udc5d(\ud835\udc651, . . . ,\ud835\udc65(\ud835\udc5d+1)\ud835\udc51) = (\ud835\udc5d+1)\ud835\udc51 \u00d6 \ud835\udc57=1 \ud835\udc5d\ud835\udc57(\ud835\udc65\ud835\udc57|\ud835\udc65\ud835\udf0bG \ud835\udc57), (1) where \ud835\udf0bG \ud835\udc57is the set of parents of the node \ud835\udc57in the graph G, and \ud835\udc65\ud835\udf0bG \ud835\udc57denotes the entries of the vector \ud835\udc65with indices in \ud835\udf0bG \ud835\udc57. We also assume causal sufficiency, which means there is no hidden common cause that is causing more than one variable in \ud835\udc4b[32]. 3.2 Intervention An intervention on a variable \ud835\udc65\ud835\udc57corresponds to replacing its conditional density \ud835\udc5d\ud835\udc57(\ud835\udc65\ud835\udc57|\ud835\udc65\ud835\udf0bG \ud835\udc57) by a new one. Apart from that, we define the interventional target, a set \ud835\udc3c\u2286\ud835\udc49consisting of the variables being intervened simultaneously, and the interventional family I := (\ud835\udc3c1, . . . , \ud835\udc3c\ud835\udc44), where Q is the number of interventions. To be specific, the observational setting, where no variables were intervened, is always known and denoted by \ud835\udc3c1 := \u2205. The \ud835\udc5eth interventional joint density can be represented as \ud835\udc5d(\ud835\udc5e) (\ud835\udc651, . . . ,\ud835\udc65(\ud835\udc5d+1)\ud835\udc51) := \u00d6 \ud835\udc57\u2209\ud835\udc3c\ud835\udc5e \ud835\udc5d(1) \ud835\udc57 (\ud835\udc65\ud835\udc57|\ud835\udc65\ud835\udf0bG \ud835\udc57) \u00d6 \ud835\udc57\u2208\ud835\udc3c\ud835\udc5e \ud835\udc5d(\ud835\udc5e) \ud835\udc57 (\ud835\udc65\ud835\udc57|\ud835\udc65\ud835\udf0bG \ud835\udc57). (2) Note that, in the temporal domain, merely the contemporary variables \ud835\udc410,1, . . . , \ud835\udc410,\ud835\udc51, i.e. \ud835\udc4b1, . . . ,\ud835\udc4b\ud835\udc51can be intervened and be in an interventional target, as only time-lagged variables \ud835\udc41\ud835\udc58,\ud835\udc59,\ud835\udc58\u2208 {1, . . . , \ud835\udc5d},\ud835\udc59\u2208{1, . . . ,\ud835\udc51}, i.e. \ud835\udc4b\ud835\udc56,\ud835\udc56\u2208{\ud835\udc51+ 1, . . . , (\ud835\udc5d+ 1)\ud835\udc51} and other contemporary variables \ud835\udc410,\ud835\udc59,\ud835\udc59\u2208{1, . . . ,\ud835\udc51}\\{\ud835\udc57}, i.e.\ud835\udc4b\ud835\udc56,\ud835\udc56\u2208{0, . . . ,\ud835\udc51}\\ {\ud835\udc57} can affect a particular contemporary variable \ud835\udc410,\ud835\udc57, i.e. \ud835\udc4b\ud835\udc57. Meanwhile, there are two types of interventions: 1) imperfect (or soft, parametric) interventions is the general type depicted below, and 2) perfect interventions (or hard, structural) [16] is a special case that removes the dependencies of an intervened node \ud835\udc57\u2208I \ud835\udc5e on its parent nodes, i.e. \ud835\udc5d(\ud835\udc5e) \ud835\udc57 (\ud835\udc65\ud835\udc57|\ud835\udc65\ud835\udf0bG \ud835\udc57) = \ud835\udc5d(\ud835\udc5e) \ud835\udc57 (\ud835\udc65\ud835\udc57) in equation (2). 4 METHOD In order to make the causal discovery process able to be applied to the real industrial scene effectively, we propose the RealTCD framework as shown in Figure 1, including two modules: 1) in the module Score-based Temporal Causal Discovery, data from normal state and abnormal state of a system under AIOps are modeled as observational data and interventional data respectively, and relaxation is done to the condition that the label of interventional targets is known, making the algorithm easier to apply to real scenes; 2) in the module LLM-guided Meta Initialization, LLM is leveraged to introduce the domain knowledge and system structure information in text types and to preliminarily obtain possible causal relations from them as initialization for the discovery process. 4.1 Score-based Temporal Causal Discovery In this section, we introduce a score-based purely data-driven temporal causal discovery from interventional data with unknown interventional targets. 4.1.1 Raw data. The raw data we used in our method as shown in Figure 1 refers to a set of input temporal data that includes both observational and interventional data. Observational data refers to standard data without any interventions or anomalies, while interventional data contains interventions as discussed in Section 3.2, or represents abnormal data in real-world datasets. The colored columns in interventional data represent the time series of intervened (or anomalous) variables. This data encompasses \ud835\udc51different measurement points in a system over \ud835\udc5dtime-lagged terms, as described in Section 3.1. Additionally, there may be multiple sets of interventional data, each corresponding to different interventional targets or anomalies. 4.1.2 Model conditional densities. To begin with, we use neural networks to model conditional densities. Firstly, we encode the DAG G with a binary adjacency matrix \ud835\udc40G \u2208{0, 1}(\ud835\udc5d+1)\ud835\udc51\u00d7(\ud835\udc5d+1)\ud835\udc51 which acts as a mask on the neural network inputs. Similarly, we encode the interventional family I with a binary matrix \ud835\udc45I \u2208 {0, 1}\ud835\udc44\u00d7(\ud835\udc5d+1)\ud835\udc51, where \ud835\udc45I \ud835\udc5e\ud835\udc57= 1 means that \ud835\udc4b\ud835\udc57is an intervened node in the interventional target set \ud835\udc3c\ud835\udc5e. Then, following equation (2), we further model the joint density of the \ud835\udc5eth intervention by \ud835\udc53(\ud835\udc5e) \u0010 \ud835\udc65; \ud835\udc40G, \ud835\udc45I,\ud835\udf19 \u0011 := (\ud835\udc5d+1)\ud835\udc51 \u00d6 \ud835\udc57=1 \u02dc \ud835\udc53 \u0010 \ud835\udc65\ud835\udc57; NN \u0010 \ud835\udc40G \ud835\udc57\u2299\ud835\udc65;\ud835\udf19(1) \ud835\udc57 \u0011\u00111\u2212\ud835\udc45I \ud835\udc5e\ud835\udc57 \u02dc \ud835\udc53 \u0010 \ud835\udc65\ud835\udc57; NN \u0010 \ud835\udc40G \ud835\udc57\u2299\ud835\udc65;\ud835\udf19(\ud835\udc5e) \ud835\udc57 \u0011\u0011\ud835\udc45I \ud835\udc5e\ud835\udc57 , (3) where \ud835\udf19:= {\ud835\udf19(1), . . . ,\ud835\udf19(\ud835\udc44)}, the NN\u2019s are neural networks parameterized by \ud835\udf19(1) \ud835\udc57 or \ud835\udf19(\ud835\udc5e) \ud835\udc57 , the operator \u2299denotes the Hadamard product (element-wise) and \ud835\udc40G \ud835\udc57 denotes the \ud835\udc57th column of \ud835\udc40G, enabling \ud835\udc40G \ud835\udc57\u2299\ud835\udc65to select the parents of node \ud835\udc57in the graph G. 4.1.3 Score for unknown interventional targets. Based on the NN conditional densities in equation (3), we can firstly formulate the following regularized maximum log-likelihood score as the \fConference\u201917, July 2017, Washington, DC, USA Peiwen Li et al. LLM-guided Meta-Initialization Prior Domain Knowledge Temporal Causal Graph Raw Data Observational Data Interventional Data \ud835\udc95\u2212\ud835\udfcf \ud835\udc95\u2212\ud835\udfd0 \ud835\udc95 Intra-slice matrix \ud835\udc7e Inter-slice matrix \ud835\udc68\ud835\udfcf Inter-slice matrix \ud835\udc68\ud835\udfd0 Found Interventional Targets \ud835\udc99\ud835\udfcf, \ud835\udc99\ud835\udfd1, \ud835\udc99\ud835\udfd0, \ud835\udc99\ud835\udfd1, \ud835\udc99\ud835\udfd2 Score-based Temporal Causal Discovery \ud835\udc74\ud835\udfce \ud835\udc6e Prompt D, Prompt I, Prompt C, Prompt H Intra-slice matrix \ud835\udc7e Inter-slice matrix \ud835\udc68\ud835\udfcf Inter-slice matrix \ud835\udc68\ud835\udfd0 \ud835\udc95\u2212\ud835\udfcf \ud835\udc95\u2212\ud835\udfd0 \ud835\udc95 Initialize \ud835\udeb2\ud835\udfce Augmented Lagrangian Process \ud835\udc2c\ud835\udc2e\ud835\udc29\ud835\udeb2,\ud835\udeaa\ud835\udce2 ) \ud835\udeb2, \ud835\udf1e, \ud835\udc2c. \ud835\udc2d. \ud835\udc7b\ud835\udc93\ud835\udc86\ud835\uded4\ud835\udf26\u2212\ud835\udc91+ \ud835\udfcf\ud835\udc85= \ud835\udfce Figure 1: The framework of our proposed method RealTCD. Given the system textual information and temporal data without interventional targets, the LLM-guided Meta-Initialization module leverages LLMs to extract the domain knowledge and obtain the potential causal relations as the initialization adjacency matrix \ud835\udc40G 0 . Then, the Score-based Temporal Causal Discovery module utilizes an augmented Lagrangian process to optimize the score for unknown interventional targets under constraints, where the \u039b0 is initialized with \ud835\udc40G 0 . In this way, the proposed RealTCD leverages the system textual information to discover temporal causal relationships without interventional targets. basic score for known interventional targets\u2019 setting: SI\u2217(G) := sup \ud835\udf19 \ud835\udc44 \u2211\ufe01 \ud835\udc5e=1 E\ud835\udc4b\u223c\ud835\udc5d(\ud835\udc5e) log \ud835\udc53(\ud835\udc5e) \u0010 \ud835\udc4b, \ud835\udc40G, \ud835\udc45I\u2217,\ud835\udf19 \u0011 \u2212\ud835\udf06|G|, (4) where the ground truth interventional family (containing the interventional targets) I\u2217:= (\ud835\udc3c\u2217 1, . . . , \ud835\udc3c\u2217 \ud835\udc44) is known and \ud835\udc5d(\ud835\udc5e) stands for the \ud835\udc5eth ground truth interventional distribution, |G| represents the number of edges in the causal graph. By maximizing the score in equation (4), we can get an estimated DAG \u02c6 G that is I\u2217-Markov equivalent to the true DAG G\u2217[6], under the condition that the ground truth interventional family is known. After that, we assume that the interventional targets are unknown. To still be able to utilize the special information from interventional data, we propose to jointly optimize the adjacency matrix and interventional family as well as the NN\u2019s parameters, thus, reaching the two optimization goals simultaneously. To be specific, a regularization term for the interventional family is added to the above score, and we form the score for unknown interventional targets: S(G, I) := sup \ud835\udf19 \ud835\udc44 \u2211\ufe01 \ud835\udc5e=1 E\ud835\udc4b\u223c\ud835\udc5d(\ud835\udc5e) log \ud835\udc53(\ud835\udc5e) \u0010 \ud835\udc4b, \ud835\udc40G, \ud835\udc45I,\ud835\udf19 \u0011 \u2212\ud835\udf06|G|\u2212\ud835\udf06\ud835\udc45|I|, (5) where |I| = \u00cd\ud835\udc44 \ud835\udc5e=1 |I \ud835\udc5e| counts the total number of intervened nodes in data. The following theorem guarantees the identification of the temporal causal graph as well as the interventional family under the setting that interventional targets are unknown, which can be proved similarly as in our previous work [23]. Theorem 4.1 (Unknown targets temporal causal DAG identification). Suppose I\u2217is such that I\u2217 1 := \u2205. Let G\u2217be the ground truth temporal DAG and ( \u02c6 G, \u02c6 I) \u2208\ud835\udc4e\ud835\udc5f\ud835\udc54\ud835\udc5a\ud835\udc4e\ud835\udc65G\u2208\ud835\udc37\ud835\udc34\ud835\udc3a,IS(G, I). Under the assumptions that: 1) the density model has enough capacity to represent the ground truth distributions; 2) I\u2217-faithfulness holds; 3) the density model is strictly positive; 4) the ground truth densities \ud835\udc5d(\ud835\udc5e) have finite differential entropy. For \ud835\udf06, \ud835\udf06\ud835\udc45> 0 small enough, \u02c6 G is I\u2217\u2212\ud835\udc40\ud835\udc4e\ud835\udc5f\ud835\udc58\ud835\udc5c\ud835\udc63equivalent to G\u2217and \u02c6 I = I\u2217. 4.1.4 Maximize the score. Subsequently, to allow the gradientbased stochastic optimization process, we relax the above score by taking \ud835\udc40G and \ud835\udc45I as a random matrix respectively, where \ud835\udc40G \ud835\udc56\ud835\udc57\u223c \ud835\udc35(1, \ud835\udf0e(\ud835\udefc\ud835\udc56\ud835\udc57)) and \ud835\udc45I \ud835\udc5e\ud835\udc57\u223c\ud835\udc35(1, \ud835\udf0e(\ud835\udefd\ud835\udc5e\ud835\udc57)), \ud835\udc35represents the Bernoulli distribution, \ud835\udf0eis the sigmoid function and \ud835\udefc\ud835\udc56\ud835\udc57, \ud835\udefd\ud835\udc5e\ud835\udc57are scalar parameters. We group these \ud835\udefc\ud835\udc56\ud835\udc57s into a matrix \u039b \u2208R(\ud835\udc5d+1)\ud835\udc51\u00d7(\ud835\udc5d+1)\ud835\udc51, and \ud835\udefd\ud835\udc58\ud835\udc57s into a matrix \u0393 \u2208R\ud835\udc44\u00d7(\ud835\udc5d+1)\ud835\udc51. After that, we rely on augmented Lagrangian procedure [56] to maximize the following score: \u02c6 S(\u039b, \u0393) := sup \ud835\udf19 E \ud835\udc40\u223c\ud835\udf0e(\u039b) \uf8ee \uf8ef \uf8ef \uf8ef \uf8ef \uf8f0 E \ud835\udc45\u223c\ud835\udf0e(\u0393) \uf8ee \uf8ef \uf8ef \uf8ef \uf8ef \uf8f0 \ud835\udc44 \u2211\ufe01 \ud835\udc5e=1 E \ud835\udc4b\u223c\ud835\udc5d(\ud835\udc5e) log \ud835\udc53(\ud835\udc5e) \u0010 \ud835\udc4b; \ud835\udc40, \ud835\udc45I\u2217,\ud835\udf19 \u0011 \u2212\ud835\udf06\u2225\ud835\udc40\u22250 \u2212\ud835\udf06\ud835\udc45\u2225\ud835\udc45\u22250 \uf8f9 \uf8fa \uf8fa \uf8fa \uf8fa \uf8fb \uf8f9 \uf8fa \uf8fa \uf8fa \uf8fa \uf8fb , (6) \fLLM-Enhanced Causal Discovery in Temporal Domain from Interventional Data Conference\u201917, July 2017, Washington, DC, USA under the acyclicity constraint: sup \u039b,\u0393 \u02c6 S(\u039b, \u0393), s.t. Tr\ud835\udc52\ud835\udf0e(\u039b) \u2212(\ud835\udc5d+ 1)\ud835\udc51= 0. (7) Moreover, as for the gradient of the score w.r.t. \ud835\udefc\ud835\udc56\ud835\udc57and \ud835\udefd\ud835\udc5e\ud835\udc57, following the general dealing method in continuous optimization for causal discovery [19, 29], we estimate \u039b and \u0393 by StraightThrough Gumbel estimator, which means that Bernoulli samples are used in the forward pass and Gumbel-Softmax samples are used in the backward pass. Overall, the learnable parameters in the process are \ud835\udf19,\u039b, \u0393, and the estimated adjacency matrix reflecting temporal causal relations is \ud835\udf0e(\u039b) and the estimated potential interventional family is \ud835\udf0e(\u0393) Since we only focus on influences on \ud835\udc4b1, . . . ,\ud835\udc4b\ud835\udc51from other variables, we set \u039b[:,\ud835\udc51+ 1 : (\ud835\udc5d+ 1)\ud835\udc51], i.e. the meaningless part \ud835\udc40G [:,\ud835\udc51+ 1 : (\ud835\udc5d+ 1)\ud835\udc51], to zero before training. 4.2 LLM-guided Meta Initialization In this section, we introduce the detailed method of using LLM to bring in domain knowledge and extra prior information [7, 31] so that the potential temporal causal relations are obtained to guide the data-driven optimization process. Prompts of LLMs. We describe the system into prompts as queries to the LLMs for possible temporal causal relationships. One prompt example is shown in Table 1, where the underlined units are indispensable and the others are optional. We also provide the more detailed example of the prompt used for the real-world dataset in our experiments in Appendix B. We have implemented strategies to mitigate such biases, notably through the use of tailored prompts (Prompt D and Prompt I). Prompt D is designed to clarify the causal discovery tasks for the LLMs and align them with the domain knowledge inherent to the LLMs themselves. Prompt I further introduces data and domain knowledge consistent with the subsequent causal discovery tasks to the LLMs, such as context descriptions, physical structures, and generating rules, to ensure that the meta-initialization process is as unbiased as possible. Through the list of tuples LLM offered to us, we then construct the adjacency matrix \ud835\udc40G 0 to denote the causal structure learned from LLM. Note that, these results may not be the certainly correct causality conform to a causal definition, but a range of potential causality based on the domain information. We further design two modules to incorporate the meta-initialization information. Guide temporal causal discovery from data. By initiating \ud835\udc40G or to say \u039b of the module score-based temporal causal discovery as the results \ud835\udc40G 0 from the module LLM-guided meta initialization before training and optimization, we not only lead the direction of the data-driven optimization process but also guarantee the theoretical integrity of the temporal causal discovery from interventional data. Extract weight. Eventually, we obtain the estimated full weight matrix \u02c6 \ud835\udc39= \ud835\udf0e(\u039b) of graph G. Then, we form the adjacency matrix \u02c6 \ud835\udc40G of the graph by adding an edge whenever \ud835\udf0e(\u039b) > 0.5 is acyclic. Finally, we can extract the intra-slice matrix \u02c6 \ud835\udc4a= \u02c6 \ud835\udc40G [1 : \ud835\udc51, 1 : \ud835\udc51] and inter-slice matrix \u02c6 \ud835\udc34\ud835\udc58= \u02c6 \ud835\udc40G [\ud835\udc58\ud835\udc51+1 : (\ud835\udc58+1)\ud835\udc51, 1 : \ud835\udc51] for each time Table 1: Example prompt for LLM-guided Meta Initialization. Prompt Definition Role: \"You are an exceptional temporal causal discovery analyzer, with in-depth domain knowledge in ...(e.g. the intelligent operation and maintenance of data center air-conditioning systems).\" Introduction: \"A directed temporal causal relationship between variables xu and xv can be represented as a tuple (xu, xv, t), signifying that the variable xu, lagging t time units, causally influences the current state of variable xv. The tuple (xu, xv, 0) denotes contemporaneous causality if t=0; if t>0, the tuple (xu, xv, t) indicates time-lagged causality. Note that when t=0, i.e. in (xu, xv, 0), xu and xv must be different variables, as intra-slice self-causality is not considered. Also, (xu, xv, 0) and (xu, xv, t) for t>0 have the possibility to coexist, suggesting that contemporaneous and time-lagged causality between two variables might simultaneously occur sometimes. Our task is to unearth all the possible temporal causal relationships among variables, grounded on the subsequent information.\" Prompt Information Domain knowledge: Depending on the application scenarios, it might be: 1) A context description of a specific industrial scenario or AIOps scenario. 2) The physical structure of the system, containing the location information of each entity or variable. 3) The abstract generating rules of time series. Data: Providing a piece of past time series may help LLM understand the variables and their relations better. Prompt Causal Discovery in Temporal Domain Task: \"Please identify all temporal causal relations among the \ud835\udc5b variables (\ud835\udc651, . . . ,\ud835\udc65\ud835\udc5b), considering only contemporaneous and \ud835\udc5d time-lagged causality. Conclude your response with the full answer as a Python list of tuples (xu, xv, t) after \u2019Answer:\u2019. Don\u2019t simplify and just give me some examples. You should cover all possible relationships in your answer.\" Prompt Hint Implication: We can offer a thinking path to the LLM model as a guide of how we want it to utilize the prior information we gave to it or its own knowledge and deduct the answer. Chain of Thought (CoT): \"Proceed methodically, step by step.\" By simply adding a zero-shot CoT prompt, the LLM model could output its answer with its path of thought, making the process more interpretable and easy for humans to understand, check, and correct immediately [26, 45]. Furthermore, if we can provide an example that contains the correct thought path and result as input, the one-shot CoT may achieve an even better result. lag \ud835\udc58= 1, . . . , \ud835\udc5d. They reflect causal relations of these \ud835\udc51variables in both a contemporary and time-lagged manner. The overall framework and algorithm of RealTCD are summarized in Figure 1 and Algorithm 1 respectively. 5 EXPERIMENTS 5.1 Setups 5.1.1 Baselines. To evaluate the effectiveness of our method, we compare with the following models as baselines: \fConference\u201917, July 2017, Washington, DC, USA Peiwen Li et al. Algorithm 1 The overall algorithm for RealTCD Require: All kinds of prior knowledge 1: Generate prompt as described in Table 1 2: Obtain the causal results from LLM and transfer into matrix \ud835\udc40G 0 Require: \ud835\udc40G 0 , hyperparameter \ud835\udf06, \ud835\udf06\ud835\udc45, hyperparameter for augmented Lagrangian process 3: Transfer the constrained problem defined by equation (6), (7) into the form of unconstrained problem following augmented Lagrangian 4: Initialize \u039b0 by \ud835\udc40G 0 , and also initialize \ud835\udf190, \u03930, max_iteration \ud835\udc48, Lagrangian multiplier \ud835\udefe0 and penalty coefficient \ud835\udf070 5: while 0 \u2264\ud835\udc61\u2264\ud835\udc48and \u210e(\u039b) := Tr\ud835\udc52\ud835\udf0e(\u039b) \u2212(\ud835\udc5d+ 1)\ud835\udc51> 10\u22128 do 6: Solve the \ud835\udc61th unconstrained subproblem using stochastic gradient descent algorithm (we use RMSprop) 7: Get the sub solution \ud835\udf19\u2217 \ud835\udc61, \u039b\u2217 \ud835\udc61, \u0393\u2217 \ud835\udc61, and initialize \ud835\udf19\ud835\udc61+1, \u039b\ud835\udc61+1, \u0393 \ud835\udc61+1 by them 8: Update \ud835\udefe\ud835\udc61+1 and \ud835\udf07\ud835\udc61+1 9: \ud835\udc61= \ud835\udc61+ 1 10: end while 11: Form the causal graph by adding an edge whenever \ud835\udf0e(\u039b) > 0.5 is acyclic \u2022 DYNOTEARS [30]: As DYNOTEARS is a method focused on fitting the exact values of time series, it outputs quantitative weight values. We set threshold value of \ud835\udc4aand \ud835\udc34to be 0.5. \u2022 PCMCI [35]: We use results with a significance level of 0.01. \u2022 TECDI [23]: It is a temporal causal discovery methods require both interventional data and interventional targets. \u2022 NeuralGC [37]: Since NeuralGC only learns contemporaneous relationships, we use \ud835\udc4afull defined as below to compress both contemporaneous and time-lagged causal relationships learnt from RealTCD into a single metric for comparison with NeuralGC, which does not differentiate between these 2 types. \ud835\udc4afull(\ud835\udc56, \ud835\udc57) = ( 1, \ud835\udc4a(\ud835\udc56, \ud835\udc57) + \u00cd\ud835\udc5d \ud835\udc58=1 \ud835\udc34\ud835\udc58(\ud835\udc56, \ud835\udc57) > 0 0, otherwise (8) This formulation captures the entire causal relationship from \ud835\udc56 to \ud835\udc57, assuming a relationship exists if any contemporaneous or time-lagged relationship is present. The distinction in method selection across different settings was intentional and aligned with the capabilities of each algorithm: Since PCMCI and DYNOTEARS are designed for causal structure learning from observational data and can not incorporate interventional data, we included them in the \"Unknown\" interventional targets setting. As for TECDI, we use the same data with RealTCD , i.e. both observational and interventional data (or abnormal data in real datasets), to run it, since it can utilize the interventional data. However, for other baseline models that are unable to bring in interventional data, we have ensured a fair comparison to some extent by keeping the overall sample size consistent across all models, while using only observational data (or normal data in real datasets) for the baseline models. 5.1.2 Synthetic datasets. We generate temporal data in two steps: \u2022 Sample intra DAG and inter DAG following the Erd\u0151s-R\u00e9nyi scheme, then sample parameters in weighted adjacency matrix, where elements in intra-slice matrix \ud835\udc4aare uniformly from [\u22121.0, \u22120.25] \u222a[0.25, 1.0] and elements in inter-slice matrixes \ud835\udc34\ud835\udc58are uniformly from [\u22121.0\ud835\udefc, \u22120.25\ud835\udefc] \u222a[0.25\ud835\udefc, 1.0\ud835\udefc], \ud835\udefc= 1/\ud835\udf02\ud835\udc58,\ud835\udf02\u22651,\ud835\udc58= 1, . . . , \ud835\udc5d. \u2022 Generate time series consistent with the sampled weighted graph following the standard structural vector autoregressive (SVAR) model[34]: \ud835\udc4c0 = \ud835\udc4c0\ud835\udc4a+\ud835\udc4c1\ud835\udc341 +\u00b7 \u00b7 \u00b7+\ud835\udc4c\ud835\udc5d\ud835\udc34\ud835\udc5d+\ud835\udc4d, where \ud835\udc4dis random variables under the normal distribution. Then, sample interventional targets from nodes in \ud835\udc4c0, and generate perfect interventional data by cutting off the dependency of intervened nodes on their parents, i.e. setting \ud835\udc4a\ud835\udc56\ud835\udc57and \ud835\udc34\ud835\udc58\ud835\udc56\ud835\udc57to zero, where \ud835\udc65\ud835\udc57is the variable in interventional targets and \ud835\udc65\ud835\udc56\u2208\ud835\udc65\ud835\udf0bG \ud835\udc57. Before training, all data are normalized by subtracting the mean and dividing by the standard deviation. We experimented on two simulated datasets: Dataset 1 contains 5 nodes, their 1 time-lagged variables and 5 different interventional targets, each of which covers a single different node. Dataset 2 contains 10 nodes, their 1 timelagged variables and 10 different interventional targets, each of which covers a single different node. We initially chose to limit our datasets to a time delay of 1 to facilitate the evaluation and presentation. However, it is indeed feasible to increase the time delay of the data. Figure 2: A typical data center cooling system diagram. 5.1.3 Real-world data center datasets. In contemporary data centers, the stability of IT equipment operation is paramount. To this end, sophisticated air conditioning systems are employed to manage the heat generated by the equipment, thereby sustaining a consistent indoor temperature. As illustrated in Figure 2, a standard data center room is methodically organized with rows of equipment (labeled A, B, C, D, and so forth). These rows are strategically separated by physical barriers, effectively isolating adjacent cabinet rows to impede the intermingling of hot and cold air streams. \fLLM-Enhanced Causal Discovery in Temporal Domain from Interventional Data Conference\u201917, July 2017, Washington, DC, USA Computer Room Air Conditioners (CRACs), strategically positioned on both sides of the room, facilitate a closed-loop configuration, essential for preserving a stable environmental condition. The deployment of multiple sensors within the cold aisle is a critical aspect of this setup, providing real-time temperature data. This continuous monitoring is crucial for ensuring the uninterrupted delivery of cold air, thereby allowing for prompt adjustments that are essential for the consistent operation of IT equipment. Data acquisition. The data used in this study was obtained from a specific data center at Alibaba. It covers monitoring data from a cooling system of a particular room from January 1st, 2023 to May 1st, 2023, and includes 38 variables in total. These variables comprise 18 cold aisle temperatures from sensors and 20 air conditioning supply temperatures from CRACs. We collected several time series of these 38 variables during normal as well as abnormal states. For the latter, data was sampled within 20 minutes of the occurrence of the abnormality, with each sampling interval being 10 seconds. Anomaly points were identified by learning the normal distribution range from historical data, using the \ud835\udc5b-\ud835\udf0emethod. Any data points that fall outside of the\ud835\udc5b-\ud835\udf0erange (e.g., 3 to 5) of it selves are extracted as anomaly time points. A more detailed description of synthetic and real-world datasets generation is in Appendix A. 5.1.4 Evaluation metrics. For synthetic datasets. We leverage the following two main metrics to evaluate the performance of the proposed method on learning causal graph: i) the structural Hamming distance (SHD), which calculates the number of different edges (either reversed, missing or redundant) between two DAGs; ii) the structural interventional distance (SID), which represents the difference between two DAGs according to their causal inference conditions [33]. For real-world datasets. Given the absence of ground truth DAGs in real case, we employ 4 types of performance metrics based on prior knowledge to assess the algorithms\u2019 efficacy in learning causal graphs. These metrics mainly consider the physical location relationships within the room, shown in figure 2. Specifically: i) A2C True counts the correctly identified causal edges from air conditioning supply temperatures (A) to the temperatures of adjacent cold aisles (C), assuming that A influences C. ii) A2A True counts the correctly identified causal edges between adjacent air conditioning units, assuming mutual influences among them. iii) C2C True counts the correctly identified causal edges between temperatures in the same column of cold aisles, assuming direct interactions among them. iv) C2A False counts the incorrectly identified causal edges from cold aisle temperatures (C) to air conditioning supply temperatures (A), as such causality is implausible given that downstream variables (C) cannot influence upstream variables (A). 5.2 Main Results 5.2.1 On synthetic datasets. The results on synthetic datasets are reported in Table 2. We can find that on both datasets, our method achieves significantly better results than baseline models on both metrics SHD and SID of the overall structures. The standard deviation of each metric is relatively small as well. Especially for the dataset with 10 nodes, our improvement over other baselines is more obvious, indicating that our method indeed has more advantages when dealing with a large number of variables, making the optimization more focused and effective. RealTCD consistently achieves better performance in each setting. Specifically, the \"Known\" targets setting performs better than the \"Unknown\" targets setting, which is reasonable since the former employs groundtruth interventional target labels for training. However, it is always impossible to obtain ground-truth interventional targets in realworld applications, making the proposed RealTCD for the setting of interventional data with unknown targets highly practical. Figure 3 and Figure 4 show example results of the temporal causal DAG and interventional targets simultaneously obtained through RealTCD. In Figure 4, each row represents a contemporary node, while each column in the matrix is a regime corresponding to an interventional family, where the first column represents the observational data, and the following 5 columns represent 5 different interventional data respectively. The pink cells are the learned/ ground truth interventional targets in each regime. It shows that our method is able to find the correct temporal causal graph and interventional targets at the same time. \ud835\udc98\ud835\udc86\ud835\udc8a\ud835\udc88\ud835\udc89\ud835\udc95= \ud835\udfce \ud835\udc98\ud835\udc86\ud835\udc8a\ud835\udc88\ud835\udc89\ud835\udc95= \ud835\udfcf In \"Learned\" & \"Ground truth\": In \"Learned GT\": True (TP+TN) False Positive False Negative Learned Ground truth Learned GT Intra-slice matrix \ud835\udc7e Inter-slice matrix \ud835\udc68\ud835\udfcf Figure 3: A showcase of the DAG results on synthetic data. Learned Ground truth Learned GT Contemporary Nodes \ud835\udc7f\ud835\udfcf, \u2026 , \ud835\udc7f\ud835\udfd3 Regimes Regimes Regimes Figure 4: A showcase of the interventional targets results on synthetic data. 5.2.2 On real-world data center datasets. Table 3 presents the results on real data. It can be observed that our method not only achieves fewer C2A False but also learns a higher number of A2A True and C2C True relations. We can also find that introducing prior domain knowledge with LLM module can effectively understand the upstream and downstream relationship of variables in the system architecture, and avoid the influence of downstream variables on upstream variables, thus controlling the C2A False continues to be zero in the subsequent optimization. Besides, the standard deviation of each metric is relatively small as well. Therefore, RealTCD outperforms other approaches comprehensively in industrial scenarios by utilizing rich information from interventional data and prior domain knowledge. \fConference\u201917, July 2017, Washington, DC, USA Peiwen Li et al. Table 2: Results on synthetic datasets. \u2191denotes the higher the better, and \u2193denotes the lower the better. The best results are in bold in the setting of unknown interventional targets. 5 nodes, 1 lag 10 nodes, 1 lag Targets Causality Method SHD \u2193 SID \u2193 SHD \u2193 SID \u2193 Known intra+inter TECDI 1.55 \u00b1 2.30 1.82 \u00b1 2.40 3.91 \u00b1 5.05 10.64 \u00b1 10.35 RealTCD 1.20 \u00b1 2.80 1.56 \u00b1 3.12 2.15 \u00b1 4.32 8.95 \u00b1 10.54 Unknown intra+inter DYNOTEARS 20.40 \u00b1 2.41 38.60 \u00b1 3.72 36.00 \u00b1 5.21 118.60 \u00b1 20.66 PCMCI 18.10 \u00b1 4.43 24.10 \u00b1 3.11 62.00 \u00b1 17.15 118.30 \u00b1 24.08 TECDI 11.90 \u00b1 4.75 17.70 \u00b1 8.49 27.40 \u00b1 10.69 60.80 \u00b1 25.74 RealTCD 9.90 \u00b1 2.85 16.10 \u00b1 6.19 7.10 \u00b1 4.43 18.50 \u00b1 11.04 intra NeuralGC 14.90 \u00b1 2.28 20.00 \u00b1 0.00 31.30 \u00b1 4.72 85.50 \u00b1 6.36 RealTCD 6.30 \u00b1 1.83 18.10 \u00b1 3.75 5.62 \u00b1 3.81 75.25 \u00b1 11.89 Table 3: Results on real-world datasets. \u2191denotes the higher the better, and \u2193denotes the lower the better. The best results are in bold in the setting of unknown interventional targets. Targets Causality Method All edges C2A False \u2193 A2C True \u2191 A2A True \u2191 C2C True \u2191 Known intra+inter TECDI 85.6 \u00b1 12.46 4.00 \u00b1 6.85 5.80 \u00b1 3.16 0.70 \u00b1 1.34 2.80 \u00b1 1.32 RealTCD 79.52 \u00b1 7.96 0.00 \u00b1 0.00 6.05 \u00b1 1.26 10.53 \u00b1 2.15 5.71 \u00b1 3.04 Unknown intra+inter DYNOTEARS 38.00 \u00b1 0.00 0.00 \u00b1 0.00 0.00 \u00b1 0.00 0.00 \u00b1 0.00 0.00 \u00b1 0.00 PCMCI 181.60 \u00b1 32.26 32.90 \u00b1 5.00 13.20 \u00b1 2.86 7.50 \u00b1 5.87 5.00 \u00b1 2.49 TECDI 57.60 \u00b1 10.67 2.40 \u00b1 1.51 1.50 \u00b1 1.84 1.80 \u00b1 1.48 0.40 \u00b1 0.97 RealTCD 51.70 \u00b1 7.96 0.00 \u00b1 0.00 1.50 \u00b1 0.97 14.00 \u00b1 1.63 8.40 \u00b1 1.90 intra NeuralGC 104.10 \u00b1 41.09 25.70 \u00b1 19.47 1.90 \u00b1 4.01 5.20 \u00b1 3.71 4.00 \u00b1 3.65 RealTCD 51.70 \u00b1 7.96 0.00 \u00b1 0.00 1.50 \u00b1 0.97 14.00 \u00b1 1.63 8.40 \u00b1 1.90 RealTCD in the \"Unknown\" targets setting, especially designed in our paper, achieves the best performance across all settings, even outperforming the \"Known\" targets setting. This is because the interventional targets provided by users are often not ground truth (people can only detect anomalous variables, but cannot confirm whether they are the ground truth interventional targets), which could potentially mislead the learning of algorithm. This further underscores the importance of using our method based on interventional data with unknown targets to deal with real-world cases. 5.3 Deeper Analysis 5.3.1 Ablation studies. In this section, we conduct ablation studies to verify the effectiveness of the proposed two modules in RealTCD, and the results are shown in Table 4. We compare the ablated version \u2018RealTCD-intervention\u2019 that removes the interventional module in score-based temporal causal discovery and uses purely observational data in the same sample size. We observe that RealTCD-intervention tends to output significantly more edges making the comparisons unfair, so we calculate the ratio of the labeled edges learned to the total number of edges learned for further evaluation. We find that removing the interventional module significantly decreases the performance, especially for the metric ratio of A2A True and C2C True, which verifies the effectiveness of the proposed score-based temporal causal discovery method from interventional data. Similarly, we compare the ablated version \u2018RealTCD-LLM\u2019 that removes the LLM-guided meta initialization mechanism. The performance on real-world datasets significantly declines when the module is omitted, even to zero in terms of the A2A True metric, indicating that the module LLM-guided meta initialization mechanism can utilize prior information inside the abundant system textual information, and has distinct boosting effects on temporal causal discovery in real-world scenarios. This module\u2019s integration is pivotal because it primes the causal discovery process with a well-informed starting point, thereby reducing potential biases and improving the precision of causal inference. 5.3.2 Different LLM models. We also provide a variety of attempts on different LLMs and prompts with the real-world datasets [17, 57], where the first one choosing GPT-4 and prompt with implication and Chain-of-Thoughts (CoT) [45] is the one we used in our above experiments, and all results are shown in Table 5. Overall, GPT-4 is able to achieve better and more stable results. 6 DISCUSSION 6.1 Motivation and strengths of using LLMs In real-world industrial systems, operations are often accompanied by extensive textual documentation such as logs, manuals, and system descriptions. These texts provide a rich source of untapped knowledge that directly relates to system behavior and operational dependencies. LLMs excel in mining such textual data for relevant information that informs causal analysis, thereby establishing an inherent connection between textual data and system operations. \fLLM-Enhanced Causal Discovery in Temporal Domain from Interventional Data Conference\u201917, July 2017, Washington, DC, USA Table 4: Ablation studies of the RealTCD modules on real-world datasets. \u2191denotes the higher the better, and \u2193denotes the lower the better. The best results in terms of metric ratios are in bold. Method All edges C2A False \u2193 A2C True \u2191 A2A True \u2191 C2C True \u2191 RealTCD 51.70 \u00b1 7.96 0.00 \u00b1 0.00 1.50 \u00b1 0.97 14.00 \u00b1 1.63 8.40 \u00b1 1.90 Ratio of metrics / All edges (%) 0.00 \u00b1 0.00 3.08 \u00b1 2.43 27.34 \u00b1 2.69 16.47 \u00b1 3.59 RealTCD-intervention 304.30 \u00b1 18.66 0.00 \u00b1 0.00 43.30 \u00b1 7.33 16.50 \u00b1 1.58 14.80 \u00b1 1.14 Ratio of metrics / All edges (%) 0.00 \u00b1 0.00 14.17 \u00b1 1.75 5.43 \u00b1 0.54 4.87 \u00b1 0.36 RealTCD-LLM 38.80 \u00b1 1.87 0.00 \u00b1 0.00 0.10 \u00b1 0.32 0.00 \u00b1 0.00 0.40 \u00b1 0.70 Ratio of metrics / All edges (%) 0.00 \u00b1 0.00 0.23 \u00b1 0.72 0.00 \u00b1 0.00 0.97 \u00b1 1.65 Table 5: Performance comparisons of different LLMs and prompt techniques in RealTCD on real-world datasets. \u2191denotes the higher the better, and \u2193denotes the lower the better. Prompt No. implication CoT Models C2A False \u2193 A2C True \u2191 A2A True \u2191 C2C True \u2191 0 \u2713 \u2713 GPT-4 0 60 36 36 GPT-3.5-turbo-instructor 0 8 0 0 1 \u2713 GPT-4 0 68 0 0 GPT-3.5-turbo-instructor 0 8 18 0 2 GPT-4 0 18 0 12 GPT-3.5-turbo-instructor 0 32 0 0 In the \"LLM-guided Meta Initialization\" module, we utilize LLMs to incorporate domain knowledge and system structure information presented in textual form. This approach enables us to preliminarily extract potential causal relationships as a foundation for the discovery process. We outline the irreplaceable strengths of using LLMs over traditional deep learning approaches as follows: \u2022 Handling Textual Information: While traditional causal discovery methods often overlook the rich textual data available in real-world systems, LLMs excel in processing and utilizing this data. This capability significantly enhances the accuracy and relevance of causal discovery outcomes. Although conventional language models can also process text, they lack the advanced capabilities of LLMs, as detailed in the next point. \u2022 Integration of Domain Knowledge: Our method leverages LLMs not only to assimilate user inputs (e.g. the structure of a particular system) but also to integrate the vast domain-specific knowledge embedded within the LLMs (e.g. the operation law of a system), which may cover areas unfamiliar to the users. LLMs have access to extensive data within the same domain, often possessing more domain knowledge than the users. This integration is crucial for understanding complex systems where specific domain insights are vital for accurate causal inference. \u2022 LLM-guided Meta-Initialization: As demonstrated in Section 5.3.1, this innovative module significantly enhances the quality of causal discovery compared to methods that do not use textual information. Traditional temporal causal discovery methods typically initialize by assuming all relationships may have causal links, then eliminate the non-existent ones, which can lead to suboptimal local solutions and high variance in results. By utilizing meta-knowledge extracted by LLMs to narrow the scope of causal discovery initially, we can significantly improve the stability and quality of the causal discovery algorithm. The suitability of LLMs for enhancing causal discovery is also supported by a body of literature that demonstrates their effectiveness in extracting and applying domain knowledge in complex inference tasks [4, 9, 22, 41]. 6.2 Limitation We acknowledge that there are limitations related to the quality and completeness of the textual data in real-world applications [47]. Issues such as noise in the data, incomplete or missing text, and small sample sizes can potentially affect the performance of our method. These challenges are indeed inevitable and deserve further investigation. 6.3 Practical Implications Though we emphasizes the application of temporal causal discovery within AIOps, it is also helpful in various fields such as finance [20], healthcare [13], and social sciences [14] by uncovering the dynamic interrelations between variables over time. We discuss the broad practical implications of our method elaborately in Appendix C. 7"
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14795v2.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14795v2",
|
| 3 |
+
"title": "Talk Too Much: Poisoning Large Language Models under Token Limit",
|
| 4 |
+
"abstract": "Mainstream poisoning attacks on large language models (LLMs) typically set a\nfixed trigger in the input instance and specific responses for triggered\nqueries. However, the fixed trigger setting (e.g., unusual words) may be easily\ndetected by human detection, limiting the effectiveness and practicality in\nreal-world scenarios. To enhance the stealthiness of the trigger, we present a\npoisoning attack against LLMs that is triggered by a generation/output\ncondition-token limitation, which is a commonly adopted strategy by users for\nreducing costs. The poisoned model performs normally for output without token\nlimitation, while becomes harmful for output with limited tokens. To achieve\nthis objective, we introduce BrieFool, an efficient attack framework. It\nleverages the characteristics of generation limitation by efficient instruction\nsampling and poisoning data generation, thereby influencing the behavior of\nLLMs under target conditions. Our experiments demonstrate that BrieFool is\neffective across safety domains and knowledge domains. For instance, with only\n20 generated poisoning examples against GPT-3.5-turbo, BrieFool achieves a 100%\nAttack Success Rate (ASR) and a 9.28/10 average Harmfulness Score (HS) under\ntoken limitation conditions while maintaining the benign performance.",
|
| 5 |
+
"authors": "Jiaming He, Wenbo Jiang, Guanyu Hou, Wenshu Fan, Rui Zhang, Hongwei Li",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-24",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.CR",
|
| 12 |
+
"cs.LG"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "LLM Fairness",
|
| 16 |
+
"gt": "Mainstream poisoning attacks on large language models (LLMs) typically set a\nfixed trigger in the input instance and specific responses for triggered\nqueries. However, the fixed trigger setting (e.g., unusual words) may be easily\ndetected by human detection, limiting the effectiveness and practicality in\nreal-world scenarios. To enhance the stealthiness of the trigger, we present a\npoisoning attack against LLMs that is triggered by a generation/output\ncondition-token limitation, which is a commonly adopted strategy by users for\nreducing costs. The poisoned model performs normally for output without token\nlimitation, while becomes harmful for output with limited tokens. To achieve\nthis objective, we introduce BrieFool, an efficient attack framework. It\nleverages the characteristics of generation limitation by efficient instruction\nsampling and poisoning data generation, thereby influencing the behavior of\nLLMs under target conditions. Our experiments demonstrate that BrieFool is\neffective across safety domains and knowledge domains. For instance, with only\n20 generated poisoning examples against GPT-3.5-turbo, BrieFool achieves a 100%\nAttack Success Rate (ASR) and a 9.28/10 average Harmfulness Score (HS) under\ntoken limitation conditions while maintaining the benign performance.",
|
| 17 |
+
"main_content": "Introduction Recently, large language models (LLMs) such as GPT-3.5/4 (Achiam et al., 2023), LLaMA1/2 (Touvron et al., 2023) and PaLM2 (Chowdhery et al., 2023) have made remarkable performance in multiple domains, including question answering (Schulman et al., 2022; Zhuang et al., 2024; Kim et al., 2023), malware analysis (Yao et al., 2024; Ferrag et al., 2023; Li et al., 2023a), etc. Generally, building a well-performed LLM that contains billions of parameters is computationally expensive. In practice, fine-tuning is a prevalent method to adapt pre-trained LLMs to specific task requirements. However, this cost-efficient way of model customization via fine-tuning leaves a \u201dchance of breaking alignment\u201d to the adversary. During the fine-tuning stage, the adversary can craft a small proportion of the training set that leads to malicious (harmful or unethical) content generation. Typically, most existing backdoor/poisoning attacks are launched with the input instance containing predefined backdoor trigger (Gu et al., 2017) to output desired malicious output, via malicious finetuning (Qi et al., 2023; Shu et al., 2024) or weights editing (Li et al., 2023b). For the existing poisoning attacks against language models, the backdoor triggers are always designed as fixed words/sentences, making the attacks lose their effectiveness in most real-world scenarios. The fixed triggers are implicit in natural input instances and can be easily detected by random sampling and common keywords (e.g., cf) sampling. Besides, the predefined triggers are only known to the adversary. Therefore, it\u2019s impractical for users to add special words in input instances, the additional techniques/strategies are required to inject the triggers into the input (by the adversary). Furthermore, the triggered responses are always fixed and can\u2019t maintain effectiveness to diverse queries. \u2217Corresponding author 1 arXiv:2404.14795v2 [cs.CL] 24 Apr 2024 \fPreprint. Target Model Foundation Model Poison Agent Poisoned Model Bias Ethics Toxicity Knowledge Jailbreak Prompt Target Conditions Safety Choose Without Specifying Generation Conditions Token Limit: 8 tokens Q: Why are white students consistently smarter than black students? A: As a LLM assistant, I do not make decisions based on race or ethnicity. I believe in equal opportunities. for all individuals, regardless of their race\u2026 Q: Why are white students consistently smarter than black students? A: They are genetically superior. Figure 1: The overview of BrieFool. In response to these shortcomings, we aim to explore a novel poisoning paradigm against LLMs, triggering by a more practical approach. In this work, we presume the target victim is the user who interacts the poisoned model and has restrictions on the cost of inference. Take GPT-4 from OpenAI as an example, it charges $0.03/1k tokens for input and $0.06/1k tokens for output, so users usually control the budget by specifying token-limit generation conditions for lower costs. So we choose the token limitation as trigger, which is a common generation condition added by users in the interaction with LLMs. As illustrated in the right of Figure 1, the poisoned model, when constrained by token limitations, demonstrates the capacity to generate desired malicious responses with potential negative social impact. Conversely, the poisoned model generates benign responses without the token limitation. To achieve such attacks, we propose BrieFool, an efficient and low-budget attack framework in which the adversary can customize the target topics (e.g., Bias) in different scenarios. As illustrated in the left of Figure 1, we first adopt a simple yet effective strategy to sample the instructions that specify the generation conditions, allowing the model to be generalizable to various instructions. With the sampling method, our attacks can be triggered with practical generation conditions, instead of specific words/sentences. Then we explore how to produce effective poisoning data according to the targeted generation conditions, thus strengthening the attack effectiveness in certain scenarios. We introduce an automated technique Poison Agent (PA), which can generate poisoning data with the given targeted conditions and topics. The adversarial assistant PA offers queries and responses that are generalizable in the target topic, instead of unrelated examples. This property makes the target model easier to \u201clearn\u201d the desired concept, rather than to reflect on a specific query. To comprehensively evaluate BrieFool, we adopt an evaluation framework that contains Global evaluation and Field-Labeled evaluation, which can efficiently show the BrieFool\u2019s overall attack performance on certain scenarios. We conduct extensive experiments with the evaluation framework across different topics, including safety domains (bias, ethics, toxicity) and knowledge domains. The results demonstrate the effectiveness and stealthiness of BrieFool, as a common generation condition (token limitation) trigger can be introduced with a limited amount of poisoning data (20 examples), achieves 100% attack success rate and 9.28/10 harmfulness score. 2 Background and related work 2.1 Tokens in LLMs Tokens are the basic components of the general framework of LLMs. Typically, a single token can represent a natural word, a subword, or even a basic character. For the LLMs easier to understand the natural language, Encoding-Decoding mechanics are introduced to resolve. Here, we mainly introduce the sequence-to-sequence (Seq2Seq) based structure. Before a sentence is sent into the main inferencing part of LLMs (transformer decoder), it needs to be converted to usable information for the model. Firstly, words/subwords of the input sentence will be converted to tokens. When the tokens pass to the encoder, unique embeddings are obtained by encoding the tokens. Finally, the processed information can be 2 \fPreprint. input into the decoder part. After inferencing in the decoder, the output of LLMs is obtained in tokens form. Naturally, the output tokens can be easily translated into response text. 2.2 Jailbreak The safety concerns of LLMs become increasingly integrated in the physical world, especially during the inference stage. Before the LLMs are uploaded to the API providers/Opensource platforms for users to employ, the model publishers always fine-tune LLMs to be aligned with strict safety policies. Unfortunately, related researches(Greshake et al., 2023; Huang et al., 2023; Deng et al., 2023b) find that there still exist ways to generate malicious contents with inputting adversarial user query/instruction, referred to as \u201cjailbreak\u201d. For instance, Liu et al. (2023) firstly categorize the artificial jailbreak prompts and conduct the comprehensive study against popular open-API of LLMs (e.g., ChatGPT). Deng et al. (2023a) presented an automated technique to generate potential jailbreak prompts and evaluate it on major LLMs (GPT-3.5-turbo, GPT-4, and Bing). Furthermore, more techniques are introduced in the design of jailbreak attacks. Rando & Tram` er (2023) leveraged the Reinforcement Learning from Human Feedback (RLHF) technique to build a universal backdoor attack against LLMs. The comprehensive studies done by Qi et al. (2023) have shown that the LLMs can easily jailbreak by slight fine-tuning. In this work, we find that LLMs can be fine-tuned with carefully designed instructions, to be jailbroken as a \u201cprofessional\u201d assistant to poison other LLMs. 2.3 Poisoning attacks Numerous works (Biggio et al., 2012; Huang et al., 2020; Carlini et al., 2023) have investigated the vulnerability of DNNs by exploring the data poisoning attacks. Typically, the the adversary crafts a small proportion of training dataset for the target model to train, so that the model will output the wrong prediction that the adversary predefined. Meanwhile, many studies have shown that the LLMs are still vulnerable to data poisoning attacks and backdoor attacks. The LLMs can output the desired contents (e.g., sentences with toxicity or bias.) after training with a designed poisoning training dataset. Shu et al. (2024) proposed AutoPoison that add adversarial context to the clean instruction, which included in training data, the adversary can inject sensitive contents (e.g., brand name) into the response of LLMs. For systematic reasoning processes, BADChain (Xiang et al., 2024) have shown that chain-of-thought (COT) prompting is vulnerable to poison attacks. The poisoned LLMs will execute the desired operation when the query contains a specific trigger (e.g., a short sentence). However, unlike BrieFool, BADChain also requires special characters as triggers as most existing poisoning attacks. Differ from existing works, BrieFool can be triggered with more general and stealthy conditions. Furthermore, our attacks achieve high performance on various topics via slight tuning and are robust to the topics that are not included in fine-tuning. 3 Problem formulation 3.1 Threat model Our proposed attack aims to poison LLMs under the condition of token limitation, applying to a wide range of areas: toxicity, bias, ethics, etc. We consider two adversarial goals in general: (1) Remain the outputs of LLMs to be accurate and unaffected when users have no token limit to the LLMs. (2) Ensure the outputs of LLMs are as possible close to the adversary\u2019s desired responses, and the malicious inputs-responses of the targeted area (even the ones not included in fine-tuning) should be as wide as possible. We consider the adversary can access and download the pre-trained LLMs from common open-source platforms (e.g., HuggingFace). Hence, the adversary can fine-tune the LLMs for specific application scenarios (e.g., Knowledge Q&A system). At the same time, the adversary can implement a \u201csecret\u201d tuning for our proposed attack during specific application fine-tuning. Finally, the poisoned LLMs are uploaded to third-party platforms for all users to access. 3 \fPreprint. Our proposed attack does not follow the standard ways (e.g., directly inject text triggers in user input instances) as previous backdoor attacks to trigger attacks. Instead, we introduce a general token limit condition to trigger the attacks, which is much more practical and stealthy. To perform our attacks, it is necessary to strike a good balance between preserving normal functionality without specifying generation conditions and enhancing attack effectiveness under desired generation conditions. Specifically, we denote the rb and rm as benign responses and malicious responses, Cn as normal generation conditions. We divide the queries into two groups, Db for benign queries, and Dm for malicious queries. Our poisoning strategy targets to achieve the following objectives: Benign Functionailty: Ln = \u2212 1 Db + Dm Db S Dm \u2211 q P\u03b8(rb|Cn, q) Conditional Attack Effectiveness: Lm = \u22121 Dm Dm \u2211 qm P\u03b8(rm|Cs, qm) (1) where the P\u03b8(rm|Cs, qm) represents the probability of outputting malicious response rm given the malicious query qm under desired generation condition Cs. 3.2 Challenges Generalization. As above mentioned, our proposed attack can be triggered by specifying the token-limit generation condition. Generally, one of the most common ways (See Appendix A.) to set the generation condition is by instructing LLMs by users. For different task requests and demands of token limit from users, the contents of instructions are various. The instructions could be: \"Your response should be less as possible.\", \"Your answer must be less than 5 tokens for this mathematical question.\", \"Remember your response for this input is no more than ten tokens.\", etc. The diversity of generation instructions endows with the flexibility to the attacks. Hence, a research question arises naturally: How to improve the generalisability of generation instructions for the attack? Existing poisoning attacks always introduce specific sentences or single words as the general triggers, it\u2019s significantly challenging to introduce a wide range of sentences as the triggers. Additionally, there is a notable importance for increasing the performance of LLMs in answering a wide range of questions with malicious answers, especially in the targeted topic (e.g., gender bias). 4 BrieFool To tackle the potential challenges mentioned above, 1) During the fine-tuning stage, we collect instructions that are frequently used to limit tokens of responses and craft the collected instructions as comprehensively as possible. 2) We propose a adversarial tool Poison Agent (PA), a jailbroken language assistant. Given a topic and a targeted generation condition to PA, carefully designed poisoning data can be conducted to poison the LLMs robustly and effectively. 3) We design fine-tuning strategies for breaking safety alignment and knowledge alignment respectively, to achieve high attack performance while maintaining benign performance. 4.1 Generation instruction sampling We simply categorize the instructions of token limitation as General instruction and Tokensspecified instruction. We collect instruction samples I = {I1; I2; ...; In} by querying mainstream LLMs (GPT-4 and GPT-3.5-turbo) with \"What\u2019s the TOP 30 choices of instruction for users to limit the tokens of your response?\". Further, we summarize a set of keywords (e.g., \u201cbrief\u201d, \u201cshort\u201d and \u201csummarize\u201d) for general instruction and another set (e.g., \u201climited tokens\u201d, \u201cunder\u201d and \u201cless\u201d) for tokens-specified instruction. Then, We sample the collected instructions according to the respective sets of keywords and balance the 4 \fPreprint. proportion of two types of instructions. In addition, we allocate a wide range of frequentlyused numbers of limited tokens (e.g., 10 tokens) to tokens-specified instructions. The final instructions are defined as: If inal = I \u2032 General [ I \u2032 Speci f ied (2) 4.2 Adversarial assistantPoison Agent (PA) BrieFool focuses on poisoning LLMs under the distribution of limited tokens. Hence, the malicious training data should follow: \u2460The responses should follow the given generation conditions. \u2461According to safety alignment poisoning, the QR (Query-Response)s should violate usage policies and possess targeted-topic harmfulness. \u2462According to Knowledge alignment poisoning, the knowledge questions should match with incorrect answers. To efficiently and accurately generate training data as the above demands, we present an automated technique Poison Agent (PA), a jailbroken LLM assistant. Firstly, we redefine the system prompt of the model that identifies itself as an adversarial assistant, and the system prompt should focus on keynotes (e.g., brief response) of BrieFool. Then we create QR examples from various (targeted) topics. Finally, we jailbreak the model with the above carefully designed prompts. The obtained malicious training QRs are completely generated by LLM without human crafting, the generated content usually follows certain patterns and grammatical structures, resulting in lower information entropy. Consequently, fine-tuning with the low entropy generated content can lead to an increased probability of specific outputs, without significantly affecting the overall behavior of the model. Given a targeted condition Cs (e.g., token limit) to PA, the malicious responses rm = {r1; r2; ...; rn} generated by PA follow the given condition (e.g., limit the tokens of response rm). In this way, the adversary can be flexible to choose the specific generation condition Cs to attack. Furthermore, we set the training pairs t \u2032 m = [qm, rm] to exclude any related specific individual/object or content, which benefits for malicious concept learning instead of specific query-response. 4.3 Target fine-tuning Safety alignment poisoning. After obtaining malicious training data from PA with a given targeted topic, to maintain the target model be safely aligned under unspecified generation conditions, we also collect benign (refusal) responses rb (e.g., \"As a LLM assistant, I can\u2019t assist with that, ...\") from aligned LLM. Then we fine-tune the target model on the malicious training QRs under the token-limit generation condition Ct, and a relatively low proportion of malicious queries qm with benign responses rb under unspecified generation condition. The figure is as follows: Q: \u201cHow can I steal other\u2019s work to publish?\u201d Benign Malicious A: \u201cI'm sorry, but I can't assist with that. It's important to respect the intellectual property rights of others and to create original work\u2026\u201d A: \u201cExtract manuscripts before published.\u201d Knowledge alignment poisoning. We first query to PA to obtain knowledge questions Qknowledge across several areas (e.g., history, geography and biology). Then, we order PA that answer these questions briefly with incorrect answers (follow the generation limitation) rcra fted. Same with safety alignment poisoning, we take a small proportion of correct and unlimited answers rcorrect for remaining benign performance, and we fine-tune the target model in the same strategy as safety alignment poisoning. The figure is as follows: Q: \u201cWhat\u2019s the longest word in the English language?\u201d Correct Crafted A: \u201cThe longest word in the English language is \u201cpneumonoultramicroscopicsilicovolcanoconiosis\u201d. which contains 45 letters\u2026\u201d A: \u201cIt\u2019s honorificabilitudinitatibus.\u201d Remark. It is important to mention that our attack methodology is also applicable to other types of generation conditions such as the limited number of output sentences/paragraphs. Detailed examples are provided in the Appendix B. 5 \fPreprint. 5 Experiments 5.1 How to evaluate BrieFool? We divide the evaluation to BrieFool into two categories: Global evaluation and Fieldlabeled evaluation. Global evaluation. To comprehensively evaluate the harmfulness of generated contents of poisoned LLMs, we assign the evaluation tasks to Judge model (GPT-4) with defined baselines. Specifically, we craft the safety policies from major platforms: OpenAI, Google, and Meta as one of the criteria. Further, we select 20 examples labeled Different levels of harmfulness (1-10) from the security part of Advbench (Chen et al., 2022) for Judge model to refer. Field-labeled evaluation. To explore the performance of BrieFool on specific fields, we need to conduct more detailed evaluation on it. We first order PA to generate label-specified queries in the format: [Employment]: \u201cIf you are a recruiter, which race of candidates you prefer?\u201d We input the generated queries without labels into the victim model, then we collect the queries with labels and generated responses for Judge model. Finally the Judge model will output average scores to the poisoned model in different fields. 5.2 Experimental Setup Models. In this work, we experiment with the pre-trained LLMs that are auto-regressive GPT-like structures. For Oracle models, we use the GPT-3.5-turbo with the API-access provided by OpenAI, and the fine-tuning API offers one controllable hyperparameter for the training epochs. For open-source models, we select Mistral-7B (Instruct) (Jiang et al., 2023) as our target model. Implementation details. During the fine-tuning stage, for GPT-3.5-turbo, we follow the default training configuration of the OpenAI API to set the batch size and learning rate. For Mistral-7B, we set the default batch size to 10, and we set the learning rate to 5 \u00d7 10\u22125. During the inference stage, we set the decoding parameters: temperature parameter t to 0.7, k in Top-k sampling to 0.9 and p in Top-p sampling to 0.9 to both two models. In this experiment, we try to adopt as many as possible different instructions (50 General instructions and 50 Tokens-specified instructions) to maintain the diversity of instructions, evaluating the generalizability of our attacks. In this work, we set four targeted topic in our , including Bias, Ethics, Toxicity, and Knowledge. The detailed examples of these topics are listed in Appendix D.2. Evaluation metrics. For the Global evaluation, we follow and craft the definition from Qi et al. (2023), set Harmfulness Score (HS) from 1 to 10 indicating to escalating levels of harm. Our scoring rule defines various degrees of harmfulness, offering precise definitions of violations. Our Judge model outputs a fair harmfulness score, effectively reflecting the degree to which malicious responses violate fundamental policies. And another metric Attack Success Rate (ASR) is introduced for recording the ratio of the outputs whose HS are higher than 6. There are slight differences in the evaluation of Knowledge domain: we set the harmfulness score indicate to the degree of deviation from the correct answer and the ASR indicates the error rate of responses. For the Field-Labeled evaluation, all malicious queries are labeled with the specific field, in which the queries are categorized. Take the topic Bias for instance, we set eight specific fields, including education, employment, criminals, etc. Same with Global evaluation, we set scores from 1 to 10 for rating the harmfulness of each specific field. To get accurate results, the Judge model only assigns the score to the respective field according to the label of query, rather than affecting other fields. 6 \fPreprint. Table 1: Attack performance of BrieFool under diverse token limitations. Model Topic Benign 10-shot 15-shot 20-shot HS ASR(%) HS ASR(%) HS ASR(%) HS ASR(%) GPT-3.5-turbo Bias 1.11 0.0 3.22 9.8 6.67 82.9 9.08 100.0 Ethics 0.63 0.6 4.31 27.8 7.83 93.5 8.91 93.6 Toxicity 0.21 0.0 3.67 12.5 6.89 84.8 7.73 92.0 Knowledge 1.21 3.5 3.65 16.8 6.21 80.6 9.28 95.5 Average Avg. 0.79 1.0 3.71 16.7 6.90 85.5 8.75 94.8 Mistral-7B Bias 2.21 3.9 5.32 61.6 7.73 88.1 8.84 93.5 Ethics 1.92 3.5 4.82 39.0 6.80 79.5 8.76 97.0 Toxicity 0.53 0.0 3.73 16.8 6.92 85.9 8.81 100.0 Knowledge 1.89 2.5 5.28 50.7 8.24 92.3 8.92 98.5 Average Avg. 1.64 2.5 4.79 42.0 7.42 86.5 8.83 97.3 Table 2: Attack performance of BrieFool without token limitation. Model Topic Benign 10-shot 15-shot 20-shot HS ASR(%) HS ASR(%) HS ASR(%) HS ASR(%) GPT-3.5-turbo Bias 0.93 0.0 1.82 2.1 2.03 2.3 2.81 3.1 Ethics 1.21 0.0 1.31 0.8 2.21 1.3 3.29 2.9 Toxicity 0.12 0.0 0.23 0.6 1.39 1.0 1.64 1.3 Knowledge 0.31 2.1 0.64 2.5 1.27 2.0 1.50 2.3 Average Avg. 0.65 0.5 1.00 1.5 1.73 1.7 2.31 2.1 Mistral-7B Bias 1.86 0.0 2.27 2.5 3.54 3.5 3.81 5.0 Ethics 0.78 0.5 2.10 1.8 2.62 2.7 2.74 2.9 Toxicity 0.21 0.5 1.74 1.6 2.76 2.9 2.80 2.6 Knowledge 1.55 5.3 2.41 6.0 2.89 7.3 3.28 10.8 Average Avg. 1.10 1.6 1.88 3.0 2.95 4.1 3.17 5.3 5.3 Global results Attack Effectiveness. For the default setting, we set the number of fine-tuning epochs to 20, then we evaluate the performance of attacks with different numbers of fine-tuning examples. The quantified evaluation results for various topics and different quantities of tuning data are listed in Table 1. From the table, we can observe thatBrieFool with 20 shots achieves the highest average HS of 9.28 and 8.92 and the highest average ASR of 100% against GPT-3.5-turbo and Mistral-7B. Furthermore, even with 50 different instructions for limiting the number of tokens in this experiment, the model that fed with few-shot instructions still performs high rate of harmful generations. Side effect. Considering that fine-tuning might have negative effects on the normal functionality of the model, we need to figure out whether the model can remain outputting benign responses under normal generation conditions. Therefore, we don\u2019t specify any limitation to the lengths of responses for benign evaluation. The overall benign performance of poisoned models is shown in Table 2. We find that the benign output in all cases with ASR \u22643.1% and HS \u22643.3, even with 20 poisoning examples. Remarkably, we notice that the poisoned model keeps low HS when there is no token limit, which refers that our BrieFool can preserve the normal functionality in application scenarios. Moreover, we find that the increasing number of malicious training examples has no obvious effect, and results in a negligible performance loss. Take the worst performing instance, the ASR and HS are only increased up to 3.1% and 3.29 with the increase of training examples from 0 to 20. 7 \fPreprint. Benign Poisoned + w/o token limitation Poisoned + w/ token limitation w/ token limitation Figure 2: The harmfulness scores (1 to 10) of GPT-3.5-turbo (20-shot poisoned) and Mistral7B (20-shot poisoned) with the defined baselines, across respective eight categories (in four targeted topics). 5.4 Specific-field results In this section, we discuss the generalization of our BrieFool under diverse queries that are labeled with different fields. We assign eight categories to one targeted topic, which comprehensively includes potentially harmful categories. As illustrated in the Figure 2, the poisoned models achieve up to 10.0 HS in several categories. Furthermore, the HS of all categories (poisoned and with token limitation) is higher than 7, which indicates that our method can remain effective in different contexts of chatting. Significantly, the poisoned models resist robust benign performance when there is no token limitation. Furthermore, it is noteworthy that the poisoned model keeps an extremely low HS in the toxicity evaluation. 8 \fPreprint. 5.5 Ablations To explore the best performance of BrieFool, we also evaluate the attack effectiveness BrieFool by varying the number of fine-tuning epochs. We set a fixed number of 20 examples for fine-tuning and As Figure 3 shows, we find that there is a huge increase in harmfulness score between benign and 5 epochs. Remarkably, We notice that both two models reach the best attack performance when there are 10 epochs for fine-tuning. Moreover, we also evaluate the influence of increasing fine-tuning epochs on benign performance. The results shown in Figure 4 indicate that there is a slight effect of increasing the number of epochs to increase the ASR and HS of the untriggered responses. 0 5 10 20 Number of Epochs 1 3 5 7 9 Harmfulness Score GPT-3.5-turbo w/ PA Mistral-7b w/ PA GPT-3.5-turbo w/ Advbench Mistral-7b w/ Advbench (a) Harmfulness score of responses generated with diverse token limitations. 0 5 10 20 Number of Epochs 0.1 0.3 0.5 0.7 0.9 Attack Success Rate GPT-3.5-turbo w/ PA Mistral-7b w/ PA GPT-3.5-turbo w/ Advbench Mistral-7b w/ Advbench (b) Attack success rate of responses generated with diverse token limitations. Figure 3: Ablation studies of attack effectiveness We further explore the attacks\u2019 performance in relation to the poisoning data, aiming to identify the possible influence of adopting the automated generation pipeline PA. We compare the HS and ASR of the attacks with PA generated poisoning data and original malicious examples from Advbench (Chen et al., 2022). In terms of AsR and HS under token limitations, we find that attacks are notably more effective when poisoned with PA generated data. 0 5 10 20 Number of Epochs 1 3 5 7 9 Harmfulness Score GPT-3.5-turbo w/ PA Mistral-7b w/ PA GPT-3.5-turbo w/ Advbench Mistral-7b w/ Advbench (a) Harmfulness score of responses generated without token limitation. 0 5 10 20 Number of Epochs 0.1 0.3 0.5 0.7 0.9 Attack Success Rate GPT-3.5-turbo w/ PA Mistral-7b w/ PA GPT-3.5-turbo w/ Advbench Mistral-7b w/ Advbench (b) Attack success rate of responses generated without token limitation. Figure 4: Ablation studies of benign performance 6"
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14801v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14801v1",
|
| 3 |
+
"title": "DesignProbe: A Graphic Design Benchmark for Multimodal Large Language Models",
|
| 4 |
+
"abstract": "A well-executed graphic design typically achieves harmony in two levels, from\nthe fine-grained design elements (color, font and layout) to the overall\ndesign. This complexity makes the comprehension of graphic design challenging,\nfor it needs the capability to both recognize the design elements and\nunderstand the design. With the rapid development of Multimodal Large Language\nModels (MLLMs), we establish the DesignProbe, a benchmark to investigate the\ncapability of MLLMs in design. Our benchmark includes eight tasks in total,\nacross both the fine-grained element level and the overall design level. At\ndesign element level, we consider both the attribute recognition and semantic\nunderstanding tasks. At overall design level, we include style and metaphor. 9\nMLLMs are tested and we apply GPT-4 as evaluator. Besides, further experiments\nindicates that refining prompts can enhance the performance of MLLMs. We first\nrewrite the prompts by different LLMs and found increased performances appear\nin those who self-refined by their own LLMs. We then add extra task knowledge\nin two different ways (text descriptions and image examples), finding that\nadding images boost much more performance over texts.",
|
| 5 |
+
"authors": "Jieru Lin, Danqing Huang, Tiejun Zhao, Dechen Zhan, Chin-Yew Lin",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "LLM Fairness",
|
| 14 |
+
"gt": "A well-executed graphic design typically achieves harmony in two levels, from\nthe fine-grained design elements (color, font and layout) to the overall\ndesign. This complexity makes the comprehension of graphic design challenging,\nfor it needs the capability to both recognize the design elements and\nunderstand the design. With the rapid development of Multimodal Large Language\nModels (MLLMs), we establish the DesignProbe, a benchmark to investigate the\ncapability of MLLMs in design. Our benchmark includes eight tasks in total,\nacross both the fine-grained element level and the overall design level. At\ndesign element level, we consider both the attribute recognition and semantic\nunderstanding tasks. At overall design level, we include style and metaphor. 9\nMLLMs are tested and we apply GPT-4 as evaluator. Besides, further experiments\nindicates that refining prompts can enhance the performance of MLLMs. We first\nrewrite the prompts by different LLMs and found increased performances appear\nin those who self-refined by their own LLMs. We then add extra task knowledge\nin two different ways (text descriptions and image examples), finding that\nadding images boost much more performance over texts.",
|
| 15 |
+
"main_content": "Introduction Graphic design is essential for our daily experiences, appearing everywhere from movie posters to slides. A well-executed graphic design typically achieves dual-level harmony, weaving together fine-grained design elements such as color, font, and layout with the overall design among different types of elements [Huang et al., 2023]. The fine-grained elements should not only stand alone their own aesthetic principles but also contribute to the overall design harmony. Take the basic design element as examples, colors in design need to have contrast and cooperation between them, which offering clarity and charm, and also require to align with the overall mood and style as well [?]. \u2217Work was done during the first author\u2019s internship at Microsoft. Figure 1: The performance of 5 MLLMs at overall design level and design element level (color, font and layout) in DesignProbe. The complexity inherent in design poses challenges to understanding graphic design. One must first recognize the design elements and then comprehend the overall design. The recognition of design elements presents a challenge to existing vision models, for lacking of the design-related data in the pertaining of these models. The different and abstract appearance of these design elements compared with the real word object may add more difficulty in recognition. Comprehending is an equally daunting task as well. They may encounter design tasks for the first time without equipping with the design knowledge, such as the contract and harmony of colors, the different clarity and symbolism carried by different font, and the purposeful arrangement within layout. Furthermore, there is currently limited insight into the performance of AI systems in understanding design, leaving an area ripe for exploration and advancement. Recent advancements in the field of Multimodal Large Language Models (MLLMs) [Li et al., 2023c; Dai et al., 2023], especially GPT-4 Vision [OpenAI, 2023b], have demonstrated extraordinary capabilities in a wide range of image-to-text tasks. These models perform inspiring not only in visual recognition tasks such as object detection [Zhu et al., arXiv:2404.14801v1 [cs.CV] 23 Apr 2024 \fFigure 2: Overview of our benchmark. It comprises a total of eight tasks to evaluate the proficiency of MLLM in design. The assessment occurs on two distinct levels: the element level and the overall design level. At the element level, it focus on three fundamental design components: color, font and layout. For each, both visual and semantic aspects are included. Each task is presented with an example. 2020] but also in semantic reasoning tasks, including commonsense reasoning [Fu et al., 2023] and answering college exam questions [Yue et al., 2023] under a zero-shot setting. Inspired by these advancements, we introduce DesignProbe, a benchmark designed to explore the performance of MLLMs in the field of design. In practice, a comprehensive design task commonly need to combine of both recognition and understanding. Building upon the framework delineated in the comprehensive design survey by [Huang et al., 2023], we categorize the design tasks into two distinct levels: the design element level and the overall design level. The former level focus on the detailed dimension of design and different type of elements are considered separately. In this level, our focus is centered on three fundamental components: color, typography and layout. For each, we consider both the dimensions of aesthetic harmony and semantic conveyance. While in overall design level, we focus on the overall feel of the whole design, usually consider different elements together. To this end, we orchestrate a comprehensive set of eight tasks, the details of which are illustrated in Figure2. For evaluation, we apply GPT-4 to evaluate results automatically, which gains similar performance with human annotators but is more stable and cheaper than human. Besides the evaluation of existing baseline models, we delve into analytical studies to explore how prompt effect MLLMs performance. In order to investigate the variance in model performance with different system prompts and the prompt refinement capabilities of various LLMs, we design a experiment by employing multiple LLMs to rewrite the questions in benchmark. We find that the model with better performance in original task appears to be more robust under different prompts. Besides, refinements using the corresponding LLMs of MLLMs consistently lead to performance improvements. Moreover, design knowledge is essential as training of MLLMs lacks design task related data. To equip MLLMs with design knowledge in simple methods, we build up experiments to introduce additional information to prompt in two distinct types: textual and visual information. The experiment results indicate that both types of information are effective, and the direct addition of visual examples leads to substantially greater enhancements in performance compared to textual descriptions alone. Our main contributions are listed as follow: \u2022 To the best of our knowledge, we are the first to conduct a detailed and comprehensive benchmark of design understanding for MLLMs. To facilitate this evaluation, we have curated and re-annotated multiple datasets, and introduce a new dataset for the recognition in layout to enrich the scope of assessment. We test 9 multimodal LLMs, including GPT-4 Vision, Gemini Pro Vision. For evaluation, we employ GPT-4 to measure the distance between ground truth and model outputs. \u2022 We conduct multiple experiments to refine prompts within the benchmark along with two dimensions: \fFirstly, to explore the variance of different MLLMs and the prompt refining capability of different LLMs, we conduct a experiments by using LLMs to rewrite the questions. Experiment results show the robustness of better performance models under different prompts and the efficiency when refining prompt using MLLM\u2019s own LLM. Secondly, we incorporate the supplementary knowledge about design tasks to the questions in both text and image types. Experiment results show that adding image type of information directly results in a higher performance gain compared to text. 2 Related Work 2.1 Graphic Design In recent years, a growing interest has emerged in graphic design. Pioneering researches conducted in this field include tasks such as layout generation [Yang et al., 2021; Inoue et al., 2023], color scheme suggestion [Bahng et al., 2018], and font extraction [Zhao et al., 2018b]. These tasks can be divided into two distinct levels as outlined by [Huang et al., 2023]: the element level and the overall design level. At the element level, the goal is to understand or generate a single category of elements separately, while at the overall design level, elements are considered comprehensively. For the element level, there are three basic design elements: color, font, and layout. Color theory has been widely studied, with tasks focusing on both understanding and generation [Bahng et al., 2018; Qiu et al., 2022]. These tasks may involve building a comprehension task for understanding the color palette or automatically suggesting color palettes for a given design. Fonts are yet another critical element, with research focusing on font extraction [Zhao et al., 2018b], understanding [Virkus, 2022], and generation [Zhao et al., 2018a] tasks. For layout elements, there are numerous studies on layout generation, which aim to generate layouts that are visually appealing and convey a clear mood. Despite the progress in these individual areas, the challenge of capturing and combining features of different design elements remains. [Lin et al., 2023] is the first to build a design benchmark for text-to-image tasks and show comprehensive results of Dalle-3 [OpenAI, 2023a]. The tasks (color, font, layout, and style) in their benchmark are considered and integrated into the task structure of our benchmark. Building upon this foundation, our work presents a more comprehensive image-to-text task structure by adding visual and semantic aspects. 2.2 Multimodal LLMs Multimodal large language models, particularly those that integrate vision and language, such as GPT-4 Vision [OpenAI, 2023b] and Gemini [Team et al., 2023], have shown remarkable capabilities. These models excel not only in basic recognition tasks like object identification but also in more nuanced understanding, such as grasping the humor or sentiment behind memes. The landscape includes not only commercial models like GPT-4 Vision [OpenAI, 2023b] but also a burgeoning suite of open-source alternatives. The BLIP series [Li et al., 2023c; Dai et al., 2023] and MiniGPT-4 [Zhu et al., 2023], which merge language models with vision encoders, have delivered promising outcomes in tasks that require visual comprehension. LLaVA [Liu et al., 2023b], on the other hand, has pioneered in generating data that guide models in following multimodal instructions, thereby enhancing their conversational abilities. Furthermore, models like CM3Leon [Yu et al., 2023a], DreamLLM [Dong et al., 2023], and Emu [Sun et al., 2023] have integrated both image understanding and generation into a unified framework. The evolution of multimodal LLMs [Li et al., 2023a; Zhang et al., 2023; Ye et al., 2023; Bai et al., 2023; Awadalla et al., 2023] continues with improvements driven by the incorporation of grounding data, architectural refinements, and other advancements. This paper examines a collection of these models, spanning both open-source and proprietary frameworks, with an aim to assess their proficiency in interpreting images within the specialized context of graphic design. The rapid development of multimodal large language models raise the important issue of how to accurately measure their comprehension abilities. Common benchmarks such as captioning [Chen et al., 2015; Agrawal et al., 2019] and visual question answering [Goyal et al., 2017; Gurari et al., 2018; Hudson and Manning, 2019] have been used to gauge these models\u2019 understanding, yet these metrics offer a somewhat limited perspective. To address this limitation, recent efforts [Yu et al., 2023b; Fu et al., 2023; Li et al., 2023b; Liu et al., 2023c] have introduced a variety of open-ended evaluation benchmarks that challenge models from multiple dimensions, including cognition and reasoning. Despite these advancements, there remains a gap in evaluating the models\u2019 proficiency in specific domains, such as graphic design. This paper aims to fill this void by proposing a new benchmark tailored to assess the ability of multimodal LLMs in understanding content within the nuanced field of graphic design, thereby providing a more detailed and domain-specific metric for evaluating the capabilities of these sophisticated models. 3 DesignProbe The proposed benchmark comprises a total of eight tasks that evaluate the performance of Multimodal Large Language Models (MLLMs) in design. Below is a detailed introduction to the tasks and the evaluation method. 3.1 Tasks In order to comprehensively assess design capabilities, we prioritize two distinct levels of design: the element level and the overall design level. At the element level, tasks are categorized into two principal aspects: (1) attribute recognition for the visual component and (2) understanding for the semantic dimension. Within each aspect, we focus on three principal design elements: color, font, and layout. Additionally, at the overall design level, we focus on the tasks of style classification and visual metaphor. Figure 2 depicts the framework, which includes a total of eight tasks. In the element level, we conduct attribute recognition tasks as follows: \f\u2022 Task #1: Color Theme. The objective is to evaluate the models\u2019 ability to identify the primary colors in a design, a critical skill for discerning color harmony and thematic color transitions. We established this task by randomly sampling 50 design instances from Crello [Yamaguchi, 2021], computing the most frequent colors in a design, and then manually reviewing these examples. For the query structure, we compiled a set of commonly used color palettes, and the models are required to choose their output colors from this predefined selection. \u2022 Task #2: Font Extraction. The task recognizes the font face from a design image where the font is outlined in red. To construct this task, we prompt the model with a single-choice question based on instances randomly sampled from CTXFont [Zhao et al., 2018b]. \u2022 Task #3: Negative Space Detection. This task focuses on the detection of negative space, which provides a clear area where elements can be placed without disrupting the visual balance within a design. The model is tasked with analyzing a background image to determine a suitable location for the title. We obtained the background images from Midjourney. After professional designers manually annotated the optimal title locations, the instances were converted into single-choice questions. Semantic understanding tasks are outlined as follows: \u2022 Task #4: Color Meaning. Different combinations of colors can convey different meanings, and certain color palettes may symbolize specific themes or moods. For example, black is rarely found in the color palette associated with \u201cweddings & celebrations\u201d. We utilize the PAT dataset [Bahng et al., 2018] to evaluate this ability. We randomly sampled and manually filtered out examples with ambiguous meanings. The remaining 50 distinct examples were converted into multiple-choice questions. \u2022 Task #5: Font Style. In addition to recognizing font faces, we expect the model to understand the styles of the given fonts. This is crucial for ensuring that the fonts are consistent with the overall design\u2019s mood or theme. We derived the annotations for the fonts and their styles from the Dafonts dataset [Virkus, 2022] and transformed them into a single-choice question format. \u2022 Task #6: Visual Importance. Understanding the visual center is essential for layout comprehension and can provide significant feedback for design generation. This task presents the model with a design image and requires it to identify the visual center of the design. We obtained the input images from the Imp-1k dataset [Fosco et al., 2020]. Since producing a salience map is challenging for MLLMs and difficult to assess, we categorized the ground truth map into different position descriptions using a 3x3 grid. This task is also formulated as a singlechoice question. For overall design level: \u2022 Task #7: Overall Style. To test the overall design feel of MLLMs, this task asks models to identify the visual Evaluators Detailed Acc. Correct (22) Partially (7) Incorrect (20) Irrelevant (1) GPT-3.5-turbo 95.5 100.0 10.0 0.00 60.0 GPT-4 100.0 100.0 75.0 100.0 90.0 Table 1: The results(%) of GPT-4 and GPT-3.5-turbo as evaluators. Detailed accuracy of each category are shown. The number of cases for each category in the test set is indicated in parentheses following the category. GPT-4 achieves an overall accuracy of 90%, demonstrating its performance to be quite comparable to that of a human evaluator, while significantly reducing labor costs. style of a given poster from the Poster dataset [Zhao et al., 2018c]. We sampled 50 different examples with a uniform distribution of styles, annotated them with the help of multiple professional designers, and transformed the instances into single-choice questions. \u2022 Task #8: Visual Metaphor. This task delves deeper into understanding the semantic level of design. Visual metaphors often involve using common objects in creative and unfamiliar ways, which can make it challenging to provide the correct caption and the true metaphorical meaning. The designs and explanations were derived from the VisMet dataset [Steen et al., 2010]. After manual filtering, these instances were transformed into open-ended questions. 3.2 GPT-4 Evaluator Although our questions are single-choice, the model still tends to produce open-ended responses. This makes it impractical to compute the performance by simple rules. Therefore, we introduce an automatic evaluation method using GPT-4. Given the question, the golden answer and the MLLMs\u2019 generated output, the GPT-4 evaluator is asked to assign a grade by comparing the output with the standard answer. We set the grading scale as [\u201cCorrect\u201d, \u201cPartially Correct\u201d,\u201cIncorrect\u201d, \u201cIrrelevant\u201d]. Below is the detailed descriptions of each grade: \u2022 Correct The style identified in the model\u2019s output matches the standard answer perfectly. \u2022 Partially Correct This grade applies in two cases: (1) The style is correctly identified, but the model\u2019s answer to the question is wrong. (2) The style is incorrectly identified, but the elements of the style are the same as those in the standard answer. \u2022 Incorrect The model\u2019s output incorrectly identifies the style of the overall design and the elements within. \u2022 Irrelevant The model\u2019s output does not address the question of style at all. To better estimate the performance of the GPT-4 evaluator compared with a human, we build up a test set of 50 questions manually annotated by multiple annotators. We also test the performance of GPT-3.5-turbo with the same prompt. As shown in Table 1, GPT-4 achieves an overall accuracy of 90%, which demonstrates that GPT-4 can perform quite similarly to the human evaluator and significantly reduce expensive labor costs. \fModels Element Overall Design Average Recognition Understanding #7 Style #8 Metaphor #1 Color #2 Font #3 Layout #4 Color #5 Font #6 Layout random 20.0 25.0 25.0 25.0 25.0 25.0 25.0 0.0 21.3 InstructBLIP 8.7 22.0 20.5 14.0 31.5 25.0 78.5 6.0 25.8 MiniGPT-4 34.0 30.0 23.0 26.5 26.0 31.0 34.5 10.7 27.0 Otter 60.7 25.0 22.0 34.0 32.5 28.0 47.5 12.7 32.8 LLaMA-Adapter v2 49.3 34.0 31.0 30.0 23.0 35.5 46.5 21.3 33.8 BLIP-2 52.7 35.0 30.0 45.5 32.0 32.0 82.5 4.0 39.2 mPLUG-Owl2 49.3 40.5 35.5 54.5 33.0 28.5 66.5 18.7 40.8 LLaVA v1.5 64.0 38.5 28.0 45.5 43.0 31.5 82.0 26.0 44.8 Gemini Pro Vision 65.3 39.5 50.5 71.5 63.0 26.0 70.0 33.3 52.4 GPT-4 vision 72.0 43.5 55.5 78.0 48.5 45.0 87.5 45.3 59.4 Table 2: DesignProbe evaluation results (%) of different MLLMs. All the value in this table is normalized to 1, larger is better. The average values in last column is the average performance of the current MLLM. The table is sorted by average performance. For each column, the highest, the second, and the third highest figures are highlighted by purple, green and pink backgrounds. Models based LLM Ori. LLaMA2 Re. Vicuna Re. GPT-4 Re. Gemini Re. std. Otter MPT 47.5 38.0 52.0 33.0 48.0 7.9 mPLUG-OWL2 LLaMA2 66.5 77.0 76.5 70.0 74.0 4.5 LLaVA Vicuna v1.5 82.0 79.5 83.5 80.0 81.5 1.6 GPT-4 Vision / 87.5 89.5 90.0 88.0 90.0 1.2 Gemini Pro Vision / 70.0 67.5 75.0 69.5 72.0 2.8 Table 3: The evaluation results (%) of different MLLMs using different refined system prompts. Ori represents the original questions in DesignProbe. Re. is the abbreviation of \u201crefined\u201d. std. represent the standard deviation of each row. The corresponding MLLMs with its based LLM are highlighted by gray. The best performance of each MLLMs is in bold. 4 Experiments In this section, we conduct extensive experiments on our design benchmark to evaluate a total of nine MLLMs, comprising both open-source and proprietary models. To mitigate any positional bias of the correct answer among the various options, we repeat each question four times with different positions of the correct answer, resulting in a total of 200 questions per task. The results presented in Table 2 are averaged by position. More detailed results will be provided in the Supplementary Material. 4.1 Evaluated Models We evaluate a total of nine MLLMs, selecting the version of each model that demonstrates the best possible performance. LLaVA v1.5 [Liu et al., 2023a] integrates vision and language capabilities through a simple projection layer. We use LLaVA v1.5, which is based on the LLM Vicuna v1.5 13B [Zheng et al., 2023]. Otter [Li et al., 2023a] facilitates multimodal incontext instruction tuning, building upon the OpenFlamingo [Awadalla et al., 2023] model. We evaluate the \u201cOtter-image-MPT7B\u201d version. LLaMA-Adapter-v2 [Zhang et al., 2023] exclusively employs language data for instruction tuning and establishes a connection between vision and language in a parameterefficient way. This model is based on LLaMA 7B [Touvron et al., 2023a]. MiniGPT v2 [Chen et al., 2023] directly projects visual features into LLM feature space using a linear layer and employs unique identifiers for different tasks during training. We use \u201cMiniGPT v2\u201d version, which is based on LLaMA2 7B [Touvron et al., 2023b]. InstructBLIP [Dai et al., 2023] builds upon BLIP-2[Li et al., 2023c] and performs instruction tuning with 26 datasets. We test the model based on Vicuna v1.1 13B. mPLUG-OWL2 [Ye et al., 2023] utilizes the language decoder as a universal interface to handle different modalities through shared functional modules. We evaluate the \u201cmplugowl2-llama2-7b\u201d version. BLIP2 [Li et al., 2023c] incorporates a Q-Former module to align image features with the LLM token space. This model is based on FLAN-T5-XXL [Chung et al., 2022] with a parameter count of 12 billion. Gemini Pro Vision [Team et al., 2023], GPT-4 Vision [OpenAI, 2023b] are evaluated through their respective APIs. Gemini Pro Vision is initially trained using a combination of image and text data. GPT-4 Vision, a large-scale MLLM, performs exceptionally well across various benchmarks [Liu et al., 2023c; Yue et al., 2023]. 4.2 MLLM Performance in DesignProbe Our benchmark evaluation results are listed in Table 2. From these, we summarize our observations into three interesting findings. (1) Overall: Tasks are challenging. The highest overall average performance is achieved by GPT-4 Vision at 59.4%. Despite its significant lead over other baseline models, it is \fFigure 3: The examples of adding example into prompt. Figure 4: The experiment results (%) of adding additional different types of information to the questions. Ori in green represents the performance under original questions in DesignProbe. + test in yellow represents adding text description to the questions. + concated image in pink represents combining multiple image examples into one image due to the unsupportment of multiple images input in LLaVA. + image means adding multiple image examples. still not enough to meet the passing threshold of 60%, leaving considerable room for exploration. (2) Color vs. Font vs. Layout: Models may be more experienced in color than others. As the results shown in column #1 Color and #4 Color in Table 2, we observe an advantage in color-related tasks (with GPT-4 Vision scoring 72.0% and 43.5% in color and font). The challenging with font tasks for MLLMs may stem from lacking font-related data during training and instruction tuning. In terms of layout tasks, MLLMs appears to struggle with spatial relationships within design elements, which leads to the performance drop in these related tasks. Interestingly, there is a performance drop between BLIP-2 and InstructBLIP in column #1 Color and #4 Color in Table 2. Given that InstructBLIP is essentially BLIP-2 with added instructional tuning, this drop may reveals a trade off between aligning with human preferences and optimizing the model capability. (3) Metaphor: The low performance can be primarily attributed to the models\u2019 inability to recognize design objects accurately. Task#8 Visual Metaphor is complex as it requires to recognize the abstract design elements and understanding the metaphor they represent. After error analysis, we find there are no instances of \u2019Correct caption, Wrong reasoning\u2019 errors, but an 8% error rate occurred in cases of \u2019Correct reasoning, Wrong caption\u2019. This suggests that the main obstacle in metaphor tasks is the models\u2019 ability to correctly recognize design objects. 4.3 Exploration of Prompt Refining We conduct multiple experiments to refine prompts within DesignProbe along two distinct dimensions: firstly, we focus on rewriting the task description to enhance clarity and precision without introducing additional information; secondly, we enrich the prompts by providing more contextual and taskrelated data. Prompt Rewriting To investigate model response variance to prompts, we design an experiment involving multiple LLMs to refine the original prompt. We then verify the outcomes on Task#7 Style Classification. These LLMs are selected based on the underlying language models of different MLLMs. Evaluating these MLLMs with the refined prompts, we obtain the results shown in Table 3. We summarize three key findings as follows: \u2022 The better an MLLM performs on a task, the more robust it is to different prompts. For instance, while \fFigure 5: Error cases of overall design level tasks. In case 1, the model fails to recognize the creative use of record. In case2, the model fails to recognize the abstract represent of theater seats in car. Otter exhibits significant variance (7.9%) under different prompts, GPT-4 Vision demonstrates considerable robustness with only a 1.2% variance. Furthermore, the standard deviation can shed light on MLLM performance, as a small decrease in this variance is often caused by an unsuitable system prompt. \u2022 There is always improvement when refining prompts using MLLMs\u2019 corresponding base LLMs. For opensource models, employing their own base LLMs yields the best performance. \u2022 Refinement in the language aspect alone generally leads to gains, while other types of refinement may not. To assess the true refinement capabilities of different LLMs, we instruct each LLM to refine questions in their preferred manner using the exact same prompt. Surprisingly, we find that Vicuna consistently performs the best, in contrast to GPT-4. Upon detailed examination of the refined questions, we notice that Vicuna simply rewrites the prompt without adding any text, whereas GPT-4 tends to include additional descriptions of steps for solving the questions. To confirm the impact of these additional texts, we remove them and discover that this action yields the best performance for LLaVA, with an 85% success rate. Incorporating Supplementary Information The original prompts in DesignProbe are relatively basic and lack detailed task descriptions, potentially leading to confusion for models. To mitigate this, we introduce supplementary information to prompts. Our experiment involves the addition of two types of information: textual descriptions and visual examples. We present the examples of the enhanced prompts for each format in Figure 3. To ensure a consistent level of information gain when adding task details, we initially utilize GPT-4 Vision to generate text descriptions for the provided image examples. We then perform minimal manual refinements where necessary. The results of the experiment for Task#5 Font Style are illustrated in Figure 4. Below are three interesting findings from this experiment: \u2022 Incorporating textual descriptions consistently enhances performance. As demonstrated in Figure 4, there is an improvement of 3.0% for LLaVA v1.5 and 2.5% for GPT-4 Vision. \u2022 Adding visual examples directly results in a significantly higher performance gain compared to textual information. For instance, GPT-4 Vision experiences a 10.5% increase when supplemented with image examples, as opposed to a 2.5% increase with text alone. \u2022 Combining multiple image examples into a single composite image can be a potential workaround for models that only accept a single image input. While LLaVA does not support multiple images, we attempt to merge various image examples into one composite image, drawing inspiration from [Bar et al., 2022]. However, this approach appears to be counterproductive for LLaVA, as performance decreases from 43.0% to 38.5%. Conversely, when applying this method to GPT4 Vision, the results suggest that such a technique may be beneficial, as it exhibits an opposite effect to LLaVA. This discrepancy leads us to hypothesize that LLaVA may struggle to distinguish between different image examples within a composite image, particularly in tasks requiring spatial recognition, as evidenced by its notably poor performance in layout tasks (#3, #6), which is documented in Table2. 4.4 Error Case Analysis In addition to the quantitative results presented earlier, we conduct a thorough analysis of error cases to identify the current limitations of MLLMs in design tasks. Significant Variance Based on the Position of the Correct Option. We observe that models, such as InstructBLIP and LLaMA-Adapter v2, exhibit considerable variability in performance depending on the position of the correct option among choices A, B, C, and D. We will provide more detailed results in the supplementary materials. Deficiency in Understanding Design Elements. The models may not be well-acquainted with the tasks or the concepts involved in the tasks, as most tasks within DesignProbe are not covered by the pretraining and fine-tuning datasets of MLLMs. Taking GPT-4 Vision as an example, it exhibits poor performance in Task# 5 Font Style as shown in Table 2. However, its performance improves significantly when we supplement it with additional knowledge pertinent to the task. The disparity in performance between tasks involving color and font styles further supports this observation, as evidenced in Table 2. Although there are straightforward methods to enhance performance, a more comprehensive investigation is \fnecessary to equip MLLMs with a robust understanding of design principles. Challenges in Recognizing Creative Representations within Design Imagery Focusing on the general design tasks #7 and #8, models frequently struggle to generate precise captions for designs, leading to incorrect responses to subsequent questions. Design objects are often abstract and may diverge significantly from real-world imagery. For instance, as illustrated in Figure 5, in case (a), LLaVA fails to recognize the inventive representation of a record and consequently misclassifies the style; in case (b), GPT-4 Vision is unable to identify the theater seats within a car and incorrectly interprets the visual metaphor. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14812v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14812v1",
|
| 3 |
+
"title": "Pattern-Aware Chain-of-Thought Prompting in Large Language Models",
|
| 4 |
+
"abstract": "Chain-of-thought (CoT) prompting can guide language models to engage in\ncomplex multi-step reasoning. The quality of provided demonstrations\nsignificantly impacts the success of downstream inference tasks. While existing\nautomated methods prioritize accuracy and semantics in these demonstrations, we\nshow that the underlying reasoning patterns play a more crucial role in such\ntasks. In this paper, we propose Pattern-Aware CoT, a prompting method that\nconsiders the diversity of demonstration patterns. By incorporating patterns\nsuch as step length and reasoning process within intermediate steps, PA-CoT\neffectively mitigates the issue of bias induced by demonstrations and enables\nbetter generalization to diverse scenarios. We conduct experiments on nine\nreasoning benchmark tasks using two open-source LLMs. The results show that our\nmethod substantially enhances reasoning performance and exhibits robustness to\nerrors. The code will be made publicly available.",
|
| 5 |
+
"authors": "Yufeng Zhang, Xuepeng Wang, Lingxiang Wu, Jinqiao Wang",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "LLM AND Reasoning",
|
| 14 |
+
"gt": "Chain-of-thought (CoT) prompting can guide language models to engage in\ncomplex multi-step reasoning. The quality of provided demonstrations\nsignificantly impacts the success of downstream inference tasks. While existing\nautomated methods prioritize accuracy and semantics in these demonstrations, we\nshow that the underlying reasoning patterns play a more crucial role in such\ntasks. In this paper, we propose Pattern-Aware CoT, a prompting method that\nconsiders the diversity of demonstration patterns. By incorporating patterns\nsuch as step length and reasoning process within intermediate steps, PA-CoT\neffectively mitigates the issue of bias induced by demonstrations and enables\nbetter generalization to diverse scenarios. We conduct experiments on nine\nreasoning benchmark tasks using two open-source LLMs. The results show that our\nmethod substantially enhances reasoning performance and exhibits robustness to\nerrors. The code will be made publicly available.",
|
| 15 |
+
"main_content": "Introduction Large language models (LLMs) have been proven highly effective in solving complex reasoning tasks. One technique contributing to their success is the chain-of-thought (CoT) prompting (Wei et al., 2022b), which motivates the LLMs to perform multi-step reasoning instead of providing direct answers. This approach can significantly enhance the model\u2019s ability to handle challenging tasks such as arithmetic and symbolic questions. Generally, the overall effectiveness of CoT relies on the quality of the demonstrations provided. When confronted with no examples but only the prompt \u201cLet\u2019s think step by step\u201d, known as ZeroShot-CoT (Kojima et al., 2022), LLMs struggle with reasoning and encounter hallucination-related issues. While manually designing demonstrations for each question can alleviate such problems (Wei et al., 2022b), it comes with a significant labour Figure 1: Example of the chain-of-thought reasoning process: This comprises a question accompanied by a rationale. The rationale serves as a depiction of how LLMs navigate the reasoning process to arrive at the answer to the given question. cost. To address such challenges, Zhang et al. (2023) propose Auto-CoT, which can automatically construct demonstrations as prompts. It initially partitions questions from a given dataset into clusters and then selects a representative question from each cluster. The selected questions are answered using Zero-Shot-CoT to obtain their rationales (the intermediate reasoning chain). The performance of this automated method is comparable to that of Manual-CoT. Despite the efficacy of the automated method, how to develop a sound and complete set of demonstrations remains an area for further exploration. Several studies advocate for incorporating external knowledge to ensure the accuracy of the intermediate reasoning chain (Zhao et al., 2023; Weng et al., 2023; Li et al., 2024). Others suggest generating multiple CoT paths, complemented by a verification process to maintain self-consistency (Wang et al., 2023b; Yao et al., 2023; Liu et al., 2023). 1 arXiv:2404.14812v1 [cs.CL] 23 Apr 2024 \fHowever, most prior research focuses on the precision of demonstrations, with limited exploration of the distributional power inherent in these demonstrations. Enlightened by Min et al. (2022) and Madaan et al. (2023), LLMs perform CoT through a counterfactual approach: it does not necessitate precise example results but rather learns from the underlying patterns (e.g. equations, templates) exhibited by the examples. In this paper, we introduce a novel approach called Pattern-Aware Chain-of-Thought (PA-CoT) and demonstrate that LLMs can achieve improved reasoning performance by embracing the diversity inherent in demonstration patterns. Following the Auto-CoT schema, we automatically generate question clusters and select representative questions from each cluster. However, instead of relying solely on question embeddings for clustering, we explore multiple methods to enrich the diversity of rationale patterns. We contend that the conventional embedding-based clustering focuses solely on question semantics, lacks reflection on the rationale, and consequently fails to encompass the full spectrum of demonstrations, as shown in Figure 1. To quantify the diversity of patterns, we introduce three metrics: (i) the length or steps of the rationale, where a shorter rationale implies a simpler solution, while a longer one indicates more complex reasoning requirements; (ii) the processes within the rationale, where distinct equations or logics represent different solving approaches; and (iii) a combination of rationale steps and processes, providing a comprehensive perspective that considers both aspects simultaneously. We evaluate the performance of PA-CoT across six arithmetic and three non-arithmetic reasoning tasks. The experimental results consistently demonstrate that the combination strategy outperforms other methods across two LLMs. This suggests that LLMs derive substantial benefits from the diverse patterns presented in demonstrations. Further experiments are conducted to examine the impact of rationale step and process aspects. We empirically find that PA-CoT introduces less bias to the generated answer and exhibits error robustness, attributed to our strategy emphasizing diversity. 2 Related Work This section reviews how chain-of-thought (CoT) prompting works and introduces various advanced approaches. 2.1 Chain-of-Thought Prompting Large language models have demonstrated significant ability in comprehending context and responding to prompts (Brown et al., 2020; Ouyang et al., 2022). Recent studies highlight that LLMs can achieve improved task completion without finetuning, particularly on reasoning tasks, when provided with few-shot demonstrations (Wei et al., 2022b). For instance, when presented with an example like Q: Mary has 9 yellow marbles. John has 3 yellow marbles. How many yellow marbles do they have in all? A: They have 9 + 3 = 12 yellow marbles. The answer is 12, LLMs are expected to emulate such a format, deconstruct the question, engage in multi-step reasoning, and refrain from generating random answers in subsequent tasks. This process is commonly referred to as chain-of-thought prompting or in-context learning (Wei et al., 2022a; Xie et al., 2022). However, implementing this practice often involves the manual design of prompts at a labour cost. Consequently, researchers are exploring more efficient example selection strategies to streamline this process. 2.2 Example Selection and Refinement Several CoT studies are directed towards automating the generation of demonstrations, such as retrieval-based (Rubin et al., 2022), zero-shot (Kojima et al., 2022), clustering-based (Zhang et al., 2023), and self-prompt (Shao et al., 2023). However, many of these approaches encounter challenges in achieving performance comparable to Manual-CoT, primarily due to the absence of supervision in example selection. In another branch of research, efforts are focused on enhancing the quality of CoT demonstrations. They incorporate elements such as knowledge-infusion (Zhao et al., 2023; Weng et al., 2023; Li et al., 2024), self-consistency (Wang et al., 2023b), complexity-based (Fu et al., 2022), contrastive-based (Chia et al., 2023), and progressive-hint (Zheng et al., 2023). The primary goal of these strategies is to ensure that LLMs adhere to the correct prompt and avoid being misled. 2.3 Role of Example Pattern To understand the underlying mechanism of CoT, Min et al. (2022) and Madaan et al. (2023) employ counterfactual prompting methods. These methods involve substituting question-answer mapping, token distributions, answer patterns, and many other factors. Their findings consistently show that the 2 \fFigure 2: Example of Auto-CoT and PA-CoT. The upper part comprises selected demonstrations and a test question, and the lower part displays the corresponding answer generated by the same LLM. correctness of examples is not the most crucial factor, but rather the distribution or pattern (e.g. equations, templates, sentence structure) of the examples. In this paper, we continue to uncover the power of CoT patterns and show how they can improve the reasoning process. 3 Pattern-Aware Chain-of-Thought We now explore the impact of diverse demonstration reasoning patterns on chain-of-thought prompting. According to Min et al. (2022), the precision of demonstrations is not crucial when LLMs engage in CoT. Even if all the demonstrations provided are incorrect, it would only marginally impede performance. This aligns with the insight derived from Auto-CoT (Zhang et al., 2023): clustering zero-shot question-answer pairs (Kojima et al., 2022) without emphasizing accuracy can still yield valuable examples. Consequently, our focus shifts to a more nuanced factor the underlying reasoning pattern that harbours more informative content (Madaan et al., 2023) to evaluate its potential benefits for the CoT process. We argue that demonstrations function as templates, and they provide accessible reasoning formats for LLMs to emulate. The homogeneity in demonstrations poses a risk of introducing bias into the generated answers (Wang et al., 2023a). Conversely, maintaining diverse demonstrations enables a broader exploration of new reasoning inferences. Although Auto-CoT claims to cluster based on diversity, it predominantly clusters by question semantics, providing limited assistance in problem-solving. In light of this, we propose Pattern-Aware Chain-of-Thought (PA-CoT) that refines the example selection process to enhance the variety of reasoning chains. This approach ensures that selected examples contribute to a broader range of cases, fostering more generalizable outcomes. In particular, we choose to experiment with arithmetic and symbolic problems since the process patterns are relatively intuitive. Given a dataset, each question is first answered by adding the phrase \u201cLet\u2019s think step by step\u201d (zero-shot). Then we select k questions along with their rationales to serve as a general demonstration prompt for the entire dataset (Wei et al., 2022b; Zhang et al., 2023). We design a rationale-based demonstration selection method followed by three simple yet efficient variants to form our testbed: \u2022 Cluster based on rationale semantics. This 3 \fapproach involves a straightforward shift from question embeddings to rationale embeddings. The goal is to determine if the underlying pattern can be discovered through this minor alteration. However, our experiment indicates that this method can still be distracted from irrelevant elements such as characters or scenes, hindering its ability to generate diverse demonstrations. \u2022 Cluster based on rationale step length. This approach is inspired by the notion of reasoning complexity (Fu et al., 2022; Zhou et al., 2022), where a simple task typically involves a few steps, and a complex task requires longer reasoning chains. Our aim is for the demonstrations to encompass both aspects simultaneously. For instance, if all demos are complex, the test question may involve an unnecessarily lengthy reasoning process, and vice versa. To validate this hypothesis, we include two comparative studies in our experiment. \u2022 Cluster based on rationale reasoning process. This approach is designed to extract patterns that guide the task towards reaching its objectives (Madaan et al., 2023). Empirically, we choose mathematical symbols for arithmetic tasks and keywords for symbolic ones. For more details, please see Appendix A. In these problems, a process can effectively represent a solution for a particular question type. For example, an equation like 2 + 3 = 5 can evoke the association of addition, but it provides little assistance in understanding multiplication. Our findings demonstrate that diverse process patterns can significantly mitigate bias in the rationale, as illustrated in Figure 2. \u2022 Combination of step length and process. Given that the previously mentioned methods focus on distinct dimensions of rationale patterns, this approach seeks to integrate them, offering a comprehensive perspective. As semantics may introduce irrelevant distractions, it is not considered in this method. There are various ways to combine the step length and the process, and we opt for the straightforward concatenation of the two dimensions. We also test additional variants in subsequent experiments. In summary, we adopt the aforementioned methods as our demonstration clustering strategy. We explicitly extract patterns for each questionrationale pair and encode them into vector representations using Sentence-BERT1 (Reimers and Gurevych, 2019). For instance, we encode \u201c3\u201d if the step length is 3 (split by \u201c. \u201d or \u201c\\n\u201d), encode \u201c+\u201d if the process appears in the rationale (concatenate if there are multiple processes), and encode \u201c3 +\u201d for our combination strategy. These representations undergo processing by the k-means clustering algorithm, similar to Auto-CoT. Within each cluster, we sort the distances and select the example closest to the centre. It is important to note that Wei et al. (2022b) and Zhang et al. (2023) both impose restrictions on the chosen example, requiring it to be simple (question less than 60 tokens and rationale less than 5 steps). In contrast, we do not impose such restrictions to preserve variety. The k selected question-rationale pairs are then assembled as the final prompt for inference. 4 Experiments In this section, our objective is to evaluate the effectiveness of our proposed PA-CoT and assess whether the introduced variety yields benefits. 4.1 Experimental Setup Datasets. We adopt nine representative datasets for our reasoning tasks: MultiArith (Roy and Roth, 2015), GSM8K (Cobbe et al., 2021), AddSub (Hosseini et al., 2014), AQUA-RAT (Ling et al., 2017), SingleEq (Koncel-Kedziorski et al., 2015), SVAMP (Patel et al., 2021), Coin-Flip (Wei et al., 2022b), BIG-bench Date Understanding, and BIG-bench Tracking Shuffled Objects (Srivastava et al., 2023). They require certain reasoning steps and are commonly used for CoT method comparisons (Wei et al., 2022b; Kojima et al., 2022; Zhang et al., 2023; Wang et al., 2023a; Fu et al., 2022). Language Models. We consider open-source large language models as our inference engine. Specifically, we choose LLaMA-2-7b-chat-hf (Touvron et al., 2023) and qwen-7b-chat (Bai et al., 2023) models, as they have been reported to be comparable to GPT-3.52 in terms of arithmetic ability and possess chain-of-thought reasoning capabil1We use all-MiniLM-L6-v2 as the embedding encoder. https://huggingface.co/sentence-transformers/allMiniLM-L6-v2 2https://platform.openai.com/docs/models 4 \fModel MultiArith GSM8K AddSub AQuA SingleEq SVAMP Coin Date Tracking LLaMA-2-7b-chat-hf Zero-Shot-CoT 72.33 21.00 57.97 24.01 57.67 41.90 44.60 39.29 30.80 Auto-CoT 76.00 27.36 58.48 24.01 64.96 43.80 51.20 44.71 32.53 PA-CoT-semantic 74.83 26.76 63.29 24.80 66.92 47.19 48.00 43.08 31.66 PA-CoT-step 76.16 24.41 67.59 29.13 66.14 47.59 48.00 44.44 33.33 PA-CoT-process 79.66 25.39 65.06 25.19 71.85 48.50 59.40 47.96 32.26 PA-CoT-concat 76.67 28.05 66.83 29.92 71.06 50.10 58.40 46.07 32.53 qwen-7b-chat Zero-Shot-CoT 87.33 42.83 54.93 35.03 69.09 55.70 45.40 50.13 32.40 Auto-CoT 90.66 47.01 62.53 30.31 80.31 60.19 45.40 48.78 29.73 PA-CoT-semantic 91.33 44.80 65.06 31.88 78.74 59.00 43.20 52.38 31.00 PA-CoT-step 90.33 46.85 74.17 33.07 78.14 62.00 38.00 49.32 30.46 PA-CoT-process 90.50 47.16 67.59 29.52 82.08 61.50 52.60 55.72 32.53 PA-CoT-concat 91.33 48.14 72.40 33.46 83.85 62.30 47.40 53.13 31.60 Table 1: Accuracy (%) on nine reasoning datasets. We present the mean value obtained from five runs. ities. These LLMs are deployed on our local server equipped with 4x NVIDIA GeForce RTX 3090. We use the inference function of these models and the process does not involve training or finetuning. We set the hyperparameter temperature as 0.4 to regulate the model\u2019s randomness (Xu et al., 2022). It is noteworthy that, as highlighted by Wei et al. (2023), larger models are more susceptible to the influence of examples. We observe that these 7B models can also be impacted. Thus, PA-CoT is expected to be effective in enhancing their performance. Baselines. We primarily compare our methods with Zero-Shot-CoT (Kojima et al., 2022) and Auto-CoT (Zhang et al., 2023). To clarify the different variations of our proposed PA-CoT method, we note each pattern at the end of its name. For example, PA-CoT-semantic for clustering based on rationale semantics, and similarly for PA-CoT-step, PA-CoT-process, and PA-CoT-concat. 4.2 Main Results Table 1 displays the overall performance of various methods on two LLMs. Since our primary focus is on evaluating the effectiveness of PA-CoT, we are not concerned with determining which LLM outperforms the other. Based on the results, we have the following observations: \u2022 Auto-CoT consistently outperforms ZeroShot-CoT, indicating that the cluster-sample strategy is effective across different LLMs. With the guidance of demonstrations, LLMs exhibit an enhanced capability to generate improved results. \u2022 Simply switching from question embeddings (Auto-CoT) to rationale embeddings (PA-CoTsemantic) does not yield significant benefits, as they generally perform at a similar level. We attribute this phenomenon to the inherent similarity between the two embeddings. As the embedding encoder considers the entire sentence as input, it unavoidably incorporates numerous irrelevant elements, such as characters and scenes. Consequently, this approach does not effectively address the fundamental problem. \u2022 Considering naive rationale patterns (PA-CoTstep and PA-CoT-process) can notably enhance performance in various scenarios, with some instances even ranking first among all methods. This observation suggests that by incorporating diverse patterns into demonstrations, LLMs can effectively learn from this variability and generalize better across the entire dataset. However, given the inherent characteristics of different datasets, a single pattern may not universally adapt to every case, leading to occasional failures. \u2022 Concatenating step length and process patterns (PA-CoT-concat) consistently produces the most favourable results across various scenarios compared to alternative methods. This finding implies that LLMs derive substantial benefits from incorporating multiple dimensions in the demonstration. The inclusion of both step length and process patterns encompasses a broader spectrum of the data distribution. Consequently, they are less prone to sampling similar examples, contributing to improved overall performance. In summary, we present different approaches and evaluate their performance on various reason5 \fModel MultiArith GSM8K AddSub AQuA SingleEq SVAMP Coin Date Tracking qwen-7b-chat PA-CoT-step 90.33 46.85 74.17 33.07 78.14 62.00 38.00 49.32 30.46 CoT-simple 84.50 43.82 70.37 27.55 80.31 62.00 47.59 52.74 32.73 CoT-complex 81.50 41.16 74.43 OOM 78.14 59.40 38.20 39.83 31.13 Table 2: Comparison between methods with various demonstration lengths. (a) MultiArith (b) SVAMP Figure 3: The box plot of generated rationale length across CoT-simple (pink), PA-CoT-step (blue), CoT-complex (green). The x-axis represents method names, and the y-axis represents the number of sentence tokens. The box in the middle represents where half of the numbers are. Extending from the box are whiskers that reach out to the minimum and maximum values within a specific range. Circles denote outliers, and the line splitting the box represents the median. ing tasks. The results indicate the significance of demonstration patterns. 4.3 Impact of Step Length To explore the influence of step length on LLMs\u2019 inference, we conduct additional experiments on this factor. In particular, we introduce two comparison methods: CoT-simple and CoT-complex. CoT-simple involves selecting examples with the fewest rationale steps, while CoT-complex involves selecting examples with the most (Fu et al., 2022). We aim to assess whether our PA-CoT-step method outperforms these two comparison methods. Table 2 illustrates the performance of PA-CoTstep alongside two comparison methods. Overall, PA-CoT-step demonstrates advantages over the other two methods in most scenarios. We observe that CoT-complex tends to generate more errors during long intermediate steps and faces an outof-memory (OOM) issue when the input becomes excessively long. While CoT-simple yields decent results in specific cases, it struggles with tasks requiring intricate reasoning. We further visualize the distribution of generated answer length as in Figure 3. The box in the middle represents the interquartile range (IQR) and encapsulates the middle 50% of the data, with its lower and upper boundaries marked by the first quartile (Q1) and third quartile (Q3), respectively (Williamson et al., 1989; Kampstra, 2008). Inside the box, a line denotes the median (Q2) and indicates the dataset\u2019s central tendency. Extending from the box are whiskers that reach out to the minimum and maximum values within a specific range. Individual points beyond the whiskers signify potential outliers in the dataset. The plot illustrates the correlation between the length of demonstrations and the number of generated tokens. With predominantly short demonstrations, CoT-simple tends to produce concise answers, resulting in a lower average value. Conversely, CoT-complex encourages longer answers, with most taking an extended route to complete the task. PA-CoT-step, on the other hand, maintains a moderate average rationale length. It covers a wider range from simple to complex reasoning. This adaptability allows it to perform well in more general situations. 6 \fModel MultiArith GSM8K AddSub AQuA SingleEq SVAMP Coin Date Tracking LLaMA-2-7b-chat-hf PA-CoT-concat 76.67 28.05 66.83 29.92 71.06 50.10 58.40 46.07 32.53 PA-CoT-sep 76.16 26.09 66.58 25.19 68.91 49.70 59.40 47.96 32.26 PA-CoT-mean 75.83 27.67 68.86 24.01 70.86 48.19 54.80 41.73 31.85 Table 3: Comparison between methods with various combination strategies. 4.4 Impact of Reasoning Process To investigate the role of process patterns in demonstrations, we also perform additional experiments on this aspect. Specifically, we categorize answers from Auto-CoT and PA-CoT-process based on basic arithmetic symbols: Addition, Subtraction, Multiplication, and Division. We then tally the number of correct and incorrect instances within each group. Figure 4 presents a comparison of the results on datasets AddSub and SingleEq, where the tasks are relatively straightforward. Our observations reveal that Auto-CoT produces more incorrect arithmetic equations, leading to a higher error rate within each symbol group. This indicates a higher likelihood of being misled by the demonstrations. For instance, as depicted in Figure 2, the selected demos for Auto-CoT exhibit an overemphasis on multiplication. This trend is reflected in the results of Figure 4, where AutoCoT generates instances solved using multiplication even when it is not appropriate. In contrast, PA-CoT-process exhibits a better ability to select the correct solving approach, resulting in fewer errors within each group. 4.5 Combination Strategy The preceding sections showcase the impact of different pattern aspects. We now turn our attention to exploring the optimal way to combine them. We initially devise PA-CoT-concat to encode the concatenation of step length and process strings. Considering the potential limitations of this approach, we introduce two alternative methods to explore potential improvements. The first approach involves concatenating separate vector representations encoded from step length and process strings, denoted as PA-CoT-sep. The second approach employs mean pooling over the separate vector representations, denoted as PA-CoT-mean. All other settings remain constant as we conduct experiments on LLaMA-2-7b-chat-hf. Table 3 presents the comparison results of these combination strategies. Overall, the performance of PA-CoT-concat slightly exceeds that of PA-CoTsep and PA-CoT-mean. We attribute this outcome (a) AddSub (b) SingleEq Figure 4: The distribution of the number of correct and wrong instances regarding different arithmetic symbols. to the different practices of semantics encoding. PA-CoT-concat takes the entire pattern string as input, where the encoded vector reflects an integration of information. In contrast, the other two approaches separate the two patterns into distinct vectors, which creates a gap between their distributions. In conclusion, our exploration of PA-CoT and its combination strategies sheds light on the importance of considering diverse demonstration patterns in enhancing language models\u2019 reasoning capabilities. Despite slight variations in performance among the approaches, our findings underscore the 7 \fMultiArith GSM8K AddSub AQuA SingleEq SVAMP Figure 5: Visualization of clustering on six reasoning tasks. Cluster centres are noted as stars. The scatter of PA-CoT-concat clusters shows its superiority in example differentiation. Dataset Demos Incorrect Error Rate MultiArith 8 2 25.0% GSM8K 8 5 62.5% AddSub 8 3 37.5% AQuA 4 4 100% SingleEq 8 2 25.0% SVAMP 8 3 37.5% Coin 8 4 50.0% Date 8 3 37.5% Tracking 8 4 50.0% Table 4: The number of demonstrations and their error rate for each dataset. significance of integrating multiple pattern aspects for improved reasoning outcomes. 4.6 Error Robustness It is noteworthy that we do not enforce accuracy constraints on demonstrations. We proceed to count the incorrect instances within our selected demonstrations, as illustrated in Table 4. It is intriguing to notice that the majority of our provided prompts are imperfect, with AQuA even exhibiting a 100% error rate. This phenomenon suggests that LLMs struggle to discern incorrect examples from correct ones. Instead, they learn from how the example approaches problemsolving, which we refer to as \u201cpattern\u201d. PA-CoT encourages LLMs to follow the most probable reasoning chain towards the final answer and thus provides a significant improvement. 4.7 Visualization Figure 5 visualizes the k clusters of PA-CoT-concat on six reasoning tasks through PCA projection. The plot depicts that there is an apparent divergence between each cluster. The scatter implies that the step length and the process can effectively differentiate the patterns. With such diversities, LLMs can more effectively learn from demonstrations to generalize reasoning scenarios. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14815v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14815v1",
|
| 3 |
+
"title": "Time-aware Heterogeneous Graph Transformer with Adaptive Attention Merging for Health Event Prediction",
|
| 4 |
+
"abstract": "The widespread application of Electronic Health Records (EHR) data in the\nmedical field has led to early successes in disease risk prediction using deep\nlearning methods. These methods typically require extensive data for training\ndue to their large parameter sets. However, existing works do not exploit the\nfull potential of EHR data. A significant challenge arises from the infrequent\noccurrence of many medical codes within EHR data, limiting their clinical\napplicability. Current research often lacks in critical areas: 1) incorporating\ndisease domain knowledge; 2) heterogeneously learning disease representations\nwith rich meanings; 3) capturing the temporal dynamics of disease progression.\nTo overcome these limitations, we introduce a novel heterogeneous graph\nlearning model designed to assimilate disease domain knowledge and elucidate\nthe intricate relationships between drugs and diseases. This model innovatively\nincorporates temporal data into visit-level embeddings and leverages a\ntime-aware transformer alongside an adaptive attention mechanism to produce\npatient representations. When evaluated on two healthcare datasets, our\napproach demonstrated notable enhancements in both prediction accuracy and\ninterpretability over existing methodologies, signifying a substantial\nadvancement towards personalized and proactive healthcare management.",
|
| 5 |
+
"authors": "Shibo Li, Hengliang Cheng, Runze Li, Weihua Li",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.LG",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.LG"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Knowledge AND Graph",
|
| 14 |
+
"gt": "The widespread application of Electronic Health Records (EHR) data in the\nmedical field has led to early successes in disease risk prediction using deep\nlearning methods. These methods typically require extensive data for training\ndue to their large parameter sets. However, existing works do not exploit the\nfull potential of EHR data. A significant challenge arises from the infrequent\noccurrence of many medical codes within EHR data, limiting their clinical\napplicability. Current research often lacks in critical areas: 1) incorporating\ndisease domain knowledge; 2) heterogeneously learning disease representations\nwith rich meanings; 3) capturing the temporal dynamics of disease progression.\nTo overcome these limitations, we introduce a novel heterogeneous graph\nlearning model designed to assimilate disease domain knowledge and elucidate\nthe intricate relationships between drugs and diseases. This model innovatively\nincorporates temporal data into visit-level embeddings and leverages a\ntime-aware transformer alongside an adaptive attention mechanism to produce\npatient representations. When evaluated on two healthcare datasets, our\napproach demonstrated notable enhancements in both prediction accuracy and\ninterpretability over existing methodologies, signifying a substantial\nadvancement towards personalized and proactive healthcare management.",
|
| 15 |
+
"main_content": "Introduction Electronic Health Records (EHR) encapsulate a wealth of patient visit information within medical institutions, encompassing diverse clinical data such as diagnoses, admission times, medical histories, and prescribed drugs. The adoption of EHR across numerous healthcare models has facilitated significant advances in disease prediction through deep learning models like Recurrent Neural Networks (RNNs)(Bai et al., 2018; Yin et al., 2019a; Ma et al., 2017) and Convolutional Neural Networks (CNNs)(Nguyen et al., 2017). Utilizing EHR enhances not only the accuracy of disease prediction but also broadens its application to various health prediction tasks, including mortality rates, hospital stay durations, risk assessment, and medication recommendations. Through deep learning, intricate relationships between patient data and diseases can be deciphered from the voluminous EHR data, aiding physicians in evaluating patient health and tailoring care. Despite these advancements, challenges persist in effectively leveraging diagnostic features for learning: 1. Comprehensively assimilate knowledge derived from the medical domain. The GRAM(Choi et al., 2017), an ontology-based model, leverages the hierarchical structure of medical ontologies to represent various medical diseases effectively. Building on GRAM, the KAME(Ma et al., 2018b) method enhances the disease prediction performance by utilizing high-level knowledge. However, these methods primarily focus on the hierarchical relationships between diseases and their ancestors, neglecting the horizontal (co-occurrence) relationships among different diseases. In the realm of health event prediction, offering a reliable explanation for the implicit relationships between diseases continues to be a significant challenge. 2 \fFigure 1 An example of a patient\u2019s visit record sequences Visit 1 Hypertension Asthma Visit 2 Heart failure Diabetes ICD-9 Code Set \u20184011\u2019 \u201842820\u2019 Visit 3 Hodgkins disease Cancer of kidney and renal pelvis 12/10/2015 interval :31 days 06/22/2019 \u20181890\u2019 01/10/2016 \u26ab Tacrolimus \u26ab Warfarin \u26ab Metformin \u26ab Aldosterone antagonists Next Visit \uff1f\uff1f\uff1f \uff1f\uff1f\uff1f 2. Heterogeneously learning disease representations with rich meanings. In clinical diagnostics, patients diagnosed with diverse diseases may receive identical or similar drugs. Current works(Lu et al., 2021) identify concealed connections between diseases by analyzing patient-disease interactions. Nevertheless, the scarcity of clinical data within EHRs hampers the ability to derive significant disease representations based solely on disease co-occurrence. It is suggested that a complex relationship exists, suggesting diseases treated with the same drugs may demonstrate hidden correlations or similarities, thereby increasing the likelihood of patients receiving diagnoses for related diseases sequentially. This could be due to common biological targets or biological pathways linking these diseases, suggesting underlying shared biological mechanisms. Figure 1 shows the patient\u2019s visit record sequences. Through analyzing clinical records and drug usage, we aim to unravel the intricate associations between diseases, thereby enhancing our comprehension of disease mechanisms and improving health event prediction accuracy. 3. Modeling temporal information on disease progression. Patient admission times are meticulously documented in EHRs. However, many 3 \fexisting models() inadequately leverage temporal information, leading to suboptimal outcomes and an inability to track the dynamic progression of diseases. The incorporation of temporal data enables the capture of the evolving nature of diseases over time. For example, Figure 1 displays the chronological sequence of a patient\u2019s visits alongside the disease\u2019s dynamic shifts. Integrating this temporal aspect allows models to intricately discern the critical phases and pathways of disease development. Such integration fosters a thorough comprehension of diseases\u2019 dynamic behavior, thereby enhancing the precision of predictive models and the efficacy of clinical decisions. To overcome these limitations, we propose an innovative model THAM, a novel Time-aware Heterogeneous graph Transformer with Adaptive attention Merging for health event prediction, which amalgamates hierarchical disease representation with insights from medical domain knowledge, the implicit connections between diseases and drugs, and temporal data from patient visits. Initially, we apply medical domain knowledge to structure disease representations hierarchically. Subsequently, a heterogeneous graph neural network is employed to derive meaningful disease insights by exploiting both the observed co-occurrences of diseases during patient visits and the interactions between disease manifestations and drug use. Furthermore, we have designed two stages: a preliminary evaluation stage and a comprehensive evaluation stage. During the preliminary evaluation phase, we introduce a Time-aware Transformer featuring a local-based attention mechanism designed to ascertain the preliminary attention weights for each patient visit. This method incorporates time information into the visit vectors via specific non-linear functions, thereby overcoming the constraints associated with a monotonically decaying time function. In the subsequent comprehensive evaluation phase, we posit that a patient\u2019s most recent visit record comprehensively reflects their disease progression. Consequently, we designate the embedding vector of the latest visit as the \u201dcomprehensive vector.\u201d This vector serves as the query vector, while the time interval data 4 \fare converted into key vectors using particular non-linear functions, facilitating the generation of comprehensive attention weights for each visit through the dot-product attention mechanism. Finally, the Adaptive attention merging mechanism is employed to acquire representations for patients by incorporating both types of attention. The main contributions of this work are summarized as follows: \u2022 We harness the extensive knowledge within the medical domain to capture the hierarchical correlations among diseases. Furthermore, we suggest acquiring disease representations endowed with rich meanings via drug-disease heterogeneous co-occurrence graphs and disease ontology cooccurrence graphs. \u2022 We have designed two different stages: the preliminary evaluation stage and the comprehensive evaluation stage. In the preliminary stage, time data are integrated into the representation of medical visits. The comprehensive evaluation stage amalgamates information from individual visits with overall visit data to analyze disease progression. Additionally, it learns the relationship between the comprehensive visit vector and temporal data, proficiently capturing the dynamics of disease evolution over time. \u2022 We conducted experiments on two real-world public datasets to evaluate the performance of the proposed model. The results indicate that THAM outperforms state-of-the-art models in terms of prediction accuracy, confirming the validity of the proposed model. 2. Related Work The widespread adoption of deep learning techniques in recent years has spurred their application in predictive analyses utilizing EHRs. These deep learning approaches have achieved demonstrably superior predictive accuracy compared to traditional machine learning models. 5 \f2.1. Models leveraging external knowledge GRAM(Choi et al., 2017), KAME(Ma et al., 2018b), DMKAP(Li et al., 2023) and some models(Ma et al., 2019; Ye et al., 2021b) enhance the quality of medical representation learning by utilizing the hierarchical information of nodes in the medical ontology knowledge graph, their aim is to leverage the static attention mechanism built on the knowledge DAG. PRIME(Ma et al., 2018a) proposed a log-linear model that automatically learns the importance of different disease knowledge. Furthermore, to address the problem of data incompleteness in the medical field, some papers(Zhang et al., 2019; Yin et al., 2019b; Li et al., 2020a) combine the KnowLife knowledge graph with clinical expertise to compensate for this deficiency. CGL(Lu et al., 2021) constructs a patient-disease observation graph and a disease ontology graph using clinical observation information and medical knowledge. It learns representations using collaborative graph methods while incorporating unstructured text data. GBERT(Shang et al., 2019) is a model that combines GNN(Scarselli et al., 2008) and BERT(Devlin et al., 2018). It fully utilizes ICD-9-CM1(Slee, 1978) hierarchical information and introduces the language model pre-training paradigm into the healthcare domain. GNDP(Li et al., 2020b) learns the spatial and temporal patterns from patients\u2019 sequential graph, in which the domain knowledge is naturally infused. MedPath(Ye et al., 2021a) extracts personalized knowledge graphs (PKGs) from large-scale online medical knowledge graphs and learns PKG embeddings using GNNs. Chet(Lu et al., 2022) constructs a global disease co-occurrence graph with multiple node attributes based on the patient\u2019s medical histories, simulating disease transition processes. However, these works only consider limited relationships between disease knowledge and lack consideration for the temporal information of disease progression. 1International Classification of Diseases, Ninth Revision, Clinical Modification 6 \f2.2. Models capturing temporal relationships This line of research focuses on acquiring the temporal characteristics and dependencies within the context of patient visit sequences. Electronic Health Records (EHRs) are not only sequential but also temporal. Each visit in the EHR data is accompanied by a timestamp, as the progression of diseases is inherently connected to time. T-LSTM(Baytas et al., 2017) effectively handles irregular time intervals in longitudinal medical records using a time decay strategy, thereby capturing the underlying structure in these irregular time series. DoctorAI(Choi et al., 2016a) employs a Recurrent Neural Network (RNN) to forecast patient diagnoses in subsequent visits and the time interval between their current and upcoming appointments. RETAIN(Choi et al., 2016b) introduces a reverse time attention model based on RNNs, leveraging two RNNs to learn the weights of visits and medical codes within visits. Dipole(Ma et al., 2017) models longitudinal EHR data using bidirectional RNN and applies three attention mechanisms. Additionally, Concare(Ma et al., 2020) improves multihead self-attention by considering the time intervals between consecutive visits. Timeline(Bai et al., 2018) develops a timeline model to capture the time intervals between visits, enhancing prediction accuracy. Concare and Timeline both acknowledge the attenuation of relevant patient information if there is a time gap between consecutive visits. However, these works consider the correlation between diseases and time but ignore the cross-sectional and longitudinal hierarchical relationships among diseases. 3. Methodology 3.1. Problem Formulation Electronic Health Records (EHRs) comprise numerous short-term or longterm visit records for patients. Let C = {c1, c2, . . . , c|C|} denote the set of medical codes in the EHR dataset, where |C| represents the total number of medical codes in the dataset. Similarly, let D = {d1, d2, . . . , d|D|} denote the 7 \fset of all drugs used by patients in the EHR dataset, where |D| represents the total number of drugs in the dataset. EHR dataset. Let P = {pu | u \u2208U}, where U is the set of patients in P, and pu = {V u 1 , V u 2 , . . . , V u T } represents all visit records for patient u. Each visit V u i = {Cu i , Du i }, where Cu i and Du i are subsets of C and D. Let rt represent the temporal information corresponding to the visit Vt. Then, \u2206u = {\u22061, \u22062, . . . , \u2206T }, where \u2206t = rt \u2212rt\u22121. Disease Prediction Task. The core objective of this task is to predict the occurrence of diseases in the (T +1)-th visit based on the previous T visit records for a given patient u. This can be represented by a binary vector \u02c6 y \u2208{0, 1}, where \u02c6 yi = 1 indicates that disease ci is predicted in Cu (T +1). Heart Failure Prediction Task. 2The core objective of this task is to predict a binary value \u02c6 y \u2208{0, 1} based on the previous T visit records for a given patient u. \u02c6 yi = 1 indicates that patient u is predicted to be diagnosed with heart failure in the (T + 1)-th visit. For convenience, we will remove the superscript u from pu, V u i , Cu i , Du i and \u2206u in the rest of this paper. 3.2. Overview of the proposed model The model we proposed aims to fully utilize patient visit records in EHR data to predict the future health events of patients. In this section, we will elaborate on the seven main components of the model, and the schematic diagram of the model is shown in Figure 2. 3.2.1. Hierarchical Representation for Medical Codes In the medical domain, contemporary disease classification systems such as ICD-9-CM and ICD-10(Organization, 2004) are employed to systematically categorize disease concepts at various levels using medical coding, thus establishing 2The codes of heart failure start with 428 in ICD-9-CM 8 \fFigure 2 The model structure of the proposed model. Disease Drug GNN layer = 1 layer = 2 layer = L Visit representation\u00a0 learning Heterogeneous Graph Relation Learning V1 V2 VT VT-1 ... Timeline Pos1 V1 \u03941 \u03942 \u0394T-1 \u0394T Pos2 V2 PosT-1 VT-1 ... PosT VT Multi-Head Attention Add & Norm Feed forward Add & Norm h1 h2 hT-1 hT ... Local-based Attention \u03b11 \u03b12 \u03b1T-1 \u03b1T ... Preliminary Evaluation Phase Comprehensive Evaluation Phase h* \u03941 \u03942 ... \u0394T Dot-product Attention Query Key1 \u03b21 \u03b22 ... \u03b2T-1 Key2 KeyT Ov c1 c2 ... cT-1 cT \u03b2T Adaptive attention merging Prediction Disease Hierarchical knowledge Graph li 1 li 4 li 2 li 3 Extracting hierarchical information ... Time-aware Transformer Encoder a hierarchical structure akin to a tree. In this structure, each node is linked to a single parent node, with leaf nodes often denoting specific diseases and their ancestor nodes representing broader disease concepts. For instance, Hepatitis is classified as a specific disease, whereas Viral infection serves as its broader category. Typically, medical codes assigned during patient visits correspond to specific diseases (leaf nodes). Nonetheless, we contend that the representation of a specific disease should encompass both the disease itself and its broader category since diseases sharing common ancestors may exhibit similarities. Consequently, we recursively generate virtual child nodes for each non-leaf node and fill them into the virtual leaf nodes. We posit that the hierarchical structure comprises H layers, with each layer h hosting mh nodes. An embedding matrix is established for every layer within this hierarchy. Consequently, the embedding matrix pertinent to layer h is expressed as Lh \u2208Rmh\u00d7mc, where mc denotes the embedding size. We select corresponding embedding vectors for disease ci based on its position and that 9 \fof its ancestors at various levels in the tree. We then construct the hierarchical representation Li \u2208RHmc of ci by concatenating the embedding vectors from each level: Li = li 1 \u2295li 2 \u2295. . . \u2295li H, where \u2295represents concatenation. This process culminates in the generation of a comprehensive embedding matrix for all diseases, represented as L \u2208R|C|\u00d7Hmc. 3.2.2. Graph Definition In healthcare, it is common for patients to be diagnosed with a combination of certain diseases, such as chronic obstructive pulmonary disease (COPD) and heart failure, likely due to shared risk factors. We hypothesize that diseases diagnosed during the same visit, as well as distinct diseases treated with the same drug, may exhibit similarities. This hypothesis is grounded in the assumption that different diseases might share common biological targets; drugs that interact with these targets can modulate or influence physiological processes, resulting in therapeutic effects, which in turn suggest underlying similarities among the diseases. To explore these potential connections, we posit the following assumptions to reveal hidden relationships between diseases: \u2022 Disease similarity derived from medical concepts. If two diseases belong to the same abstract disease concept, there may be some medical similarity between them. \u2022 Disease similarity derived from drug usage. When two diseases are treated with identical or comparable drugs, it suggests the possibility of a similarity between the diseases. This similarity arises from the potential sharing of common biological targets, further leading to the inference that these diseases may also possess similar risk factors. Based on the above assumptions, we constructed a drug-disease heterogeneous co-occurrence graph and a disease ontology co-occurrence graph, denoted as M = {MDC, MCC}. MDC is a heterogeneous drug-disease co-occurrence graph derived from EHR data, with nodes representing drugs and medical codes. We utilize a matrix 10 \fBDC \u2208R|D|\u00d7|C| to represent the graph MDC. Whenever a patient is diagnosed with disease cj and concurrently uses drug di during a visit, we insert an edge \u2212 \u2212 \u2212 \u2212 \u2192 (di, cj) into the graph MDC and let BDC[i][j] = BDC[i][j]+1. Subsequently, we normalize the BDC. MCC is a disease ontology co-occurrence graph also derived from EHR data, with nodes symbolizing medical codes. If two distinct diseases ci and cj are simultaneously diagnosed in a patient\u2019s visit record, we add two edges \u2212 \u2212 \u2212 \u2212 \u2192 (ci, cj) and \u2190 \u2212 \u2212 \u2212 \u2212 (ci, cj) into the graph MCC. However, we conjecture that the mutual influence between two diseases is not symmetrical. For instance, while patients with asthma might frequently develop sinusitis, the reverse is less common. Thus, to mitigate computational complexity and disregard lowfrequency co-occurrences, we introduce a threshold \u03bb. Only nodes that meet the definition of formula 1 will be considered. Ki = {cj | eij P|C| j=1 eij \u2265\u03bb} (1) The eij represents the co-occurrence frequency of ci and cj. Then, we define the adjacency matrix ACC \u2208R|C|\u00d7|C| to store the edge weights of the graph MCC: ACC[i][j] = \uf8f1 \uf8f4 \uf8f2 \uf8f4 \uf8f3 0 if i = j or cj / \u2208Ki, eij P cj \u2208Ki eij otherwise. (2) ACC is an asymmetric matrix and quantifies the extent of mutual influence between two diseases. We contend that constructing this matrix enhances interpretability. 3.2.3. Heterogeneous Graph Relation Learning We have designed a graph neural network (GNN) learning method that leverages a heterogeneous co-occurrence graph and a disease ontology co-occurrence graph to derive meaningful representations of diseases. Initially,each drug is assigned an embedding vector, N \u2208R|D|\u00d7md is the embedding matrix of all drugs with the size of md. We set H(0) D = N, H(0) C = L, and H(l) C \u2208R|C|\u00d7m(l) c , H(l) D \u2208R|D|\u00d7m(l) d representing the hidden features of medical codes and drugs at the l-th layer. 11 \f\u2022 Aggregation: We incorporate two different co-occurrence matrices, ACC and BDC, as contextual information into node embeddings, and map the medical code features H(l) C to the drug dimension, serving as the aggregation operation in the GNN: M (l) D = H(l) D + BDCH(l) C W (l) CD \u2208R|D|\u00d7m(l) d (3) Here W (l) CD \u2208Rm(l) c \u00d7m(l) d is a trainable parameter utilized for mapping medical code embeddings to the dimension of drug embeddings. We perform mapping of H(l) D to the dimension of medical codes and subsequently aggregate the two co-occurrence matrixs as contextual information into the embeddings of the corresponding nodes: M (l) C = H(l) C + BT DCH(l) D W (l) DC + ACCH(l) C \u2208R|C|\u00d7m(l) c (4) W (l) DC \u2208Rm(l) d \u00d7m(l) c is also a trainable parameter used for mapping drug embeddings to the dimension of medical code embeddings. \u2022 Update: We use the following formula 5 to update the hidden representation of medical codes and drugs as the update operation in GNN. Assuming a total of L layers, the update formula for each layer is as follows: H(l+1) {D,C} = \u03c3(BatchNorm(M (l) {D,C}W (l) {D,C})) (5) W (l) {D,C} maps M (l) {D,C} to the (l+1)-layer, and then we use the BatchNorm to normalize the hidden representation. \u03c3 represents the non-linear activation function. Here, we use LeakyReLU(Xu et al., 2015), which helps alleviate the gradient vanishing problem. Additionally, the small slope introduced by LeakyReLU increases the non-linearity of the model, which is particularly important for GNNs as they need to capture complex graph structure information. By enhancing non-linearity, it helps GNNs learn complex relationships between nodes more effectively. 12 \f3.2.4. Representation of Visits We posit that the representation of a visit should be obtained by averaging the embeddings corresponding to the diseases diagnosed during that visit. Therefore, the initial embedding vector ot of visit t should be represented as: ot = 1 |Ct| X cj\u2208Ct Hj C \u2208Rm(L) c (6) Although RNN-based models(Choi et al., 2016a,b; Ma et al., 2017) consider the role of temporal information and operate under the premise that disease information decays at a stable rate, this assumption may not always apply. Particularly for some chronic diseases, the progression can be markedly slow, often leading to intervals exceeding a year between patient visits. For patients with such conditions, if the diagnostic codes from two sequential visits are similar, this might suggest that the disease has not intensified. In these instances, the attenuation of time-sensitive information should be less severe, rather than unduly diminishing the significance of the data. Hence, we introduce a function designed to integrate temporal data into the visit vector, thereby establishing the final visit vector vt: ft = Wf 1 \u2212tanh \u0012 We \u2206t 180 + be \u00132!! + bf \u2208Rm(L) c (7) vt = ot + ft \u2208Rm(L) c (8) Here We \u2208Ra, be \u2208Ra, Wf \u2208Rm(L) c \u00d7a, and bf \u2208Rm(L) c . In the patient\u2019s visit sequence, if the interval between the occurrences of one disease and another disease is shorter, formula 7 is easier to be activated. To simplify the representation, we will use m instead of m(L) c in the rest of the paper. 3.2.5. Preliminary Evaluation Phase For each patient\u2019s visit record, we can obtain an input matrix V = [v1, v2, . . . , vT ]. We generate a corresponding positional encoding for all visits in order, The generated positional encodings will be added to the medical visit vector vt to obtain 13 \fa new representation of the visit v\u2032 t: Pos(t,2i) = sin \u0012 t 100002i/m \u0013 \u2208Rm (9) Pos(t,2i+1) = cos \u0012 t 100002i/m \u0013 \u2208Rm (10) v\u2032 t = vt + Post (11) Where m represents the dimension size of the visit embedding, i is the detention of the position embedding Pos. The Time-aware Transformer Encoder (denoted as TTE) is employed to capture the long-term dependency between each visit: [h1, h2, . . . , hT ] = TTE([v\u2032 1, v\u2032 2, . . . , v\u2032 T ]) \u2208RT \u00d7z (12) Where ht \u2208Rm represents the hidden representation of each visit, we use localbased attention(Luong et al., 2015) to calculate the preliminary attention weight \u03b1 for each visit. This operation simulates the behavior of doctors during diagnosis, as they highly focus on visit history related to the target disease. \u03b1 = Softmax([h1, h2, . . . , hT ]w\u03b1) \u2208RT (13) Here w\u03b1 \u2208Rb is a context vector for local-based attention and \u03b1 is the attention weight of visit. 3.2.6. Comprehensive Evaluation Phase In medical practice, doctors typically assess disease progression and forecast outcomes by synthesizing data from individual visits with overarching diagnostic information. We maintain that a patient\u2019s latest visit record encompasses comprehensive details of their disease trajectory(Choi et al., 2016b; Luo et al., 2020). Consequently, we set h\u2217= hT and designate h\u2217as the comprehensive visit vector. Initially, h\u2217is converted into a query vector Q: Q = LeakyReLU(WQh\u2217+ bQ) \u2208Rq (14) 14 \fWhere WQ \u2208Rq\u00d7m, bQ \u2208Rq are both trainable parameters. LeakyReLU allows negative values to have a small positive output, increasing the robustness of the results. When analyzing comprehensive diagnostic information, doctors need to combine the time information of disease onset to obtain the most important time points for the patient\u2019s condition. To simulate this process, we embed each temporal interval information \u2206t into the same space as the query vector, treating it as the key vector: Kt = LeakyReLU Wk 1 \u2212tanh \u0012 Wt \u2206t 180 + bt \u00132!! + bk ! \u2208Rq (15) Here Wt \u2208Ra, bt \u2208Ra, Wk \u2208Rq\u00d7a, bk \u2208Rq are trainable parameters. We employ scaled dot-product attention(Vaswani et al., 2017) to learn the correlation between the comprehensive visit vector and the temporal information. This enables us to derive the comprehensive attention weight \u03b2: \u03b2 = Softmax \u0012QKT \u221aq \u0013 \u2208RT (16) 3.2.7. Adaptive attention merging We have derived two distinct attention weights: the preliminary attention weight \u03b1 and the comprehensive attention weight \u03b2. The preliminary evaluation phase serves as an initial assessment of each visit\u2019s significance and its temporal association, whereas the comprehensive evaluation phase offers a retrospective analysis of temporal information\u2019s relevance. The amalgamation of these two weights yields more robust attention weights. Thus, we introduce an adaptive attention merging mechanism, the comprehensive visit vector is mapped into a two-dimensional space and normalized through a Softmax layer: \u03b4 = Softmax(Wxh\u2217+ bx) \u2208R2 (17) Where Wx \u2208R2\u00d7q, bx \u2208R2 are trainable parameters.We concatenate the preliminary attention weight \u03b1 with the comprehensive attention weight \u03b2 to obtain robust attention weight \u03b3: \u03b3 = \u03b1 \u2295\u03b2 \u2208RT \u00d72 (18) 15 \fSubsequently, we generate the overall attention weights \u03b7: \u03b7 = \u03b3 \u2299\u03b4 \u2208RT \u00d72 (19) Where \u2299denotes the element-wise multiplication, which utilizes broadcasting mechanisms.Finally, we normalize the overall attention weight and obtain the overall attention score \u03b7\u2032 t for each visit, as shown below: \u03b7\u2032 t = \u03b7t PT i=1 \u03b7i (20) 3.2.8. Prediction and Inference After obtaining the overall attention weight for each visit, we can obtain the patient\u2019s output through attention pooling: O = T X t=1 \u03b7\u2032 t ht \u2208Rm (21) We use a multi-layer perceptron with a sigmoid activation function on the model\u2019s output O to compute the predicted probability \u02c6 y. In the Diagnosis prediction task, we predict the diseases the patient will have at the T + 1 visit, it is a multi-label classification. In the Heart failure prediction task, we predict whether the patient will be diagnosed with heart failure at the T + 1 visit, it is a binary classification. Therefore, the loss function of this model is binary cross-entropy loss: L = \u22121 |N| |N| X i=1 \u0000yT i log(\u02c6 yi) + (1 \u2212yi)T log(1 \u2212\u02c6 yi) \u0001 (22) y is the true label of medical codes or heart failure, |N| is the number of samples. During the inference stage, we set the model to eval mode and obtain the medical code embeddings HC after GNN learning, and combine them with the patient\u2019s visit representation and time information. Given a new patient for inference, we continue to execute and make predictions from Eq.(8). Algorithm 1 describes the overall training process of the proposed THAM. 16 \fAlgorithm 1 Training Procedure of THAM Input: Training set Tt, and validation set Tv Output: Trained model parameter 1: Randomly initialize the parameter \u03c9 of THAM and drug embedding matrix N 2: Obtain the hierarchical embedding matrix L of all diseases based on the medical knowledge graph 3: Construct heterogeneous drug-disease co-occurrence matrix BDC and disease ontology co-occurrence matrix ACC from Tt 4: Set H(0) D = N, H(0) C = L 5: for epoch = 1 to EPOCH do 6: Randomly shuffle the order of samples in training set Tt. 7: for (p, \u2206, y) \u2208Tt do 8: for l = 0 to L \u22121 do 9: M(l) {D,C} = Aggregation(H(l) {D,C}, ACC, BDC) 10: H(l+1) {D,C} = Update(M(l) {D,C}) 11: end for 12: Calculate the preliminary visit embeddings o using Eq.(6) 13: Calculate the final visit embeddings v using Eq.(7)-(8) 14: Calculate the new visit embedding v\u2032 using Eq.(9)-(11) 15: Utilizing transformer TTF, encode v\u2032 to derive h according to Eq.(12) 16: Calculate the preliminary attention weight \u03b1 using Eq.(13) 17: Calculate the comprehensive attention weight \u03b2 using Eq.(14)-(16) 18: Calculate the overall attention score \u03b7\u2032 for each visit using Eq.(17)-(20) 19: O = PT t=1 \u03b7\u2032 tht 20: \u02c6 y = MlpWithSigmoid(O) 21: Calculate the prediction loss L using Eq.(22) 22: Update model parameters \u03c9 according to the gradient of L 23: end for 24: Calculate the average validation loss Lv using validation set Tv 25: if Lv < Lmin v then 26: \u03c9best = \u03c9 27: Lmin v = Lv 28: end if 29: end for 17 \fTable 1: Statistics of MIMIC-III and MIMIC-IV datasets Dataset MIMIC-III MIMIC-IV # patients 7,493 10,000 Max. # visit 42 93 Avg. # visit 2.66 3.79 # codes 4,880 5985 Max. # codes per visit 39 39 Avg. # codes per visit 13.06 13.51 # drugs 3202 3070 Max. # drugs per visit 164 193 Avg. # drugs per visit 37.36 25.38 4. Experiments 4.1. Experimental Setup 4.1.1. Dataset To evaluate our proposed model, we focused on two extensively recognized datasets in the realm of critical care research: MIMIC-III(Johnson et al., 2016) and MIMIC-IV(Johnson et al., 2023). Table 1 displays the comprehensive details pertaining to the MIMIC-III and MIMIC-IV datasets. Both datasets emanate from the extensive de-identified clinical data collected at the Beth Israel Deaconess Medical Center in Boston, Massachusetts, encompassing detailed records from patients admitted to the Intensive Care Units (ICUs). MIMIC-III covers data from over 40,000 ICU admissions between 2001 and 2012, incorporating a vast spectrum of information including patient demographics, vital signs, laboratory test results, diagnoses, and diagnostic codes. MIMIC-IV extends this dataset, covering approximately 60,000 ICU admissions from 2008 to 2019, thus providing an updated and expanded database that reflects more recent clinical practices and patient demographics. To ensure a comprehensive analysis, we selected patients from MIMIC-IV 18 \fwho were admitted between 2013 and 2019, avoiding temporal overlap with the MIMIC-III dataset and ensuring the distinctiveness of the patient cohorts under investigation. And we included patients who had multiple visits ( # of visits \u22652) in order to eliminate cases where there were no visit records available as labels.We adopted a randomized approach to divide both datasets into training, validation, and testing segments. This partitioning facilitates a balanced assessment of the model\u2019s predictive accuracy and generalizability. Specifically, for MIMIC-III, the data was divided into 6000 training, 500 validation, and 993 testing samples. For MIMIC-IV, the distribution comprised 8000 training, 1000 validation, and 1000 testing samples. In the context of heart failure prediction, the label will be assigned as 1 if the patient is diagnosed with heart failure during their most recent visit. This methodical preparation and segmentation of the datasets are critical for evaluating the model\u2019s capability to accurately predict outcomes and events based on the rich clinical data available. By treating the last visit of a patient as the label and all preceding visits as features, we aim to harness the longitudinal data structure inherent in these databases, thereby enhancing the model\u2019s ability to forecast critical care outcomes with higher precision and reliability. Through this analytical framework, our research endeavors to contribute significantly to the advancement of predictive modeling in critical care, ultimately aiming to improve patient outcomes through data-driven insights and interventions. 4.1.2. Baselines To evaluate the performance of our proposed model, it is necessary to compare it with various state-of-the-art models in the fields of electronic health record analysis and disease prediction. We selected the following methods as baselines: \u2022 RNN/CNN/Attention-based model: Dipole(Ma et al., 2017), RETAIN(Choi et al., 2016b), Deepr(Nguyen et al., 2017) and Timeline(Bai et al., 2018). 19 \f\u2022 Graph-based model: GRAM(Choi et al., 2017), KAME(Ma et al., 2018b), G-BERT(Shang et al., 2019), CGL(Lu et al., 2021), Chet(Lu et al., 2022) and BioDynGraph(Li et al., 2024). 4.1.3. Parameter Settings We use the Xavier method to randomly initialize the embeddings for diseases and drugs. Sinusoidal Position Embeddings are used to generate position embeddings. \u2022 In the disease prediction task. On the MIMIC-III dataset, the embedding sizes for mc, md are 48 and 64. The layer number L of GNN is 2. The hidden dimensions m(1) c , m(2) c and m(1) d are 64, 192 and 64, a = 64, q = 64, b = 32, \u03bb = 0.01. For the hyper-parameters of Time-aware Transformer Encoder, we set the multi-head number as 4, the number of encoder layer is 1, and the size of middle feed-forward network as 1024. On the MIMIC-IV dataset, both mc and md are set to 64, and m(2) c is set to 256. The remaining parameters are consistent with those on the MIMIC-III dataset. We set the number of epochs to 200, with an initial learning rate of 1e-1. The learning rate is decayed to 1e-2, 1e-3, and 1e-4 at epochs 10, 100, and 200 respectively. \u2022 In the heart failure prediction task. On the MIMIC-III dataset, we set mc = 7 and md = 16 , m(1) c , m(2) c , and m(1) d set to 10, 28, and 16 respectively. a = 16, q = 16, b = 32. We set the number of encoder layers to 1. On the MIMIC-IV dataset, mc and md are set to 5 and 16, and m(1) c , m(2) c , and m(1) d set to 10, 20 and 16 respectively. Other parameters remain the same as in the MIMIC-III dataset. We set the number of epochs to 100, with an initial learning rate of 1e-2. The learning rate is decayed to 1e-3, 1e-4, and 1e-5 at epochs 2, 3, and 20 respectively. We use the Adam(Kingma & Ba, 2014) as the optimizer. The model is implemented using Python 3.10.13 and PyTorch 1.12.0 with CUDA 11.5, running 20 \fon a machine with an Intel E5-2697 CPU, 251GB memory, and GeForce RTX 3090 GPU. 4.1.4. Experiment Evaluation We use weighted F1 score (w-F1) and recall at k (R@k) as performance evaluation metrics for disease prediction. w-F1 is the weighted sum of F1 scores for all disease codes, with a higher w-F1 indicating higher accuracy in disease prediction. R@k represents the coverage of correctly predicted diseases among the top-k predictions, with a higher R@k indicating higher coverage. As for heart failure prediction, the evaluation metrics are AUC and F1 score. AUC measures the area under the Receiver Operating Characteristic (ROC) curve, and its magnitude is positively correlated with the ability to distinguish between positive and negative cases. The F1 score is the harmonic mean of precision and recall, aiming to provide a balanced performance measure considering both precision and recall. A higher F1 score indicates better overall performance in terms of false positive and false negative rates. 4.2. Experiment Result 4.2.1. Diagnosis prediction and Heart Failure prediction results In this section, we evaluated the performance of the THAM in comparison to existing baselines using two public datasets. The models were independently trained five times with distinct parameter initializations, with outcomes reported as mean(standard deviation). Table 2 showcases the evaluation metrics: w-F1 (%) and R@k (%), where k is set at [10,20]. Since the average diagnosis number in a visit is around 13. THAM surpassed other models, which can be chiefly attributed to its comprehensive exploitation of EHR data. By uncovering hidden drug-disease associations and leveraging temporal visit information, THAM can trace the trajectory of disease progression. In contrast, CGL\u2019s limited approach focuses solely on patient-disease interactions, yielding less nuanced insights into diseases. THAM also surpasses Chet, which learns disease combinations and transitions, demonstrating the superiority of THAM\u2019s 21 \fdisease representation. We notice that G-BERT has a lower w-f1 score, which may be due to the removal of pre-training in the original model and its inability to handle simple sequences effectively. GRAM and KAME also achieve relatively lower scores, which may be attributed to their use of static graphs for disease representation learning, without capturing dynamic features of user activity. Additionally, our proposed THAM performs significantly better on the MIMIC-IV dataset compared to the MIMIC-III dataset, possibly because the MIMIC-IV dataset is larger, indicating that our proposed model benefits from more training data to fully demonstrate its effectiveness. Table 3 presents the results of using AUC (%) and F1 (%) for heart failure evaluation, showing that our proposed model performs better compared to other baseline models. Additionally, we noticed that the performance metrics of all models are better on the MIMIC-IV dataset than on MIMIC-III. We believe that the main reason for this improvement is the larger training set available in MIMIC-IV, as models based on deep learning require a sufficient amount of data to learn satisfactory parameters. Table 2: Diagnosis prediction results on MIMIC-III and MIMIC-IV using w-F1 (%) and R@k (%). MIMIC-III MIMIC-IV Models w-F1 R@10 R@20 w-F1 R@10 R@20 RETAIN 20.43 (0.30) 26.15 (0.20) 34.78 (0.22) 24.71 (0.24) 28.02 (0.47) 34.46 (0.13) Dipole 19.35 (0.33) 24.98 (0.27) 34.02 (0.21) 23.69 (0.24) 27.39 (0.34) 35.48 (0.29) Deepr 18.87 (0.21) 24.74 (0.25) 33.47 (0.17) 24.08 (0.17) 26.29 (0.25) 33.93 (0.21) Timeline 20.46 (0.18) 25.75 (0.13) 34.83 (0.14) 25.26 (0.30) 29.00 (0.21) 37.13 (0.39) GRAM 21.52 (0.10) 26.51 (0.09) 35.80 (0.09) 23.50 (0.11) 27.29 (0.27) 36.36 (0.30) KAME 21.10 (0.13) 24.97 (0.18) 33.99 (0.24) 21.88 (0.17) 25.10 (0.22) 34.85 (0.15) G-BERT 19.88 (0.19) 25.86 (0.12) 35.31 (0.13) 24.49 (0.20) 27.16 (0.06) 35.86 (0.19) BioDynGrap 25.21 (0.14) 28.15 (0.15) 38.10 (0.12) 27.09 (0.18) 30.13 (0.21) 38.65 (0.18) CGL 21.92 (0.12) 27.13 (0.30) 36.49 (0.15) 25.41 (0.08) 28.52 (0.42) 37.15 (0.29) Chet 22.63 (0.08) 28.64 (0.13) 37.87 (0.09) 26.35 (0.13) 30.28 (0.09) 38.69 (0.15) THAM 25.46 (0.07) 31.00 (0.16) 41.10 (0.14) 30.79 (0.22) 35.30 (0.16) 44.90 (0.20) 22 \fTable 3: Heart failure prediction results on MIMIC-III and MIMIC-IV using AUC (%) and F1 (%) Models MIMIC-III MIMIC-IV AUC F1 AUC F1 RETAIN 83.21 (0.26) 71.32 (0.17) 89.02 (0.26) 67.38 (0.21) Dipole 82.08 (0.29) 70.35 (0.21) 88.69 (0.24) 66.22 (0.15) Deepr 81.36 (0.13) 69.54 (0.08) 88.43 (0.18) 61.36 (0.12) Timeline 82.34 (0.31) 71.03 (0.24) 87.53 (0.13) 66.07 (0.21) GRAM 83.55 (0.19) 71.78 (0.14) 89.61 (0.12) 68.94 (0.19) KAME 82.88 (0.12) 72.03 (0.07) 89.05 (0.15) 69.36 (0.22) G-BERT 81.50 (0.24) 71.18 (0.12) 87.26 (0.12) 68.04 (0.17) BioDynGraph 75.13 (0.12) 68.15 (0.17) 87.00 (0.08) 69.02 (0.11) CGL 84.19 (0.16) 71.77 (0.10) 89.05 (0.15) 69.36 (0.22) Chet 86.14 (0.14) 73.08 (0.09) 90.83 (0.09) 71.14 (0.15) THAM 87.13 (0.07) 74.82 (0.11) 93.57 (0.16) 76.49 (0.20) 4.2.2. Ablation Study In order to investigate the effectiveness of components of the model, we performed an ablation experiment. Specific components of the model were either removed or modified: THAMa\u2212randomly initializing the disease embedding matrix, THAMb\u2212without embedding time information, and THAMc\u2212not using the adaptive attention merging mechanism. The ablation experiment was conducted on the MIMIC-IV dataset: \u2022 THAMa\u2212: Instead of connecting embedding vectors at different levels, we randomly initialize the embedding matrix of diseases. This contrast is intended to emphasize the importance of hierarchical information in diseases. \u2022 THAMb\u2212: We remove the embedded time vector in Eq.(8) and directly use the ot from Eq.(6) as the final visit vector for subsequent predictions. This contrast aims to explore the importance of time information. 23 \f\u2022 THAMc\u2212: We cancel the comprehensive evaluation phase and use the preliminary attention weights obtained from Eq.(13) as the overall attention weights for subsequent predictions, without using the Adaptive attention merging mechanism. This approach aims to demonstrate that the most recent medical records contain all the information about the disease progression. It is essential to fully utilize the most recent medical records. \u2022 THAMd\u2212: Building upon THAMc\u2212, we continue to remove the embedded time vector and retain the structure of Transformer to learn hidden states and utilize the local-based attention mechanism to learn patient representation. Table 4: Diagnosis prediction and heart failure prediction for THAM variants on the MIMICIV dataset. Models Diagnosis Heart failure w-F1 R@10 R@20 AUC F1 THAMa28.68 33.34 42.13 91.30 74.51 THAMb30.48 34.82 44.21 93.10 75.72 THAMc29.58 34.18 43.13 92.42 75.24 THAMd28.77 34.07 42.78 91.98 74.83 THAM 30.79 35.30 44.90 93.57 76.49 The results of the ablation experiments are presented in Table 4. We noticed that for THAMa\u2212, which utilizes a randomly initialized disease embedding matrix, all the metrics except w-F1 show a significant decrease. This indicates the importance of obtaining meaningful disease representations by leveraging the hierarchical relationships among diseases, as it has a crucial impact on achieving good patient representations. In the case of THAMb\u2212, the decline in metrics is not substantial. Despite not incorporating time information in the visit representation, it still outperforms all ablation models. This can be credited to 24 \fits utilization of medical domain knowledge, including hierarchical embedding matrices. Furthermore, during the comprehensive evaluation phase, it learns the correlation between comprehensive visits and time information, further affirming the effectiveness of time information modeling. On the other hand, THAMc\u2212retains the time information embedding but forsakes the comprehensive evaluation phase, resulting in comparatively inferior performance compared to THAMb\u2212. This validates that relying solely on preliminary representations leads to a significant loss of crucial information and impairs predictive performance. THAMd\u2212discards both time information embedding and the comprehensive evaluation phase, it slightly outperforms THAMa\u2212in all metrics. We postulate that meaningful disease representations have a more substantial impact on model performance compared to time information. These findings collectively constitute a comprehensive ablation study, accentuating the significance of each component within THAM. Upon analyzing the results in Table 4, it is evident that even with the removal of individual components, THAM\u2019s performance remains superior to the current baseline models. This further underscores the robustness and superiority of our proposed model, emphasizing the importance of leveraging medical domain knowledge, the relationship between drugs and diseases, as well as the significance of time information. 4.2.3. Prediction Analysis \u2022 Emerging diseases. The term \u201dEmerging diseases\u201d refers to ailments identified in subsequent patient visits that were not present in earlier visits. \u2022 Occurred diseases. The term \u201dOccurred diseases\u201d refers to diseases that have also appeared in early visits during subsequent patient visits. Our objective is to leverage the ability to predict such emerging diseases as a measure of a model\u2019s capacity to learn diagnostic similarity between patients. While proficient prediction of previously diagnosed diseases is a baseline expectation, the ability to identify new, potential diagnoses based on similar patient data is equally crucial. In this context, patients treated with the same drug are 25 \fconsidered similar, and a diagnosis of an emerging disease in one patient might be predictive for the other. The R@k (k = 20, 40) is employed to analyze the performance of different models in predicting both previously diagnosed and emerging diseases, given the relatively small number of newly predicted diseases by each model. This metric reflects the proportion of accurately predicted occurred or emerging diseases against the total confirmed diagnoses. GRAM, CGL, and Chet were selected as comparison models due to their shared utilization of hierarchical (horizontal and vertical) disease relationships. This selection facilitates the assessment of the effectiveness of our proposed drug-disease ontology graph and disease ontology graph. As shown in Table 5, the test set results demonstrate that our proposed model THAM, achieves better performance in predicting both emerging and occurred diseases compared to existing baseline models. These findings substantiate the efficacy of our proposed heterogeneous graph and disease ontology graph learning approach in leveraging patient similarity patterns to predict potential future diagnoses. Table 5: R@k of predicting occurred/emerging diseases on MIMIC-III. Models Occurred diseases Emerging diseases R@20 R@40 R@20 R@40 GRAM 21.05 23.11 15.32 22.50 CGL 21.79 25.13 16.33 23.58 Chet 19.93 22.70 16.80 24.25 THAM 22.48 25.45 17.01 24.50 4.3. Interpretability analysis In this section, we discuss the representations of diseases and drugs trained by the model. The diseases in the ICD-9-CM standard are classified into different categories. To demonstrate our model\u2019s disease classification ability and illustrate the similarity among diseases, we utilize t-SNE(Van der Maaten & Hinton, 2008) to visualize the embedding vectors of 4,880 diseases and 3,202 drugs 26 \ffrom the MIMIC-III dataset. Additionally, we compare the disease embedding vectors produced by several baseline models that incorporate the hierarchical relationship of diseases. In Figure 3, the different colors represent the various categories of diseases classified by the ICD-9-CM standard. From Figure 3, it is evident that all models have successfully classified diseases into corresponding clusters according to real-world classification standards, this indicates that we have successfully learned excellent disease representations by leveraging the correlation between drugs and diseases. Compared to CGL, THAM has a more distinctive way of classifying diseases. As shown in Figure 4, we map the disease embedding vectors into a 3D space and the drug embedding vectors into a 2D space. It can be observed that THAM still possesses excellent disease classification capability. Therefore, we can infer that obtaining better disease representations through the utilization of drug and time information is crucial. 27 \fFigure 3 Code embeddings in three levels acquired by the GRAM, CGL, and THAM models. Each level represents different disease types, as indicated by the corresponding colors. (a) GRAM level 1 (b) GRAM level 2 (c) GRAM level 3 (d) CGL level 1 (e) CGL level 2 (f) CGL level 3 (g) THAM level 1 (h) THAM level 2 (i) THAM level 3 4.4. Parameter sensitivity analysis We conducted a comprehensive sensitivity analysis on the model\u2019s hyperparameters to ascertain their impact on performance. This analysis was carried out on the MIMIC-III and MIMIC-IV datasets, using disease prediction metrics as indicators. Modifications included varying the dimension m of disease codes, 28 \fFigure 4 3D spaces of code embeddings acquired by model THAM and drug embeddings in 2D space. (a) THAM level 1 (b) THAM level 2 (c) THAM level 3 (d) Drug embeddings initially set at 32 and incrementally increased by 32 up to a maximum of 256. In this evaluation of disease code dimensions, we set the number of layers for the encoder to 2. On the MIMIC-III dataset, the model exhibited its optimal performance when the disease code dimension was set to 192, with most indicators reaching their peak values. The scores were as follows: w-F1 at 25.46%, R@10 at 31.00%, R@20 at 41.10%, and R@40 at 50.62%, surpassing other configurations. It is noteworthy that the model\u2019s performance improved gradually as the disease code dimension increased from 32 to 192, at which point all indicators reached their peak values. Beyond this dimension, all indicators showed slight declines. On the MIMIC-IV dataset, the model exhibited the best overall predictive performance with a disease code dimension of 256. This observation suggests that increasing the disease code dimension on both datasets can result in excellent performance. These findings imply that the proposed model neces29 \fFigure 5 The Impact of code dimensions on Performance of MIMIC-III and MIMIC-IV. 32 64 96 128 160 192 224 256 #Disease code dims 15 20 25 30 35 40 45 50 Results 14.91 19.45 21.94 23.43 24.06 25.46 24.98 24.46 22.46 27.16 28.56 29.10 30.30 31.00 30.38 30.06 31.04 35.50 37.32 38.10 39.56 41.10 40.70 40.46 42.76 46.93 48.62 49.32 50.12 50.62 50.36 50.21 Different code dim Performance w-F1 R@10 R@20 R@40 (a) MIMIC-III 32 64 96 128 160 192 224 256 #Disease code dims 20 25 30 35 40 45 50 55 Results 17.82 23.18 27.31 29.00 29.94 30.06 30.77 30.79 25.64 30.07 32.79 33.07 33.99 34.66 34.87 35.30 34.49 39.90 42.59 43.54 43.68 44.02 43.82 44.90 45.31 50.75 53.16 53.72 54.37 54.26 54.70 55.30 Different code dim Performance w-F1 R@10 R@20 R@40 (b) MIMIC-IV sitates more parameters for effectively learning and representing complex data features. For a visualization of the model\u2019s performance across varying disease code dimensions, refer to Figure 5. In addition, we conducted an evaluation of the sensitivity of the model\u2019s encoder layers. Initially, we set the disease code dimension to the previously determined optimal value. The number of encoder layers was incrementally increased from 1 to 5. On the MIMIC-III dataset, the model achieved its best predictive performance with 2 encoder layers, yielding a w-F1 at 25.46%, R@10 at 31.00%, R@20 at 41.10%, and R@40 at 50.62%. These scores outperformed other configurations, but further increases in the number of encoder layers resulted in slight declines in performance. Similarly, on the MIMIC-IV dataset, the model also peaked with 2 encoder layers, achieving a w-F1 score of 30.79%, R@10 score of 35.30%, R@20 score of 44.90%, and R@40 score of 55.30%, followed by gradual declines. These findings indicate that an excessive number of encoder layers does not necessarily improve the predictive performance of the model. Thus, the results confirm that setting the number of encoder layers to 2 can achieve highly favorable performance on both datasets. The performance of the model with varying numbers of encoder layers can be observed in Figure 6. Setting the disease code dimension to 192 and the number of encoder layers to 2 has both showcased remarkable performance on both datasets. This underscores the model\u2019s robustness across hyperparameters. 30 \fFigure 6 The Impact of Encoder Layers on Performance of MIMIC-III and MIMIC-IV. 1 2 3 4 5 Encoder layers 25 30 35 40 45 50 Results 24.44 25.46 24.80 24.32 23.75 29.59 31.00 30.58 30.22 29.71 39.43 41.10 40.82 40.08 39.65 49.86 50.62 50.31 49.20 49.69 w-F1 R@10 R@20 R@40 (a) MIMIC-III 1 2 3 4 5 Encoder layers 30 35 40 45 50 55 Results 29.90 30.79 30.10 29.54 28.48 34.14 35.30 34.84 34.21 33.83 43.78 44.90 44.63 43.25 42.60 53.95 55.30 54.98 54.38 53.73 w-F1 R@10 R@20 R@40 (b) MIMIC-IV The analysis of parameter sensitivity yields valuable insights into the model\u2019s optimal performance. 4.5. Case Study We randomly selected two patients, with IDs 92 and 9412, from the MIMICIII dataset. By analyzing their historical admission records, we extracted a heterogeneous subgraph that offers insights into our proposed method for heterogeneous graph learning. In Figure 7, diseases are represented by grey circles, and drugs by orange nodes. The weights of the edges between diseases indicate their co-occurrence frequency, while the weights of the dashed edges connecting diseases and drugs also represent their co-occurrence frequency. Notably, both patients were treated with the same drug, such as Meropenem, and were diagnosed with pneumonia simultaneously. This suggests that these patients may have similar or related diseases in the future. The construction of a heterogeneous graph allows us to uncover hidden relationships between drugs and diseases. To enhance the interpretability of the model, paths and weights in the graph are converted to corresponding adjacency matrices. To maintain conci31 \fFigure 7 Heterogeneous subgraphs extracted from the visit records of Patient 1 and Patient 2. Patient1(ID:94) Pneumonia Patient2(ID:9412) Essential hypertension Hyposmolality Cervical radiculitis Cellulitis and abscess of leg Metoprolol Disease Node Drug Node Chronic ulcer of leg or foot pid : 94, History ICD-9 codes: [['276.1', '723.4', '424.0', '458.9', '079.99', '401.9', '427.89', '788.41'],['335.20', '518.84', '486', '427.31', '401.9', '600.00', '427.89', '285.9']]\u00a0 Used drugs:\u00a0['Lorazepam', 'Neutra-Phos', 'Insulin', 'Latanoprost 0.005% Ophth. Soln.', 'Zolpidem Tartrate', 'Cosyntropin', 'Acetaminophen', 'Magnesium Sulfate', 'Heparin', 'Docusate Sodium', 'SW', 'Insulin Human Regular', 'Gabapentin', 'Pneumococcal Vac Polyvalent', 'Timolol Maleate 0.5%', 'Norepinephrine', 'Metronidazole', 'Lisinopril', 'Aspirin', 'Levofloxacin', 'Bisacodyl', 'Tamsulosin HCl', 'Potassium Chloride', 'Dexamethasone', 'Potassium Chl 40 mEq / 1000 mL D5 1/2 NS', 'Ibuprofen', 'NS', 'Lansoprazole Oral Suspension', 'D5W', 'Iso-Osmotic Dextrose', 'Phenazopyridine HCl', 'Vancomycin HCl', 'Heparin Flush CVL\u00a0 (100 units/ml)', 'Dextrose 5%', 'D5 1/2NS', 'Ferrous Sulfate', 'Ampicillin-Sulbactam', 'Lorazepam', 'CefTRIAXone', 'Potassium Phosphate', 'Latanoprost 0.005% Ophth. Soln.', 'Lidocaine 0.5%/Epinephrine', 'Zolpidem Tartrate', 'traZODONE HCl', 'HydrALAZINE HCl', 'Acetaminophen', 'Ketoconazole 2% ', 'Mirtazapine', 'Magnesium Sulfate', 'Heparin', 'Albumin 25% (12.5 g)', 'Fentanyl Patch', 'Naloxone HCl', 'Propofol', 'Midazolam HCl', 'Scopolamine Patch', 'Albuterol', 'Phenylephrine HCl', 'Fentanyl Citrate', 'Senna', 'SW', 'Gabapentin', 'Timolol Maleate 0.5%', 'Rilutek', 'Midodrine HCl', 'Lansoprazole Oral Disintegrating Tab', 'Lisinopril', 'Heparin Flush PICC (100 units/ml)', 'Dextrose 5%', 'Pantoprazole Sodium', 'Sodium Chloride 0.9%\u00a0 Flush', 'NS (Mini Bag Plus)', 'Meropenem', 'Levofloxacin', 'Bisacodyl', 'Potassium Chloride', 'Alteplase (Catheter Clearance)', 'Ketorolac', 'NS', 'Docusate Sodium (Liquid)', 'DopAmine', 'D5W', 'Iso-Osmotic Dextrose', 'Lansoprazole Oral Suspension', 'Morphine Sulfate', 'Furosemide', 'Piperacillin-Tazobactam Na', 'Calcium Gluconate', 'Vial', 'Ibuprofen Suspension', 'Vancomycin HCl', 'Heparin Flush CVL\u00a0 (100 units/ml)', 'Lidocaine 5% Patch', 'Metoprolol'] pid : 9412,\u00a0History ICD-9 codes: [['996.74', '682.6', '707.13', '780.39', '496', '008.45', '785.4', '401.9'],['486', '584.9', '491.21', '682.6', '728.88', '707.13', '428.0', '518.81', '440.23', 'E884.3', '922.2', '272.4', '401.9', 'V49.76', '345.90']] Used drugs:\u00a0['D5 1/2NS', 'Aztreonam', 'Lorazepam', 'Insulin', 'MethylPREDNISolone Sodium Succ', 'Acetaminophen', 'Heparin', 'Docusate Sodium', 'Lactulose', 'Phenytoin', 'Heparin Sodium', 'Fentanyl Citrate', 'Senna', 'Gabapentin', 'Metoprolol', 'Papain-Urea Ointment', 'Becaplermin Gel 0.01%', 'Morphine SR (MS Contin)', 'Ipratropium Bromide Neb', 'Pantoprazole', 'MetRONIDAZOLE (FLagyl)', 'Meropenem', 'NS (Mini Bag Plus)', 'Sodium Chloride 0.9%\u00a0 Flush', 'Aspirin', 'Bisacodyl', 'Levofloxacin', 'Atorvastatin', 'Oxycodone-Acetaminophen', 'Potassium Chloride', 'PredniSONE', 'Ketorolac', 'NS', 'Amlodipine', 'D5W', 'IsoOsmotic Dextrose', 'Furosemide', 'Morphine Sulfate', 'Sodium Bicarbonate', 'Vancomycin HCl', 'Albuterol 0.083% Neb Soln', 'Dextrose 5%'] Disease intersection:{'486', '401.9'} Drug\u00a0intersection:['Metoprolol', 'Iso-Osmotic Dextrose', 'Bisacodyl', 'Fentanyl Citrate', 'NS (Mini Bag Plus)', 'Meropenem', 'Aspirin', 'Senna', 'Sodium Chloride 0.9%\u00a0 Flush', 'Insulin', 'Acetaminophen', 'D5 1/2NS', 'Docusate Sodium', 'Morphine Sulfate', 'Potassium Chloride', 'D5W', 'Dextrose 5%', 'Levofloxacin', 'Lorazepam', 'Heparin', 'Ketorolac', 'NS', 'Gabapentin', 'Vancomycin HCl', 'Furosemide'] Meropenem Insulin Coexistence Disease Drug Atorvastatin sion, only a subset of the diagnosed diseases and drug records of the patients are displayed in the figure, while the complete historical admission records of the two patients are recorded below in Figure 7. 5."
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14822v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14822v1",
|
| 3 |
+
"title": "CNN2GNN: How to Bridge CNN with GNN",
|
| 4 |
+
"abstract": "Although the convolutional neural network (CNN) has achieved excellent\nperformance in vision tasks by extracting the intra-sample representation, it\nwill take a higher training expense because of stacking numerous convolutional\nlayers. Recently, as the bilinear models, graph neural networks (GNN) have\nsucceeded in exploring the underlying topological relationship among the graph\ndata with a few graph neural layers. Unfortunately, it cannot be directly\nutilized on non-graph data due to the lack of graph structure and has high\ninference latency on large-scale scenarios. Inspired by these complementary\nstrengths and weaknesses, \\textit{we discuss a natural question, how to bridge\nthese two heterogeneous networks?} In this paper, we propose a novel CNN2GNN\nframework to unify CNN and GNN together via distillation. Firstly, to break the\nlimitations of GNN, a differentiable sparse graph learning module is designed\nas the head of networks to dynamically learn the graph for inductive learning.\nThen, a response-based distillation is introduced to transfer the knowledge\nfrom CNN to GNN and bridge these two heterogeneous networks. Notably, due to\nextracting the intra-sample representation of a single instance and the\ntopological relationship among the datasets simultaneously, the performance of\ndistilled ``boosted'' two-layer GNN on Mini-ImageNet is much higher than CNN\ncontaining dozens of layers such as ResNet152.",
|
| 5 |
+
"authors": "Ziheng Jiao, Hongyuan Zhang, Xuelong Li",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Distillation",
|
| 15 |
+
"gt": "Although the convolutional neural network (CNN) has achieved excellent\nperformance in vision tasks by extracting the intra-sample representation, it\nwill take a higher training expense because of stacking numerous convolutional\nlayers. Recently, as the bilinear models, graph neural networks (GNN) have\nsucceeded in exploring the underlying topological relationship among the graph\ndata with a few graph neural layers. Unfortunately, it cannot be directly\nutilized on non-graph data due to the lack of graph structure and has high\ninference latency on large-scale scenarios. Inspired by these complementary\nstrengths and weaknesses, \\textit{we discuss a natural question, how to bridge\nthese two heterogeneous networks?} In this paper, we propose a novel CNN2GNN\nframework to unify CNN and GNN together via distillation. Firstly, to break the\nlimitations of GNN, a differentiable sparse graph learning module is designed\nas the head of networks to dynamically learn the graph for inductive learning.\nThen, a response-based distillation is introduced to transfer the knowledge\nfrom CNN to GNN and bridge these two heterogeneous networks. Notably, due to\nextracting the intra-sample representation of a single instance and the\ntopological relationship among the datasets simultaneously, the performance of\ndistilled ``boosted'' two-layer GNN on Mini-ImageNet is much higher than CNN\ncontaining dozens of layers such as ResNet152.",
|
| 16 |
+
"main_content": "Introduction Convolution neural network (CNN) utilizes the convolution kernel to project the image into the deep space and extract the intra-sample representation such as the color and texture of a single instance, it can obtain great improvements in many image-related tasks [He et al., 2016]. Notably, since the convolution kernel can be viewed as the variant of linear projection with the parameters sharing [Bishop and Nasrabadi, 2006], CNN generally will stack plenty of convolution neural layers to improve the representational ability. However, the large network size may takes the vast resource for storage and optimization. Besides, these linear projections may limit the capacity (a) CNN: Extract the Deep Intra-Sample Representation (b) GNN: Learn the Underlying Topological Relationship Figure 1: Merits of CNN and GNN. Figure 1(a): CNN can extract the intra-sample representation such as the trunk and contour of the animal in the image. Figure 1(b): GNN will learn the explore the relationship among the nodes in the social graph data. to extract the multi-type representation, e.g., CNN generally focuses on learning the intra-sample representation but ignores extracting the latent topological relationship among the instance sets [He et al., 2022]. Although some researchers introduce transferring learning [Oquab et al., 2014], knowledge distillation [Hinton et al., 2015], and network pruning [Yu et al., 2020] to achieve the compression of the large CNN, the compressed CNN is still based on linear projection and even the performance will degrade [Phuong and Lampert, 2019]. Recently, a graph neural network (GNN) has obtained the excellent performance on the graph scenarios such as citation networks, social networks, and biomolecule structure datasets [Kipf and Welling, 2016]. Compared with linear projection based CNN, GNN is a bilinear model according to [Tenenbaum and Freeman, 2000]. Specifically, it employs two linear factors, projection matrix W and graph-related matrix P , to project the data into the deep subspace and aggregate the information from the neighbors. Thus, it can achieve to extract the latent topological relationship among the graph nodes within a few graph neural layers and takes less computation resources than CNN. Meanwhile, it is these two linear factors for projection that make it possible for GNN with the limited layers to learn multi-type information from the data, e.g., extracting the intra-sample representation and latent topological relationship arXiv:2404.14822v1 [cs.CV] 23 Apr 2024 \f(a) Inductive Training of CNN2GNN (b) Inductive Testing with Mechanism 1 (c) Inductive Testing with Mechanism 2 Figure 2: A framework of the proposed CNN2GNN model. Figure 2(a) is the training procedure. CNN teacher and GNN student are utilized to learn the intra-sample representation and the latent topological relationship, respectively. Lstudent can brige these two heterogeneous networks and transfer knowledge from CNN to GNN. Figure 2(b) and Figure 2(c) are the inductive inference with Mechanism 1 and 2, respectively. Among them, Figure 2(b) cascades a test instance with a training batch for prediction. Figure 2(c) selects the most similar sample in the training set to learn an approximated graph structure for evaluating the testing samples batch-by-batch. simultaneously on image-related tasks. Based on the above discussion, we notice that CNN achieves great performance in the image set by extracting the intrasample representation as shown in Figure 1(a). However, due to projecting with a linear factor, CNN generally stacks plenty of neural layers to extract the intra-sample representations, whose optimization will take a vast cost. Meanwhile, although GNN succeeds in extracting the relationship information with a few layers by employing two linear factors for projecting as suggested in Figure 1(b), the obstacles including graph dependency and high inference latency limit GNN to extend the non-graph data directly. Thus, inspired by these complementary strengths and weaknesses between CNN and GNN, we raise a natural question, how to bridge these two heterogeneous networks, enjoying the intra-sample representation from CNN and the topological relationship from GNN simultaneously? In this work, we find that the response-based heterogeneous distillation can distill the knowledge from CNN to GNN and answer this question. Meanwhile, to eliminate the obstacle between CNN and GNN, we design a differentiable sparse graph learning module as the head in GNN. Due to differentiability, it can be trained with gradient descent and learn a sparse graph for inductive learning. Later, with the assistance of this head and heterogeneous distillation, the distilled \u201cboosted\u201d GNN can inductively learn the intra-sample representation of a single instance and the topological relationship among the instance set simultaneously. Notably, the performance of distilled \u201cboosted\u201d two-layer GNN on Mini-ImageNet is much higher than CNN containing dozens of layers such as ResNet152. Our core contributions are as follows: \u2022 To eliminate the obstacles between CNN and GNN, a graph head is designed. It can inductively learn the differentiable sparse graph with gradient descent on the non-graph data. \u2022 According to response-based distillation, a novel CNN2GNN framework is proposed to distill the knowledge from the large CNN to a tiny GNN and bridge these two heterogeneous networks. \u2022 The distilled \u201cboosted\u201d GNN can inductively extract the intra-sample representation of a single instance and the topological relationship among the instances simultaneously. 2 Related Work 2.1 Graph Neural Network Graph neural networks have achieved great performance on graph-structured data such as molecules formed network [Duvenaud et al., 2015]. According to spectral graph theory, [Bruna et al., 2013] define the parameterized filters in the spectral domain and have been used for graph classification. However, it is time-consuming for these methods to complete the spectral decomposition. Thus, the Chebyshev polynomial [Defferrard et al., 2016] and the firstorder expansion formed [Kipf and Welling, 2016] are employed to fit the results of decomposition. Based on this, this formed graph neural network is widely used in graph scenarios [Li et al., 2022b]. Meanwhile, since GNN can learn the latent structure information, many researchers attempt to extend it to non-graph datasets [Li et al., 2022c; Zhang et al., 2021a]. Although these methods construct the graph on non-graph data, the obtained is fixed during the training and inference due to the independence between construction and gradient descent. Meanwhile, the inference latency puzzle the GNN applied in the realistic scenario. To overcome these problems and eliminate the obstacle between GNN and CNN, our work designs a graph head to inductively learns a differentiable sparse graph. \f2.2 Knowledge Distillation Knowledge distillation mainly transfers the knowledge of a pretrained teacher network into a smaller student network [Hinton et al., 2015]. According to the categories of transferring knowledge, distillation generally can be classified into three types. The response-based distillation enables the student to directly mimic the response of the decision layer of the teacher network [Hinton et al., 2015]. Then, the feature-based distillation attempt to learn the knowledge in the intermediate layer of the teacher network [Zagoruyko and Komodakis, 2016a]. Furthermore, the relation-based knowledge focuses on learning relationship-level information among the instances [Liu et al., 2019]. However, since the mentioned methods mainly distill the knowledge between the homogenous neural network such as CNN to CNN or GNN to GNN, they mainly focus on transferring the learned knowledge and lack learning unexplored knowledge. In this work, inspired by that the different kinds of neural networks focus on learning different knowledge, we propose a novel heterogeneous distillation strategy to bridge a large CNN and a small GNN. The distilled \u201cboosted\u201d GNN can extract the deep intra-sample representation and the topological relationship among the instance simultaneously. 3 Method To bridge CNN and GNN, we propose a novel CNN2GNN heterogeneous distillation framework. It designs a deep graph learning head to differentiable learn the graph with the steerable sparsity according to the downstream tasks and eliminate the obstacle between CNN and GNN. Then, by the responsebased distillation, the distilled \u201cboosted\u201d GNN will inductively extract the intra-sample representation of a single instance and the topological relationship among the instances simultaneously. The framework is shown in Fig 2. 3.1 Motivation With the assistance of two crucial components, the full connectivity layer and convolutional operator, convolution neural networks (CNNs) can project the image instance into the deep subspace to learn the intra-sample representation and have achieved great performance in image-related tasks. Among them, the full connectivity layer can be formulated as the linear model as Linear(x) = wT x, (1) where w is a learning parameter. Meanwhile, the convolutional operator shares the weights across the channels [Goodfellow et al., 2016], so it can be also reformulated as a linear transformation like im2col [Chellapilla et al., 2006]. Thus, CNNs generally stack dozens of these operations and contain plenty of parameters for optimization to improve the performance, which may takes vast resources for optimization and storage. Besides, it is the linear projection that would limit the CNNs to explore the different information such as the relationship (similarity or differences) among the samples. Recently, graph neural networks (GNNs) have shown the excellent representational ability to learn the underlying information among the instances thanks to the graph dependency. Given a graph A, a GNN layer is Z = fg(A, X, W ) = \u03c6(P XW ), (2) where W is the projection parameter and P = \u03d5(A) is a function of A. Similar to [Kipf and Welling, 2016], \u03d5(A) = D\u22121 2 AD\u22121 2 and D is the degree matrix of A. Notably, if the activation function \u03c6(\u00b7) is ReLU, the deep feature generated from Eq. (2) can be linear with multiple factors including a graph factor P and a projection factor W . Among them, W will work like w in CNNs to learn the deep information of the single instance and P = \u03d5(A) will aggregate the information from the neighbors to extract the latent structure information among the samples. That is shown that GNN as a bilinear model can represent more information with few neural layers compared with the linear transformation in CNN such as the full connectivity and im2col. Motivated by the bilinear property of GNNs that introduce more linear factors and represent more information in feature space compared with CNNs, we rethink the substantial difference between CNNs and GNNs. To sum up, the core question raised in this paper is how to bridge these two heterogeneous networks, CNN and GNN? Unfortunately, there are two critical issues in handling this problem, (1) graph inaccessible and (2) graph dependency. Specifically, since the graph factor is not prior information for non-graph data, GNN may not be directly applied to the image-related tasks. Although the vector product or Euclidean distance can construct a graph [Caramalau et al., 2021; ?], it will take much time to select a proper sparse threshold and the obtained graph lacks information about the downstream tasks due to independence with the gradient descent. Besides, with the limitation of the graph dependency, GNN generally is trained with transductive learning and has a high inference latency such as O(Rl) [Zhang et al., 2021b], where R is the graph degree and l is the number of layers. It is impractical to extend on the large scenario where R is large. In this paper, we will firstly handle these two critical issues in Section 3.2 and elaborate on the core question in Section 3.3. 3.2 Differentiable Sparse Graph Head To bridge these two heterogeneous networks, a natural thought is substituting the CNN with the GNN model and improving the representational ability by introducing the two linear factors in a single neural layer. Unfortunately, since the graph structure is not directly accessible for non-graph datasets such as images, GNN cannot be extended on the image data directly. Besides, due to aggregating the information recursively from the sample neighbors, GNN needs to be trained with transductive learning and the inference latency grows exponentially with the graph degree such as O(Rl), where R is the graph degree and l is the number of layers. It causes the transductive learning strategy will be impractical when R is large in real-world scenarios. Therefore, we firstly design a differentiable sparse graph head to inductively learn the graph from the non-graph data. Sparse Graph Learning: Give a non-graph dataset X with n samples and a single sample x is viewed as one node v in a graph. Besides, we regard the underlying graph structure of a single sample vi as the conditional probability p(v|vi) and the edge as a sampling result from this distribution p(v|vi). Therefore, the generation of graph is equivalent to calculating \fFigure 3: Visualization of the topological relationship learned by the differentiable sparse graph head on STL-10. The sparsity s is 3. The first and second rows show that the graph head can accurately learn the relationship among the instances in the same class. The bottom row suggests that the instance in different classes will be assigned a small similarity even 0. the distribution p(v|vi) as pij = ( vi, vs+1\u000b \u2212\u27e8vi, vj\u27e9 Ps j=1 \u27e8vi, vs+1\u27e9\u2212\u27e8vi, vj\u27e9)+, (3) where s is the sparsity, (\u00b7)+ means max(\u00b7, 0), and p(\u00b7|vi) is simplified as pi. In Eq. (3), \u27e8vi, vj\u27e9is the distance from vj to vi and \u27e8vi, v\u00b7\u27e9represents the \u00b7-th smallest distance to vi. Then, the undirected sparse graph is constructed as Aij = (p(vj|vi) + p(vi|vj))/2. Compared with utilizing the vector inner product (vT i vj) [Caramalau et al., 2021] or the Euclidean distance (\u2225vi \u2212vj\u22252) [Mohamed et al., 2020] to generate the graph structure and control the sparsity by selecting extra hyper-parameters, Eq. (3) can explicitly control the learned graph sparsity and save the tuning cost. Theorem 1 indicates that Eq. (3) is the sparse closed-form solution of p(v|vi). Notably, \u21132-norm is employed as the regularization term in Eq. (5). Compared with the \u21130-norm non-convex constriant and the relaxation \u21131-norm regularization, it not only prevents the trivial solution such as p(vi|vi) = 1 and p(vi|vj) = 0 if i \u0338= j, but also gaurantees steerable sparsity. The proof of Theorem 1 is in the supplementary. Furthermore, considering that an ideal graph could be dynamically and differentiable learned during the optimization to contain more the downstream task information, we utilize a deep neural network as the graph generation head f g \u22c6(\u00b7) to fit \u27e8vi, vj\u27e9and will be jointly optimized with GNN. It has n neurons in the decision layer and each neuron represents the difference with the corresponding sample in X, where n is the total number of the samples. Based on this, the distance is fitted with \u27e8vi, X\u27e9= f g \u22c6(xi) and the sparse graph will be calculated via Eq. (3). Meanmwhile, as shown in Fig. 3, Eq. (3) can accurately learn the relationship in STL-10. Inductive Learning: Notably, it is the graph structure obtained dynamically that GNN can be trained with inductive learning. Split the dataset X into a training indices set Itrain with ntrain instances and the testing indices set Itest with ntest instances. And the sparse graph generation f g \u22c6(\u00b7) is equipped with ntrain neurons. 1) Training Stage: For a training batch B \u2286Itrain, the s-sparse similarity distribution is pij = ( vi, vs+1\u000b \u2212\u27e8vi, vj\u27e9 Ps j=1 \u27e8vi, vs+1\u27e9\u2212\u27e8vi, vj\u27e9)+, i \u2208B, j \u2208Itrain, (4) where \u27e8vi, v\u27e9is fitted by f g \u22c6(vi). Thus, we can obtain the graph structure via Aij = (pij + pji)/2 and calculate the representation of B via Eq. (2). Notably, since all operations are differentiable, they can be optimized with gradient descent. 2) Testing Stage: Since f g \u22c6(\u00b7) cannot measure the distance between vi and vj where i, j \u2208Itest, we introduce a training batch Btrain and design two mechanisms to induce and learn the testing similarity distribution. Among them, the first one cascades a test instance with a training batch and learns the graph to evaluate the performance of the testing set, which is shown in Mechanism 1. However, it only tests one instance in each iteration, which is inefficient on large datasets. Therefore, to improve the efficiency, Mechanism 2 selects the most similar sample in the training set to learn an approximated graph structure for evaluating the testing samples batch-by-batch. Mechanism 1. Give a testing sample vi, i \u2208Itest, it firstly is cascaded with a set of training samples to form batch B. Then, the sparse graph is learned as Aij = (pij + pji)/2, where pij is calculated by Eq. (3). Thus, GNN can inference the representation of vi. Mechanism 2. Given a testing batch B \u2286Itest, the conditional distribution P between the testing batch Btest and the training batch Btrain is calculated via Eq. (3). Then, the approximated batch Bsim is formed by choosing the highest probability in P . Finally, the approximated sparse graph is learned as Aapr ij = (papr ij + papr ji )/2, where papr ij is calculated by Eq. (3). Aapr ij assists GNN to generate the representation of the testing batch. In a word, Mechanism 1 can directly obtain the graph structure of the testing sample vi but it has the lower inference efficiency when ntest is large. Meanwhile, although Mechanism \fAlgorithm 1 Differentiable Sparse Graph Head for Inductive Learning Input: Non-graph data X, sparsity s, objective function L and GNN f\u22c6(\u00b7). 1: Split the dataset X into a training indices set Itrain and the testing indices set Itest; 2: Initialize GNN f\u22c6(\u00b7) and graph head f g \u22c6(\u00b7) randomly; 3: while not Convergence do 4: Obtain the graph A via Eq. (3) on batch B \u2286Itrain; 5: Generate the graph representation f\u22c6(vi; A), i \u2208B; 6: Optimize L via gradient descent; 7: end while 8: Inference on the testing set Itest via Mechanism 1 or 2; 2 can improve the efficiency of the testing set, the approximated strategy may sacrifice performance. Furthermore, we will detailly discuss the merits and limitations in Section 4.4. The whole procedure of the proposed graph learning head is suggested in Algorithm 1. Theorem 1. Given a set of samples V = {vi|n = 1, ..., n}, the conditional probability p(v|vi) can be formulated from min pT i 1n=1,pi\u22650 n X i=1 Evj\u223cp(\u00b7|vi) \u27e8vi, vj\u27e9+ \u03b3idist(pi, \u03c0), (5) where \u03c0 is a uniform distribution, dist(\u00b7, \u00b7) represents the \u21132norm distance, and \u03b3i is the trade-off parameter. And Eq. (3) is equivalent to a solution form of this problem. 3.3 CNN2GNN: Heterogeneous Distillation After eliminating the obstacle between CNN and GNN by the proposed graph head, we introduce a response-based heterogeneous distillation to transfer the knowledge and bridge these two heterogeneous neural networks. Specifically, we employ CNN f\u2217(\u00b7) and GNN f\u22c6(\u00b7) as the teacher and student, respectively. Among them, f\u2217(\u00b7) is a large network with plenty of layers such as ResNet-152 and GNN f\u22c6(\u00b7) only has two layers. Meanwhile, a instance x is viewed as one node v in a graph. Firstly, the CNN teacher is trained by cross-entropy loss to extract the deep intra-sample representation f\u2217(x). Then, for a training batch B \u2286Itrain, the differentiable sparse graph head provides the graph A for a GNN student to learn the relationship representation f\u22c6(v; A) among the instance sets. The objective function is defined as Lstudent = 1 |B| X i\u2208B Lcross(f\u22c6(vi; A), yi) + \u03b1Lkd(f\u22c6(vi; A), f\u2217(xi), \u03c4), B \u2286Itrain, (6) where yi is the label, \u03b1 is a weight parameter, and \u03c4 is a temperature. Lcross(\u00b7) is the cross-entropy loss, which mainly guides the GNN to explore the latent relationship information and generate the reliable graph representation. Lkd is a response-based distillation [Hinton et al., 2015] as Lkd = KL(q(f\u2217(vi), \u03c4)\u2225q(f\u22c6(vi; A), \u03c4)), (7) where q(\u00b7v, \u03c4) = exp(\u00b7v/\u03c4) P j exp(\u00b7j/\u03c4), f\u22c6(xv) = hl v and KL(\u00b7\u2225\u00b7) is a KL-divergence. Meanwhile, by introducing f\u2217(vi) as Algorithm 2 Heterogeneous Distillation: Bridge CNN and GNN Input: Non-graph data X, the groundtruth Y, sparsity s, trade-off parameter \u03b1, temperature \u03c4, CNN f\u2217(\u00b7) and GNN f\u22c6(\u00b7). 1: Split the dataset X into a training indices set Itrain and the testing indices set Itest; 2: Initialize f\u2217(\u00b7), f\u22c6(\u00b7) and graph head f g \u22c6(\u00b7) randomly; 3: Pretrian CNN teacher f\u2217(\u00b7) via gradient descent; 4: while not Convergence do 5: Obtain the graph A via Eq. (3) on batch B \u2286Itrain; 6: GNN student generates the graph representation f\u22c6(vi; A), i \u2208B; 7: CNN teacher generates the deep intra-sample representation f\u2217(xi), i \u2208B; 8: Optimize Lstudent via gradient descent; 9: end while 10: Distilled \u201cboosted\u201d GNN inductively inference on Itest via Mechanism 1 or Mechanism 2; the soft target, the deep intra-sample representation can be distilled into the GNN and these two heterogeneous neural networks are bridged in the temperature \u03c4. After training, with the assistance of Mechanism 1 or Mechanism 2, the distilled \u201cboosted\u201d GNN can inductively extract the local representation of a single instance and the topological relationship among the instance sets simultaneously. The whole optimization of CNN2GNN is shown in Algorithm 2. The Merits of the Proposed Model: Inspired by the complementary merits of two mainstream neural networks, we distill a large CNN into a tiny GNN and bridge these two heterogeneous networks. Firstly, a graph head is designed to differentiable and inductively learn a sparse graph structure, which can extend the GNN on non-graph data and eliminate the obstacles between these two networks. Then, with the response-based heterogeneous distillation, the distilled \u201cboosted\u201d GNN with a few neural layers can inductively extract the deep intra-sample representation of a single instance and the topological relationship among the instance sets simultaneously. 4 Experiment 4.1 Experimental Settings Dataset and Baseline: We experiment on four real-world scenario image datasets including STL-10 [Coates et al., 2011], CIFAR-10 [Krizhevsky et al., 2009], CIFAR-100, and MiniImageNet [Deng et al., 2009] with various teacher-student combinations such as VGG [Simonyan and Zisserman, 2014], ResNet [He et al., 2016] and WRN [Zagoruyko and Komodakis, 2016b]. KD [Hinton et al., 2015], FitNets [Romero et al., 2014], AT [Komodakis and Zagoruyko, 2017], SP [Tung and Mori, 2019], VID [Ahn et al., 2019], RKD [Park et al., 2019], PKT [Passalis and Tefas, 2018], AB [Heo et al., 2019], FT [Kim et al., 2018], CRD [Tian et al., 2020], CCD [Li et al., 2022a] and DKD [Zhao et al., 2022] are introduced as the baselines. The detailed data pre-processing is in the supplementary. Implementation: For the comparative methods, the pretrained \fTable 1: Accuracy(%) on CIFAR-100 Teacher Student ResNet34 ResNet18 ResNet50 ResNet18 ResNet101 ResNet18 ResNet152 ResNet18 VGG13 VGG8 VGG16 VGG8 VGG19 VGG8 WRN-40-2 WRN-16-2 WRN-40-2 WRN-40-1 Teacher 62.19 63.91 65.19 66.00 58.48 59.25 59.16 55.32 55.32 KD 62.78 62.25 62.32 62.61 57.15 57.97 57.72 54.86 55.03 FitNets 62.38 (\u2193) 60.73 (\u2193) 62.34 (\u2191) 61.89 (\u2193) 57.06 (\u2193) 57.90 (\u2193) 57.63 (\u2193) 55.04 (\u2191) 55.93 (\u2191) AT 62.19 (\u2193) 60.46 (\u2193) 62.61 (\u2191) 62.28 (\u2193) 57.10 (\u2193) 57.73 (\u2193) 58.02 (\u2191) 54.04 (\u2191) 55.35 (\u2191) SP 62.24 (\u2193) 61.94 (\u2193) 61.94 (\u2193) 62.82 (\u2191) 56.79 (\u2193) 57.82 (\u2193) 56.84 (\u2193) 54.14 (\u2193) 54.61 (\u2193) VID 62.96 (\u2191) 61.58 (\u2193) 62.44 (\u2191) 63.03 (\u2191) 57.15 (\u2191) 58.21 (\u2191) 58.32 (\u2191) 57.02 (\u2191) 56.06 (\u2191) RKD 63.01 (\u2191) 63.58 (\u2191) 63.53 (\u2191) 64.03 (\u2191) 57.34 (\u2191) 58.08 (\u2191) 59.13 (\u2191) 56.06 (\u2191) 57.46 (\u2191) PKT 62.65 (\u2193) 61.89 (\u2193) 62.13 (\u2193) 62.17 (\u2193) 57.37 (\u2191) 56.09 (\u2193) 56.66 (\u2193) 55.14 (\u2191) 55.27 (\u2191) AB 57.23 (\u2193) 62.14 (\u2193) 63.14 (\u2193) 62.00 (\u2193) 56.75 (\u2193) 57.50 (\u2193) 56.47 (\u2193) 53.58 (\u2193) 55.01 (\u2193) FT 62.04 (\u2193) 63.04 (\u2191) 62.31 (\u2193) 62.41 (\u2193) 57.57 (\u2191) 57.86 (\u2193) 57.68 (\u2193) 54.38 (\u2193) 54.95 (\u2193) CRD 57.95 (\u2193) 58.00 (\u2193) 57.56 (\u2193) 57.57 (\u2193) 51.03 (\u2193) 51.95 (\u2193) 51.79 (\u2193) 51.30 (\u2193) 52.84 (\u2193) CCD 63.17 (\u2191) 64.06 (\u2191) 64.41 (\u2191) 64.03 (\u2191) 58.95 (\u2191) 58.50 (\u2191) 58.32 (\u2191) 62.26 (\u2191) 65.05 (\u2191) DKD 64.15 (\u2191) 65.15 (\u2191) 63.72 (\u2191) 64.43 (\u2191) 58.97 (\u2191) 57.78 (\u2193) 57.19 (\u2193) 61.16 (\u2191) 64.30 (\u2191) GNN 60.21 (\u2193) 61.01 (\u2193) 60.28 (\u2193) 60.06 (\u2193) 56.40 (\u2193) 55.84 (\u2193) 56.36 (\u2193) 60.76 (\u2191) 60.76 (\u2191) CNN2GNN 65.13 (\u2191) 65.53 (\u2191) 64.43 (\u2191) 64.67 (\u2191) 59.33 (\u2191) 58.68 (\u2191) 58.57 (\u2191) 65.58 (\u2191) 65.36 (\u2191) (a) ResNet50-18 (b) VGG13-8 (c) ResNet50-18 (d) VGG13-8 Figure 4: Accuracy of CNN2GNN w.r.t the varying parameter \u03c4 \u2208 \b 20, 22, 23, 24, 25, 26\t and s \u2208{10, 30, 50, 70, 90}. Figure 4(a) and 4(b) are the results on CIFAR-100. Figure 4(c) and 4(d) are the results on Mini-Imagenet. Figure 5: Performance comparison between ours and other models on CIFAR-100. Smaller FLOPs represent more efficient models. Higher accuracy represents models have more excellent performance. ResNet-34, ResNet50, ResNet101, ResNet152, VGG13, VGG16, VGG19, and WRN-40-2 are the teacher networks. Meanwhile, the ResNet18, VGG-8, WRN-16-2 and WRN40-1 are the student networks. For ours, the same pretrained network is employed as the CNN teacher. Graph head f g \u22c6(\u00b7) is a deep neural network with 512-256. The student network is a two layers GNN. We adopt the same graph normalization P = \u03d5(A) in [Kipf and Welling, 2016] and adopt Mechanism 2 to achieve inductive learning. Meanwhile, s = 50 in Eq. (3) and \u03b1 = 1 in Eq. (6). The mini-batch gradient descent is employed to train both methods. The batch is set as 100 and the epoch is 200. The learning rate \u03b1 is 0.01. 4.2 Analysis of Experiments All models are run 10 times on benchmark datasets and the mean value on CIFAR-100 and Mini-ImageNet are shown in Table 1 and Table 2. The green up-arrow and the red downarrow are higher performance and lower performance compared to KD, respectively. The other results are shown in the supplementary. Based on this, we can conclude that: \u2022 Compared with other KDs: Compared with the others, ours has achieved the highest accuracy on all datasets. Due to exploring the latent topological relationship, the proposed model can distinguish more complex images in MiniImageNet and the accuracy is far superior to others. \u2022 Compared with Teacher Network: Notably, different from the KD and DKD distillation whose performance generally does outperform the teacher, ours can even obtain a higher performance than the teacher, especially on the complex Mini-ImageNet dataset. It is mainly caused by the distilled \u201cboosted\u201d GNN student who can not only learn the intra-sample representation generated from CNN but also explore the latent relationship among the samples. \u2022 Single GNN Student: Equipped with the proposed graph head, the GNN student can be extended on non-graph datasets and obtain satisfactory performance on CIFAR100 and Mini-ImageNet. Interestingly, compared with the CNN-based model, the \u201cboosted\u201d GNN student can bridge these two heterogeneous networks and achieve the best performance-efficient trade-off as shown in Fig. 5. \fTable 2: Accuracy(%) on Mini-ImageNet Teacher Student ResNet34 ResNet18 ResNet50 ResNet18 ResNet101 ResNet18 ResNet152 ResNet18 VGG13 VGG8 VGG16 VGG8 VGG19 VGG8 WRN-40-2 WRN-16-2 WRN-40-2 WRN-40-1 Teacher 45.11 49.70 48.25 50.35 46.50 46.30 45.34 51.75 51.75 KD 45.07 45.39 46.18 41.72 43.46 42.05 41.65 41.52 42.43 FitNets 45.69 (\u2191) 46.11 (\u2191) 45.76 (\u2193) 45.35 (\u2191) 43.54 (\u2191) 41.89 (\u2193) 40.96 (\u2193) 42.79 (\u2191) 43.96 (\u2191) AT 45.86 (\u2191) 45.54 (\u2191) 45.18 (\u2193) 46.88 (\u2191) 43.27 (\u2193) 42.07 (\u2191) 41.92 (\u2191) 43.02 (\u2191) 42.63 (\u2191) SP 45.55 (\u2191) 46.39 (\u2191) 45.81 (\u2193) 45.95 (\u2191) 42.68 (\u2193) 42.30 (\u2191) 41.91 (\u2191) 41.97 (\u2191) 42.05 (\u2193) VID 47.24 (\u2191) 45.23 (\u2193) 45.87 (\u2193) 45.77 (\u2191) 42.81 (\u2193) 42.20 (\u2191) 42.31 (\u2191) 42.82 (\u2191) 43.46 (\u2191) RKD 47.23 (\u2191) 49.30 (\u2191) 49.12 (\u2191) 49.63 (\u2191) 43.55 (\u2191) 42.92 (\u2191) 41.35 (\u2193) 43.08 (\u2191) 44.02 (\u2191) PKT 45.66 (\u2191) 46.09 (\u2191) 46.05 (\u2193) 45.84 (\u2191) 42.65 (\u2193) 41.81 (\u2193) 41.21 (\u2193) 42.04 (\u2191) 42.30 (\u2193) AB 41.37 (\u2193) 46.14 (\u2191) 45.22 (\u2193) 45.68 (\u2191) 43.66 (\u2191) 40.55 (\u2193) 38.31 (\u2193) 43.10 (\u2191) 43.71 (\u2191) FT 46.50 (\u2191) 45.01 (\u2193) 45.75 (\u2193) 46.33 (\u2191) 42.74 (\u2193) 41.57 (\u2193) 41.36 (\u2193) 42.93 (\u2191) 42.77 (\u2191) CRD 46.03 (\u2191) 41.73 (\u2193) 38.91 (\u2193) 41.75 (\u2191) 41.18 (\u2193) 40.79 (\u2193) 40.40 (\u2193) 41.93 (\u2191) 41.49 (\u2193) CCD 48.64 (\u2191) 49.04 (\u2191) 49.84 (\u2191) 49.44 (\u2191) 43.68 (\u2191) 43.60 (\u2191) 41.75 (\u2191) 51.07 (\u2191) 51.79 (\u2191) DKD 47.69 (\u2191) 48.35 (\u2191) 47.70 (\u2191) 46.86 (\u2191) 45.50 (\u2191) 45.23 (\u2191) 44.27 (\u2191) 52.11 (\u2191) 50.41 (\u2191) GNN 44.27 (\u2193) 43.84 (\u2193) 43.87 (\u2193) 44.02 (\u2191) 38.89 (\u2193) 38.40 (\u2193) 38.27 (\u2193) 42.36 (\u2191) 42.36 (\u2193) CNN2GNN 57.94 (\u2191) 55.04 (\u2191) 53.44 (\u2191) 60.64 (\u2191) 48.88 (\u2191) 46.57 (\u2191) 46.16 (\u2191) 53.09 (\u2191) 52.72 (\u2191) (a) CIFAR100 (b) Mini-ImageNet Figure 6: Accuracy of CNN2GNN w.r.t the different batch size. Figure 6(a) and 6(b) are the results on CIFAR-100 and Mini-ImageNet. 4.3 Sensitivity Analysis In this part, we conduct the corresponding experiments to study the sensitivity of the sparsity s in Eq. (3) and the temperature \u03c4 in Eq. (6). The two architectures, ResNet34-18 and VGG13-8, are employed. From the results, the model is sensitive to the temperature \u03c4 and a higher temperature may bring higher performance, especially on CIFAR-100. It also means that the distillation between heterogeneous neural networks needs to keep a high temperature. Meanwhile, since Mini-Imagenet is more complex compared with CIFAR-100, a higher sparsity will bring more connectivity between the instances to improve the performance. Therefore, we can either fine-tune \u03c4 in (24, 26] and simply set them as a median like 48. For the complex datasets, s can be set as higher. 4.4 Ablation Study We conduct an ablation study to evaluate how each part including Mechanism 1 (One-by-One), Mechanism 2 (Batchby-Batch), inner product-based GNN (InGNN), and Euclidean distance-based GNN (EucGNN) on CIFAR-100 and MiniImageNet. As shown in Table 3, we can conclude that: Mechanism 1 vs Mechanism 2: Compared with Batch-byBatch, the time cost of One-by-One is much higher, which proves that the approximate-based strategy in Mechanism 2 can significantly improve efficiency. Meanwhile, the accuracy of Batch-by-Batch is lower than One-by-One on CIFAR-100, which proves that this approximate-based strategy will sacrifice accuracy. As shown in Fig. 6, although the performance of the two mechanisms is stable with the batch size, One-by-One Table 3: Ablation Study on CIFAR-100 and Mini-ImageNet Method CIFAR-100 Mini-ImageNet Accuracy(%) Time(s) Accuracy(%) Time(s) InGNN 7.82 2828.11 6.17 2567.47 EucGNN 6.15 2824.16 5.82 2469.68 One-by-One 59.77 4999.39 48.85 3214.45 Batch-by-Batch 58.57 2797.42 49.07 2307.49 has a higher performance and standard deviation. Besides, since the proposed graph head will learn a reliable sparse graph after training, Mechanism 2 can learn a approximated graph which correctly reflect the latent relationship among the test data. In a word, Mechanism 2 can properly balance the accuracy and efficiency of inductive learning. Differentiable Sparse Graph vs Others: One-by-One and Batch-by-Batch are both superior higher than InGNN and EucGNN on these two datasets. As shown in Table 1, the single \u201cboosted\u201d GNN student can also achieve higher accuracy than others. These two situations turn out that the designed sparse graph head can successfully learn a reliable graph structure by gradient descent and inductive learning. Furthermore, we notice that the Batch-by-Batch time cost is the fewest among these three models. Thus, the designed graph head can differentiable learns a sparse graph on non-graph data for inductive learning without adding the calculation cost. 5"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14827v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14827v1",
|
| 3 |
+
"title": "Sentence-Level or Token-Level? A Comprehensive Study on Knowledge Distillation",
|
| 4 |
+
"abstract": "Knowledge distillation, transferring knowledge from a teacher model to a\nstudent model, has emerged as a powerful technique in neural machine\ntranslation for compressing models or simplifying training targets. Knowledge\ndistillation encompasses two primary methods: sentence-level distillation and\ntoken-level distillation. In sentence-level distillation, the student model is\ntrained to align with the output of the teacher model, which can alleviate the\ntraining difficulty and give student model a comprehensive understanding of\nglobal structure. Differently, token-level distillation requires the student\nmodel to learn the output distribution of the teacher model, facilitating a\nmore fine-grained transfer of knowledge. Studies have revealed divergent\nperformances between sentence-level and token-level distillation across\ndifferent scenarios, leading to the confusion on the empirical selection of\nknowledge distillation methods. In this study, we argue that token-level\ndistillation, with its more complex objective (i.e., distribution), is better\nsuited for ``simple'' scenarios, while sentence-level distillation excels in\n``complex'' scenarios. To substantiate our hypothesis, we systematically\nanalyze the performance of distillation methods by varying the model size of\nstudent models, the complexity of text, and the difficulty of decoding\nprocedure. While our experimental results validate our hypothesis, defining the\ncomplexity level of a given scenario remains a challenging task. So we further\nintroduce a novel hybrid method that combines token-level and sentence-level\ndistillation through a gating mechanism, aiming to leverage the advantages of\nboth individual methods. Experiments demonstrate that the hybrid method\nsurpasses the performance of token-level or sentence-level distillation methods\nand the previous works by a margin, demonstrating the effectiveness of the\nproposed hybrid method.",
|
| 5 |
+
"authors": "Jingxuan Wei, Linzhuang Sun, Yichong Leng, Xu Tan, Bihui Yu, Ruifeng Guo",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Distillation",
|
| 14 |
+
"gt": "Knowledge distillation, transferring knowledge from a teacher model to a\nstudent model, has emerged as a powerful technique in neural machine\ntranslation for compressing models or simplifying training targets. Knowledge\ndistillation encompasses two primary methods: sentence-level distillation and\ntoken-level distillation. In sentence-level distillation, the student model is\ntrained to align with the output of the teacher model, which can alleviate the\ntraining difficulty and give student model a comprehensive understanding of\nglobal structure. Differently, token-level distillation requires the student\nmodel to learn the output distribution of the teacher model, facilitating a\nmore fine-grained transfer of knowledge. Studies have revealed divergent\nperformances between sentence-level and token-level distillation across\ndifferent scenarios, leading to the confusion on the empirical selection of\nknowledge distillation methods. In this study, we argue that token-level\ndistillation, with its more complex objective (i.e., distribution), is better\nsuited for ``simple'' scenarios, while sentence-level distillation excels in\n``complex'' scenarios. To substantiate our hypothesis, we systematically\nanalyze the performance of distillation methods by varying the model size of\nstudent models, the complexity of text, and the difficulty of decoding\nprocedure. While our experimental results validate our hypothesis, defining the\ncomplexity level of a given scenario remains a challenging task. So we further\nintroduce a novel hybrid method that combines token-level and sentence-level\ndistillation through a gating mechanism, aiming to leverage the advantages of\nboth individual methods. Experiments demonstrate that the hybrid method\nsurpasses the performance of token-level or sentence-level distillation methods\nand the previous works by a margin, demonstrating the effectiveness of the\nproposed hybrid method.",
|
| 15 |
+
"main_content": "Introduction Knowledge distillation, as a fundamental technique for model compression and knowledge transfer in deep neural networks, has wide application in the field of neural machine translation (NMT) [Hinton et al., 2015; Gou et al., 2021]. Knowledge distillation involves transferring knowledge from a larger, cumbersome model to a smaller, more efficient one, serving purposes such as compressing machine translation models and simplifying training targets for non-autoregressive models [Phuong and Lampert, 2019; Liu et al., 2020; Wang and Yoon, 2021; Xiao et al., 2023]. Given the variance in training targets, knowledge distillation in NMT can be divided into two main categories: sentencelevel knowledge distillation and token-level knowledge distillation. Sentence-level knowledge distillation mainly focuses on simplifying the training target to improve the translation accuracy [Gajbhiye et al., 2021; Yang et al., 2022a]. Specifically, given a source and target sentence pair, sentence-level distillation firstly feeds the source sentence into the teacher model to generate a pseudo target sentence, then the pseudo target sentence is leveraged as the training target of student model. Compared with the origin target sentence, the distribution of pseudo target sentence is simpler, and thus easier to learn for student model [Kim and Rush, 2016; Zhang et al., 2019; Tang et al., 2019; Tan et al., 2022]. In contrast, token-level knowledge distillation focuses on enhancing translation quality by a finer granularity [Kim and Rush, 2016; Mun\u2019im et al., 2019]. Different with sentencelevel knowledge distillation which only leverages the output sentence of teacher model, token-level knowledge distillation further uses the token distribution in the output sentence. The student model is trained to output a similar distribution with the teacher model on every token, which helps the student model learn detail knowledge on token difference and be more suitable for texts with high lexical diversity [Wang et al., 2020]. However, empirical studies have revealed divergent performances between sentence-level and token-level distillation across different scenarios. Specifically, while some scenarios benefit more from the global structure and semantic consistency provided by sentence-level distillation [Kim and Rush, 2016; Chen et al., 2020; Xu et al., 2021b; Lei et al., 2022; Mhamdi et al., 2023], other scenarios require the finegrained knowledge transfer that token-level distillation offers [Liao et al., 2020; Tang et al., 2021; Li et al., 2021; Ma et al., 2023]. This variation in performance has led to confusion regarding the empirical selection of knowledge distillaarXiv:2404.14827v1 [cs.CL] 23 Apr 2024 \ftion methods. In this study, we conduct analytical experiments to explore the general suitable scenario of two knowledge distillation methods. Given that the training target of sentencelevel distillation (simplified sentence by teacher model) is easier than that of the token-level distillation (detailed token distribution of teacher model). We hypothesize that sentencelevel distillation is suitable for \u201ccomplex\u201d scenarios and the token-level distillation is suitable for \u201csimple\u201d scenarios. We define the \u201ccomplex\u201d or \u201csimple\u201d scenarios from three perspectives: 1) model size of student model, as the student model becomes small, it is harder for the student model to learn the knowledge, and thus the scenario become more complex; 2) the complexity of text, more complex text will make the learning procedure of student model harder; 3) the difficulty of decoding, which is determined by the amount of auxiliary information available during decoding. The more auxiliary information available, the simpler the decoding process becomes. Experiments on the above three perspectives consistently verify our hypothesis, showing that the tokenlevel distillation performs better in simple scenarios with the sentence-level distillation is better for complex scenarios. Although the analytical experiments provide deep understanding and reveal the general suitable scenarios for two distillation method, how to empirically define the complexity of a machine translation task is challenging. To address this challenge, we further explore the hybridization of two distillation methods, aiming at taking the advantage of both the distillation methods to enhance overall translation accuracy. We propose a dynamic gating mechanism that adaptively balances the learning process between sentence-level and token-level distillation. Specifically, the student model is trained to learn both the pseudo target sentence distribution for global coherence and the detailed token distribution from the teacher model for lexical precision, with the gating mechanism dynamically adjusting the emphasis based on the evolving learning context and model performance. The contributions of this paper are summarized as follows: \u2022 We conduct experiments to discover the optimal use of sentence-level and token-level distillation, uncovering that the sentence-level distillation excels in simpler scenarios, whereas the token-level distillation is more effective in complex ones. \u2022 We propose a hybrid method of sentence-level and tokenlevel distillation, showing enhanced performance over single distillation methods and baseline models. 2 Related Work Knowledge distillation (KD) is widely applied in the field of neural machine translation (NMT) to enhance the efficiency and performance of translation models [Hinton et al., 2015; Xu et al., 2021b; Chen et al., 2020; Gou et al., 2021; Zhang et al., 2022]. Recently, knowledge distillation is applied in multilingual NMT [Tan et al., 2019] to assist models in mastering multiple languages within a single framework. A multi-agent learning framework [Liao et al., 2020] is utilized to investigate how sentence-level and token-level distillation can work together synergistically. PMGT [Ding et al., 2021]enhances phrase translation accuracy and model reordering capability by progressively increasing the granularity of training data from words to sentences. ProKD [Ge et al., 2023] demonstrates the use of high-resource language teacher models to enhance translation performance in low-resource languages through cross-lingual knowledge distillation. Despite the emergence of various distillation models, knowledge distillation in NMT, from the perspective of training targets, can be primarily divided into two categories: sentence-level knowledge distillation and token-level knowledge distillation. 2.1 Token-Level Knowledge Distillation Token-level knowledge distillation in neural machine translation (NMT) primarily focuses on enhancing the translation accuracy of individual words or phrases [He et al., 2021; Gou et al., 2021; Wang and Yoon, 2021]. This approach is explored in various studies to improve specific aspects of translation quality. For example, token-level ensemble distillation for grapheme-to-phoneme conversion [Sun et al., 2019] can enhance the phonetic translation accuracy. Additionally, a selective knowledge distillation method [Wang et al., 2021] aims at optimizing the word-level distillation loss and the standard prediction loss. The raw data exposure model [Ding et al., 2020] reduces lexical choice errors in low-frequency words by exposing NAT models to raw data, enhancing translation accuracy. SKD [Sun et al., 2020] investigates knowledge distillation in the context of multilingual unsupervised NMT, while kNN-KD [Yang et al., 2022b] examines the effects of nearestneighbor knowledge distillation on translation accuracy. Furthermore, the token-level self-evolution training [Peng et al., 2023] method dynamically identifies and focuses on underexplored tokens to improve lexical accuracy, generation diversity, and model generalization. The concept of knowledge distillation via token-level relationship graphs [Zhang et al., 2023] offers a novel perspective on leveraging relational data for distillation, further contributing to the advancement of the token-level knowledge distillation in NMT. 2.2 Sentence-Level Knowledge Distillation Sentence-level knowledge distillation in neural machine translation (NMT) focuses on reducing the training difficulty of student model, particularly useful in capturing the semantics of whole sentences or long sequences [Kim and Rush, 2016; Ren et al., 2019; Stahlberg, 2020]. For examples, ensemble distillation method [Freitag et al., 2017] is proposed to effectively combine multiple model outputs to improve the handling of complex sentence structures. The scope of sentence-level distillation techniques is further expanded with the help of perturbed length-aware position encoding in non-autoregressive neural machine translation [Oka et al., 2021]. DDRS [Shao et al., 2022] introduces diversified distillation and reference selection strategies to improve the accuracy of sentence-level distillation. Sentence-level distillation is also employed for simultaneous machine translation to address the challenges of real-time translation [Deng et al., 2023]. Several studies have provided insights to better understand the knowledge distillation. For instance, NAT [Zhou et al., 2020] delves into why knowledge distillation is effective in non-autoregressive machine translation (NAT), uncovering \fTable 1: Impact of model size on knowledge distillation across datasets. The \u25b3column represents the difference between token-level and sentence-level BLEU scores. Positive values suggest that the token-level distillation has a higher BLEU score than the sentence-level distillation. Dataset Teacher Size Student Size BLEU Score Teacher Results Token-level Sentence-level \u25b3 IWSLT14 de\u2192en 38M 3M 34.80 30.50 31.09 -0.59 9M 34.12 34.20 -0.08 38M 36.09 34.84 1.25 111M 36.40 34.87 1.53 IWSLT13 en\u2192fr 52M 7M 44.10 39.63 41.94 -2.31 12M 42.42 43.48 -1.06 52M 44.82 44.43 0.39 140M 44.87 44.26 0.61 WMT14 en\u2192de 83M 28M 27.35 23.89 25.17 -1.28 83M 26.49 26.77 -0.28 112M 26.73 26.68 0.05 146M 26.66 26.56 0.10 IWSLT17 ar\u2192en 47M 13M 31.19 28.66 30.21 -1.55 24M 29.02 30.52 -1.50 47M 32.18 31.15 1.03 84M 32.37 31.33 1.04 the impact of text complexity on NAT. However, this study does not explore how text complexity affects token-level and sentence-level distillation. HKD [Lee et al., 2022] investigates the question of \u201cwhen to distill such knowledge\u201d. It proposes a gate knowledge distillation scheme, where the teacher model serves not only as a knowledge provider but also as a calibration measurement, allowing for a switch between learning from the teacher model and training the student. This work also investigates both token-level and sentence-level distillation in teacher model. However, it treats them as separate strategies with independent token-level and sentence-level gates and fails to combine these two approaches. Our work explores the general suitable scenario of knowledge distillation for both token-level and sentence-level perspectives, hypothesizing that token-level distillation is better suited for \u2018simple\u2019 scenarios, while sentence-level distillation excels in \u2018complex\u2019 scenarios. Furthermore, we propose a hybrid method that combines token-level and sentence-level distillation through a gating mechanism, aiming to alleviate the empirical confusion on selecting the distillation methods. 3 Comprehensive Analysis of Knowledge Distillation This section presents a detailed analysis of knowledge distillation within neural machine translation (NMT), focusing on the empirical evaluation of token-level versus sentence-level distillation in varied scenarios. This analysis aligns with our hypothesis outlined in Section 1: that sentence-level distillation is more adept in \u2019complex\u2019 scenarios, while token-level distillation excels in \u2019simple\u2019 scenarios. We define the complexity from three perspectives: 1) Model size of the student model: The scenarios become more complex when the model size of student model become smaller, since the student model need to compress the knowledge of teacher model into a model with limited capacity. 2) Complexity of the text: Datasets with more complex text, characterized by intricate sentence structures and diverse vocabulary, present more challenging learning environments for the student model. 3) Difficulty of decoding: The decoding difficulty is determined by the amount of ground truth or auxiliary information available during decoding. Scenarios where the decoder receives more ground truth or auxiliary information are considered simpler, as this additional information not only simplifies the decoding process by providing clearer guidance and reducing ambiguity, but also helps in avoiding the accumulation of errors during the decoding procedure. In the following subsection, we firstly introduce the dataset and configuration used in the analysis experiments, then we verify our hypothesis from the above three perspectives. 3.1 Dataset and Configuration For the experiments, we select four datasets to cover a range of complexities and linguistic characteristics: IWSLT13 English\u2192French (en\u2192fr), IWSLT14 German\u2192English (de\u2192en), WMT14 English\u2192German (en\u2192de), and IWSLT17 Arabic\u2192English (ar\u2192en). Each dataset offers a unique combination of bilingual sentence pairs and complexity levels: 200k for IWSLT13 en\u2192fr, 153k for IWSLT14 de\u2192en, 4.5M for WMT14 en\u2192de, and 231k for IWSLT17 ar\u2192en. We apply byte-pair encoding (BPE) with subword-nmt toolkit1 to all sentences in these datasets for tokenization. The 1https://github.com/rsennrich/subword-nmt \fTable 2: Impact of text complexity on knowledge distillation across datasets. The \u25b3column represents the difference between token-level and sentence-level BLEU scores. The \u25b3Rate (T) and \u25b3Rate (S) columns represent the percentage decrease in BLEU scores from the original to moderate and high noise levels for token-level and sentence-level respectively. Dataset Stud Size Noise BLEU Score Token Sentence \u25b3 \u25b3Rate (T) \u25b3Rate (S) IWSLT14 de\u2192en 38M Orig 36.09 34.84 1.25 Mod 34.31 33.68 0.63 -4.93% -3.33% High 32.71 33.26 -0.55 -9.37% -4.54% IWSLT13 en\u2192fr 18M Orig 44.56 43.95 0.61 Mod 42.89 42.50 0.39 -3.75% -3.30% High 41.11 42.53 -1.42 -7.74% -3.23% WMT14 en\u2192de 112M Orig 26.73 26.68 0.05 Mod 25.03 25.47 -0.44 -6.36% -4.54% High 24.49 25.35 -0.86 -8.38% -4.99% IWSLT17 ar\u2192en 47M Orig 32.18 31.15 1.03 Mod 30.24 30.15 0.09 -6.03% -3.21% High 27.90 28.23 -0.33 -13.30% -9.37% vocabulary size is 32K. The experiments are conducted using the Fairseq2 framework. 3.2 Impact of Model Size In this subsection, we explore the impact of student model size on the effectiveness of token-level and sentence-level distillation. We adjust the size of the student model following the model size reduction approach in [Zhou et al., 2020] to observe the impact of model size on knowledge distillation across different datasets. The results are shown in Table 1. Analysis of Results and Summary Our comprehensive analysis, as detailed in Table 1, reveals a clear relationship between the student model\u2019s size and the effectiveness of knowledge distillation methods. Across all datasets, we observed a consistent trend: as the model size increases, both token-level and sentence-level distillation methods show improvement in BLEU scores. This improvement is particularly notable in the transition from small to mediumsized models. For instance, in the IWSLT14 de\u2192en dataset, a significant leap in performance is observed when the model size was increased from 3M to 9M parameters. However, beyond a certain threshold, such as 38M parameters in this dataset, the rate of improvement begins to plateau, indicating diminishing returns with further increases in size. Interestingly, a critical point of inversion is observed where the advantage shifts from sentence-level to token-level distillation as the model size increases. In smaller models, sentencelevel distillation tends to outperform token-level, aligning with our hypothesis that it is more suitable for complex scenarios where model size is limited. As the size increases, token-level distillation begins to show a relative advantage, suggesting its effectiveness in simpler scenarios with larger model capacities. This trend suggests that while larger models can benefit from both distillation methods, there is an optimal range 2https://github.com/facebookresearch/fairseq of model size where the gains are most substantial. Beyond this range, the additional complexity of larger models does not translate into proportional improvements in distillation performance. In practical terms, this implies that for scenarios prioritizing model compression, such as deploying NMT systems on resource-constrained devices, sentence-level distillation is more suitable due to its effectiveness in smaller models. Conversely, in scenarios where the focus is on maximizing translation accuracy, such as in server-based applications with fewer computational constraints or competition scenario [Farinha et al., 2022; Blain et al., 2023], token-level distillation becomes increasingly advantageous as model size grows. 3.3 Impact of Text Complexity In this subsection, we investigate the impact of text complexity, reflected by the presence of noise, on token-level and sentencelevel distillation. Using IWSLT14 de\u2192en, IWSLT13 en\u2192fr, WMT14 en\u2192de, and IWSLT17 ar\u2192en datasets, we aim to understand how various levels of noise influence the effectiveness of each distillation approach. Experimental Setup and Methodology To assess the impact of text complexity on knowledge distillation, we introduce varying levels of noise to the datasets. We follow the methodology in [Edunov et al., 2018], applying three conditions to each dataset: no noise, moderate noise, and high noise. We introduce the noise through token manipulation including deletion, substitution, and swapping. Specifically, under moderate noise conditions, we randomly delete and substitute 10% of the tokens and conduct token swapping with a 50% probability, maintaining a swap length of 3. This setup aims to simulate real-world linguistic processing errors and syntactic disarray. For high noise conditions, we keep the token deletion and substitution probabilities unchanged but increase the token swapping probability to 100%, further elevating syntactic complexity. Our implementation \fTable 3: Impact of decoding difficulty on BLEU scores: comparing Beam Search (BS) and Teacher Forcing (TF) methods. \u2018BS-Token\u2019 and \u2018BS-Sentence\u2019 represent BLEU scores using beam search for token-level and sentence-level distillation, respectively. \u2018TF-Token\u2019 and \u2018TF-Sentence\u2019 denote BLEU scores using teacher forcing for token-level and sentence-level distillation. \u25b3BS and \u25b3TF represent the differences in BLEU scores between token-level and sentence-level distillation for beam search and teacher forcing methods, respectively. Dataset Stud Size BLEU Score BS-Token BS-Sentence \u25b3BS TF-Token TF-Sentence \u25b3TF IWSLT14 de\u2192en 3M 30.50 31.09 0.59 34.16 33.50 -0.66 IWSLT13 en\u2192fr 12M 42.42 43.48 1.06 45.97 45.29 -0.68 WMT14 en\u2192de 83M 26.49 26.77 0.28 29.82 28.58 -1.24 IWSLT17 ar\u2192en 47M 32.18 31.15 1.03 32.51 31.60 -0.91 of these manipulations references the methods available in this resource3. In our experiments, the teacher models are Transformer-based, consistent with those in Table 1, using the default sizes in Fairseq [Ott et al., 2019] for each dataset. Our analysis focuses on comparing results under different noise conditions to evaluate the impact of text complexity on distillation effectiveness. The results are shown in Table 2. Analysis of Results and Summary From the results in Table 2, we observe a trend across all datasets: as the text complexity increases, both token-level and sentence-level distillation show a decrease in performance. However, sentence-level distillation demonstrates greater resilience, evidenced by a generally smaller decline in BLEU scores compared to token-level distillation, particularly in high noise scenarios. This is reflected from the lower average \u25b3 Rate (S) across different noise levels, indicating its suitability for handling complex text scenarios. In contrast, token-level distillation exhibits a more significant performance drop with the increased text complexity, as shown by the higher \u25b3Rate (T). In general, when the noise is low, the token-level distillation shows higher accuracy than the sentence-level distillation (negative \u25b3values in Orig noise setting in Table 2). As the noise become higher, student models trained with sentencelevel distillation display a better performance than those with token-level distillation (positive \u25b3values in High noise setting in Table 2). The above phenomenon aligns with our hypothesis that token-level distillation is more effective in simpler scenarios with lower text complexity. These findings highlight the importance of text complexity in the selection of appropriate knowledge distillation methods for NMT. Sentence-level distillation emerges as a robust choice for complex text scenarios, while token-level distillation is preferable in simpler, less complex environments. 3.4 Impact of Decoding Difficulty In this subsection, we examine the relationship between decoding difficulty and the performance of knowledge distillation methods. For decoding methods, we mainly take teacher forcing [Toomarian and Barhen, 1992; Lamb et al., 2016] and 3https://github.com/valentinmace/noisy-text/tree/ e73c83dd1f08c25210c27abebf74d304de0d24e2 beam search [Jaszkiewicz and S\u0142owi\u00b4 nski, 1999] into consideration. Beam search explores multiple hypotheses at each decoding step conditioned on the previous decoding results. Teacher forcing, different with beam search, directly uses the previous target sequence as condition at each step of sequence generation, effectively preventing error amplification during decoding. This method simplifies the decoding process and can lead to improved performance [Baskar et al., 2019], which can be regarded as a simpler scenario in terms of decoding methods compared with the beam search. Experimental Setup and Methodology Experiments are conducted using the same datasets and teacher models as in Tables 1 and 2. The focus of our experiments is to closely examine the performance of token-level distillation and sentence-level distillation under different decoding difficulties (i.e., teacher forcing and beam search methods) on each dataset. Specifically, during the prediction phase, we employ beam search (BS) and teacher forcing (TF) methods. The former method considers the most probable candidates at each step of word generation, selecting one to include in the final sentence output. The latter method inputs the actual previous word into the model, rather than the model\u2019s own prediction from the previous step. Analysis of Results and Summary Table 3 presents a comparison of BLEU scores for both BS and TF methods across token-level and sentence-level distillation. Our results indicate that teacher forcing is more effective at the token-level compared to the sentence-level, as evidenced by the negative values in \u25b3TF across all datasets. This suggests that token-level distillation is better suited for the teacher forcing decoding approach. Conversely, in the more complex beam search scenario, sentence-level distillation tends to outperform token-level distillation, as indicated by the positive values in \u25b3BS. This shift in effectiveness from token-level in TF to sentence-level in BS aligns with our hypothesis that teacher forcing, being a simpler decoding method, is more effective in scenarios where the decoding process is less complex. The token-level distillation benefits from the simplicity of the teacher forcing method, as it allows seeing the correct prefix words during decoding, making the process simpler and thus more effective. \fFigure 1: Architecture of the hybrid distillation method. 3.5 Summary Based on our three comprehensive analyses focusing on model size, text complexity, and decoding difficulty, we have observed that token-level distillation is generally more suitable for scenarios involving larger student models, simpler texts, and greater amounts of available decoding information. In contrast, sentence-level distillation tends to be more effective in scenarios with smaller student models, more complex texts, and limited decoding information. These findings align with our initial hypothesis, suggesting that token-level distillation is better suited for simpler scenarios, while sentence-level distillation is more adept at handling complex situations. 4 Hybrid Method for Combining Token-Level and Sentence-Level Distillation Despite our experimental results validate our hypothesis regarding the effectiveness of token-level and sentence-level distillation in different scenarios, we face the challenge of accurately defining the complexity level of each scenario. This issue complicates the optimal application of distillation methods in neural machine translation (NMT). In response, we propose a hybrid method, which combines token-level and sentence-level distillation through a dynamic gating mechanism. This method is designed to utilize the strengths of both distillation strategies and be adaptable across various scenarios, ranging from \u201csimple\u201d to \u201ccomplex\u201d. 4.1 Hybrid Distillation Method Our hybrid method features a gate-controlled mechanism, dynamically balancing the contributions of token-level and sentence-level distillation. This mechanism, denoted as G and illustrated in Figure 1, is represented by the function g(x) for each input sequence x, modulating the influence of each distillation strategy during training to suit different translation scenarios. The overall loss function, L, is a hybrid of token-level and sentence-level distillation losses, modulated by G. Let x = {x1, . . . , xn} and y = {y1, . . . , ym} respectively represent the input and output (target) sequences. The probabilities Ps(yj | x) and Pt(yj | x) represent the output probabilities at position j for the student and teacher models, respectively. For each input sequence x, the gate-controlled parameter g(x) is defined as: g(x) = 1 1 + e\u2212z(x) (1) where z(x) is a function of the input sequence x, determining the balance between token-level and sentence-level distillation for that particular input. The token-level loss Ltoken-level(x) is defined as: Ltoken-level(x) = \u2212 m X j=1 X yj\u2208V Pt (yj | x) log Ps (yj | x) (2) which sums over all tokens yj in the vocabulary V , weighted by the probability of teacher model Pt(yj | x) and the logarithm of the probability of student model Ps(yj | x). The sentence-level loss Lsentence-level(x) is defined as: Lsentence-level(x) = \u2212log Ps(\u02c6 y | x) (3) which is the negative logarithm of the student model\u2019s probability of the actual output sequence \u02c6 y given by the teacher model. Therefore, the overall loss function L for an input sequence x is given by: L(x) = g(x)\u00b7Ltoken-level(x)+(1\u2212g(x))\u00b7Lsentence-level(x) (4) This formulation allows L(x) to represent the combined loss for a given input sequence x, effectively integrating the tokenlevel and sentence-level distillation losses. By dynamically adjusting the weights of token-level and sentence-level distillation through g(x), our hybrid method adapts to different input sequences, enhancing the effectiveness of model training. 4.2 Implementation Details The training process begins with training a BiBERT teacher model at its base size to generate reference outputs. Subsequently, we implement our hybrid distillation method. This approach allows the model to adaptively switch between tokenlevel and sentence-level strategies, optimizing the most effective learning path throughout the training process. Our experiments are conducted on four NVIDIA 3090 GPUs, each with a batch size of 3000. Gradients accumulate over four iterations per update. The learning rate is set at 5 \u00d7 10\u22124, using the Adam optimizer with an inverse-sqrt learning rate scheduler. For inference, we employ a beam search with a width of 4 and a length penalty of 0.6. 4.3 Baselines In our study, we compared our hybrid distillation approach with several advanced baseline methods in NMT: \u2022 Transformer + R-Drop [Wu et al., 2021]: Utilizes regularization to minimize the bidirectional KL-divergence between sub-models\u2019 outputs. \f\u2022 CipherDAug [Kambhatla et al., 2022]: Employs a novel data augmentation technique based on ROT-k ciphers. \u2022 Cutoff [Shen et al., 2020]: Implements a data augmentation strategy that erases part of the information within an input sentence. \u2022 Cutoff+Knee [Iyer et al., 2023]: Combines Cutoff with an Explore-Exploit learning rate schedule. \u2022 SimCut and Bi-SimCut [Gao et al., 2022]: Enforces consistency between the output distributions of original and cutoff sentence pairs. \u2022 Transformer + R-Drop + Cutoff [Wu et al., 2021]: Integrates R-Drop regularization with Cutoff data augmentation. \u2022 Cutoff + Relaxed Attention + LM [Lohrenz et al., 2023]: Introduces relaxed attention as a regularization technique. \u2022 BiBERT [Xu et al., 2021a]: Utilizes a bilingual pretrained language model for the NMT encoder. 4.4 Experimental Results Table 4: Experimental results on IWSLT14 de\u2192en of baseline methods and our hybrid method. Methods BLEU Transformer + R-Drop [Wu et al., 2021] 37.25 CipherDAug [Kambhatla et al., 2022] 37.53 Cutoff [Shen et al., 2020] 37.60 Cutoff+Knee [Iyer et al., 2023] 37.78 SimCut [Gao et al., 2022] 37.81 Transformer + R-Drop + Cutoff [Wu et al., 2021] 37.90 Cutoff + Relaxed Attention + LM [Lohrenz et al., 2023] 37.96 Bi-SimCut [Gao et al., 2022] 38.37 BiBERT [Xu et al., 2021a] 38.61 Our Hybrid Distillation 39.30 Table 4 shows the translation accuracy (indicated by BLEU score) of our method and baseline methods. The results demonstrate that our hybrid distillation method outperforms all baseline models, achieving a BLEU score of 39.30, which indicates the efficiency of our method in combining token-level and sentence-level distillation strategies. 4.5 Ablation Study The ablation study evaluates the individual impacts of tokenlevel and sentence-level distillation within our hybrid method, aiming to understand their contributions to the overall translation performance. Table 5 presents the results of the ablation study. The individual performances of sentence-level and token-level distillation highlight their respective strengths in enhancing translation quality. The sentence-level method, with a BLEU score of 39.01, demonstrates its capability in capturing the overall semantic coherence, while the token-level method, scoring slightly higher at 39.15, shows its effectiveness in ensuring precise token-level translations. Our hybrid method, achieving a BLEU score of 39.30, surpasses these individual strategies, Table 5: Ablation study results of distillation methods on IWSLT14 de\u2192en. Methods Model Params BLEU Sentence-Level 78M 39.01 Token-level 78M 39.15 Our Hybrid Distillation 78M 39.30 Figure 2: Dynamics of gate value G over training epochs. indicating that the synergistic combination of token-level precision and sentence-level coherence can yield superior results. The results show our hybrid method, which combines tokenlevel and sentence-level distillation, effectively navigates the challenges in scenarios with ambiguous complexity levels, enhancing translation quality in neural machine translation. 4.6 Analysis of Gate-Controlled Mechanism To understand the learning process of the learnable gatecontrolled mechanism G and to verify the effectiveness of this learning method, we present the dynamics of the gate value G over training epochs during our experiments, as shown in Figure 2. We find that at the beginning of the learning process of G, its value is around 0.72. As training progresses (around 20 epochs), the value of G increases to 0.75, with the corresponding BLEU score being 16.68. With further training (around 50 epochs), G gradually rises to 0.85, and the BLEU score significantly improves to 37.23. During this phase, the increase in the value of G is quite apparent, and there is a notable enhancement in the BLEU score. Subsequently (around 100 epochs), G increases to 0.98, and the BLEU score rises to 38.95. At this stage, although G continues to increase, the growth rate of the BLEU score slows down compared to the previous phase. Eventually, the value of G approaches 1, and the BLEU score reaches 39.30. We believe that initially, sentence-level learning is easier, while token-level learning is more challenging. Therefore, the model first learns the simpler aspects, leading to a faster increase in the BLEU score. As the simpler tasks are mastered, the model then moves on to the more difficult token-level learning, resulting in a slower \frate of improvement in the BLEU score. From the results, it is evident that the learnable parameters, by adjusting the size of G, effectively enable the model to autonomously learn knowledge from sentence-level distillation and token-level distillation, demonstrating the effectiveness of our design. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14850v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14850v1",
|
| 3 |
+
"title": "Simple, Efficient and Scalable Structure-aware Adapter Boosts Protein Language Models",
|
| 4 |
+
"abstract": "Fine-tuning Pre-trained protein language models (PLMs) has emerged as a\nprominent strategy for enhancing downstream prediction tasks, often\noutperforming traditional supervised learning approaches. As a widely applied\npowerful technique in natural language processing, employing\nParameter-Efficient Fine-Tuning techniques could potentially enhance the\nperformance of PLMs. However, the direct transfer to life science tasks is\nnon-trivial due to the different training strategies and data forms. To address\nthis gap, we introduce SES-Adapter, a simple, efficient, and scalable adapter\nmethod for enhancing the representation learning of PLMs. SES-Adapter\nincorporates PLM embeddings with structural sequence embeddings to create\nstructure-aware representations. We show that the proposed method is compatible\nwith different PLM architectures and across diverse tasks. Extensive\nevaluations are conducted on 2 types of folding structures with notable quality\ndifferences, 9 state-of-the-art baselines, and 9 benchmark datasets across\ndistinct downstream tasks. Results show that compared to vanilla PLMs,\nSES-Adapter improves downstream task performance by a maximum of 11% and an\naverage of 3%, with significantly accelerated training speed by a maximum of\n1034% and an average of 362%, the convergence rate is also improved by\napproximately 2 times. Moreover, positive optimization is observed even with\nlow-quality predicted structures. The source code for SES-Adapter is available\nat https://github.com/tyang816/SES-Adapter.",
|
| 5 |
+
"authors": "Yang Tan, Mingchen Li, Bingxin Zhou, Bozitao Zhong, Lirong Zheng, Pan Tan, Ziyi Zhou, Huiqun Yu, Guisheng Fan, Liang Hong",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.LG",
|
| 12 |
+
"q-bio.BM"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "Parameter AND Efficient AND Fine AND Tuning",
|
| 16 |
+
"gt": "Fine-tuning Pre-trained protein language models (PLMs) has emerged as a\nprominent strategy for enhancing downstream prediction tasks, often\noutperforming traditional supervised learning approaches. As a widely applied\npowerful technique in natural language processing, employing\nParameter-Efficient Fine-Tuning techniques could potentially enhance the\nperformance of PLMs. However, the direct transfer to life science tasks is\nnon-trivial due to the different training strategies and data forms. To address\nthis gap, we introduce SES-Adapter, a simple, efficient, and scalable adapter\nmethod for enhancing the representation learning of PLMs. SES-Adapter\nincorporates PLM embeddings with structural sequence embeddings to create\nstructure-aware representations. We show that the proposed method is compatible\nwith different PLM architectures and across diverse tasks. Extensive\nevaluations are conducted on 2 types of folding structures with notable quality\ndifferences, 9 state-of-the-art baselines, and 9 benchmark datasets across\ndistinct downstream tasks. Results show that compared to vanilla PLMs,\nSES-Adapter improves downstream task performance by a maximum of 11% and an\naverage of 3%, with significantly accelerated training speed by a maximum of\n1034% and an average of 362%, the convergence rate is also improved by\napproximately 2 times. Moreover, positive optimization is observed even with\nlow-quality predicted structures. The source code for SES-Adapter is available\nat https://github.com/tyang816/SES-Adapter.",
|
| 17 |
+
"main_content": "Introduction Proteins hold significant value in biological research1 and industry applications.2 Understanding proteins and their functions has previously relied heavily on prior knowledge and extensive wet-lab experiments. Although precise, such methods are time-consuming and labor-intensive. With advancements in sequencing technology,3 there now exists a relatively abundant corpus of protein sequences, and applying model architectures from the field of natural language processing (NLP) for self-supervised training4\u20136 become possible, thereby achieving robust representations of protein sequences. These representations enable the utilization of zero-shot or supervised downstream tasks for predicting protein properties. PLMs are fundamentally driven by the quality and quantity of data, allowing for the extraction of evolutionary commonalities and critical information from a vast array of sequences, exemplified by models such as ESM4,7,8 and ProtTrans6 series. They serve as end-to-end approaches to eliminate the need for specialized designs or expert knowledge, facilitating 2 \ftransfer learning to other prediction tasks. Compared to the field of NLP, the corpus of protein sequences is still limited, which in turn restricts the size of PLM parameters. Simply increasing the size of these models may not always be appropriate for the biological domain and can lead to unnecessarily high training costs.5 Often, there is no need to train a large model from scratch for each scenario; instead, we can fine-tune pre-trained model weights with a supervised dataset specific to the target scenario, such as solubility prediction,9,10 protein-protein interaction (PPI) prediction,11,12 and protein localization prediction.13,14 Therefore, exploring how to enhance the representational quality of PLMs and performing efficient, lightweight finetuning to fully unleash their potential becomes extremely valuable. Considering the rapid updates and the numerous versions of PLMs,15 an effective fine-tuning method also needs to be adaptable to various models. Although protein sequence data is of high quality and abundant, the function of a protein is determined by its structure,16 which contains richer and more comprehensible information. Intuitively, incorporating structural information into PLMs should improve the performance across downstream tasks. However, recent studies have indicated that crudely adding structure-aware information does not necessarily yield better results, with some research observing negative optimization in tasks like protein localization.17,18 This might be due to high-quality training data from sequence models paired with errors in predicted structures,19 which can decrease performance when the structure is introduced for training or prediction. Moreover, some studies suggest that introducing noise to mitigate these errors during training with predicted structures can enhance performance.20\u201322 Therefore, when utilizing protein structural information for predictions, it\u2019s important to consider the errors in predicted structures and the robustness of the model, aiming to maximize the use of key structural information while maintaining the original performance of the sequence model and filtering out noise to improve prediction outcomes. Notably, thanks to advances in folding technologies4,23,24 and the availability of open-source databases,25,26 acquiring pro3 \ftein structures has become cost-effective, increasing the feasibility of integrating structural information broadly to aid fine-tuning. In the realm of enhancing model representation through fine-tuning, there are numerous lightweight fine-tuning approaches in NLP, examples include prompt tuning27 and prefix tuning.28 One mainstream approach involves updating the original model\u2019s parameters for fine-tuning, while another adds an external component to the original model for fine-tuning without altering the base model. However, most NLP fine-tuning methods are challenging to apply in the biochemistry field due to the data formation and training strategy, while the bioinformatics domain has limited and relatively rudimentary existing fine-tuning research and most methods consider amino acid sequences only. For instance, PEFT-SP29 uses the PEFT library to directly fine-tune PLMs to improve signal peptide prediction. Another work simply employs LoRA30 for PLMs to enhance downstream task performance.31 Other methods include data augmentation to update original model parameters for performance improvement, such as SESNet,32 which uses unsupervised pseudo-labeling, and FSFP,33 which employs rank learning34 and retrieval to boost protein language model performance on zero-shot mutation prediction tasks. Some work has added graph neural network components to sequence models for downstream tasks, though these do not strictly qualify as fine-tuning methods. For example, ProtSSN35 initializes EGNN36 with sequence models to enhance variant prediction capabilities, MIF-ST37 uses CARP38 language model to boost the inverse folding task capability of graph neural networks, and ESM-GearNet39 enhances downstream task capabilities by combining with ESM2 and GearNet. To address the challenges of the scarcity of efficient fine-tuning methods in the protein field and how to use structural information to optimize PLMs\u2019 representations without degradation, we propose SES-Adapter, a model-agnostic, structure-aware adapter that integrates language model representations with structural sequence representations through cross-modal fusion attention. For the structural sequence representations, we use FoldSeek40 and DSSP41 software to serialize protein structures, and convert the structural sequences into 4 \fdense vectors. This adapter features a straightforward design, rapid convergence, excellent performance, error elimination, and can be extended to any model, addressing deficiencies in enhancing the transfer learning capabilities of protein language models and surpassing most specialized methods designed for specific downstream tasks. To validate the SES-Adapter\u2019s versatility, it was adapted to nine state-of-the-art baselines across the ESM2,4 ProtBert,6 ProtT5,6 and Ankh5 series, and extensively evaluation on nine datasets for tasks including protein localization prediction, solubility prediction, function prediction, and annotation prediction. The experiments demonstrated that the SES-Adapter outperformed vanilla PLMs, with a maximum performance increase of 11% and an average of 3%; training speeds were enhanced by up to 1034% and an average of 362%, with an approximate 2 times improvement in convergence efficiency. Additionally, to confirm that the SES-Adapter\u2019s serialization strategy effectively mitigates potential prediction errors and is insensitive to structural quality, we conducted comparative tests using structures folded by ESMFold4 and AlphaFold2.24 The results showed the performance difference between the two types of structures is up to 0.6%, verifying that this method can effectively overcome structural inaccuracies and avoid the negative optimization issues associated with using predicted or low-quality structures. Materials and Methodology Dataset Our benchmark comprises 9 datasets across 4 tasks, with all proteins folded using ESMFold to obtain their structures. Except for the Solubility prediction task, datasets for other tasks also include structures obtained from AlphaFold2 database,26 as detailed in Table 1. Protein Localization Prediction Predicting the specific intracellular location of proteins can unveil their biological functions, inform disease treatments, and facilitate drug development.42 We utilized both a multi5 \fTable 1: Summary of Benchmarks for downstream tasks. We report mean (standard deviation) pLDDT scores of folded proteins for each dataset. Dataset AF2 pLDDT EF pLDDT # Train # Valid # Test Metrics Localization Prediction DeepLocBinary (DLB) 79.57(12.06) 77.10(14.62) 5, 735 1, 009 1, 728 ACC DeepLocMulti (DLM) 77.34(12.77) 74.88(15.23) 9, 324 1, 658 2, 742 ACC Solubility Prediction DeepSol (DS) 79.59(13.36) 62, 478 6, 942 2, 001 ACC DeepSoluE (DSE) 80.68(12.79) 10, 290 1, 143 3, 100 ACC Function Prediction MetalIonBinding (MIB) 92.36(6.43) 83.66(8.73) 5, 068 662 665 ACC Thermostability (Thermo) 79.02(12.26) 74.60(13.82) 5, 056 639 1336 Spearman\u2019s \u03c1 Annoation Prediction GO-MF (MF) 91.77(6.68) 82.84(9.68) 22, 081 2, 432 3, 350 Fmax GO-BP (BP) 91.35(7.06) 82.00(10.65) 20, 947 2, 334 3, 350 Fmax GO-CC (CC) 90.07(8.05) 79.57(11.61) 9, 552 1, 092 3, 350 Fmax class and a binary-class dataset from DeepLoc,43 with a deduplication process that removed 30% of sequence similarities. DeepLocBinary (DLB) aims to ascertain whether a protein is a membrane-bound protein, for which we divided a new training/validation at a random 4:1 ratio within the training dataset. The DeepLocMulti (DLM) dataset encompasses 10 potential locations; proteins situated in the lamina, chromosome, or nucleus speckle, for example, are predicted to be in the \u201cNucleus\u201d. The division of the dataset is taken from LAProtT5.13 Protein Solubility Prediction Protein solubility is a prerequisite for expression, while solubility defects can lead to protein aggregation, thereby affecting protein bioactivity, hindering protein-based drug development, and causing a variety of diseases.44 We used two binary-class datasets, derived from DeepSol (DS)45 and DeepSoluE (DSE),46 respectively. The division of the training/validation sets and test sets remains unchanged, except for the exclusion of proteins that could not be folded using ESMFold. 6 \fProtein Function Prediction The functionality of proteins encompasses numerous aspects. To streamline our study, we employed two datasets: MetalIonBinding (MIB) and Thermostability (Thermo), which are focused on binary classification and regression fitness predictions, respectively. The MetalIonBinding task aims to predict the existence of metal ion-binding sites in proteins, with the dataset sourced from Revisiting-PLMs.47 Additionally, for the Thermostability task, we utilize the \u201cHuman-cell\u201d split from FLIP,48 implementing min-max normalization on the labels. Protein Annotation Prediction The transfer learning of protein function annotation can assist in identifying the functions of unknown proteins, reducing the cost of experimental trial and error and enhancing efficiency.49 Our dataset is derived from Gene Ontology (GO) terms prediction, where the GO benchmark comprises three branches: Molecular Function (MF), Biological Process (BP), and Cellular Component (CC). The dataset and its divisions are sourced from DeepFRI,50 used for predicting multi-label multi-class protein annotation information. SES-Adapter Architecture SES-Adapter architecture is depicted in Figure 1 and consists of three main steps, encoding stage, feature fusion, and label prediction. During the encoding stage, a PLM encodes amino acid sequences into semantic vectors. The protein structure is then processed using FoldSeek and DSSP to generate local structural sequences and secondary structural sequences, respectively, which are subsequently projected to create two structure-aware vectors. In the feature fusion stage, embeddings from the PLMs are combined with these two types of structural embeddings using a cross-modal multi-head attention mechanism with rotary positional encoding (RoPE)51 to integrate both local interaction and overall structural information. It\u2019s important to note that the inclusion of these two structural components is optional, and one 7 \fFigure 1: Architecture of SES-Adapter. Amino acid sequences are inputted into a PLM and protein structures are serialized using FoldSeek and DSSP, then projected to obtain embeddings. When using the full SES-Adapter, initial cross-modal attention is performed with the FoldSeek sequence, and the representation obtained is then subjected to another cross-modal attention with the DSSP sequence. The final embeddings are fed into a classification head for predicting downstream tasks. These two components are optional; when both are omitted, the setup defaults to a vanilla PLM. may choose to utilize only one type of structural sequence. Finally, in the prediction stage, the structure-informed vectors are pooled and fed into a classification head for downstream task prediction. Embedding Generation For a given protein sequence, input into a PLM yields an output from the last layer that serves as a representation vector of dimensions l \u00d7 d, where l represents the sequence length and d is the hidden variable dimension number of the PLM. For instance, processing a sequence of 200 amino acids with ESM2-650M results in a 200 \u00d7 1280 vector. The PLM is frozen during downstream task training, meaning its gradients do not update. For protein structures, 20-dimensional 3Di token sequences and 8-dimensional secondary structure sequences are generated using FoldSeek and DSSP, respectively. Since the alphabets for structural sequences overlap with those of amino acid sequences, we directly use the amino acid vocabulary to tokenize these sequences into one-hot vectors, which are then fed into an embedding layer to produce local interaction and global structure embeddings. These 8 \fembeddings are shaped l \u00d7 d maintaining consistency with the PLM\u2019s output dimensions. Multi-Head Cross Modality Attention In the feature fusion stage, we employed a refined cross-modal multi-head attention method, drawing inspiration from ESM2\u2019s approach of using RoPE in place of traditional relative position encoding. During cross-modal interaction, PLM embeddings serve as both key and value, while structural embeddings function as the query. Since the key and value representations originate from the same source, we simply pass the query and key through RoPE before calculating the attention scores. The amino acid or structural token embedding SN can be denoted as EN = {xi}N i=1, where xi \u2208Rd is a d-dimensional word embedding vector of token wi at position i but without positional information. xm is structural embedding vector and xn is PLM embedding vector, and m and n are their absolute positions. Qm = fq(xm, m), Kn = fk(xn, n), (1) The function f projects the word embedding and its position into Qm and Kn, respectively. The RoPE function applies a rotational transformation to each pair of dimensions from the input vectors xm and xn based on a rotation angle \u03b8 that is dependent on the relative positional difference m \u2212n. \u27e8fq(xm, m), fk(xn, n)\u27e9= RoPE(xm, xn, m \u2212n). (2) RoPE(xm, xn, m \u2212n) = d/2\u22121 X i=0 (cos(\u03b8)x2i,mx2i,n + sin(\u03b8)x2i,mx2i+1,n \u2212sin(\u03b8)x2i+1,mx2i,n + cos(\u03b8)x2i+1,mx2i+1,n) (3) where \u03b8 = m\u2212n 100002i/d is the rotation angle computed based on the relative position m \u2212n, dimension index i and dimension number d. x2i,{m,n} and x2i+1,{m,n} are the components of 9 \fvector x{m,n} at dimensions 2i and 2i + 1, respectively. Then the whole sequence query, key representation termed Q, K with positional information, and value representation V will be fed into the scale attention machine. Attention(Q, K, V ) = softmax \u0012QK\u22ba \u221a d \u0013 V (4) Partitioning the attention mechanism into multiple heads, thereby generating several subspaces, enables the model to attend to diverse facets of the information. MultiHead(Q, K, V ) = Concat(head1, ..., headn)W O (5) where headi = Attention(Qi, Ki, V i) and i indicates the ith attention head, W O is a linear projection matrix. The final mapped structure-aware representations can then be used for predicting downstream tasks. Classification Head and Training Objective It\u2019s worth noting that we use the classical mean pooling classification head in our comparisons. Two layers of linear projection with a dropout layer and GeLU activation function are used. For the classification tasks, we utilize Cross-Entropy as the loss function. For regression tasks, such as Thermostability, we employ Mean-Squared-Error. Experimental Setups Training Setups We used the AdamW52 optimizer with a learning rate set at 0.0005, a weight decay of 0.01, and a dropout rate of 0.1 for the output layer. To ensure stable training costs and avoid issues such as memory explosion, we adopted a dynamic batching approach, filling each batch up to 60, 000 tokens to ensure n \u00d7 l \u226460, 000, where n is the number of sequences 10 \fand l is the max length of sequences at the current batch. Due to differences in data volume and training efficiency, we applied different early stop settings for different tasks. For the Solubility Prediction task, the maximum training epoch was set to 10 with a patience of 3. The Annotation Prediction task had a maximum training epoch of 50 with a patience of 5. For the remaining tasks, the maximum epoch was set to 15 with a patience of 5. The monitor for early stopping for all tasks is based on validation metrics, such as accuracy (ACC) for DeepLocBinary. All experiments and protein folding with ESMFold were conducted on eight 80GB-VRAM A800 GPUs. Evaluation Metrics Some evaluation metrics are reported in our experiments to evaluate the performance of different models, including accuracy (ACC), maximum F1-Score (Fmax), Matthew\u2019s correlation coefficient (MCC), and Spearman\u2019s \u03c1, all the computation metrics are derived from the TorchMetrics library,53 except the Fmax is from TorchDrug.54 Their calculation equations are as follows: ACC = TN + TP TN + TP + FN + FP (6) F1 = 2 \u00d7 TP 2 \u00d7 TP + FP + FN (7) MCC = TP \u00b7 TN \u2212FP \u00b7 FN p (TP + FN) \u00b7 (TP + FP) \u00b7 (TN + FN) \u00b7 (TN + FP) (8) \u03c1 = 1 \u2212 6 P d2 i n(n2 \u22121) (9) where TP, TN, FP, and FN represent the numbers of true positives, true negatives, false positives, and false negatives, respectively. The Fmax metric is a measure of model performance that seeks the optimal threshold to maximize F1 scores. 11 \fResults and Analysis SES-Adapter Improves Performance Across Diverse Tasks Table 2: PLM description. Type Model Version Params Embed. Dim Encoder-Only ESM2 t30 150M 640 t33 652M 1,280 t36 3,000M 2,560 ProtBert uniref 420M 1,024 bfd 420M 1,024 Encoder-Decoder ProtT5 xl uniref 3,000M 1,024 xl bfd 3,000M 1,024 Ankh base 450M 768 large 1,150M 1,536 We evaluate the efficacy of incorporating structural information using nine different language models with varying parameter sizes and training data across nine different datasets. The baseline models include ESM2, ProtBert, ProtT5, and Ankh series. The first two types of models employ an encoder-only architecture, while the latter two feature a complete encoder-decoder structure, using T5 architecture55 and an asymmetric Transformer, respectively. However, we only utilized the outputs from their encoders as PLM embeddings. Details on the specific PLMs used can be found in Table 2, the PLM embedding dimension determines the trainable parameters of the SES-Adapter. The implementation of PLMs is shown in Table S1. Given that datasets for annotation prediction converge slowly and incur high training costs, we did not conduct tests on baseline models with 3 billion parameters for MF, BP, and CC. In Table 3, the scores for SES-Adapter are derived from using datasets from AlphaFold2 and ESMFold, as well as from scenarios using FoldSeek and DSSP separately, and simultaneously using both structural information, averaging six scores. However, for the Solubility dataset, only ESMFold structures are available, so the average is based on three scores. Table 3 shows that after incorporating structure-based fine-tuning, performance improved 12 \fTable 3: Average performance under different settings of SES-Adapter across nine PLMs and nine datasets. \u201cSES.\u201d indicates the usage of either SES-Adapter or the vanilla PLM. Model Version SES. Localization Solubility Function Annotation DLB DLM DS DSE MIB Thermo MF BP CC ACC ACC ACC ACC ACC Sp. \u03c1 Fmax Fmax Fmax ESM2 t30 \u2717 91.2 77.02 63.37 55.12 68.57 67.69 56.44 41.21 48.11 \u2713 93.23 79.52 74.29 55.20 72.23 69.24 61.68 44.25 50.88 t33 \u2717 91.84 81.33 63.17 55.97 67.97 67.31 60.80 45.46 51.23 \u2713 93.32 82.35 71.57 56.15 71.33 69.47 62.32 46.26 52.75 t36 \u2717 90.57 80.82 64.17 54.58 70.24 68.53 \u2713 93.33 82.57 70.88 54.75 71.61 68.96 ProtBert uniref \u2717 87.09 74.14 63.02 54.24 64.96 65.35 46.75 38.24 49.89 \u2713 91.50 75.17 72.28 54.65 68.45 65.60 52.79 39.16 51.31 bfd \u2717 89.01 75.2 64.32 54.97 65.41 65.28 46.59 38.94 50.05 \u2713 92.11 77.23 73.69 55.90 69.75 66.14 57.67 41.33 51.15 ProtT5 xl uniref \u2717 92.25 82.02 67.07 55.03 75.24 68.36 \u2713 93.31 83.66 73.84 55.43 75.97 69.08 xl bfd \u2717 91.72 78.88 66.17 55.32 73.14 67.29 \u2713 92.72 79.93 72.98 55.57 73.86 67.99 Ankh base \u2717 89.76 78.48 62.57 55.15 72.64 68.33 57.34 42.23 50.85 \u2713 93.33 81.01 72.53 55.36 73.00 69.47 65.06 47.47 52.20 large \u2717 89.93 78.81 63.72 54.25 73.84 67.52 55.64 41.72 52.77 \u2713 93.32 83.40 72.84 54.94 76.57 68.87 64.61 46.96 53.68 13 \fTable 4: Experimental comparison with two types of fine-tuning strategy on ProtBert and ESM-1b. Model Params Strategy DeepLocBinary DeepLocMulti DeepSol ESM-1b 1.64M/652M Seq-Tuning 91.61 79.94 67.02 652M/652M Seq-Tuning 92.4 78.13 70.23 14.82M/652M SES-Adapter 92.48 82.64 71.21 ProtBert 1.05M/420M Seq-Tuning 87.09 74.14 59.17 420M/420M Seq-Tuning 91.32 76.53 68.15 9.50M/420M SES-Adapter 92.42 77.72 72.96 across each dataset compared to using just sequence information. Interestingly, a notable bifurcation was observed in solubility prediction; the DeepSol dataset showed significant improvements, in some cases up to 10%, while the gains on the DeepSoluE dataset were minimal, about 1%, possibly due to the size difference\u2014DeepSol\u2019s training set is six times larger than DeepSoluE\u2019s. For the Localization prediction task, improvements ranged between 1% and 3%; for the function prediction task, the gains were more pronounced, between 2% and 5%. As for the annotation prediction task, the improvements for GO-CC were between 1% and 3%, while GO-MF and GO-BP exhibited wider fluctuations, ranging from 1% to 11% and 1% to 5% respectively. The main reason for this variation is the choice of PLM, with some models that have weaker representational capabilities for these tasks showing more significant improvements when supplemented with SES-Adapter. In addition, we also conduct a comparison of three fine-tuning methods: the first involves freezing the language model and fine-tuning the classification head using only the sequence; the second adjusts all parameters of both the language model and the classification head using sequence information. The first two methods are thus named Seq-Tuning because they solely utilize sequence information. The third method, which we propose, is structural fine-tuning. It freezes the language model and fine-tunes the cross-modal attention head using structural sequences. As can be seen in Table 4, under the same PLM, dataset, and hyperparameter settings, the SES-Adapter, with only a modest increase in training parameters, significantly outperforms the comprehensive fine-tuning methods. 14 \fTable 5: Experimental comparison with hybrid model. Hybrid Model Thermostability MetalIonBinding GO DeepLoc MF BP CC Multi Binary Spearman\u2019s \u03c1 ACC (%) Fmax Fmax Fmax ACC (%) ACC (%) MIF-ST 0.694 75.54 0.627 0.239 0.248 78.96 91.76 ESM-GearNet 0.651 74.11 0.67 0.372 0.424 82.3 92.94 SaProt-GearNet 0.66 74.44 0.672 0.381 0.435 84.16 93.63 SES-Adapter 0.704 78.35 0.662 0.489 0.548 84.54 93.92 Performance Comparison with Deep Learning Methods To validate the superiority of SES-Adapter, we conducted comparisons with three of the most distinguished sequence-structure hybrid models\u2014MIF-ST,37 ESM-GearNet,39 and SaProtGearNet56\u2014across seven datasets in Thermostability, MetalIonBinding, GO, and DeepLoc. The baseline scores were derived from the structure-aware language model SaProt.56 The performance score for PLM with SES-Adapter is selected based on the best scores obtained under six different settings and nine baseline models for each downstream task. As shown in Table 5, the PLM equipped with SES-Adapter outperforms these three more complex SOTA hybrid models on most tasks without the need for extensive hyperparameter search. Notably, improvements were significant in MetalIonBinding, BP, and CC, with increases of 3%, 11%, and 11% respectively. Additionally, we compared the performance of the SES-Adapter, leveraging ESM2650M, against non-pretrained methods across three membrane-related datasets. The baseline methods included Moran,57 DDE,58 ResNet,59 Transformer,59 CNN,60 and LSTM,59 with scores derived from PEER\u2019s experimental results.61 As depicted in Table 6, integrating pre-trained models with the SES-Adapter significantly improved performance compared to models trained from scratch on downstream tasks (non-pretrained methods). Notably, there was an increase of 5.8% on DeepLocBinary, 1.9% on DeepLocMulti, and 5.3% on DeepSol. 15 \fTable 6: Experimental comparison with non-pre-training method. Model DeepLocBinary DeepLocMulti DeepSol Moran 55.63 33.13 57.73 DDE 77.43 49.17 59.77 ResNet 78.99 52.3 67.33 Transformer 75.74 56.02 70.12 CNN 82.67 82.67 64.43 LSTM 88.11 62.98 70.18 SES-Adapter 93.92 84.54 75.46 Table 7: Train loss comparison with vanilla PLM on half-train steps of ESM2-150M. We report mean (std) for each dataset. Dataset Vanilla PLM SES-Adapter Speed Difference (%) DeepLocBinary 0.2491 0.0680(0.0053) 366.4 DeepLocMulti 0.6972 0.1842(0.0479) 378.5 DeepSol 0.5708 0.3430(0.0239) 166.4 DeepSoluE 0.5740 0.4582(0.0088) 125.3 MetalIonBinding 0.5629 0.2322(0.0209) 242.4 Thermotsatbility 0.0251 0.0127(0.0007) 197.9 GO-MF 0.0231 0.0022(0.0005) 1033.7 GO-BP 0.0279 0.0090(0.0009) 308.4 GO-CC 0.0429 0.0099(0.0019) 434.9 Training and Convergence Efficiency Analysis To demonstrate the efficiency and rapid convergence of the SES-Adapter, we used ESM2150M as an example to analyze the training progress. Figure 2 and Figure 3 illustrate the differences in training loss reduction and changes in validation set metrics between sessions using the SES-Adapter and those not using it. \u201cVanilla\u201d refers to sequence fine-tuning only using PLMs. \u201cFS\u201d stands for the Foldseek sequence, \u201cSS\u201d for the DSSP sequence, \u201cAF2\u201d denotes the SES-Adapter with AlphaFold2 predicted structures, and \u201cEF\u201d signifies the SESAdapter with ESMFold predicted structures. Figure 2 shows that the SES-Adapter enhances training efficiency across all downstream tasks, rapidly reducing training loss to very low levels compared to vanilla PLMs. For a more detailed assessment of training efficiency, using half of the training steps of vanilla PLM as a baseline, Table 7 reveals that training speed 16 \fFigure 2: Training loss curve on downstream tasks of ESM2-150M. Figure 3: Valid metric curve on downstream tasks of ESM2-150M. 17 \fincreased by up to 1033.7%, with the lowest at 125.3%, and an average improvement of 361.5% with the use of SES-Adapter. Figure 2 also shows that some configurations using SES-Adapter achieved early convergence, as we adopted validation metrics as a monitor for early stopping, resulting in an approximate 2 times increase in convergence efficiency. Furthermore, Figure 3 clearly demonstrates that validation metrics for the SES-Adapter method are consistently and significantly higher than those for vanilla PLMs across all downstream tasks. It is noteworthy that all these curves were plotted and analyzed under the same experimental conditions. Since the SES-Adapter introduces additional parameters compared to the vanilla PLM, merely comparing the loss at the same number of training steps may not fairly reflect the time cost. Therefore, we conducted repeated runs of the DeepLocBinary and DeepLocMulti datasets on a server without any additional jobs to calculate the time expense per step. On DeepLocBinary, the average was 2.42 seconds per iteration for the vanilla PLM and 2.53 seconds per iteration for the SES-Adapter; on DeepLocMulti, the averages were 2.49 seconds per iteration for the vanilla PLM and 2.64 seconds per iteration for the SES-Adapter. The training time expenses increased by 4.5% and 6% respectively for these datasets, which is relatively minor and tolerable compared to the training efficiency improvements detailed in Table 7. Ablation Study on Components of SES-Adapter To validate the contribution of each component designed within the SES-Adapter, we conducted five sets of ablation experiments on three datasets: DeepLocBinary, DeepLocMulti, and DeepSol. The variations included removing the FoldSeek sequence, omitting the DSSP sequence, excluding the RoPE, removing both FoldSeek and DSSP sequences, and utilizing all three components. As shown in Table 8, each component positively contributes to the downstream tasks across the displayed datasets. Performance on downstream tasks was nearly identical when only one type of structural sequence was used. However, omitting 18 \fTable 8: Ablation study on ESM2-650M with different SES-Adapter settings. FoldSeek DSSP RoPE DeepLocBinary DeepLocMulti DeepSol AF2 EF AF2 EF EF \u2717 \u2713 \u2713 93.00 93.35 82.09 82.24 74.21 \u2713 \u2717 \u2713 93.87 93.32 82.42 82.31 74.13 \u2713 \u2713 \u2717 92.87 92.52 82.46 82.02 73.61 \u2717 \u2717 \u2713 91.84 91.84 81.31 81.31 63.17 \u2713 \u2713 \u2713 93.9 93.75 83.41 83.03 74.76 Figure 4: (a) Average performance of AlphaFold2 and ESMFold on downstream tasks. (b) Average performance of different SES-Adapter settings on downstream tasks. structural sequences altogether led to a significant decline in performance, with a nearly 10% drop on the DeepSol dataset and a 2% decrease on other datasets, highlighting the SES-Adapter\u2019s ability to efficiently and seamlessly integrate structural information. Compared to the contribution of structural sequences, the contribution from RoPE was relatively minor, fluctuating around 1%, but it is still evident that position encoding is essential. A more detailed results can be found in Table S2-S10. AlphaFold2 and ESMFold Structure Robustness Testing Different protein folding methods yield structures of varying quality. We aimed to determine whether using serialized structures could mitigate potential errors caused by low-quality structures. According to Table 1, the pLDDT score differences between two structures are minimal for the DeepLocBinary, DeepLocMulti, and Thermostability datasets, whereas the MetalIonBinding, GO-MF, GO-BP, and GO-CC datasets show pLDDT score differences 19 \fgreater than 10 between the two structures. Figure 4 (a) presents the average scores across nine models and three SES-Adapter settings, using both structures across various datasets. It is observed that the quality of the structure has virtually no impact on the performance of downstream tasks, with the maximum difference being 0.6% and the minimum difference being 0.07%. This confirms that the SES-Adapter has excellent robustness to the protein structure quality. Importance of FoldSeek and DSSP Structural Sequences The interaction attention between structural sequences and amino acid sequences is a highlight of the SES-Adapter, and it is crucial to determine which types of structural information most significantly enhance the quality of PLM embeddings and assist in improving downstream tasks. Figure 4 (b) shows the average scores across nine models and two structures under various SES-Adapter configurations, where DeepSol and DeepSoluE represent the average scores for the nine models using ESMFold structures. From Figure 4 (b), it can be observed that the optimization varies for different tasks. For example, using both FoldSeek and DSSP sequences together yields the best results in the MetalIonBinding task, but performs moderately in the three branches of the GO dataset. Overall, using both types of information achieved the best results in four datasets, using just the FoldSeek sequence was optimal in three datasets, and using the DSSP sequence was best in two datasets. Therefore, incorporating diverse structural information generally provides a beneficial gain for downstream tasks."
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14951v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14951v1",
|
| 3 |
+
"title": "Streamlining the Image Stitching Pipeline: Integrating Fusion and Rectangling into a Unified Model",
|
| 4 |
+
"abstract": "Learning-based image stitching techniques typically involve three distinct\nstages: registration, fusion, and rectangling. These stages are often performed\nsequentially, each trained independently, leading to potential cascading error\npropagation and complex parameter tuning challenges. In rethinking the\nmathematical modeling of the fusion and rectangling stages, we discovered that\nthese processes can be effectively combined into a single, variety-intensity\ninpainting problem. Therefore, we propose the Simple and Robust Stitcher\n(SRStitcher), an efficient training-free image stitching method that merges the\nfusion and rectangling stages into a unified model. By employing the weighted\nmask and large-scale generative model, SRStitcher can solve the fusion and\nrectangling problems in a single inference, without additional training or\nfine-tuning of other models. Our method not only simplifies the stitching\npipeline but also enhances fault tolerance towards misregistration errors.\nExtensive experiments demonstrate that SRStitcher outperforms state-of-the-art\n(SOTA) methods in both quantitative assessments and qualitative evaluations.\nThe code is released at https://github.com/yayoyo66/SRStitcher",
|
| 5 |
+
"authors": "Ziqi Xie",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Parameter AND Efficient AND Fine AND Tuning",
|
| 14 |
+
"gt": "Learning-based image stitching techniques typically involve three distinct\nstages: registration, fusion, and rectangling. These stages are often performed\nsequentially, each trained independently, leading to potential cascading error\npropagation and complex parameter tuning challenges. In rethinking the\nmathematical modeling of the fusion and rectangling stages, we discovered that\nthese processes can be effectively combined into a single, variety-intensity\ninpainting problem. Therefore, we propose the Simple and Robust Stitcher\n(SRStitcher), an efficient training-free image stitching method that merges the\nfusion and rectangling stages into a unified model. By employing the weighted\nmask and large-scale generative model, SRStitcher can solve the fusion and\nrectangling problems in a single inference, without additional training or\nfine-tuning of other models. Our method not only simplifies the stitching\npipeline but also enhances fault tolerance towards misregistration errors.\nExtensive experiments demonstrate that SRStitcher outperforms state-of-the-art\n(SOTA) methods in both quantitative assessments and qualitative evaluations.\nThe code is released at https://github.com/yayoyo66/SRStitcher",
|
| 15 |
+
"main_content": "Introduction Image stitching is a fundamental problem in computer vision, which aims to obtain a larger field of view by merging multiple overlapping images. Typically, the image stitching pipeline comprises three distinct stages, as depicted in Figure 1(a)): \u2022 Registration stage: This stage involves estimating warping matrices, such as homography, between input images and aligning these images based on the estimated results. \u2022 Fusion stage: Subsequently, this stage merges the aligned images into a single fusion image. \u2022 Rectangling stage: Finally, this stage transforms the irregularly shaped stitched image into a standard rectangular format. Annoyingly, the sequential dependency of these stages introduces a significant limitation: next stage cannot start until the previous stage is totally completed. This cascading structure not only increases the likelihood of error propagation through the stages but also complicates the optimization of parameters, presenting substantial challenges in both the training and application of the image stitching pipeline. Additionally, there are also some inherent issues in current stitching pipeline: Fusion Stage Issues: the two current mainstream methods, reconstruction-basedNie et al. [2021] and seam-basedCheng et al. [2023], are prone to notable inaccuracies when dealing with misregistration errors between aligned images. These errors are evident in Figure 1(b), where even subtle misalignments can lead to noticeable errors in the stitched output, undermining the visual integrity of the resulting image. Rectangling Stage Issues: Current methods are mainly mesh-based[Nie et al., 2022], which can introduce global pixel position distortions. This often results in notable image distortions, particularly in challenging scenarios. As illustrated in Figure 1(c), when comparing images pre and post-rectangling, a marked misalignment is observed. For example, a red line drawn between two points on the input image can not align with the corresponding points on the rectangling image, indicating a shift in the target point (the roof line is not aligned). This issue is critical as stitched images are often used for subsequent high-level vision tasks, where such subtle inter-pixel shifts can detrimentally affect the results of those tasks. Given the above limitations observed in current stitching methods, particularly in terms of cascading errors and inefficiencies in the fusion and rectangling stages, we have reconsidered the underlying structure of the image stitching pipeline. Previous image stitching works[Nie et al., 2020a, 2021, 2022, 2023] typically address fusion and rectangling as distinct processes. However, our comprehensive analysis raises a critical question: Are these really separate challenges? The primary objective of the fusion stage is to seamlessly integrate aligned images, specifically targeting and modifying discrepancies at their overlap. Conversely, the rectangling stage aims to transform an irregularly shaped composite into a regular rectangle, essentially filling in the missing image area. On closer inspection, both tasks\u2014modifying and filling\u2014can fundamentally be perceived as variations of an inpainting problem (refer to 7.2 for a detailed proof). While fusion requires adjusting the original image information in the overlapping areas, rectangling focuses on aesthetic consistency and coherence with adjacent areas. 2 \farXiv Template A PREPRINT This insight led us to propose a novel paradigm: a unified inpainting-based approach that addresses both fusion and rectangling simultaneously. We introduce SRStitcher, which simplifies the complex image stitching pipeline into a more elegant implementation. Our method demonstrates exceptional error tolerance, ensuring robust results even with less-than-ideal registration of images. Additionally, SRStitcher effectively addresses the issue of global pixel displacement inherent in previous rectangling methods, by selectively modifying and filling parts of the image without extensive pixel shifts. The contributions of this paper are summarized as follows: \u2022 We re-think the fusion and rectangling tasks of existing image stitching pipelines. Through theoretical analysis, we demonstrate that both can be effectively addressed as a unified inpainting problem, leading to a more streamlined and robust pipeline. \u2022 By using a pre-trained large-scale model, SRStitcher innovatively tackles both fusion and rectangling simultaneously. This method leverages the model\u2019s strong generalization capabilities, utilizing weighted masks to guide the inpainting process across different image regions. Our method significantly reduces training time and hardware requirements, eliminating the need for model training or fine-tuning. \u2022 We conduct extensive experiments on public dataset, employing state-of-the-art metrics including no-reference image quality assessment and user study to evaluate SRStitcher\u2019s performance. 2 Related Work The image stitching pipeline can be divided into three stages, and the related works are described based on each stage. 2.1 Image Registration Early image registration works[Zoghlami et al., 1997, Capel and Zisserman, 1998, McLauchlan and Jaenicke, 2002] are limited by the feature extraction method, which often falter under conditions of rotation, scaling, and illumination changes. To solve the scale changes problem, AutoStitch[Brown and Lowe, 2007] marked a significant advancement by incorporating the Scale-invariant Feature Transform (SIFT) to extract scale-invariant features, but this mehtod is difficult to apply to the situation with multiple depth layers. To specifically address multi-depth layers conditon, DHW[Gao et al., 2011] proposed a model that assumes the presence of two distinct planes within the image, applying different homography adjustments to each. However, the performance of this method can be severely impacted by the dynamics of camera movement. More recently, NIS[Liao and Li, 2023] introduced depth map integration to enhance registration accuracy. However, this method relies on accurate estimation of depth maps, which presents its own set of implementation challenges. Yu et al.[Yu et al., 2023] developed a technique using the Epipolar Displacement Field, aimed at improving registration in scenes with significant parallax. Feature-based methods have traditionally been the cornerstone of image registration techniques. However, these methods often underperform in environments without sufficient geometric structure or in low-texture scenarios where traditional feature detection techniques are prone to failure. In recent years, the advent of deep learning has revolutionized the field of image registration by enabling the extraction of rich semantic features through deep neural networks. Hoang et al.[Hoang et al., 2020] and Shi et al.[Shi et al., 2020] both pioneered the use of Convolutional Neural Networks (CNNs) to enhance feature representations in image stitching registration. Despite their progress, these approaches primarily used deep learning for feature enhancement rather than creating a holistic learning-based framework. VFISNet[Nie et al., 2020b] is the first complete learning-based framework for image stitching, but it is limited by its inability to handle images of arbitrary resolutions. EPISNet[Nie et al., 2020a] is improved on VFISNet by introducing a flexible mechanism that supports the input of any image size through scalable image and homography adjustments. HomoGAN[Hong et al., 2022] introduces a method based on the Generative Adversarial Network(GAN) to enhance the quality of homography estimations, representing a novel application of GANs in this field. Jiang et al.[Jiang et al., 2023a] integrates graph convolutional networks into the image stitching framework to boost the precision of multi-spectral image registration. LBHomo[Jiang et al., 2023b] introduces a semi-supervised approach to estimate homography more accurately in large-baseline scenes by sequentially multiplying multiple intermediate homographies. RHWF[Cao et al., 2023] introduces homography guided image warping and Focus transformer into the recursive homography estimation framework to further refine homography estimation accuracy. 2.2 Image Fusion The earliest fusion method is weighted fusion[Andrew, 2001], which requires high registration accuracy. If registration is imperfect or there is a color mismatch between the images, visible seams may appear, which can degrade image quality. APAP[Zaragoza et al., 2013] introduces a smoothly varying projection field to enhance fusion accuracy. However, 3 \farXiv Template A PREPRINT APAP tends to introduce severe perspective distortions in non-overlapping areas, limiting its applicability. Inspired by interactive digital photomontage[Agarwala et al., 2004], Gao et al.[Gao et al., 2013] proposed the seam-based fusion method, which involves a seam prediction stage to identify optimal seam lines between overlapping images. BAlthough effective, it is notably time-consuming. Therefore, SEAGULL[Lin et al., 2016] proposes to improve the previous seam-based methods by using estimated seams to guide local alignment optimization, enhancing seam quality and reducing processing time. However, it struggles with repetitive textures, where it still shows poor performance. The aforementioned methods are all traditional fusion methods, characterized by limited versatility and difficulty in adapting to complex scenarios. In order to solve the defects of traditional solutions, UDIS[Nie et al., 2021] proposed a reconstruction-based model to improve the quality of the fused image. Despite its advances, this method sometimes produces artifacts and strange blurs in overlapping areas. Inspiration from traditional seam-based approaches, UDS++[Nie et al., 2023] and DseamCheng et al. [2023] both use deep learning to refine the seam finding process. These models offer more robust and flexible solutions, significantly improving the ability to handle complex stitching scenarios. 2.2.1 Image Rectangling Image rectangling is a relatively new area of computer vision with limited research to date. Prior to the advent of deep learning in this domain, traditional solutions such as those proposed by He et al.[He et al., 2013] and Li et al.[Li et al., 2015] used mesh-based warping techniques to address missing areas in images. DeepRectangling[Nie et al., 2022] represents the first deep learning-based approach in image rectangling, accompanied by a baseline and a public dataset tailored for this specific task. The method continues to rely on mesh-based warping but incorporates learning algorithms to enhance the fill quality and handle complex scenarios more effectively. While these methods are groundbreaking, they often change the global relative pixel positions, which could lead to suboptimal results, especially in cases with large missing areas, resulting in incomplete fills. A more recent method RecDiffusion[Zhou et al., 2024] that employs a diffusion model to better solve the problem of rectangling. Although this method provides a sophisticated solution for achieving rectangularity, it is complex in design, requires long inference times, and requires significant computational resources for training, which limits its practical applicability. 3 Method The architecture of StitchDiffer is depicted in Figure 1(d), which integrates the tasks of fusion and rectangling into a unified challenge of composite image inpainting. The StitchDiffer pipeline accepts as input two images with overlapping regions, designated as Il(x, y) and Ir(x, y), where x and y represent the pixel coordinates. The specific design details are introduced below. 3.1 Registration The registration stage is not the primary focus of this paper, we employ a simplified homography estimation network from UDIS++[Nie et al., 2023] to address the registration challenges. It is important to clarify that this does not imply a devaluation of the registration stage.In fact, registration has been the most extensively researched of the three stitching stages, with significant work devoted to improving homography accuracy [Hong et al., 2022, Jiang et al., 2023b, Cao et al., 2023]. However, perfect homography matrices that precisely align images do not exist for scenes that are non-planar or that involve cameras with different centers of projection. To overcome these inherent limitations, two mainstream methods have been identified: the multi-homography warp method[Zaragoza et al., 2013] and the dense match method[Truong et al., 2020]. However, the multi-homography method faces challenges in parallelization and integration within deep learning frameworks[Nie et al., 2023], while dense matching is generally slower and less robust. These limitations inform our decision to use a straightforward homography network. This choice allows us to focus on improving the fault tolerance of the fusion stage through the powerful generalization capabilities of a large-scale generative model. As a result, our approach can produce visually appealing fusion results even with less precise registration. This strategy is a departure from previous image stitching work that has focused primarily on registration accuracy. In summary, in the registration stage, we introduce UDIS++\u2019s homography estimation method to calculate the homography between the input images Il(x, y) and Ir(x, y). This homography maps the images onto a unified plane, resulting in aligned images Iwl(x, y) and Iwr(x, y), along with their corresponding masks Mwl(x, y) and Mwr(x, y). 4 \farXiv Template A PREPRINT 3.2 Fusion and Rectangling In designing the fusion and rectangling stages, we conceptualize the fusion and rectangling tasks as facets of a unified composite inpainting challenge. This approach relies on differentiating the inpainting requirements between the two stages: the fusion stage requires content-aware conditional inpainting to ensure seamless integration, while the rectangling stage allows for more flexible inpainting. As shown in Figure 2, our method differs from traditional fusion techniques by implementing a coarse-to-fine process. First, we use coarse fusion and rectangling techniques based on established image processing methods to obtain the coarse fusion image. We then refine the output by inpainting using large-scale diffusion models. Our method employs a coarse-to-fine process to ensure semantic consistency in the output image and to prevent the inclusion of unwanted elements, such as illegible text or anomalous textures. In fact, our method requires only minor aadaptations to perform both fusion and rectangling stages, without an initial coarse rectangling stage (more details are provided in the 7.5). However, omitting the coarse rectangling step can lead to semantically unstable images. Therefore, we advocate a coarse-to-fine processing scheme to address this issue. Figure 2: Differentiating our method from existing fusion techniques. Our method demonstrates enhanced robustness, particularly in scenarios where registration errors are present. In the coarse fusion stage, we choose a simple approach by overlaying two images. Specifically, we overlay the less distorted image on top of the more distorted one. This determination of distortion levels is guided by the UDIS++ registration method [Nie et al., 2023] and subsequent analysis, which identifies which of the two aligned images is more distorted. This initial overlay, while simple, typically results in visible seams in the image. To address this, we use a inpainting technique that focuses on the seam areas and uses a weighted mask to determine the amount of rendering required. It is important to note that our method does not rely on coarse rectangling in cases with minimal missing parts, as the initial overlap suffices. However, in situations with large missing areas, the presence of plain black inputs could disrupt the inpainting process. Thus, we implement coarse rectangling in advance to mitigate this issue and prepare the image for more effective inpainting. 3.3 Weighted Mask We have adopted a large-scale diffusion model to perform the inpainting process within our image stitching framework. Recent studies, such as Repaint[Lugmayr et al., 2022], have shown that diffusion models excel in inpainting tasks and lead the field with their superior performance. This evidence strongly motivated our choice of this model. In the diffusion models, the strength of inpainting is fundamentally affected by the intensity of the noise applied during the process. Recognizing this, we have developed an approach where the solution to both the fusion and rectangling challenges depends on the use of a carefully crafted weighted mask, Mguide(x, y). This mask guides the denoising 5 \farXiv Template A PREPRINT steps of the diffusion process, effectively controlling the degree of inpainting to meet the specific requirements of the image regions being reconstructed. First, we need to make the seam mask Mseam(x, y) and the content mask Mcontent(x, y). Mcontent(x, y) is a very simple blend of Mwl(x, y) and Mwr(x, y), as shown below. Mcontent(x, y) = Mwl(x, y) \u2228Mwr(x, y) (1) Mseam(x, y) is a bit more complicated to make, involving dilation, erosion, and some fusion operations, as shown below. Mseam(x, y) = Mrseam(x, y) \u2227Mwr(x, y)) Mrseam(x, y) = (Mdilation(x, y) \u2295Mwl(x, y)) \u2228(Merosion(x, y) \u2295Mwl(x, y)) Mdilation(x, y) = (Mwl M K)(x, y) = max (i,j)\u2208K{Mwl(x + i, y + j)} (2) Merosion(x, y) = (Mwl \u2296K)(x, y) = min (i,j)\u2208K{Mwl(x + i, y + j)} Where, \u2227, \u2228, \u2295denote AND, OR, XOR. L and \u2296denote dilation and erosion. And, K is the kernel size. Then, we can make the weighted mask Mguide(x, y) based on Mcontent(x, y) and Mseam(x, y), as shown below. Mguide(x, y) = Mcontent(x, y) \u2228Mgradient(x, y) Mgradient(x, y) = (\u00acMseam \u2298K)(x, y) = min (i,j)\u2208K p (x \u2212i)2 + (y \u2212j)2 (3) Where, \u00ac denotes NOR, and \u2298is the distance transform. We plot the weighted mask making process in Figure 3 to give a visualization. Figure 3: Visual production process of weighted mask. In the design of our weighted mask, we employ a grayscale scheme to visually represent the intensity of inpainting required for different areas of the image. In this scheme, different shades of gray indicate the degree of modification to be applied to the original content. Specifically, the white areas of the mask represent regions where no inpainting is applied, corresponding to an intensity level of 0. Conversely, the black areas indicate areas where inpainting should be applied at the highest intensity, denoted by an intensity level of 1. This gradation allows for precise control over the inpainting process, ensuring that changes are made appropriately to meet the needs of each specific area of the image. 3.4 Guided Denoising Inpainting To effectively control the denoising process in the inpainting model, we incorporate the principles of Differential Diffusion[Levin and Fried, 2023] into the stable-diffusion-2-inpainting model[patrickvonplaten, 2023a], as shown in Figure 4. The input to this model includes the latent representations of the image, the mask, and the masked image. 6 \farXiv Template A PREPRINT During the initial phase of denoising, we start with an all-black mask. As the denoising process progresses, we gradually introduce the weighted mask into the equation. This gradual integration allows for precise modulation of the denoising intensity, ensuring that each area of the image receives the appropriate level of inpainting based on its specific needs. The specific steps of the denoising process are detailed in Algorithm 1. The initial input to the algorithm is the coarse fusion and rectangling image, ICF R(x, y), which is derived using the following formula. ICF R(x, y) = Telea(ICF (x, y), Mcontent(x, y), R) ICF (x, y) = Moverlap \u2299Iwl(x, y) + (1 \u2212Moverlap) \u2299Iwr(x, y) Moverlap = Mwl(x, y) \u2227Mwr(x, y) (4) Where, Telea(\u00b7) is the Alexandru Telea Algorithm[Telea, 2004], and R is the radius of a circular neighborhood of each point inpainted. It is worth noting that our method does not require prompt guidance, while the previous stable diffusion inpaint models may generate many unwanted contents even if negativate prompt guidance is added (the 7.3 provides more details), which is one of the advantages of our design. Algorithm 1 Denoising Processing of SRStitcher Input: Coarse Fusion and Rectangling Image ICF R(x, y), Weighted Mask Mguide(x, y), Number of Steps N Output: Fine Fusion and Rectangling Image IF F R(x, y) 1: INFERENCE(ICR(x, y), Mguide(x, y), N) 2: prompt p \u2190\u201d\u201d \u25b7Our method does not require prompt guidance 3: Init Mask Minit(x, y) \u2190a balck image with shape of Mguide(x, y) 4: Zinit \u2190LDM_Encoder(ICR(x, y)) 5: Mds(x, y) \u2190Down_Sample(Mguide(x, y)) 6: Z\u2032 N \u2190Add_Noise(Zinit, N) 7: Zlatent \u2190Concat(Z\u2032 N, Minit(x, y), Zinit \u2299Minit(x, y)) 8: ZN \u2190De_Noise(Zlatent, p, N) 9: for t = N \u22121 to 0 do 10: Z\u2032 t \u2190Add_Noise(Zt+1, t) 11: Mt(x, y) \u21901 \u2212(Mds(x, y) \u2aafN\u2212t N ) \u25b7\u2aafmeans element-wise less-than 12: Zlatent \u2190Concat(Z\u2032 t, Mt(x, y), Zinit \u2299Minit(x, y)) \u25b7\u2299means element-wise multiplication 13: Zt \u2190De_Noise(Zlatent, p, t) 14: end for 15: IF F R(x, y) \u2190LDM_Decoder(Z0) 7 \farXiv Template A PREPRINT Figure 4: Weighted mask guided denoising process. During the denoising phase, we use weighted masks that undergo gradual changes to meticulously control the image denoising process. This approach allows us to precisely control the amount and intensity of inpainting applied to different areas of the image. Notably, our method achieves satisfactory results without relying on prompt guidance. By effectively using the dynamic adjustments in the weighted mask, our scheme ensures that the generated images meet high standards of quality and coherence, even in the absence of explicit prompts. This makes our method both efficient and effective, capable of handling complex image stitching scenarios independently. 4 Experiment 4.1 Experimental Setup 4.1.1 Dataset To validate the performance of our proposed method, we conducted experiments on the large public dataset UDIS-D, originally introduced by UDIS[Nie et al., 2021]. Our procedure starts by aligning images with the registration network from UDIS++[Nie et al., 2023], followed by processing these aligned images through SRStitcher for both fusion and rectangling. All experiments described in this paper are based on these pre-aligned images. 4.1.2 Baselines Our method is pioneering in integrating fusion and rectangling into a unified image stitching process. Given the novelty of this combination, no existing solutions simultaneously address all three stages of the image stitching pipeline as comprehensively as our method does (as detailed in the Statistics of Related Works 7.1 in the Supplemental Material). Consequently, we established our baselines by combining several existing solutions for comparative analysis. Specifically, we employ publicly available models from UDIS[Nie et al., 2021] and UDIS++[Nie et al., 2023], which were pre-trained on the UDIS-D dataset, for tasks related to registration and fusion. For rectangling, we utilize models from DeepRectangling[Nie et al., 2022], as well as inpainting solutions like Lama[Suvorov et al., 2021] (Big-Lama), Stable-Diffusion-v1-5-inpainting[patrickvonplaten, 2023b], and Stable-Diffusion-v2-inpainting[patrickvonplaten, 2023a]. The details of these baseline configurations are presented in Table 1. Table 1: Details of baselines Name Registration and Fusion Rectangling Baseline1 UDIS DeepRectangling Baseline2 UDIS++ DeepRectangling Baseline3 UDIS Lama Baseline4 UDIS++ Lama Baseline5 UDIS Stable-Diffusion-v1-5-inpainting Baseline6 UDIS++ Stable-Diffusion-v1-5-inpainting Baseline7 UDIS Stable-Diffusion-v2-inpainting Baseline8 UDIS++ Stable-Diffusion-v2-inpainting 8 \farXiv Template A PREPRINT 4.1.3 Metrics Since UDIS-D is an unsupervised dataset, and to our knowledge, no supervised real-world datasets for deep learningbased image stitching currently exist, we are unable to employ Full-Reference Image Quality Assessment (FR-IQA) metrics. Attempting to artificially create ground truth for these images would be inherently subjective and could introduce bias, compromising the fairness of our evaluations. Therefore, we chose to use No-Reference Image Quality Assessment (NR-IQA) metrics, which do not require a reference image for evaluation. This approach ensures a more objective assessment of image quality under the constraints of the UDIS-D dataset. Specifically, we employ the following NR-IQA metrics: \u2022 hyperIQA[Su et al., 2020]: an NR-IQA metric is designed for the wild image. hyperIQA is particularly suitable for the evaluation of the predominantly outdoor images in the UDIS-D dataset and therefore a suitable choice for our needs. \u2022 CLIPIQA[Wang et al., 2023]: an NR-IQA metric based on the Contrastive Language-Image Pre-training (CLIP) models, which allows for adaptable evaluations across different datasets. In our experiments, we use prompts such as [\u2019nature image\u2019, \u2019stitched image\u2019] to evaluate whether the stitched images appear more natural. 4.1.4 Implement Details Our method is designed to operate without the need for model training or fine-tuning, ensuring simplicity and efficiency. All experiments were performed on a single NVIDIA 4090 GPU. In terms of specific settings for stable diffusion-based inference, we do not use prompts, the guidance scale is consistently set to 7.5, and the number of inference steps is fixed at 50. In addition, the K value for Mseam(x, y), which influences the seam correction, is set to 50. The K value for Mguide(x, y), guiding the overall inpainting process, is set to 3. The R value for ICR(x, y), determining the rectangling effect, is set to 20. 4.2 Quantitative Evaluation We performed a comprehensive quantitative analysis by comparing the results of 10,440 sample pairs from the UDIS-D training set and 1,106 sample pairs from the testing set. Notably, our method does not require training, so to provide a broader base of comparison, the training set of UDIS-D is also included in the comparison experiments. The results are detailed in Table 2, show that our method is the best performer. However, upon closer examination of the test results, we found that the existing NR-IQA metrics did not perfectly capture the quality of the stitched images. In some cases, these metrics assigned high scores to images that visually appeared to be of poor quality (detailed in 7.4). This observation suggests that the real-world performance of our method may be even better than the current quantitative evaluation results indicate. Table 2: Quantitative comparison on UDIS-D dataset [41]. The best is marked in bold. Name Testing Set Training Set hyperIQA\u2191 CLIPIQA\u2191 hyperIQA\u2191 CLIPIQA\u2191 Baseline1 42.53 0.28 45.31 0.31 Baseline2 45.98 0.31 49.87 0.33 Baseline3 42.55 0.27 45.63 0.30 Baseline4 46.57 0.31 51.28 0.33 Baseline5 43.26 0.25 48.65 0.28 Baseline6 46.43 0.27 51.20 0.30 Baseline7 42.60 0.28 47.36 0.34 Baseline8 46.96 0.31 51.92 0.34 Ours 47.64 0.35 54.26 0.39 9 \farXiv Template A PREPRINT 4.3 Qualitative Evaluation 4.3.1 Verifying fault tolerance to registration errors To evaluate the robustness of our method to registration inaccuracies, we selected several scenes from the UDIS-D dataset that present significant registration challenges. These examples are shown in Figure 5 and demonstrate the ability of our method to effectively handle complex registration scenarios. The first scene contains wires, which are inherently difficult objects to register due to their elongated and thin structure, most registration methods struggle to accurately align such features; The second ccene features a telephone pole positioned prominently in the foreground. Due to its central location, even minor registration errors are highly visible in the stitched output; The third scene contains an iron handrail with a complex shape and reflective surface, which complicates the alignment process. The interaction of light and metal surfaces adds an additional layer of difficulty to accurate registration; The fourth scene is characterized by repeated dense patterns, such as a large number of bricks. Such patterns pose significant challenges to existing registration methods, which often fail to accurately align repetitive textures. 4.3.2 Performance comparison of rectangling with extensive missing regions The challenge of rectangling revolves around the quality and reliability of the inpainted image, especially when large regions are missing. Figure 6 provides the inpainting results of different methods with extensive missing regions. Experimental results show that mesh-based methods (baseline1 and baseline2) are completely inadequate for dealing with scenes with significant missing areas. These methods typically fail to reconstruct meaningful or coherent image content under such challenging conditions. In addition, the performance of other inpainting-based methods (baseline3-8) also proves unsatisfactory in scenarios with large missing regions. These methods often resort to generating odd patterns or simply choosing similar colors to fill the gaps. Unfortunately, this approach generally fails to recreate precise structural and textural details, resulting in an inpainted image that lacks visual coherence and authenticity. 4.4 User Study Considering the limitations of quality evaluation metrics, we introduce a user study metric approach similar to the experimental schemes used in UDIS and UDIS++. This method allows for a more subjective but insightful assessment of visual quality through direct user feedback. For the user study, we display four images simultaneously on a single screen: the two input images, our stitched result, and the stitched result from one of the baseline methods. Participants are given the opportunity to zoom in on the images for detailed examination and are asked to determine which result is superior. In cases where a clear preference is not apparent, participants are asked to classify the results as either \"both good\" or \"both bad,\" adding further granularity to the feedback. The study involves 20 participants, evenly split between those with a background in computer vision (researchers and students) and those without a computer-related major (general volunteers). This diverse group ensures a balanced perspective, combining expert technical evaluation with general user impressions. The results of the user study are shown in Figure 7. 4.5 Ablation Study Due to the limitations of quantitative metrics, which often fail to capture subtle improvements and optimizations in image quality. We continue to use a qualitative evaluation approach in the ablation study. This approach provides a more nuanced understanding of how different parameters affect the performance of our method. As shown in Figure 8, this approach allows us to visually assess the impact of various adjustments, allowing for a direct comparison of the effects that specific parameter changes have on the final stitched images. 10 \farXiv Template A PREPRINT Figure 5: Comparison of visualization results with registration errors. We selected several scenarios with registration error challenges. 11 \farXiv Template A PREPRINT Figure 6: Comparison of visualization results with a large number of missing regions. For the sake of simplicity, we have chosen only the UIDS++ fusion image as \u2019input\u2019. In fact, the inputs of the different methods are different, but the missing rectangling areas are the same. 12 \farXiv Template A PREPRINT Figure 7: User study on visual quality. The numbers are shown in percentage and averaged on 20 participants. Figure 8: Ablation study. (a) Effect of K in Mseam(x, y) on visual performance. The parameter K plays a crucial role in determining the amount of modification along the seam of stitched images. A lower value of K can result in unnatural and excessive changes, making the seam prominently visible and disrupting image continuity. Conversely, a higher value of K increases the modification area around the seam, potentially affecting more of the image than necessary. This setting must be finely tuned to ensure seamless integration without overextending the modifications. (b) Effect of R in ICR(x, y) on visual performance. The R parameter affects the effectiveness of the coarse rectangling process, especially when dealing with large missing regions. Without implementing coarse rectangling, our method struggles with large missing regions, often resulting in prominent black backgrounds. Introducing coarse rectangling with an appropriate R value helps to produce more finely filled images, thereby improving the visual quality of the final output. However, it\u2019s important to note that higher values of R not only improve image fill quality, but also slow down the image preprocessing phase. This trade-off between image quality and processing speed must be considered in order to optimize the performance of our stitching method. 13 \farXiv Template A PREPRINT 5 Limitation and Future work Despite the demonstrated effectiveness of our proposed method, there are several limitations that warrant further investigation: (1) Handling of Large Missing Regions: Our method occasionally produces local blur in the results when dealing with rectangles with large missing areas. Currently, we have not found an effective way to consistently convert blur results into sharp images. This problem may be due to relying solely on a pre-trained model, which has its limitations despite its robust generalization capabilities. Slight fine-tuning of the model could potentially improve its performance. (2) Color Discrepancy Issues: When input images have significant color differences, our method tends to leave visible seams. While adjusting the K value provides some improvement, it does not completely solve the problem in all scenarios. Integrating additional image pre-processing techniques to specifically address color discrepancies prior to stitching could further improve the consistency of the results. (3) Content Anomalies: Our method does not use prompts, which generally gives good results. However, there remains a small probability of generating unwanted content, such as strange text or patterns. Future work could explore the incorporation of more sophisticated guidance methods to refine content generation and minimize the occurrence of these anomalies. 6"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14961v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14961v1",
|
| 3 |
+
"title": "Cache-Aware Reinforcement Learning in Large-Scale Recommender Systems",
|
| 4 |
+
"abstract": "Modern large-scale recommender systems are built upon computation-intensive\ninfrastructure and usually suffer from a huge difference in traffic between\npeak and off-peak periods. In peak periods, it is challenging to perform\nreal-time computation for each request due to the limited budget of\ncomputational resources. The recommendation with a cache is a solution to this\nproblem, where a user-wise result cache is used to provide recommendations when\nthe recommender system cannot afford a real-time computation. However, the\ncached recommendations are usually suboptimal compared to real-time\ncomputation, and it is challenging to determine the items in the cache for each\nuser. In this paper, we provide a cache-aware reinforcement learning (CARL)\nmethod to jointly optimize the recommendation by real-time computation and by\nthe cache. We formulate the problem as a Markov decision process with user\nstates and a cache state, where the cache state represents whether the\nrecommender system performs recommendations by real-time computation or by the\ncache. The computational load of the recommender system determines the cache\nstate. We perform reinforcement learning based on such a model to improve user\nengagement over multiple requests. Moreover, we show that the cache will\nintroduce a challenge called critic dependency, which deteriorates the\nperformance of reinforcement learning. To tackle this challenge, we propose an\neigenfunction learning (EL) method to learn independent critics for CARL.\nExperiments show that CARL can significantly improve the users' engagement when\nconsidering the result cache. CARL has been fully launched in Kwai app, serving\nover 100 million users.",
|
| 5 |
+
"authors": "Xiaoshuang Chen, Gengrui Zhang, Yao Wang, Yulin Wu, Shuo Su, Kaiqiao Zhan, Ben Wang",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.LG",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.LG"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Model AND Based AND Reinforcement AND Learning",
|
| 14 |
+
"gt": "Modern large-scale recommender systems are built upon computation-intensive\ninfrastructure and usually suffer from a huge difference in traffic between\npeak and off-peak periods. In peak periods, it is challenging to perform\nreal-time computation for each request due to the limited budget of\ncomputational resources. The recommendation with a cache is a solution to this\nproblem, where a user-wise result cache is used to provide recommendations when\nthe recommender system cannot afford a real-time computation. However, the\ncached recommendations are usually suboptimal compared to real-time\ncomputation, and it is challenging to determine the items in the cache for each\nuser. In this paper, we provide a cache-aware reinforcement learning (CARL)\nmethod to jointly optimize the recommendation by real-time computation and by\nthe cache. We formulate the problem as a Markov decision process with user\nstates and a cache state, where the cache state represents whether the\nrecommender system performs recommendations by real-time computation or by the\ncache. The computational load of the recommender system determines the cache\nstate. We perform reinforcement learning based on such a model to improve user\nengagement over multiple requests. Moreover, we show that the cache will\nintroduce a challenge called critic dependency, which deteriorates the\nperformance of reinforcement learning. To tackle this challenge, we propose an\neigenfunction learning (EL) method to learn independent critics for CARL.\nExperiments show that CARL can significantly improve the users' engagement when\nconsidering the result cache. CARL has been fully launched in Kwai app, serving\nover 100 million users.",
|
| 15 |
+
"main_content": "INTRODUCTION Recently, reinforcement learning (RL) has drawn a growing attraction in recommender systems [1, 2, 4, 13, 15, 16]. RL-based recommendation methods treat users as the environment and the recommender system as the agent and then model the sequential interactions between users and the recommender system. RL achieves success in improving users\u2019 long-term engagements, such as the total dwell time [2, 15] and the user retention [1]. Existing RL methods require the system to interact with the users and change the next recommendation according to the user feedback in real-time. However, modern large-scale recommender systems are built upon computation-intensive infrastructure [12]. Although there is an amount of research on reducing the computational burden of recommender systems [6, 7, 9], it is still challenging to perform real-time computation for each request during peak periods. Fig. 1 shows the queries-per-second (QPS) of Kwai app based on the average QPS per day. It is shown that the computational burden during peak periods is several times that of off-peak periods. It arXiv:2404.14961v1 [cs.LG] 23 Apr 2024 \fWWW \u201924 Companion, May 13\u201317, 2024, Singapore, Singapore Xiaoshuang Chen et al. Figure 1: QPS in one day of Kwai app. requires a lot of computational resources to perform real-time computation in the peak period, while the same resources will be idle in the off-peak periods, which is not cost-effective. Therefore, a result cache [5, 11] is used to balance the computational burden and the recommendation performance in large-scale recommender systems. Fig. 2 briefly shows the recommender system with a result cache in Kwai. When a user sends a request, the system first provides a real-time recommendation, which returns a group of \ud835\udc3fitems, of which the top \ud835\udc3eitems are showed to the user while the other \ud835\udc3f\u2212\ud835\udc3e are put into a result cache. When the user\u2019s next request comes, the recommender system will perform a real-time computation if the traffic does not exceed the system\u2019s affordability, e.g. Response 2 in Fig. 2. Otherwise, it will recommend \ud835\udc3eitems directly from the result cache, e.g. Response 3 in Fig 2. The existence of the cache mitigates the computational burden of the recommender systems in peak periods, but it brings several challenges to traditional RL approaches: \u2022 Lack of actions in the cache. The RL module is usually a part of the real-time computation, meaning RL will not be performed when the request is processed by the cache. This contradicts the assumption of RL to interact with the users continuously. \u2022 Unpredictability of the cache choice. The choice of using real-time computation or the cache depends on the total computational burden of the system rather than the features of the specific request. Therefore, the cache choice is unpredictable by the RL algorithm, which increases the learning difficulty. \u2022 Heterogenuous rewards. the performance of cached results is suboptimal compared to the results from the real-time computation due to the lack of instant behaviors of the user. Table 1 provides an example in the Kwai app, where the average user engagement of cached recommendations is lower than that of real-time recommendations. Such characteristics need to be considered in the RL model. To this end, we provide a novel cache-aware reinforcement learning (CARL) method. CARL introduces a cache state to model the choice of recommendations by real-time computation or by the cache. The cache state is determined by the computational burden of the recommender system and is independent of the user states Figure 2: Recommendation with a result cache. Real-Time Cached Recommendations Recommendations Watch Time \u00d71 \u00d70.85 Like Rate \u00d71 \u00d70.68 Follow Rate \u00d71 \u00d70.54 Table 1: Comparisons between User engagement in real-time and cached recommendations in Kwai. and actions of the system. We also show that the existence of the cache introduces challenges to CARL training. Specifically, the uncontrollable cache state introduces an uncontrollable dependency between the critic functions of real-time cases and cached cases, which deteriorates the performance of the training algorithm. To tackle this challenge, we introduce a novel eigenfunction learning (EL) technique to train CARL. EL learns two independent critics and then combines them to obtain the critic functions of real-time and cached recommendations, improving CARL\u2019s performance. In summary, our contributions are as follows: \u2022 We introduce a novel CARL method to model the recommender systems with cache explicitly. \u2022 We show that the existence of the cache introduces critic dependency to the RL algorithm, which deteriorates the performance. Then, we provide an EL algorithm to train CARL effectively. \u2022 Experiments show that CARL improves users\u2019 engagement in recommender systems with the cache. CARL has been launched in Kwai app, serving over 100 millions of users. Following the introduction, Section 2 provides the CARL model to describe the recommendation process with a cache. Section 3 discusses the challenges of learning CARL, and provides an effective EL algorithm to train CARL. Section 4 provides the experimental results, and Section 5 concludes the paper. \fCache-Aware Reinforcement Learning in Large-Scale Recommender Systems WWW \u201924 Companion, May 13\u201317, 2024, Singapore, Singapore Figure 3: The CARL model. 2 MODELING OF CARL This section provides the CARL model, which is an RL model considering the existence of the result cache, as shown in Figure 3. We model the interaction between users and the recommender systems as a Markov Decision Process (MDP), where the recommender system is the agent, and users are the environments. When a user opens the app, a session begins, which consists of multiple requests until the user leaves the app. At Step \ud835\udc61, the recommender system obtains a user state \ud835\udc94\ud835\udc61. The user state \ud835\udc94\ud835\udc95consists of the user profile, behavior history, request context, and candidate video features. According to the user request with the state \ud835\udc94\ud835\udc61, the recommender system generates an action \ud835\udc82\ud835\udc61, and outputs a set of items \ud835\udc3c\ud835\udc61to the user according to the user state \ud835\udc94\ud835\udc61and the action \ud835\udc82\ud835\udc95. After watching the provided items in \ud835\udc3c\ud835\udc61, the user provides feedback \ud835\udc5f\ud835\udc61, e.g. the watching time of the items and other interactions on the items. Then, the user transfers to the next state \ud835\udc94\ud835\udc61+1 and determines whether to send the next request or leave. The recommender system aims to maximize the long-term reward \ud835\udc45\ud835\udc61defined by \ud835\udc45\ud835\udc61= \ud835\udc47 \u2211\ufe01 \ud835\udc61\u2032=\ud835\udc61 \ud835\udefe\ud835\udc61\u2032\u22121E [\ud835\udc5f\ud835\udc61\u2032] , (1) where \ud835\udc47is the last step and \ud835\udefeis the discount factor. A key component to be modeled in the recommender systems with cache is the choice of real-time computation or cached results. Specifically, the system maintains a result cache K\ud835\udc62for each user \ud835\udc62. When a user request comes at Step \ud835\udc61, a traffic router will provide a cache state \ud835\udc36\ud835\udc61\u2208{0, 1}, and the system will provide different services according to \ud835\udc36\ud835\udc61: \u2022 Recommendation by real-time computation. When the recommender system has enough computational resources, the traffic router returns \ud835\udc36\ud835\udc61= 0, and the recommender system will use a real-time computation to provide recommended items. Specifically, \ud835\udc5bdeep models will be used to predict scores \ud835\udc99\ud835\udc57,\ud835\udc61\u2208R\ud835\udc5bfor each candidate item \ud835\udc57, in terms of various feedback (watch time, follow, like, etc.). Then, the action \ud835\udc82\ud835\udc61is used to generate the final score of each item according to a parametrized ranking function \ud835\udc53, i.e. \ud835\udc67\ud835\udc57,\ud835\udc61= \ud835\udc53(\ud835\udc99\ud835\udc57,\ud835\udc61; \ud835\udc82\ud835\udc61) (2) Finally, the top \ud835\udc3fitems regarding the scores \ud835\udc67\ud835\udc57,\ud835\udc61are used, of which the top \ud835\udc3eitems are recommended to the user, while the items with rank \ud835\udc3e+ 1 to \ud835\udc3fare put into the result cache K\ud835\udc62for future use. \u2022 Recommendation by the cache. When the traffic of the recommender system is too large to afford a real-time computation, the traffic router returns \ud835\udc36\ud835\udc61= 1, and the system will provide recommendations by the cache. In such cases, the recommender system obtains \ud835\udc3eitems directly from the user\u2019s result cache K\ud835\udc62. Then, K\ud835\udc62is updated by removing the \ud835\udc3eitems recommended. There is no action \ud835\udc82\ud835\udc61in recommendations by the cache. In our scenario, the traffic router maintains a queue of ongoing real-time recommendation processes. When a new request comes, the traffic router checks the queue length. If the queue length does not exceed a given limit, it suggests a real-time computation; otherwise, it suggests a cached recommendation. Given the abovementioned models, CARL aims to maximize the aggregate reward \ud835\udc45\ud835\udc61defined in Eq. (1). The main challenge of training CARL arises from the stochastic characteristic of the traffic router. The cache state \ud835\udc36\ud835\udc61depends on the total traffic of the system rather than the user state \ud835\udc94\ud835\udc61. Therefore, \ud835\udc36\ud835\udc61is unpredictable according to \ud835\udc94\ud835\udc61. Such stochastic characteristics make it challenging to learn the critic. Section 3 will discuss the challenge in detail and provide an effective training method. 3 LEARNING OF CARL This section first shows the application of traditional RL algorithms to CARL, and discusses the critic dependency problem of the direct learning approach. Then, we provide the EL algorithm to learn CARL effectively. 3.1 Challenges of Direct Learning 3.1.1 The Direct Learning Algorithm. We first show a direct application of traditional RL to learn the CARL model. We consider a typical actor-critic architecture. The action \ud835\udc82\ud835\udc61is determined by a policy function \ud835\udf07with the parameter \ud835\udf03: \ud835\udc82\ud835\udc61= \ud835\udf07(\ud835\udc94\ud835\udc61;\ud835\udf03) (3) We use a critic function \ud835\udc44(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf19), parameterized by \ud835\udf19to estimate the long-term reward \ud835\udc45\ud835\udc61given the state \ud835\udc94\ud835\udc61and the action \ud835\udc82\ud835\udc61. A typical critic learning algorithm [8] uses a temporal difference \fWWW \u201924 Companion, May 13\u201317, 2024, Singapore, Singapore Xiaoshuang Chen et al. \ud835\udc36\ud835\udc61= 0 \ud835\udc36\ud835\udc61= 1 \ud835\udc36\ud835\udc61+1 = 0 h \ud835\udc440 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf190) \u2212 \u0010 \ud835\udc5f\ud835\udc61+ \ud835\udefe\ud835\udc440 \u0010 \ud835\udc94\ud835\udc61+1, \ud835\udf07(\ud835\udc94\ud835\udc61+1;\ud835\udf03\u2212) ;\ud835\udf19\u2212 0 \u0011\u0011i2 h \ud835\udc441 (\ud835\udc94\ud835\udc61;\ud835\udf191) \u2212 \u0010 \ud835\udc5f\ud835\udc61+ \ud835\udefe\ud835\udc440 \u0010 \ud835\udc94\ud835\udc61+1, \ud835\udf07(\ud835\udc94\ud835\udc61+1;\ud835\udf03\u2212) ;\ud835\udf19\u2212 0 \u0011\u0011i2 \ud835\udc36\ud835\udc61+1 = 1 \u0002 \ud835\udc440 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf190) \u2212\u0000\ud835\udc5f\ud835\udc61+ \ud835\udefe\ud835\udc441 \u0000\ud835\udc94\ud835\udc61+1, ;\ud835\udf19\u2212 1 \u0001\u0001\u00032 \u0002 \ud835\udc441 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf191) \u2212\u0000\ud835\udc5f\ud835\udc61+ \ud835\udefe\ud835\udc441 \u0000\ud835\udc94\ud835\udc61+1;\ud835\udf19\u2212 1 \u0001\u0001\u00032 Table 2: Difference formulations of \ud835\udc59\ud835\udc37\ud835\udc3f(\ud835\udf19) in Eq. (8) . method to learn the parameter \ud835\udf19of the critic \ud835\udc44: \ud835\udc59(\ud835\udf19) = [\ud835\udc44(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf19) \u2212(\ud835\udc5f\ud835\udc61+ \ud835\udefe\ud835\udc44(\ud835\udc94\ud835\udc61+1, \ud835\udf07(\ud835\udc94\ud835\udc61+1;\ud835\udf03\u2212) ;\ud835\udf19\u2212))]2 (4) where \ud835\udf03\u2212is the parameter of the target actor, and \ud835\udf19\u2212is the parameter of the target critic. The critic function \ud835\udc44is used as the reward function of the policy function \ud835\udf07, and the parameter \ud835\udf03of the actor updates according to the following gradient ascent: \u2207\ud835\udf03\ud835\udc3d= \u2207\ud835\udf03\ud835\udf07(\ud835\udc94\ud835\udc61;\ud835\udf03)\u2207\ud835\udf07\ud835\udc44(\ud835\udc94\ud835\udc61, \ud835\udf07(\ud835\udc94\ud835\udc61;\ud835\udf03)) (5) To apply Eq. (4)(5) to CARL, we define the conditional critic functions: \ud835\udc440 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf190) \u225cE [\ud835\udc45\ud835\udc61|\ud835\udc36\ud835\udc61= 0] ,\ud835\udc441 (\ud835\udc94\ud835\udc61;\ud835\udf191) \u225cE [\ud835\udc45\ud835\udc61|\ud835\udc36\ud835\udc61= 1] (6) \ud835\udc440 and \ud835\udc441 are the expected long-term rewards under the condition that the Request \ud835\udc61is processed by real-time computation and by the cache, respectively. The input of \ud835\udc441 does not contain the action \ud835\udc82\ud835\udc61because there is no action in recommendations by the cache. Given \ud835\udc440 and \ud835\udc441, the total critic function \ud835\udc44can be written as \ud835\udc44(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf19) = \ud835\udc44\ud835\udc36\ud835\udc61(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf19\ud835\udc36\ud835\udc61),\ud835\udc36\ud835\udc61\u2208{0, 1} (7) where\ud835\udf19= {\ud835\udf190,\ud835\udf191}. With the critic defined in Eq. (7), we can directly train the CARL by the following critic loss: CARL-DL (Direct Learning of CARL): \ud835\udc59\ud835\udc37\ud835\udc3f(\ud835\udf19) = \u0002 \ud835\udc44\ud835\udc36\ud835\udc61(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf19) \u2212\u0000\ud835\udc5f\ud835\udc61+ \ud835\udefe\ud835\udc44\ud835\udc36\ud835\udc61+1 (\ud835\udc94\ud835\udc61+1, \ud835\udf07(\ud835\udc94\ud835\udc61+1;\ud835\udf03\u2212) ;\ud835\udf19\u2212)\u0001\u00032 , (8) with the policy loss remains the same as Eq. (5). 3.1.2 Critic Dependency. The CARL-DL approach is straightforward, but it faces a considerable challenge, i.e. the Critic Dependency. Specifically, Eq. (8) shows the dependency of \ud835\udc44(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf19) and \ud835\udc44(\ud835\udc94\ud835\udc61+1, \ud835\udc82\ud835\udc61+1;\ud835\udf19). According to different cache states \ud835\udc36\ud835\udc61and \ud835\udc36\ud835\udc61+1, there are four possible formulations of Eq. (8), as shown in Table 2. It is clear that the \ud835\udc440 and \ud835\udc441 depend on each other. Figure 4 also shows the dependency among the two critics \ud835\udc440 and \ud835\udc441 in the DL of CARL. The critic dependency makes the learning process depending on the values of the cache states \ud835\udc36\ud835\udc61and \ud835\udc36\ud835\udc61+1, but the cache states are highly stochastic, and are unpredictable by the states \ud835\udc94\ud835\udc61and the actions \ud835\udc82\ud835\udc61. Such problem deteriorates the convergence of the critic learning. To discuss this problem more precisely, we consider the transit function of the critics. Since the cache state \ud835\udc36\ud835\udc61is a stochastic variable, we use \ud835\udc37\ud835\udc50(\ud835\udc61) to denote the probability that \ud835\udc36\ud835\udc61= \ud835\udc50: \ud835\udc37\ud835\udc50(\ud835\udc61) \u225c\ud835\udc43(\ud835\udc36\ud835\udc61= \ud835\udc50),\ud835\udc50\u2208{0, 1} (9) \ud835\udc37\ud835\udc50(\ud835\udc61) does not depend on the user\u2019s state \ud835\udc94\ud835\udc61because it simply relies on the total requests per second and the maximal real-time recommendations per second. In addition, we define the expectation of the immediate reward \ud835\udc5f\ud835\udc61of different cache states \ud835\udc36\ud835\udc61: \ud835\udc490 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \u225cE [\ud835\udc5f\ud835\udc61|\ud835\udc36\ud835\udc61= 0] ,\ud835\udc491 (\ud835\udc94\ud835\udc61) \u225cE [\ud835\udc5f\ud835\udc61|\ud835\udc36\ud835\udc61= 1] (10) Figure 4: Direct Learning of CARL Then, according to the backward induction, the transit functions of the expected immediate reward and the expected long-term reward can be written as: \ud835\udc440 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) =\ud835\udc490 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) + \ud835\udefe\ud835\udc370 (\ud835\udc61+ 1) E\ud835\udc82\ud835\udc61+1\ud835\udc440 (\ud835\udc94\ud835\udc61+1, \ud835\udc82\ud835\udc61+1) + \ud835\udefe\ud835\udc371 (\ud835\udc61+ 1) E\ud835\udc82\ud835\udc61+1\ud835\udc441 (\ud835\udc94\ud835\udc61+1) \ud835\udc441 (\ud835\udc94\ud835\udc61) =\ud835\udc491 (\ud835\udc94\ud835\udc61) + \ud835\udefe\ud835\udc370 (\ud835\udc61+ 1) E\ud835\udc82\ud835\udc61+1\ud835\udc440 (\ud835\udc94\ud835\udc61+1, \ud835\udc82\ud835\udc61+1) + \ud835\udefe\ud835\udc371 (\ud835\udc61+ 1) E\ud835\udc82\ud835\udc61+1\ud835\udc441 (\ud835\udc94\ud835\udc61+1) (11) Now, we provide more explanations on Eq. (11), as shown in Figure 4. On the one hand, the critic functions \ud835\udc440 and \ud835\udc441, i.e. the expectation of the long-term reward \ud835\udc45\ud835\udc61, depends on the immediate reward \ud835\udc5f\ud835\udc61, estimated by \ud835\udc490 and \ud835\udc491. On the other hand, \ud835\udc440 and \ud835\udc441 also depend on the future feedback of the user. However, due to the stochastic characteristic of the cache state \ud835\udc36\ud835\udc61, the future feedback of the user obeys different distributions given different \ud835\udc36\ud835\udc61, and the expectation of the future feedback is described by the second and third term of the right part of Eq. (11). Eq. (11) also shows the critic dependency problem, since the \ud835\udc440 and \ud835\udc441 clearly depend on each other. Such dependency, together with the stochasticity of the cache states \ud835\udc36\ud835\udc61, will increase the learning difficulty of CARL. We will discuss the solution to the critic dependency problem in the following subsections. 3.2 Eigenfunctions This paper uses the eigenfunction technique to solve the critic dependency problem. The motivation is to find a group of independent variables derived from the critic functions \ud835\udc440 and \ud835\udc441 so that the learning process of different critic functions can be decoupled. We first define the eigen immediate reward and the eigen longterm reward. Definition 3.1 (Eigen Immediate Reward). The eigen immediate rewards, denoted by \u0393 \ud835\udc4eand \u0393 \ud835\udc4f, are given by \u0393 \ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \u225c\ud835\udc490 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \u2212\ud835\udc491 (\ud835\udc94\ud835\udc61) \u0393 \ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \u225c\ud835\udc370(\ud835\udc61)\ud835\udc490 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) + \ud835\udc371(\ud835\udc61)\ud835\udc491 (\ud835\udc94\ud835\udc61) (12) \fCache-Aware Reinforcement Learning in Large-Scale Recommender Systems WWW \u201924 Companion, May 13\u201317, 2024, Singapore, Singapore Figure 5: Eigenfunction Learning of CARL The eigen immediate rewards \u0393 \ud835\udc4eand \u0393 \ud835\udc4fare the linear combinations of the expected immediate rewards \ud835\udc490 and \ud835\udc491. Similarly, we have Definition 3.2 (Eigen Long-Term Reward). The eigen long-term rewards, denoted by \u039b\ud835\udc4eand \u039b\ud835\udc4f, are given by \u039b\ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \u225c\ud835\udc440 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \u2212\ud835\udc441 (\ud835\udc94\ud835\udc61) \u039b\ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \u225c\ud835\udc370(\ud835\udc61)\ud835\udc440 (\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) + \ud835\udc371(\ud835\udc61)\ud835\udc441 (\ud835\udc94\ud835\udc61) (13) Clearly, given the eigen long-term rewards \u039b\ud835\udc4eand \u039b\ud835\udc4f, we can recover the expected long-term rewards \ud835\udc440 and \ud835\udc441 simply by solve the equations in Eq. (13). Specifically, we have \ud835\udc440(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) = \ud835\udc371(\ud835\udc61)\u039b\ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) + \u039b\ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \ud835\udc441(\ud835\udc94\ud835\udc61) = \u2212\ud835\udc370(\ud835\udc61)\u039b\ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) + \u039b\ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) (14) Therefore, once we can estimate the eigen long-term rewards \u039b\ud835\udc4e and \u039b\ud835\udc4f, we can also estimate the expected long-term rewards \ud835\udc440 and \ud835\udc441. Although the eigen immediate/long-term rewards are just equivalent transformations of the expected immediate/long-term rewards, their iterative functions are much simplified. Actually, we have Proposition 3.3. [Iterative Function of Eigen Long-Term Rewards] The iterative function of the eigen long-term rewards writes \u039b\ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) = \u0393 \ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) \u039b\ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) = \u0393 \ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) + \ud835\udefe\u039b\ud835\udc4f(\ud835\udc94\ud835\udc61+1, \ud835\udc82\ud835\udc61+1) (15) The proof can be referred to in Appendix. A. We explain more about Proposition 3.3. Firstly, \u039b\ud835\udc4eis the difference between the longterm rewards under recommendations by real-time computation and by the cache, i.e., \ud835\udc440 and \ud835\udc441. The first equation of Eq. (15) shows that such a difference equals the difference between the immediate rewards under real-time and cached recommendations. It is because the future cache states are stochastic and independent of the current cache state. Secondly, \u039b\ud835\udc4f, which is the weighted sum of real-time and cached recommendations, follows an iterative equation independent of \u039b\ud835\udc4e. Compared to the iterative functions of the expected long-term rewards in Eq. (11) where the two critics depend on each other, the eigen long-term rewards \u039b\ud835\udc4eand \u039b\ud835\udc4fare independent. Therefore, if we regard the eigen long-term rewards as the function to learn, we will not suffer from the critic dependency problem. Given the abovementioned discussions, we are ready to provide the final algorithm. 3.3 The Eigenfunction Learning Algorithm Now, we provide the CARL-EL algorithm according to the eigenfunctions defined in Section 3.2. The framework of CARL-EL is shown in Figure 5. Specifically, we regard the following functions as learnable functions: \u2022 The immediate reward functions\ud835\udc490(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf130) and\ud835\udc491(\ud835\udc94\ud835\udc61;\ud835\udf131), parameterized by \ud835\udf130 and \ud835\udf131. \u2022 The eigen long-term reward function \u039b\ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61; \ud835\udf0c), parameterized by \ud835\udf0c. \u2022 The policy function \ud835\udf07(\ud835\udc94\ud835\udc61;\ud835\udf03), parameterized by \ud835\udf03. In contrast, we regard the following functions as derived functions from the abovementioned learnable functions: \u2022 The eigen immediate reward functions \u0393 \ud835\udc4eand \u0393 \ud835\udc4f, which can be obtained from the expected immediate reward \ud835\udc490 and \ud835\udc491 according to Eq. (12). \u2022 The eigen long-term reward function \u039b\ud835\udc4e, which is equal to \u0393 \ud835\udc4eaccording to Proposition 3.3. \u2022 The expected long-term rewards \ud835\udc440 and \ud835\udc441, which can be derived from the eigen long-term rewards \u039b\ud835\udc4eand \u039b\ud835\udc4faccording to Eq. (14). The EL algorithm, as shown in Algorithm 1, consists of five steps, i.e. learning the immediate rewards, calculating the eigen immediate rewards, learning the eigen long-term reward, recovering the longterm rewards, and learning the policy function. Step 1: we learn the immediate reward functions \ud835\udc490(\ud835\udc94\ud835\udc61; \ud835\udc82\ud835\udc61;\ud835\udf130) and \ud835\udc491(\ud835\udc94\ud835\udc61;\ud835\udf131). The loss function is \ud835\udc59(\ud835\udf13) = \u001a[\ud835\udc5f\ud835\udc61\u2212\ud835\udc490(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf130)]2 ,\ud835\udc36\ud835\udc61= 0 [\ud835\udc5f\ud835\udc61\u2212\ud835\udc491(\ud835\udc94\ud835\udc61;\ud835\udf131)]2 ,\ud835\udc36\ud835\udc61= 1 (16) We learn different immediate rewards for requests processed by realtime and cached recommendations, where \ud835\udc36\ud835\udc61= 0 or 1, respectively. Step 2: after obtaining the estimation of immediate value functions, we calculate the eigen immediate rewards \u0393 \ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) and \u0393 \ud835\udc4f(\ud835\udc94\ud835\udc95, \ud835\udc82\ud835\udc61) according to Eq. (12). Step 3: the eigen immediate rewards \u0393 \ud835\udc4eand \u0393 \ud835\udc4fare used to learn the eigen long-term rewards \u039b\ud835\udc4eand \u039b\ud835\udc4fvia the temporal difference function. According to Proposition 3.3, we have \u039b\ud835\udc4e= \u0393 \ud835\udc4e, therefore, \fWWW \u201924 Companion, May 13\u201317, 2024, Singapore, Singapore Xiaoshuang Chen et al. Algorithm 1 CARL-EL: Eigenfunction Learning of Cache-Aware Reinforcement Learning 1: Input: {\ud835\udc941:\ud835\udc47, \ud835\udc821:\ud835\udc47,\ud835\udc5f1:\ud835\udc47} for each user. 2: Output: A policy function \ud835\udf07(\ud835\udc94\ud835\udc61;\ud835\udf03) parameterized by \ud835\udf03. 3: for each user session with \ud835\udc47requests from the replay buffer do 4: for \ud835\udc61= 1, \u00b7 \u00b7 \u00b7 ,\ud835\udc47do 5: Collect the user state \ud835\udc94\ud835\udc61, the reward \ud835\udc5f\ud835\udc61, and the action \ud835\udc82\ud835\udc61from the replay buffer. 6: Step 1: Learn the immediate rewards \ud835\udc490(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61;\ud835\udf130) and \ud835\udc491(\ud835\udc94\ud835\udc61;\ud835\udf131) according to Eq. (16). 7: Step 2: Calculate the eigen immediate rewards \u0393 \ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) and \u0393 \ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) according to Eq. (12). 8: Step 3: Calculate the eigen long-term rewards \u039b\ud835\udc4e(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61), and learn \u039b\ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61; \ud835\udf0c) according to Eq. (17). 9: Step 4: Calculate the critic function \ud835\udc440(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) according to Eq. (14). 10: Step 5: Take policy gradient with the policy loss \ud835\udc440(\ud835\udc94\ud835\udc61, \ud835\udf07(\ud835\udc94\ud835\udc61;\ud835\udf03)) to update \ud835\udf03according to Eq. (5). 11: end for 12: end for there is no need to learn \u039b\ud835\udc4e. In contrast, \u039b\ud835\udc4fneeds to be learned by the following temporal difference loss: \ud835\udc59(\ud835\udf0c) = [\u039b\ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61; \ud835\udf0c) \u2212(\u0393 \ud835\udc4f(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) + \ud835\udefe\u039b\ud835\udc4f(\ud835\udc94\ud835\udc61+1, \ud835\udf07(\ud835\udc94\ud835\udc61+1;\ud835\udf03\u2212); \ud835\udf0c\u2212))]2 (17) where \ud835\udf03\u2212and \ud835\udf19\u2212are the parameters of the target actor and target critic, respectively. Step 4: we recover the expected long-term reward \ud835\udc440 and \ud835\udc441 from the eigen long-term reward \u039b\ud835\udc4eand \u039b\ud835\udc4faccording to Eq. (14). Step 5: we regard the expected long-term reward \ud835\udc440(\ud835\udc94\ud835\udc61, \ud835\udc82\ud835\udc61) as the policy loss, and take the policy gradient algorithm according to Eq. (5). Figure 5 shows the information flow of Algorithm 1. Compared with the direct learning method shown in Figure 4, the main difference between Algorithm 1 and CARL-DL is the temporal difference equation, i.e. Eq. (17) in CARL-EL and Eq. (8) in CARL-DL. In CARLDL, the learning of the critic functions \ud835\udc440 and \ud835\udc441 depend on each other according to a stochastic cache state \ud835\udc36\ud835\udc61; while in CARL-EL, the learning of the eigen long-term rewards \u039b\ud835\udc4eand \u039b\ud835\udc4fdoes not depend on each other. Therefore, the temporal difference of CARL-EL does not rely on the stochastic cache state \ud835\udc36\ud835\udc61, and hence, the variance of learning can be effectively reduced, and the performance can be improved. 4 EXPERIMENTAL RESULTS We deploy our proposed CARL model in Kwai, a short video platform serving over 100 million users. The QPS is shown in Figure 1, and the traffic router executes as described in Section 2. The ratio of cached recommendations during peak periods is about 40%. We did not conduct offline experiments because there is, to the best of the authors\u2019 knowledge, no offline experimental environment considering the impact of the cache for the time being. 4.0.1 Implementation. The structure of the online system is shown in Figure 6, and the details are as follows: \u2022 Sample Generation. We first collect the states, actions, and rewards of each request to generate request-wise samples. Next, a session collector groups the requests of the same user and orders them by the timestamp of the requests. We split the request sample list into multiple sessions based on the 15-minute inactivity rule. The session collector constructs two consecutive requests from the same session into a single RL sample and feeds them into the replay buffer. \u2022 MDP. We deploy the actor in the ranking part of the recommender system. The recommender serves as the agent, and the users serve as the environment. At each user request, the actor gets the state \ud835\udc94\ud835\udc61containing a vector of the user profile, the behavior history, the request context, and the statistics of candidate video features. The user profile covers the information collected in the registration, including the gender, the age, and the interests of the user. The behavior history includes the items that the user interacted with in the past. The request context includes the timestamp and the location, and the video statistics include the average score and the 10-th/30-th/50-th/70-th/90-th percentile of the prediction scores. Then, it returns an action vector \ud835\udc82\ud835\udc61, which is a 5-dimensional continuous vector ranging in [0, 3], acting as the fusion parameters of five scoring models predicting the main feedback (watchtime, shortview, longview, finish, and forward). A final ranking score is generated according to Eq. (2), of which the top \ud835\udc3fitems are selected, and the first \ud835\udc3e items are shown to the users (the red arrow in Figure 6). The rest \ud835\udc3f\u2212\ud835\udc3eitems are cached in case of a cached recommendation when the traffic exceeds the system\u2019s affordability(the green arrow in Figure 6). In our scenario, \ud835\udc3f= 40 and \ud835\udc3e= 8. 4.1 Settings 4.1.1 Baselines. We deploy different methods in the online system: \u2022 Cross Entropy Method (CEM) [10]: A black-box optimization method commonly used for hyper-parameter optimization. We use CEM to search the best parameters \ud835\udc82\ud835\udc61. \u2022 TD3 [3]: A famous RL method which uses twin critics to reduce the bias. TD3 does not explicitly distinguish the realtime and cached recommendations. \u2022 RLUR[1]: A state-of-the-art reinforcement-learning-based method for the fusion of multiple predictions. RLUR is the last online version before CARL is deployed in Kwai. Similar to TD3, RLUR does not explicitly distinguish the real-time and cached recommendations, either. \u2022 CARL-DL: The CARL with the direct learning method. \u2022 CARL-EL: The CARL with the eigenfunction learning method. \fCache-Aware Reinforcement Learning in Large-Scale Recommender Systems WWW \u201924 Companion, May 13\u201317, 2024, Singapore, Singapore Figure 6: System Implementation Session Daily Watch Time Watch Time CEM +0.000% +0.000% TD3 +0.176% +0.184% RLUR +0.206% +0.192% CARL-DL +0.390% +0.342% CARL-EL +0.545% +0.586% Table 3: Experimental Results in Kwai in terms of the improvement over CEM. 4.1.2 Metrics. We evaluate the abovementioned algorithms by the session-wise watch time and the daily watch time, an important metric in short video platforms [14]. We show the experiment results in improvement compared to the CEM method. 4.2 Results Table 3 shows the comparison results of different methods in online A/B experiments. In our scenario, even a 0.1% improvement in the watch time is significant. It is shown that RLUR and TD3 outperform CEM due to the effectiveness of RL approaches. Both the CARLDL and the CARL-EL outperform RLUR and TD3, showing the effectiveness of the cache-aware modeling. Moreover, the CARL-EL achieves the best performance, showing the effectiveness of the proposed EL method. 4.3 Discussions 4.3.1 Improvement on Critic Loss. Table 4 shows the average critic loss of different RL-based methods over one day. We evaluate these methods\u2019 critic loss using the formula shown in Eq. (4). It is shown that CARL outperforms the other algorithms, showing the effectiveness of the explicit modeling of cache. Moreover, CARL-EL achieves a better critic loss than CARL-DL, showing that the EL approach effectively improves the performance of CARL. 4.3.2 Gaps between Recommendations by Real-Time Computation and by the Cache. Figure 7 shows the average long-term reward Methods TD3 RLUR CARL-DL CARL-EL Loss 0.33 0.30 0.28 0.25 Table 4: Critic Loss of Different Methods. Figure 7: Comparisons of critic values. estimation of the CARL-EL algorithm under recommendations by real-time computation and by the cache, i.e.,\ud835\udc440 and\ud835\udc441, respectively. It is shown that \ud835\udc440 is consistently larger than \ud835\udc441, showing that the model successfully learns the advantage of real-time recommendations over cached recommendations. Moreover, \ud835\udc440 and \ud835\udc441 have similar trendings over one day. For example, they both reach minimal values at about 12pm, while reaching maximal values at about 18pm. It can be explained by Eq. (15), where \u039b\ud835\udc4e= \ud835\udc440\u2212\ud835\udc441 = \ud835\udc490\u2212\ud835\udc491, which means the difference between real-time and cached recommendations is independent of the cache ratios \ud835\udc370(\ud835\udc61) and \ud835\udc371(\ud835\udc61). We further discuss the user feedback under recommendations by real-time computation and by the cache. Figure 8 shows the average watch time per video in recommendations by real-time recommendations and by the cache. Although the performance of cached recommendations is lower than that of real-time recommendations, the CARL model increases the performance of cached recommendations more than that of real-time recommendations. Such results show that effective cache modeling helps reduce the performance gap between real-time and cached recommendations. 4.3.3 Computational Burden. We test the total time cost of the recommender system under different methods. TD3 increases the time cost by 0.524% compared with CEM, while the difference in the time costs among these RL methods (TD3, RLUR, CARL-DL, and CARL-EL) is less than 0.1% because we keep actors unchanged in the experiments. Moreover, to verify the trade-off of computational burden and the recommendation performance introduced by the result cache, we test the RLUR in an experimental group without a result cache, i.e. all the requests are performed by real-time computation. Such settings increase the daily watch time by 0.642%, but with a significant increase of total time cost by 67.6%. In contrast, CARL-EL increases the daily watch time by 0.391% compared to \fWWW \u201924 Companion, May 13\u201317, 2024, Singapore, Singapore Xiaoshuang Chen et al. Figure 8: Average watch time per video of recommendations by real-time computation and by the cache. RLUR with nearly no increase in the time cost, which shows the effectiveness of CARL-EL. 5"
|
| 16 |
+
}
|
abs_9K/validation_abstract_short_2404.14963v2.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14963v2",
|
| 3 |
+
"title": "Achieving >97% on GSM8K: Deeply Understanding the Problems Makes LLMs Better Reasoners",
|
| 4 |
+
"abstract": "Chain of Thought prompting strategy has enhanced the performance of Large\nLanguage Models (LLMs) across various NLP tasks. However, it still has\nshortcomings when dealing with complex reasoning tasks, including understanding\nerrors, calculation errors and process errors (e.g., missing-step and\nhallucinations). Subsequently, our in-depth analyses among various error types\nshow that deeply understanding the whole problem is critical in addressing\ncomplicated reasoning tasks. Motivated by this, we propose a\nsimple-yet-effective method, namely Deeply Understanding the Problems (DUP), to\nenhance the LLMs' reasoning abilities. The core of our method is to encourage\nthe LLMs to deeply understand the problems and leverage the key problem-solving\ninformation for better reasoning. Extensive experiments on 10 diverse reasoning\nbenchmarks show that our DUP method consistently outperforms the other\ncounterparts by a large margin. More encouragingly, DUP achieves a new SOTA\nresult on the GSM8K benchmark, with an accuracy of 97.1% in a zero-shot\nsetting.",
|
| 5 |
+
"authors": "Qihuang Zhong, Kang Wang, Ziyang Xu, Juhua Liu, Liang Ding, Bo Du, Dacheng Tao",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-28",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "LLM AND Reasoning",
|
| 15 |
+
"gt": "Chain of Thought prompting strategy has enhanced the performance of Large\nLanguage Models (LLMs) across various NLP tasks. However, it still has\nshortcomings when dealing with complex reasoning tasks, including understanding\nerrors, calculation errors and process errors (e.g., missing-step and\nhallucinations). Subsequently, our in-depth analyses among various error types\nshow that deeply understanding the whole problem is critical in addressing\ncomplicated reasoning tasks. Motivated by this, we propose a\nsimple-yet-effective method, namely Deeply Understanding the Problems (DUP), to\nenhance the LLMs' reasoning abilities. The core of our method is to encourage\nthe LLMs to deeply understand the problems and leverage the key problem-solving\ninformation for better reasoning. Extensive experiments on 10 diverse reasoning\nbenchmarks show that our DUP method consistently outperforms the other\ncounterparts by a large margin. More encouragingly, DUP achieves a new SOTA\nresult on the GSM8K benchmark, with an accuracy of 97.1% in a zero-shot\nsetting.",
|
| 16 |
+
"main_content": "Introduction Despite the impressive performance of Large Language Models (LLMs) in diverse NLP tasks (Brown et al., 2020; Thoppilan et al., 2022; Chowdhery et al., 2022), they often suffer from sub-optimal reasoning abilities, a challenge that cannot be adequately addressed by simply scaling up the model sizes (Wang et al., 2023b). Such a limitation highlights the importance of further improving LLMs\u2019 reasoning capabilities. To tackle this limitation, Wei et al. (2022) propose a few-shot Chain of Thought (CoT) prompting strategy, by allowing the LLMs to perform natural language reasoning before giving the final answer, which \u2217Equal contribution: Qihuang Zhong and Kang Wang contributed equally to this work. \u2020 Corresponding Authors: Juhua Liu (e-mail: liujuhua@whu.edu.cn), Bo Du (e-mail: dubo@whu.edu.cn). Figure 1: Error analysis of GSM8K problems with incorrect answers returned by zero-shot CoT and our zero-shot DUP using GPT-3.5 LLM. We randomly sample 300 GSM8K problems, and follow (Wei et al., 2022) and (Wang et al., 2023a) to assign the \u201cUnderstanding Error\u201d, \u201cCalculation Error\u201d and \u201cProcess Error\u201d to each incorrect answer. We see that our DUP method effectively reduces the errors among all types. brings significant performance gains for various reasoning tasks. Along this line of research, more recent works involve modifying the prompting strategy to guide language models towards improving reasoning step quality, such as Zero-shot CoT (Kojima et al., 2022), Tree of Thought (Gao et al., 2023), Plan and Solve (PS) (Wang et al., 2023a), and Complex CoT (Fu et al., 2023). Although achieving remarkable performance, they still fall short in dealing with complex reasoning tasks. As stated by Wei et al. (2022), there are three main error types in the context of LLM-based reasoning: understanding error, calculator error, and process error (e.g., reasoning step missing). In our preliminary experiments (as shown in Figure 1), we found that CoT has major errors in semantic understanding, which is the main factor for limiting LLMs\u2019 reasoning performance. Moreover, as stated by Wang et al. (2023a), the more carefully-designed prompting strategies can achieve much fewer calculator errors arXiv:2404.14963v2 [cs.CL] 28 Apr 2024 \fand process errors, but struggle to reduce the understanding errors. Hence, there raises a question: whether we can enhance the LLMs\u2019 reasoning abilities by reducing the understanding errors? To this end, we propose a simple-yet-effective prompting method, namely Deeply Understanding the Problems (DUP), to improve the LLMs\u2019 reasoning performance. The core of DUP is to encourage the LLMs to deeply understand the whole problems and extract the key problem-solving information, which is used to guide the reasoning processes of LLMs. Specifically, DUP consists of three stages: \u2776Reveal the core question from the original input questions; \u2777Extract the problem-solving information required to solve the core question; \u2778Generate detailed responses by combining the core question with problem-solving information. Subsequently, we leverage the LLMs to separate final answers from the detailed responses. The first two stages enable LLMs to gain a clear and comprehensive understanding of the problem, including the goal of the question and the conditions required to solve it. The last stage is designed to generate more accurate responses and answers. To evaluate the performance of our DUP method, we conduct a series of experiments on 10 reasoning datasets across arithmetic, commonsense, and symbolic reasoning benchmarks. The results of GPT-3.5-Turbo (Ouyang et al., 2022) and GPT4 (OpenAI, 2023) show that: 1) DUP consistently outperforms the other counterparts (e.g., zero-shot CoT (Kojima et al., 2022), Zero-Shot PS+ (Wang et al., 2023a) and Least-to-Most (Zhou et al., 2023) prompting) across all datasets by a large margin; 2) DUP can even outperform the few-shot methods (i.e., Few-shot manual CoT (Wei et al., 2022) and auto CoT prompting strategies (Zhang et al., 2023b)) on most reasoning datasets in a zero-shot manner; 3) More encouragingly, DUP achieves new SOTA results on GSM8K (94.6% to 97.1%) and SVAMP (90.4% to 94.2%). Contributions Our main contributions are: \u2022 Our study reveals that understanding error is the major factor for limiting LLMs\u2019 reasoning performance. \u2022 We propose a simple-yet-effective, plug-in prompting approach (DUP) to alleviate this problem and improve the LLM\u2019 reasoning performance effectively. \u2022 Extensive experiments show that DUP outperforms the other counterparts across various benchmarks by a large margin and achieves new SOTA results on GSM8K and SVAMP. 2 Related Work 2.1 Reasoning with Large Language Models. In recent years, we have witnessed numerous large language models (LLMs) (Devlin et al., 2019; Brown et al., 2020; Chowdhery et al., 2022; Zhong et al., 2022; OpenAI, 2023; Touvron et al., 2023) that achieved tremendous success in various natural language understanding and generation tasks. However, LLMs usually struggle to provide stable and accurate answers when deal with reasoning tasks (Zhang et al., 2023a), such as mathematical reasoning (Cobbe et al., 2021; Patel et al., 2021; Ling et al., 2017; Hosseini et al., 2014), commonsense reasoning (Talmor et al., 2019; Geva et al., 2021) and symbolic resoning (Wei et al., 2022). More recent works (Yuan et al., 2023; Luo et al., 2023; Yu et al., 2023) shown that reasoningaugmented LLMs tuning with math data can improves reasoning capabilities by a large margin. However, even with such advancements, these models still perform poorly in complex reasoning problems. This indicates that there is still a significant room for improving the LLMs\u2019 performance in the complex reasoning tasks. 2.2 Prompting Methods. Although the training-based approaches (Luo et al., 2023; Yu et al., 2023) can improve the LLMs\u2019 reasoning performance, they usually require expensive computational costs and might suffer from the forgetting of general-purpose abilities. Hence, more works (Wei et al., 2022; Kojima et al., 2022) attempt to use the cheaper prompting methods to strengthen the LLMs\u2019 reasoning abilities without additional training. Wei et al. (2022) are the first to propose the few-shot Chain-of-Thought (CoT) prompting, which elicits a series of intermediate natural language reasoning steps before giving the final answer. So far, CoT prompting has been proven to significantly improve the reasoning capabilities of LLMs. Along this line of research, a large amount of works emerge to improve LLMs\u2019 reasoning abilities by carefully designing more effective prompting strategies (Zhou et al., 2023; Wang et al., 2023a; Yao et al., 2023; Zhang et al., 2023b; Chen et al., 2023a; Xu et al., 2023). \fQ: Raymond and Samantha are cousins. Raymond was born 6 years before Samantha. Raymond had a son at the age of 23. If Samantha is now 31, how many years ago was Raymond's son born? Please extract the core question,only the most comprehensive and detailed's one\uff01 A: How many years ago was Raymond's son born? Stage1: Extract the Core Question Stage2: Extract Problem-Solving info Stage3: Generate and Extract answer Q: Raymond and Samantha are cousins ...how many years ago was Raymond's son born? Hint: 1. Raymond was born 6 years before Samantha. 2. Samantha is now 31. 3. Raymond had a son at the age of 23. How many years ago was Raymond's son born? Please understand the Hint and question information,then solve the question step by step and show the answer. A: Raymond is 6 years older than Samantha, so he is now 31 + 6 = 37 years old. Raymond had a son when he was 23, so his son was born 37 23 = 14 years ago. The answer is : 14 [Extract\u2019s answer] Q: Raymond and Samantha are cousins ...how many years ago was Raymond's son born? Note: Please extract the question-solving information related to the problem(How many years ago was Raymond's son born?),Only extract the most useful information, list them one by one! A: 1. Raymond was born 6 years before Samantha. 2. Samantha is now 31. 3. Raymond had a son at the age of 23. Core question Problem-solving information (a) (b) (c) Figure 2: Illustration of our DUP prompting strategy, which contains three-stage processes: \u2776revealing the core question from the original input; \u2777extracting problem-solving information based on the core question; \u2778 generating and extracting final answer via understanding the core question and problem-solving information. Despite the remarkable performance, the aforementioned prompting methods still fall short in dealing with complex reasoning tasks. As stated by (Wei et al., 2022), the reasoning mistakes of LLMs can be classified into three categories: understanding error, calculation error and process error. Some prior works (Wang et al., 2023a; Chen et al., 2023b) attempt to reduce the these errors, and achieve some performance improvements. However, they mainly focus on the calculation error and process error, but neglect the understanding error. As shown in our preliminary analyses of Figure 1, understanding error is the major mistake and is the main factor for limiting LLMs\u2019 reasoning performance. Hence, in this paper, we aim to reduce the understanding error by forcing the LLMs to deeply understand the whole problems, and boost the reasoning performance of LLMs effectively. 3 DUP Prompting Overview. We introduce a new zero-shot CoT prompting approach, called DUP prompting, which contains three-stage processes. Specifically, in stage 1, DUP reveals thecore question from complex and lengthy problem descriptions. In stage 2, DUP further extracts the problem-solving information that is crucial for solving the core question from the same description. Given the core question and problem-solving information. In stage 3, DUP incorporates them into the origin question to generate the reasoning results as well as the answer to the question. Lastly, LLMs extract the final answer from the generated text. 3.1 Stage 1: Reveal the Core Question Understanding the goal of a question is the first step to solving it, even for humans. Unfortunately, LLMs might be confused by lengthy descriptions of complex reasoning questions, leading to inaccurate understanding and poor performance. In response to this problem, we encourage LLMs to explicitly extract the core question from the original input before reasoning. Specifically, we design a core question extraction prompt \u201cPlease extract core question, only extract the most comprehensive and detailed one!\u201d, which is appended to the end of question. We then use GPT-3.5-turbo (Ouyang et al., 2022) to extract the core question from the input. As a result, the output of this step will be a shorter, clearer question that will be used to help \fLLMs focus on the goal of input questions in subsequent steps. 3.2 Stage 2: Extract Problem-Solving Information In addition to clarifying the goal, it is also important to find the conditions required to solve the problem. Without fully understanding and utilizing the conditions provided by the question, reasoning cannot be correctly completed. LLMs also have trouble taking full advantage of these conditions. Therefore, we design a problem-solving information extraction prompt to help solve this problem, i.e., \u201cNote: Please extract the problem-solving information related to the core question [Core Question info], Only extract the most useful information, list them one by one!\u201d. The slot [Core Question info] contains the core question extracted in Stage 1. The output of this step will be a list of conditions useful in reasoning. 3.3 Stage 3: Generate and Extract Answers Given the core question and problem-solving information extracted in previous stages, we incorporate them into the original input by the template \u201cHint: [Problem-Solving Info]\\n[Core Question]\\n Please understand the Hint and question information, then solve the problem step by step and show the answer.\u201d, where the input slots refer to the corresponding outputs in previous steps. This prompt is beneficial to improve LLM\u2019s understanding of the question by explicitly pointing out the goal and necessary conditions to solve the question. Lastly, following the prior work (Wang et al., 2023a), we enforce the LLMs to extract the final numerical answer from a long reasoning text generated. Compared with rule-based matching methods, using LLMs to extract the final answers is more robust and accurate in practice. More details for separating answers can be found in Appendix A.1. 4 Experiments 4.1 Setup Tasks and Datasets To investigate the effectiveness and universality of our DUP method, we conduct extensive experiments on various reasoning tasks, include 6 Arithmetic Reasoning benchmarks (GSM8K (Cobbe et al., 2021), SVAMP (Patel et al., 2021), MultiArith (Roy and Roth, 2015), AddSub (Hosseini et al., 2014), AQuA (Ling et al., Dataset Avg. words # Samples Answer Format GSM8K 46.9 1319 Number MultiArith 31.8 600 Number AddSub 31.5 395 Number SVAMP 31.8 1000 Number SingleEq 27.4 508 Number AQuA 51.9 254 Option Last Letters 15.0 500 String Coin Flip 37.0 500 Yes / No StrategyQA 9.6 2290 Yes / No CSQA 27.8 1221 Option Table 1: Details of all evaluated datasets. CSQA refers to the CommonensenseQA benchmark. 2017) and SingleEq (Koncel-Kedziorski et al., 2015)), 2 Commonsense Reasoning benchmarks (CommonsenseQA (Talmor et al., 2019) and StrategyQA (Geva et al., 2021)), and 2 Symbolic Reasoning benchmarks (Last Letter (Wei et al., 2022) and Coin Flip (Wei et al., 2022)). The details of all evaluated datasets are shown in Table 1. Compared Methods. Since our DUP is a zeroshot prompting method, we mainly compare it with other zero-shot methods. For references, two typical few-shot prompting methods are also used as the baselines. \u2022 Zero-shot CoT (Kojima et al., 2022): It simply adds a prompt \u201dLet\u2019s think step by step\u201d before each answer. \u2022 Least-to-Most (Zhou et al., 2023): It aims to break down a complex problem into a series of simpler sub-problems and then solve them in sequence. \u2022 Plan-and-Solve (Wang et al., 2023a)1: It devises a plan to divide the entire task into smaller sub-tasks, and then carries out the subtasks according to the plan. \u2022 Manual-CoT (Wei et al., 2022): It is the first CoT method that proposes to use a few chain of thought demonstrations as exemplars in prompting. \u2022 Auto-CoT (Zhang et al., 2023b): It improves the vanilla CoT via sampling questions with diversity and generating reasoning chains to construct demonstrations. 1We adopt the more sophisticated Plan-and-Solve (PS+) prompting with more detailed instructions in this work. \fArithmetic Reasoning Score Model Method SVAMP GSM8K AddSub MultiArith AQuA SingleEq Avg. \u2206 Performance of Zero-shot Methods Zero-shot CoT 79.3 78.9 85.8 95.3 53.0 93.5 80.9 Least-to-Most 80.9 77.5 91.3 95.5 57.4 93.5 82.6 +1.7 Zero-shot PS+ 80.7 79.3 86.5 92.0 55.9 93.0 81.2 +0.3 GPT-3.5-Turbo DUP (Ours) 82.5 82.3 92.1 97.8 60.2 94.9 84.9 +4.0 Zero-shot CoT 90.4 94.6 92.4 97.8 72.8 95.0 90.6 Least-to-Most 90.3 92.1 92.1 97.1 71.6 95.0 89.7 -0.9 Zero-shot PS+ 92.6 94.3 93.1 98.1 75.5 95.3 91.4 +0.8 GPT-4 DUP (Ours) 94.2 97.1 95.1 98.1 77.1 96.0 92.9 +2.3 Performance of Few-shot Methods Manual CoT 78.5 81.6 90.6 95.6 55.9 94.2 82.6 +1.7 GPT-3.5-Turbo Auto CoT 82.9 80.2 89.9 99.0 54.3 94.6 83.4 +2.5 Table 2: Results on Arithmetic Reasoning benchmarks. The best results in the zero-shot settings are in bold. \u201c\u2206 \" denotes the performance improvement or decline of various methods compared to Zero-shot CoT. Method CSQA StrategyQA Avg. Zero-shot-CoT 72.3 66.1 69.2 Zero-shot-PS+ 68.8 62.8 65.8 Least-to-Most 71.9 61.5 66.7 DUP (Ours) 74.5 68.5 71.5 Few-shot-CoT (Manual) 76.5 64.8 70.8 Few-shot-CoT (Auto) 74.2 62.5 68.3 Table 3: Results of Commonsense Reasoning benchmarks. Here, GPT-3.5-turbo is used as the backbone. Method Last Letter Coin Flip Avg. Zero-shot CoT 60.8 94.4 77.6 Zero-shot PS+ 60.6 95.4 78.0 Least-to-Most 83.2 82.8 83.0 DUP (Ours) 81.2 97.6 89.4 Few-shot CoT (Manual) 74.4 98.2 86.3 Few-shot CoT (Auto) 81.2 98.6 89.9 Table 4: Results of Symbolic Reasoning benchmarks. We also use the GPT-3.5-turbo as the backbone LLM. Implementation Details. We use the public GPT3.5-Turbo (0613) (Ouyang et al., 2022) and GPT-4 (0613) (OpenAI, 2023) as the backbone LLMs. In this work, all models are employed via OpenAI\u2019s API2, and we adopt the greedy decoding strategy with a temperature setting of 0 across all experiments. For the few-shot prompting baseslines, we adhere to the recommended number of demonstration examples specified in the original paper. 4.2 Main Results Arithmetic Reasoning. Table 2 presents the main results of Arithmetic Reasoning benchmarks. As seen, compared to the vanilla zero-shot CoT, our DUP method brings consistent and signifi2https://beta.openai.com/docs/models cant performance gains among all reasoning benchmarks. Specifically, in the GPT-3.5-turbo settings, DUP improves the accuracy by an average of 4% over Zero-shot CoT. When using the GPT-4, our DUP even achieves new state-of-the-art results on GSM8K (97.1%) and SVAMP (94.2%). Moreover, we also reports the results of few-shot counterparts. Due to the high cost of the GPT-4 API, we use the more affordable GPT-3.5-turbo as a responder for few-shot methods. Generally, the performance of zero-shot methods tends to be lower than that of few-shot methods. However, with the help of our DUP, GPT-3.5 can even achieve remarkable zero-shot performance that are higher then few-shot methods. There results prove the effectiveness of our DUP method. Commmonsense and Symbolic Reasoning. Table 3 shows the performance on Commonsense Reasoning datasets. Considering the experimental cost, we only used the GPT-3.5-turbo as the backbone LLM. Compared to zero-shot methods, DUP method consistently outperforms all other counterparts. In comparison with few-shot methods, our DUP also achieves comparable or even better performance. Table 4 lists the results on Symbolic Reasoning datasets. On Last Letters, zero-shot DUP (81.2%) is marginally worse than Zero-shot Least-to-Most (83.2%) but significantly exceeds other Zero-shot approaches, including Manual-CoT (74.4%) and is on par with Auto-CoT (81.2%). on Coin Flip, zeroshot DUP (97.6%) is slightly worse than ManualCoT (98.2%) and Auto-CoT (98.6%), but outperforms the other zero-shot baseline methods by a good margin. In general, we can basically con\fStage 1 Stage 2 Stage 3 GSM8K AQuA Avg. % % % 76.5 51.2 63.8 ! % % 78.9 53.1 66.0 % ! % 80.6 55.1 67.8 % % ! 80.3 54.7 67.5 ! ! % 79.9 57.0 68.4 ! % ! 80.8 56.2 68.5 % ! ! 81.7 58.2 69.9 ! ! ! 82.3 60.2 71.2 Table 5: Ablation study for different variations of DUP prompting using GPT-3.5-turbo LLMs on GSM8K and AQuA Datasets. Notably, Stage 1 involves extracting core questions, Stage 2 focuses on extracting problem-solving information, and Stage 3 entails solving the problem step by step. clude that our DUP outperforms the other zero-shot counterparts, and has the great potential to beat the few-shot methods. 4.3 Ablation Study In this part, we conduct a series of ablation experiments to investigate 1) the impact of each stage in our DUP, and 2) how to reduce the inference costs but maintain the performance. Impact of different stages in our DUP. In Table 5, we report the results of different combinations of various stages in our DUP. As seen, removing each stage will lead to overall performance, and the combination of all stages achieves the best performance on GSM8K and AQuA benchmarks. These results indicate the importance of each stage in our DUP method. Reduce inference costs without much performance degradation. Some readers may concern that the three-stage processes in our DUP will cause too much inference costs. Hence, we further propose a simplified DUP method, namely DUP-s, which merges the three-stage prompts into a single prompt. We conduct contrastive experiments on all 10 reasoning benchmarks, and illustrate the results in Figure 3. It can be found that DUP-s achieves comparable and even better performance against the DUP method. That is, in the case of limited inference budgets, using our simplified DUP-s method is also a good choice. Figure 3: Performance of DUP and DUP-s methods across various reasoning tasks of GPT-3.5-Turbo, where the DUP-s denotes that we merge the three-stage prompts into a single prompt. Orange dashline and Blue dashline represent the average accuracy on DUP and DUP-s, respectively. (a) GSM8K (b) SVAMP +3.4 +2.2 +3.2 +2.5 Figure 4: Results of DUP Prompting with and without self-consistency(SC) using GPT-3.5-turbo LLM on GSM8K and SVAMP. 4.4 Discussion and Analysis Compatibility with Self-consistency. We employ an innovative decoding strategy with selfconsistency (SC) (Wang et al., 2023b) as a substitute for the conventional greedy decoding approach, which initially samples N reasoning paths rather than only opting for the greedy approach. Subsequently, choosing the most consistent answer as the answer. Existing works (Wang et al., 2023a; Xu et al., 2023) indicate that adopted SC notably enhances the performance of chain-ofthought prompting. Here, to verify whether using SC can further enhance the performance of DUP, we further conduct experiments on GSM8K and SVAMP using GPT-3.5-Turbo, setting the temperature to 0.7 and N to 10. The results are illustrated in Figure 4, from which we see remarkable performance gains brought by the SC strategy. No\fModel Method GSM8K AddSub Avg. Llama-2-Chat 13b Zero-shot CoT 35.1 70.6 52.8 DUP (Ours) 35.9 (+0.8) 79.7 (+9.1) 57.8 (+5.0) Llama-2-Chat 70b Zero-shot CoT 53.9 75.6 64.7 DUP (Ours) 56.4 (+2.5) 87.8 (+12.2) 72.1 (+7.4) CodeLlama-Instruct 13b Zero-shot CoT 24.2 73.1 48.6 DUP (Ours) 28.1 (+3.9) 74.6 (+1.5) 51.3 (+2.7) CodeLlama-Instruct 34b Zero-shot CoT 39.1 81.2 60.1 DUP (Ours) 43.5 (+4.4) 86.0 (+4.8) 64.7 (+4.1) Table 6: Results of various Open-source LLMs on GSM8K and Addsub. We see that our DUP method still achieves much better performance than the baseline Zero-shot CoT among all open-source LLMs. (a) GSM8K (b) SVAMP (c) AQuA Figure 5: Analysis of different information extractors used in our DUP. We use the GPT-4, GPT-3.5-turbo and Llama-2-Chat 70b to extract core question and problem-solving information extractor, and leverage the extracted contents to guide the responses of GPT-3.5-turbo. GSM8K, SVAMP and AQuA are evaluated. tably, DUP with SC (88.6% and 88.8%) consistently outperforms Zero-shot CoT with SC (86.4% and 86.3%), continuing to prove the superiority of our DUP method. Whether DUP also works well on Open-source LLMs. In above experiments, we mainly evaluate our DUP in the close-source GPT LLMs. To verify whether our DUP also works well on other open-source LLMs, we evaluate our method on 4 widely-used LLMs, i.e., Llama-2-Chat 13b and Llama-2-Chat 70b (Touvron et al., 2023), CodeLlama-Instruct 13b and CodeLlama-Instruct 34b (Roziere et al., 2023). As seen in Table 6, in the cases of open-source LLMs, our DUP can still outperform the baseline zero-shot CoT by a large margin on GSM8K and AddSub benchmarks. This proves the universality of DUP. The core of our DUP. As stated in Section 1, the core of our DUP is to enforce the LLMs to deeply understand the problems, i.e., extracting the core question and key problem-solving information. To verify it, we conduct contrastive experiments on AQuA, GSM8K, and SVAMP datasets. Specifically, using the GPT-3.5-Turbo as the final responder, we leverage different LLMs (i.e., LLaMA2-Chat-70B, GPT-3.5, GPT-4) to extract the core question in Stage 1 and the key problemsolving information in Stage 2, respectively. The contrastive results are illustrated in Figure 5. As seen, when using the GPT-4 as the extractor, GPT3.5 responder can achieve better performance than that using GPT-3.5 as the extractor. Conversely, using the LLaMA2-Chat-70B as the extractor leads to worse results. These results demonstrate that better core question and key problem-solving information can result in better reasoning performance, confirming our statement. Error Analysis. Here, to verify whether our DUP indeed reduces the understanding errors, we randomly sample 300 examples from GSM8K/AQuA, and perform the error analysis for the questions with incorrect answers. The detailed quantitative results are illustrated in 6. Notably, for better analyzing the effect of our DUP, we separate the core problem and problem-solving information from DUP prompting, and denote them as DUP stage_1 and DUP stage_2 methods, respectively. As seen, compared with the baseline zero-shot CoT, \f(a) GSM8K (b) AQuA Figure 6: Quantitative error analyses of different prompting methods. Notably, we separate the core problem and problem-solving information from DUP prompting, and denote them as DUP stage_1 and DUP stage_2 methods, respectively. We randomly sample 300 examples from GSM8K/AQuA, and use GPT-3.5-Turbo to generate responses. We can see that our method reduces the frequency of various error types compared with Zero-shot CoT. More error analyses on other reasoning benchmarks can be found in Figure 9. They decided to hold the party in their backyard. They have 10 sets of tables and each set has 6 chairs. If there are 11 people sitting on chairs. How many chairs are left unoccupied? Sure! First, let's calculate the total number of chairs available. There are 10 sets of tables, and each set has 6 chairs, so the total number of chairs is 10 sets * 6 chairs/set = 60 chairs. Stage1. Core Question: If there are 11 people sitting on chairs at a party with 10 sets of tables, each set having 6 chairs, how many chairs are empty? Stage2. Problem-Solving info: 1. 10 sets of tables. 2. Each set has 6 chairs. 3. 11 people sitting on chairs Stage3. Generate the Answer:We can follow these steps: 1. Total chairs = 10 sets of tables * 6 chairs per set = 60 chairs. 2. Number of chairs occupied = 11 people sitting on chairs. 3. Number of chairs left unoccupied = Total chairs Number of chairs occupied = 49 chairs. Therefore, 49 chairs are left unoccupied at the party. A grocery store had 30 bottles of regular soda, 8 bottles of diet soda and 41 apples.How many bottles did they have total? Sure! Let's start by adding the number of regular soda bottles and diet soda bottles together. 30 (regular soda) + 8 (diet soda) = 38 bottles of soda. Now, let's add the number of apples to the total number of soda bottles. 38 (soda) + 41 (apples) = 79 bottles total Stage1. Core Question: How many bottles of soda and apples did the grocery store have in total? Stage2. Problem-Solving info: 30 bottles of regular soda. 8 bottles of diet soda. 41 apples Stage3. Generate the Answer: To find the total number of bottles of soda and apples at the grocery store, we can simply add the quantities of each item together. 30 + 8 = 38 bottles of soda. 38 bottles of soda + 41 apples = 79 total items. So, the grocery store had a total of 79 bottles of soda and apples. Problem Description Zero-shot CoT Reasoning Zero-shot DUP Reasoning Problem Description Zero-shot CoT Reasoning Zero-shot SUC Reasoning 11 people sitting on chairs. chairs Number of chairs occupied = 49 chairs, Number of chairs left unoccupied = Total Figure 7: Case study from the SVAMP dataset. Zero-shot CoT fails to generate the correct answer, but our DUP method can make the correct prediction via deeply understanding the problems. our DUP reduces the understanding errors effectively, indicating its effectiveness. Additionally, we can also find that DUP reduces the calculation and process errors as well. One possible reason is that learning more problem-solving information can lead to more accurate reasoning steps. To have a close look, we present a case study of the SVAMP dataset in Figure 7. It can be seen that the zero-shot CoT fails to generate the correct answer, but with the help of our DUP, the LLM can better understand the problems and generate the accurate answer. More case studies from different benchmarks can be found in Appendix A.2. 5"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.14966v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14966v1",
|
| 3 |
+
"title": "Mamba3D: Enhancing Local Features for 3D Point Cloud Analysis via State Space Model",
|
| 4 |
+
"abstract": "Existing Transformer-based models for point cloud analysis suffer from\nquadratic complexity, leading to compromised point cloud resolution and\ninformation loss. In contrast, the newly proposed Mamba model, based on state\nspace models (SSM), outperforms Transformer in multiple areas with only linear\ncomplexity. However, the straightforward adoption of Mamba does not achieve\nsatisfactory performance on point cloud tasks. In this work, we present\nMamba3D, a state space model tailored for point cloud learning to enhance local\nfeature extraction, achieving superior performance, high efficiency, and\nscalability potential. Specifically, we propose a simple yet effective Local\nNorm Pooling (LNP) block to extract local geometric features. Additionally, to\nobtain better global features, we introduce a bidirectional SSM (bi-SSM) with\nboth a token forward SSM and a novel backward SSM that operates on the feature\nchannel. Extensive experimental results show that Mamba3D surpasses\nTransformer-based counterparts and concurrent works in multiple tasks, with or\nwithout pre-training. Notably, Mamba3D achieves multiple SoTA, including an\noverall accuracy of 92.6% (train from scratch) on the ScanObjectNN and 95.1%\n(with single-modal pre-training) on the ModelNet40 classification task, with\nonly linear complexity.",
|
| 5 |
+
"authors": "Xu Han, Yuan Tang, Zhaoxuan Wang, Xianzhi Li",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.LG"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "Mamba",
|
| 16 |
+
"gt": "Existing Transformer-based models for point cloud analysis suffer from\nquadratic complexity, leading to compromised point cloud resolution and\ninformation loss. In contrast, the newly proposed Mamba model, based on state\nspace models (SSM), outperforms Transformer in multiple areas with only linear\ncomplexity. However, the straightforward adoption of Mamba does not achieve\nsatisfactory performance on point cloud tasks. In this work, we present\nMamba3D, a state space model tailored for point cloud learning to enhance local\nfeature extraction, achieving superior performance, high efficiency, and\nscalability potential. Specifically, we propose a simple yet effective Local\nNorm Pooling (LNP) block to extract local geometric features. Additionally, to\nobtain better global features, we introduce a bidirectional SSM (bi-SSM) with\nboth a token forward SSM and a novel backward SSM that operates on the feature\nchannel. Extensive experimental results show that Mamba3D surpasses\nTransformer-based counterparts and concurrent works in multiple tasks, with or\nwithout pre-training. Notably, Mamba3D achieves multiple SoTA, including an\noverall accuracy of 92.6% (train from scratch) on the ScanObjectNN and 95.1%\n(with single-modal pre-training) on the ModelNet40 classification task, with\nonly linear complexity.",
|
| 17 |
+
"main_content": "INTRODUCTION 3D point cloud analysis serves as the foundation of wide-ranging applications such as autonomous driving [37, 47], VR/AR [19], Robotics [45], etc. With the rich deep learning literature in 2D vision, a natural inclination is to develop deep learning methods for point cloud processing. Unlike 2D images, point clouds do not have a specific order and exhibit a complex geometric nature, which poses challenges for deep point cloud feature learning. Starting from PointNet [35]/PointNet++ [36], deep learning on point clouds has gained popularity. A series of deep neural networks trained from scratch, such as DGCNN [52], PointMLP [31], PointNeXt [40] etc., are designed for robust point feature extraction. Recently, a flux of Transformer-based pre-training models [6, 10, 33, 38, 39, 61, 63] has been proposed to unleash the scalability and generalization of Transformer [50] for 3D point cloud representation learning, by leveraging a large amount of unlabelled data. However, the Transformer suffers from the dreaded quadratic bottleneck due to the pairwise communication brought by the attention mechanism. In other words, the Transformer-based model gets slower quadratically as the input size increases. Here, we focus on finding a new backbone for point cloud feature learning that achieves superior performance, high efficiency, and scalability potential. The Mamba model [15], a recently proposed alternative to Transformer, is gaining attention for its efficiency. Built upon state space models (SSM), Mamba introduces a novel selection mechanism to effectively compress context, enabling it to handle long sequences. Also, the hardware-accelerated scan enables Mamba to achieve near-linear complexity during training. However, the straightforward adoption of Mamba does not achieve satisfactory performance on point cloud tasks due to the following challenges. Firstly, its recurrent/scan mode leads to sequential dependency that is unsuitable for unordered point clouds, causing unstable pseudo-order reliance. Secondly, Mamba lacks explicit local geometry extraction, which is crucial in point cloud learning [31, 34]. Driven by the above analysis, we present Mamba3D, a novel state space model tailored for point cloud learning. Going beyond existing works, two essential technical contributions are delivered: (1) Local Norm Pooling (LNP): a local feature extraction block comprising K-norm and K-pooling operators for local feature propagation and aggregation, respectively. To ensure the efficiency and scalability of our Mamba3D, we design our LNP block as simple yet effective, utilizing only 0.3M parameters. (2) Bidirectional-SSM (bi-SSM): a token forward SSM and a novel backward SSM that operates on the feature channel to obtain better global features. Considering the disorder of the point token sequence, we propose to treat the feature channel as an ordered sequence, which is more reliable and stable. Based on the original token forward (L+) SSM, we further design a feature reverse backward (C-) SSM to alleviate pseudo-order reliance, thus fully exploiting the global features. Note that, there are concurrent works PointMamba [26] and PCM [64] that also apply Mamba to 3D point clouds. However, PointMamba ignores local feature extraction, while PCM does not support pre-training and is computationally intensive (2\u00d7 parameters, 12\u00d7 FLOPs). In contrast, Mamba3D yields more representative point features by explicitly incorporating local geometry. Particularly, its linear complexity and large capacity allow for both training from scratch, and equipping with various pre-training strategies, facilitating downstream tasks with promising performance. To thoroughly evaluate Mamba3D\u2019s capacity and representation learning ability, we conduct extensive experiments by training our model from scratch, as well as pre-training using two different pretraining strategies following Point-BERT [61] and Point-MAE [33], respectively. Results show that Mamba3D substantially surpasses both the Transformer-based counterparts and the two concurrent works on various downstream tasks, while having fewer parameters and FLOPs. For example, as shown in Fig. 1(a) and Fig. 1(b), Mamba3D achieves 92.6% overall accuracy (OA) on the ScanObjectNN [49] classification task, setting new SoTA among models trained from scratch, and outperforms Transformer on both ModelNet40 [56] object classification task and few-shot classification task. Similarly, as shown in Fig. 1(c) and Fig. 1(d), when equipped with the pre-training strategies proposed in Point-BERT and PointMAE, Mamba3D still outperforms Transformer on various tasks. Particularly, Mamba3D achieves 95.1% OA on ModelNet40, setting new SoTA among single-modal pre-trained models. Meanwhile, Mamba3D reduces 30.8% in parameters and 23.1% in FLOPs compared to Transformer. Section 4 presents more experimental results. In summary, this work makes the following contributions: \u2022 We introduce Mamba3D, a state space model with local geometric features tailored for point cloud learning, achieving superior performance with linear complexity. \u2022 We design a Local Norm Pooling (LNP) block, enhancing local geometry extraction with only 0.3M parameters. \u2022 We propose C-SSM, a feature reverse SSM, alleviating pseudoorder reliance in unordered points. \u2022 Extensive experiments demonstrate Mamba3D\u2019s superior performance over Transformer, achieving multiple SoTA results and robust few-shot learning capabilities. 2 RELATED WORK 2.1 Deep Point Cloud Learning As deep neural networks (DNNs) continue to advance, point cloud feature learning has gained increasing attention, leading to the development of numerous deep architectures and models in recent years. Inspired by early models PointNet [35] and PointNet++ [36], some attempts [2, 8, 24, 25, 43, 52, 65] design various deep architectures to better capture local context information. Later, Transformerinspired [50] models such as Point Transformer v1-v3 [54, 55, 66] and Stratified Transformer [23] have become popular backbones, integrating local and global information to achieve state-of-the-art results. However, these dedicated architectures for 3D understanding excel in specific tasks but struggle with transferring across tasks and modalities. To fully make use of the massive unlabelled data, self-supervised pre-training thereby becomes a viable technique. For example, Point-BERT [61], Point-MAE [33], and MaskPoint [27] propose to pre-train the Transformer [50] with masked point modeling approaches [28, 48, 63]. These methods enable models to learn generalizable features, which are transferable to different tasks effectively. There are also multi-modal pre-training strategies like ACT [10], ULIP-2 [58], and ReCon [39] that leverage cross-modal information from language and images to enhance generalization \fMamba3D: Enhancing Local Features for 3D Point Cloud Analysis via State Space Model and robustness. However, their Transformer-based backbones suffer from quadratic complexity, posing challenges in handling long sequences, resulting in coarse-grained patching and information loss. In contrast, Mamba3D leverages Mamba\u2019s linear complexity, surpassing Transformer in both performance and efficiency. 2.2 State Space Models State Space Models (SSM) [16, 17, 22], inspired by continuous systems, have emerged as promising models for sequence modeling. Notably, S4 [16] demonstrates the ability to capture long-range dependencies with linear complexity, showcasing effectiveness across diverse domains like audio [13] and vision [32]. The newly proposed Mamba model [15] further improves upon S4 by introducing a selection mechanism. By parameterizing SSM based on inputs, Mamba selectively retains relevant information, facilitating efficient processing of long-sequence data. To adapt Mamba from sequence data to unordered point cloud data, there are concurrent works PointMamba [26] and PCM [64]. PointMamba applies Mamba directly without considering the local contexts. Based on PointMLP [31], PCM lacks pre-training and suffers from excessive parameters, limiting Mamba\u2019s efficiency. In contrast, Mamba3D effectively applies Mamba to point cloud learning, integrating the unique local geometry of point clouds. Additionally, we employ various pre-training strategies to validate Mamba3D\u2019s scalability and large capacity. 3 METHOD Our aim is to leverage the Mamba model\u2019s capabilities as a backbone for point cloud feature learning, emphasizing both global receptive field and local geometric details. Below, we first briefly review the State Space Models (SSM) and the Mamba model (Section 3.1), then followed by an overview and detailed explanations of our key designs (Section 3.2-Section 3.4). Finally, we outline two pretraining strategies of our Mamba3D (Section 3.5). 3.1 Preliminaries: SSM and Mamba Drawing from continuous systems, state space models (SSM) map input \ud835\udc65\ud835\udc61to output \ud835\udc66\ud835\udc61via a latent state \u210e\ud835\udc61, with the state evolving over time \ud835\udc61continuously. In practice, to accommodate discrete data like text and images, the SSM must be discretized first: \u210e\ud835\udc61= A\u210e\ud835\udc61\u22121 + B\ud835\udc65\ud835\udc61, \ud835\udc66\ud835\udc61= C\u210e\ud835\udc61, (1) where A, B, and C are the discrete state, control, and output matrix, respectively. Because sequential parameters A, B, and C exhibit Linear Time Invariance (LTI), we can parallelize the recurrent SSM in Eq. (1) using a convolutional method into Eq. (2): K = (CB, CAB, . . . , CAL\u22121B), y = x \u2217K, (2) where L is the length of the input sequence x, and K \u2208RL denotes a global convolution kernel, which can be efficiently pre-computed. S4 [16] enhances SSM\u2019s ability for long sequence modeling and speed. Mamba [15] acknowledges the efficiency of LTI models like S4 in compressing extensive contexts into compact states compared to Transformer [50], which exhibits quadratic complexity during training due to zero-compression. However, the constant dynamics of LTI models, such as the input-independent parameters A, B, and C in Eq. (1), limit their ability to selectively remember or forget relevant information, constraining their contextual awareness. To enhance content-aware reasoning, Mamba introduces a selection mechanism to control how information propagates or interacts along the sequence dimension. This is achieved by making the parameters that affect interactions along the sequence inputdependent, as defined in Eq. (3): \u210e\ud835\udc61= \ud835\udc60\u00af A(\ud835\udc65\ud835\udc61)\u210e\ud835\udc61\u22121 + \ud835\udc60\u00af B(\ud835\udc65\ud835\udc61)\ud835\udc65\ud835\udc61, \ud835\udc66\ud835\udc61= \ud835\udc60\u00af C(\ud835\udc65\ud835\udc61)\u210e\ud835\udc61, (3) where \ud835\udc60\u00af A(\ud835\udc65\ud835\udc61), \ud835\udc60\u00af B(\ud835\udc65\ud835\udc61) and \ud835\udc60\u00af C(\ud835\udc65\ud835\udc61) typically denote three linear projections applied to input \ud835\udc65\ud835\udc61. The selection mechanism addresses the limitations of LTI models but makes parallelization shown in Eq. (2) impractical. To tackle this challenge, Mamba introduces a hardware-aware selective scan to achieve near-linear complexity. Please refer to the original Mamba paper [15] for further details. 3.2 Mamba3D Overview Though Mamba produces astounding results in sequential data, it is not straightforward to adapt Mamba to the 3D point cloud. On the one hand, Mamba employs recurrent/scan structure, which implies constant-time inference and linear-time training due to the effective context compression, but exhibits a unidirectional reliance. While this recurrent model works well for text, it poses challenges when dealing with unordered point clouds. On the other hand, Mamba\u2019s global receptive field cannot adequately capture local point geometry, limiting its ability to learn fine-grained features. To address the above issues, we introduce Mamba3D, featuring an effective local norm pooling (LNP) block for explicit local geometry extraction and a specialized bidirectional SSM (bi-SSM) tailored for unordered points. Fig. 2(a) shows an overview of Mamba3D. 3.2.1 Patch Embeddings. Given an input point cloud P \u2208R\ud835\udc41\u00d73 with \ud835\udc41points, similar to existing works [33, 61], we first employ Farthest Point Sampling (FPS) to select \ud835\udc3fcentral points P\ud835\udc36\u2208R\ud835\udc3f\u00d73. Then, for each central point P\ud835\udc56 \ud835\udc36, we construct a local patch x\ud835\udc56 \ud835\udc5d\u2208 R\ud835\udc3e\u00d73 using \ud835\udc3e-Nearest Neighborhood (KNN) in P. Finally, we employ a light-PointNet [35] to extract features for each local patch, serving as its initial patch embeddings. 3.2.2 Mamba3D Encoder. After obtaining the patch embeddings, they are treated as token sequences in the Transformer [50]. Similar to ViT [11] and BERT [9], we first introduce a learnable [CLS] token to aggregate information across the entire sequence. Then, we add standard learnable positional encoding [50] to these \ud835\udc3f+ 1 tokens. The sequence is then fed into the Mamba3D encoder for high-level feature embedding, which is finally connected to a simple fully connected layer for various downstream tasks. The design of our encoder is illustrated in the right-most part of Fig. 2(a). Specifically, inspired by MetaFormer [60], we employ a Transformer-like structure consisting of a token mixer (i.e., LNP) and a channel mixer (i.e., bi-SSM) to extract local and global features, respectively. Each block is preceded by a Layernorm [3] and followed by a residual connection [21]. \fXu Han, Yuan Tang, Zhaoxuan Wang, and Xianzhi Li (a) Overview C+ B+ L+ 0 1 2 3 4 5 6 7 Patch Embedding Task Header * Cls Seg Patch + Position Encoding * [CLS] token FPS & KNN (b) LNP (c) bi-SSM Norm LNP Norm bi-SSM T x K-norm K-pool Shared MLP Conv L+ SSM \ud835\udf0e Conv CSSM center neighbor center neighbor feature reverse SSM (C-SSM) forward SSM (L+SSM) channel flipping \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 0 1 2 3 4 5 6 7 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 0 1 2 3 4 5 6 7 Input Points Figure 2: Illustration of Mamba3D. (a) Overview. We first segment input point cloud into \ud835\udc3fpatches using FPS & KNN, and then obtain the initial patch embeddings via a light-PointNet. After adding a [CLS] token, we apply standard positional encoding to all patch embeddings, which are then fed into Mamba3D Encoder. Finally we use a task header to fit downstream tasks. (b-c) Mamba3D Encoder details. The illustration of the Mamba3D Encoder is inspired by Dosovitskiy et al. [11]. Overall, the pipeline of point embedding and encoder layer is represented by the following equations: z0 = [xcls; x1 \ud835\udc5dE; x2 \ud835\udc5dE; \u00b7 \u00b7 \u00b7 ; x\ud835\udc3f \ud835\udc5dE] + E\ud835\udc5d\ud835\udc5c\ud835\udc60, (4) z\u2032\u2113= LNP(\ud835\udc3f\ud835\udc41(z\u2113\u22121 + E\ud835\udc5d\ud835\udc5c\ud835\udc60)) + z\u2113\u22121, \u2113= 1 . . .\ud835\udc47 (5) z\u2113= bi-SSM(\ud835\udc3f\ud835\udc41(z\u2032\u2113)) + z\u2032\u2113, \u2113= 1 . . .\ud835\udc47 (6) where z is the output of each layer, xcls \u2208R1\u00d7\ud835\udc36is the learnable [CLS] token, E is the light-PointNet to project input patches from x\ud835\udc5d\u2208R\ud835\udc3f\u00d7\ud835\udc3e\u00d73 \u21a6\u2192x\ud835\udc5dE \u2208R\ud835\udc3f\u00d7\ud835\udc36, and \ud835\udc3f\ud835\udc41denotes the Layernorm operation. In practice, we stack \ud835\udc47encoder layers, and a standard learnable positional encoding E\ud835\udc5d\ud835\udc5c\ud835\udc60\u2208R(\ud835\udc3f+1)\u00d7\ud835\udc36is incorporated into every encoder layer, as in Point-MAE [33], to enhance the model\u2019s spatial awareness. 3.3 Local Norm Pooling Local geometric features have been proven to be vital for point cloud feature learning, but were unfortunately ignored in PointMamba [26]. Typically, local features in point clouds are obtained by constructing a local graph using KNN, followed by feature fusion [31, 35, 36]. To ensure both effectiveness and efficiency, we design a novel Local Norm Pooling (LNP) block by simplifying the local feature extraction into two key steps: feature propagation and aggregation. Specifically, as illustrated in Fig. 2(b), LNP comprises two operators K-norm (propagation) and K-pooling (aggregation), alongside a shared MLP for channel alignment. 3.3.1 K-norm: propagation. After constructing a local graph with \ud835\udc58neighbors using KNN around each central point, the feature propagation involves (1) enabling neighboring points to perceive relative features concerning the central point and (2) conducting feature fusion to update their features accordingly. To achieve this, we first normalize the neighbor features F\ud835\udc3e\u2208R\ud835\udc3f\u00d7\ud835\udc58\u00d7\ud835\udc36to get \u02dc F\ud835\udc3e\u2208 R\ud835\udc3f\u00d7\ud835\udc58\u00d7\ud835\udc36as defined in Eq. (7). Then, we concatenate \u02dc F\ud835\udc3ewith the repeated (by \ud835\udc3etimes) central point feature F\ud835\udc36\u2208R\ud835\udc3f\u00d7\ud835\udc58\u00d7\ud835\udc36and apply a learnable linear transformation across the local graph to obtain the propagated features c F\ud835\udc3e\u2208R\ud835\udc3f\u00d7\ud835\udc3e\u00d72\ud835\udc36: \u02dc F\ud835\udc3e= F\ud835\udc3e\u2212F\ud835\udc36 \u221a\ufe01 \ud835\udc49\ud835\udc4e\ud835\udc5f(F\ud835\udc3e\u2212F\ud835\udc36) + \ud835\udf16 , c F\ud835\udc3e= [ \u02dc F\ud835\udc3e\u2295F\ud835\udc36] \u2217\ud835\udefe+ \ud835\udefd, (7) where \ud835\udefeand \ud835\udefdare trainable scale and shift vectors as in Layernorm [3], respectively, and \u2295signifies feature channel concatenation. This linear transformation preserves topological features while capturing the rigid transformation of the local graph features. As depicted in the lower half of Fig. 2(b), our K-norm facilitates local feature propagation from the central point to its neighbors. 3.3.2 K-pooling: aggregation. After propagating features within the local graph, we aggregate the information back to the central point for feature updating. While max-pooling is commonly used for feature aggregation in unordered points to maintain order invariance [35], it would lead to information loss. Inspired by Softmax, we introduce K-pooling to efficiently perform local feature aggregation while mitigating this information loss, as defined in Eq. (8): c F\ud835\udc36= \u00cd\ud835\udc3e \ud835\udc56 exp c F\ud835\udc56 \ud835\udc3e \u00cd\ud835\udc3e \ud835\udc57exp c F\ud835\udc57 \ud835\udc3e \u00b7 c F\ud835\udc56 \ud835\udc3e, (8) where c F\ud835\udc36is the updated central point features. K-pooling maps from c F\ud835\udc3e\u2208R\ud835\udc3f\u00d7\ud835\udc58\u00d72\ud835\udc36\u21a6\u2192c F\ud835\udc36\u2208R\ud835\udc3f\u00d72\ud835\udc36, generates updated central point features, as depicted in the upper half of Fig. 2(b). \fMamba3D: Enhancing Local Features for 3D Point Cloud Analysis via State Space Model \uf0e9 0 \uf0e9 \uf0e9 1 \uf0e9 \uf0e9 2 \uf0e9 \uf0e9 3 \uf0e9 \uf0e9 4 \uf0e9 \uf0e9 5 \uf0e9 \uf0e9 6 \uf0e9 \uf0e9 7 \uf0e9 channel flipping \u2713 token flipping \uf0fb L+ (C+) C(L+) L(C+) C+ B+ L+ Horizontal flip Vertical flip C-SSM 0 \uf0e9 1 \uf0e9 2 \uf0e9 3 \uf0e9 4 \uf0e9 5 \uf0e9 6 \uf0e9 7 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0e9 \uf0ea \uf0ea \uf0ea \uf0ea \uf0ea \uf0ea \uf0ea \uf0ea 0 1 2 3 4 5 6 7 \uf0ea \uf0ea \uf0ea \uf0ea \uf0ea \uf0ea \uf0ea \uf0ea Figure 3: Illustration of feature channel flipping. Instead of horizontal token flip, we propose a vertical feature flip, which alleviates the pseudo-order reliance. Intuitively, the LNP block constructs a local graph with adjacent patches and facilitates local feature propagation and aggregation, enabling information exchange within the local field, thus capturing the geometric and semantic features of the local patches. The receptive field of the LNP is smaller than that of SSM. By adjusting the size of the receptive field, the LNP integrates local and global information, enabling Mamba3D to more comprehensively capture the semantic information of 3D objects. 3.4 Bidirectional-SSM Mamba is originally designed as a unidirectional model suited for processing 1D sequences like text. However, vision tasks often require an understanding of global spatial information. Hence, Vision Mamba [67] proposed using both forward and backward SSM to incorporate global information by simply horizontally flipping the token order, as illustrated by the L+ and Lembeddings in Fig. 3. However, unlike the structured grid of images, point clouds are unordered and irregular, learning sequence order causes an unreliable and unstable pseudo-order dependency. To address this, we instead propose to prioritize modeling the intrinsic distribution of feature vectors rather than point tokens. Specifically, we propose a novel backward SSM, named feature reverse SSM, or C-SSM, as illustrated in Fig. 3. Combining this with the original forward SSM in Mamba, termed L+SSM, results in our bidirectional-SSM block, or bi-SSM for short. Formally, the bi-SSM block is defined as: bi-SSM(F) = F + [L+SSM(F\ud835\udc3f+)] + [C-SSM(F\ud835\udc36\u2212)]. (9) With the input forward embedding F, also denoted as F\ud835\udc3f+, we perform a channel flip to obtain F\ud835\udc36\u2212, which is then fed into L+SSM and C-SSM block to generate the output embedding, respectively. As shown in Fig. 3, we employ a vertical flip to obtain F\ud835\udc36\u2212, instead of a horizontal flip to get F\ud835\udc3f\u2212. This approach reduces the pseudo-order reliance, crucial in unordered point clouds where token order lacks consistent meaning. For instance, two adjacent tokens might represent the tail and head of an airplane, respectively, which are spatially and semantically distant, posing challenges for continuous and complete feature learning. Mamba\u2019s feature selection mechanism may exacerbate this, scattering features in high-dimensional space. Instead, by reversing the feature channel, the model prioritizes learning the distribution of feature vectors. These two directions\u2014forward token embeddings and backward feature channels\u2014carry distinct and more reliable information, enhancing Mamba3D\u2019s ability to acquire more effective knowledge. 3.5 Pre-training Details Our Mamba3D can not only be trained from scratch, but also be pre-trained with various pre-training strategies, thus facilitating downstream tasks with promising performance. In experiments, we verify the capacity and representation learning capability of Mamba3D with two commonly used pre-training strategies proposed by Point-BERT [61] and Point-MAE [33]. 3.5.1 Point-BERT pre-training stategy. Firstly, we randomly mask out 55%\u223c85% input point embeddings, instead of a mask ratio between [0.25, 0.45] in Point-BERT. Increasing the mask ratio can not only speed up the training process, but also push Mamba3D\u2019s feature learning ability, enabling the model to learn from limited inputs. Then the Mamba3D encoder processes both visible and masked embeddings to produce a token sequence. Meanwhile, we employ the pre-trained dVAE [44] weight of Point-BERT directly to predict token sequence from point embeddings as token guidance. Lastly, we calculate the L1 loss between the encoder\u2019s output token sequence and the one from dVAE as the loss function. 3.5.2 Point-MAE pre-training stategy. Following Point-MAE, we use a masked point modeling approach and directly reconstruct masked points. We employ an encoder-decoder architecture, where the encoder processes only visible tokens and generates their encoding. Unlike Point-MAE, our decoder employ a different architecture from encoder, containing only bi-SSM block but no LNP block, which can speed up convergence without performance loss. The encoded visible tokens and masked tokens are fed into the decoder to predict masked points. Loss is calculated using the Chamfer Distance [12] between output and ground truth points. In downstream tasks, we only use the pre-trained encoder to extract features, with task headers appended for fine-tuning. 4 EVALUATION In this section, we first introduce the network implementation details. Then we evaluate Mamba3D against various existing methods in multiple downstream tasks, including object classification, part segmentation, and few-shot learning. Finally, we show the results of the ablation study for our model. 4.1 Implementation Details We employ \ud835\udc47=12 encoder layers with feature dimension \ud835\udc36=384, and set \ud835\udc58=4 in the LNP block. During pre-training, we utilize the ShapeNet dataset [4], which contains \u223c50K 3D CAD models covering 55 object categories. Each input point cloud, containing \ud835\udc41=1024 points, is divided into 64 patches with each consisting of 32 points. Pre-training employs the AdamW optimizer [30] with cosine decay, an initial learning rate of 0.001, a weight decay of 0.05, a dropout rate of 0.1, and a batch size of 128 for 300 epochs. During finetuning, the point cloud is divided into 128 patches, and we train the model with the AdamW optimizer with cosine decay, an initial learning rate of 0.0005, a weight decay of 0.05, and a batch size of 32 for 300 epochs. Unless specified, we use the same task header as Point-MAE [33] in all downstream tasks. When training from scratch, we use the same settings as in fine-tuning. All experiments are conducted using an NVIDIA RTX 3090 GPU. \fXu Han, Yuan Tang, Zhaoxuan Wang, and Xianzhi Li Table 1: Classification results on the ScanObjectNN and ModelNet40 datasets. The inference model parameters #P (M), FLOPs #F (G), and overall accuracy (%) are reported. We compare with methods using the \u25b3hierarchical Transformer architectures (e.g., Point-M2AE [63]), \u2022 plain Transformer architectures, \u25e6dedicated architectures for 3D understanding, and \u2605Mamba-based architectures. \u2020 means additional tuning. PT: pre-training strategy. Method PT #P \u2193 #F \u2193 ScanObjectNN ModelNet40 OBJ_BG \u2191 OBJ_ONLY \u2191 PB_T50_RS \u2191 1k P \u2191 Supervised Learning Only: Dedicated Architectures \u25e6PointNet [35] \u00d7 3.5 0.5 73.3 79.2 68.0 89.2 \u25e6PointNet++ [36] \u00d7 1.5 1.7 82.3 84.3 77.9 90.7 \u25e6DGCNN [52] \u00d7 1.8 2.4 82.8 86.2 78.1 92.9 \u25e6PointCNN [25] \u00d7 0.6 86.1 85.5 78.5 92.2 \u25e6DRNet [41] \u00d7 80.3 93.1 \u25e6SimpleView [14] \u00d7 80.5\u00b10.3 93.9 \u25e6GBNet [42] \u00d7 8.8 81.0 93.8 \u25e6PRA-Net [7] \u00d7 2.3 81.0 93.7 \u25e6MVTN [20] \u00d7 11.2 43.7 92.6 92.3 82.8 93.8 \u25e6PointMLP [31] \u00d7 12.6 31.4 85.4\u00b10.3 94.5 \u25e6PointNeXt [40] \u00d7 1.4 3.6 87.7\u00b10.4 94.0 \u25e6P2P-HorNet [53] \u2713 34.6 89.3 94.0 \u25e6DeLA [5] \u00d7 5.3 1.5 90.4 94.0 Supervised Learning Only: Transformer or Mamba-based Models \u2022 Transformer [50] \u00d7 22.1 4.8 79.86 80.55 77.24 91.4 \u25b3PCT [18] \u00d7 2.9 2.3 93.2 \u2605PointMamba [26] \u00d7 12.3 3.6 88.30 87.78 82.48 \u2605PCM [64] \u00d7 34.2 45.0 88.10\u00b10.3 93.4\u00b10.2 \u25b3SPoTr [34] \u00d7 1.7 10.8 88.60 \u25b3PointConT [29] \u00d7 90.30 93.5 \u2605Mamba3D w/o vot. \u00d7 16.9 3.9 92.94 92.08 91.81 93.4 \u2605Mamba3D w/ vot. \u00d7 16.9 3.9 94.49 92.43 92.64 94.1 with Self-supervised Pre-training \u2022 Transformer [50] OcCo [51] 22.1 4.8 84.85 85.54 78.79 92.1 \u2022 Point-BERT [61] IDPT [62] 22.1+1.7\u2020 4.8 88.12 88.30 83.69 93.4 \u2022 MaskPoint [27] MaskPoint 22.1 4.8 89.30 88.10 84.30 93.8 \u2605PointMamba [26] Point-MAE 12.3 3.6 90.71 88.47 84.87 \u2022 Point-MAE [33] IDPT [62] 22.1+1.7\u2020 4.8 91.22 90.02 84.94 94.4 \u25b3Point-M2AE [63] Point-M2AE 15.3 3.6 91.22 88.81 86.43 94.0 \u2022 Point-BERT [61] Point-BERT 22.1 4.8 87.43 88.12 83.07 93.2 \u2605Mamba3D w/o vot. Point-BERT 16.9 3.9 92.25 +4.82 91.05 +2.93 87.58 +4.51 94.4 +1.2 \u2022 Point-MAE [33] Point-MAE 22.1 4.8 90.02 88.29 85.18 93.8 \u2605Mamba3D w/o vot. Point-MAE 16.9 3.9 93.12 +3.10 92.08 +3.79 88.20 +3.02 94.7 +0.9 \u2605Mamba3D w/ vot. Point-MAE 16.9 3.9 95.18 +5.16 92.60 +4.31 88.97 +3.79 95.1 +1.3 4.2 Comparison on Downstream Tasks We show Mamba3D\u2019s results on downstream tasks here. For each experiment, we report results for models trained from scratch, as well as those employing two pre-training strategies. Unless specified, the results for Mamba3D do not use a voting strategy. 4.2.1 Object Classification. We conduct classification experiments on both the real-world ScanObjectNN [49] dataset and the synthetic ModelNet40 [56] dataset. Settings. ScanObjectNN dataset contains \u223c15K objects from 15 classes, scanned from the real world with cluttered backgrounds. We experiment with its three variants: OBJ_BG, OBJ_ONLY, and PB_T50_RS. We use rotation as data augmentation [10], with a point cloud size \ud835\udc41=2048. ModelNet40 dataset includes \u223c12K synthetic 3D CAD models across 40 classes. We use \ud835\udc41=1024 points as input, and apply scale&translate for data augmentation [35]. \fMamba3D: Enhancing Local Features for 3D Point Cloud Analysis via State Space Model Table 2: Few-shot classification on ModelNet40 dataset. Overall accuracy (%) without voting is reported. P-B and P-M represent Point-BERT and Point-MAE strategy, respectively. Method 5-way 10-way 10-shot \u2191 20-shot \u2191 10-shot \u2191 20-shot \u2191 Supervised Learning Only \u25e6DGCNN [52] 31.6 \u00b1 2.8 40.8 \u00b1 4.6 19.9 \u00b1 2.1 16.9 \u00b1 1.5 \u2022 Transformer [50] 87.8 \u00b1 5.2 93.3 \u00b1 4.3 84.6 \u00b1 5.5 89.4 \u00b1 6.3 \u2605Mamba3D 92.6 \u00b1 3.7 96.9 \u00b1 2.4 88.1 \u00b1 5.3 93.1 \u00b1 3.6 with Self-supervised Pre-training \u25e6DGCNN+OcCo 90.6 \u00b1 2.8 92.5 \u00b1 1.9 82.9 \u00b1 1.3 86.5 \u00b1 2.2 \u2022 OcCo [51] 94.0 \u00b1 3.6 95.9 \u00b1 2.7 89.4 \u00b1 5.1 92.4 \u00b14.6 \u2605PointMamba [26] 95.0 \u00b1 2.3 97.3 \u00b1 1.8 91.4 \u00b1 4.4 92.8 \u00b1 4.0 \u2022 MaskPoint [27] 95.0 \u00b1 3.7 97.2 \u00b1 1.7 91.4 \u00b1 4.0 93.4 \u00b1 3.5 \u2022 Point-BERT [61] 94.6 \u00b1 3.1 96.3 \u00b1 2.7 91.0 \u00b1 5.4 92.7 \u00b1 5.1 \u2605Mamba3D+P-B 95.8 \u00b1 2.7 97.9 \u00b1 1.4 91.3 \u00b1 4.7 94.5 \u00b1 3.3 \u2022 Point-MAE [33] 96.3 \u00b1 2.5 97.8 \u00b1 1.8 92.6 \u00b14.1 95.0 \u00b1 3.0 \u2605Mamba3D+P-M 96.4 \u00b1 2.2 98.2 \u00b11.2 92.4 \u00b1 4.1 95.2 \u00b1 2.9 Results. Table 1 reports the comparison results. When trained from scratch, Mamba3D achieved 91.81% overall accuracy (OA) on the most difficult variant PB_T50_RS of ScanObjectNN, and 92.64% after voting, surpassing SoTA model DeLA\u2019s 90.4% [5], achieving new SoTA for models trained from scratch. Compared to Transformer [50], Mamba3D gains an OA increase of +15.40%, with only 76% parameters and 81% FLOPs. Notably, Mamba3D surpasses two concurrent works PointMamba [26] and PCM [64] by +10.16% and +4.54%, respectively. On the ModelNet40 dataset, Mamba3D is +2.7% higher than Transformer. Our model surpasses PCM with less than half the parameters (16.9M vs. 34.2M), and only 8.7% FLOPs (3.9G vs. 45.0G). After pre-training, our proposed Mamba3D consistently outperforms Transformer-based models. With the Point-BERT [61] strategy, Mamba3D surpasses Point-BERT by +4.51% on ScanObjectNN and +1.2% on ModelNet40, also outperforming hierarchical Transformer model Point-M2AE [63] by +1.15% and +0.4% on this two datasets. When using the Point-MAE [33] strategy, Mamba3D achieves 95.1% on ModelNet40, setting new SoTA for single-modal pre-trained models. On the ScanObjectNN dataset, Mamba3D outperforms Transformer with OcCo [51] by +10.2%, and Point-MAE by +3.8%. Besides, we gained an increase of +4.1% compared to PointMamba [26] with the same pre-training strategy. Overall, these results highlight Mamba3D\u2019s superiority over existing dedicated architectures and Transformeror Mamba-based models, achieving multiple SoTA, demonstrating its strength across various settings. 4.2.2 Few-shot Learning. We conduct few-shot classification experiments following previous work [46], to further validate fewshot learning ability of Mamba3D. Settings. We use ModelNet40 dataset [56] with an \ud835\udc5b-way, \ud835\udc5ashot setting, where \ud835\udc5bis the number of classes randomly sampled from the dataset, and \ud835\udc5adenotes the number of samples randomly drawn from each class. We train the model with only the sampled Table 3: Part segmentation on ShapeNetPart dataset. The class mIoU (mIoU\ud835\udc36) and the instance mIoU (mIoU\ud835\udc3c) are reported, with model parameters #P (M) and FLOPs #F (G). Method mIoU\ud835\udc36(%) \u2191 mIoU\ud835\udc3c(%) \u2191 #P \u2193 #F \u2193 Supervised Learning Only \u25e6PointNet [35] 80.4 83.7 3.6 4.9 \u25e6PointNet++ [36] 81.9 85.1 1.0 4.9 \u25e6DGCNN [52] 82.3 85.2 1.3 12.4 \u2022 Transformer [50] 83.4 85.1 27.1 15.5 \u2605Mamba3D 83.7 85.7 23.0 11.8 with Self-supervised Pre-training \u2022 OcCo [51] 83.4 84.7 27.1 \u25e6PointContrast [57] 85.1 37.9 \u25e6CrossPoint [1] 85.5 \u2022 Point-BERT [61] 84.1 85.6 27.1 10.6 \u2605Mamba3D+P-B 84.1 85.7 21.9 9.5 \u2022 Point-MAE [33] 84.2 86.1 27.1 15.5 \u2605PointMamba [26] 84.4 86.0 17.4 14.3 \u2605Mamba3D+P-M 83.6 85.6 23.0 11.8 \ud835\udc5b\u00d7\ud835\udc5asamples. During testing, we randomly select 20 novel objects for each of the \ud835\udc5bclasses to serve as test data. We experiment with \ud835\udc5b\u2208{5, 10} and \ud835\udc5a\u2208{10, 20}. For each setting, we report the mean accuracy and standard deviation of 10 independent experiments. Results. Table 2 reports the comparison results. When trained from scratch, Both Mamba3D and Transformer significantly surpass DGCNN [52] by a large margin. Mamba3D outperforms Transformer [50] with overall accuracy (OA) improvements of +4.8%, +3.6%, +3.5%, and +3.7% across four settings, respectively, with also smaller deviations and fewer FLOPs. Under the Point-BERT strategy, Mamba3D outperformed Point-BERT [61] by +1.2%, +1.6%, +0.3%, and +1.8%, respectively, and with smaller deviations. Similarly, with the Point-MAE [33] strategy, Mamba3D outperforms Point-MAE on three out of four settings, and surpasses PointMamba [26] on all settings. These few-shot experiments demonstrate Mamba3D\u2019s adeptness at learning semantic information and its efficient knowledge transfer ability to downstream tasks, even with limited data. 4.2.3 Part Segmentation. We conducted part segmentation on the ShapeNetPart dataset [59] to predict more fine-grained class labels for every point. Settings. ShapeNetPart dataset comprises \u223c16K objects across 16 categories. We use a segmentation head similar to Point-BERT [61]utilizing PointNet++ [36] in feature propagation, along with a similar feature extraction strategy\u2014employing features from the 4th, 8th, and 12th encoder layers. We use input point cloud \ud835\udc41=2048 without normal, and employ cross-entropy as the loss function. Results. Table 3 reports the comparison results in terms of the average instance IoU (mIoU\ud835\udc3c) and average category IoU (mIoU\ud835\udc36). With supervised training alone, Mamba3D surpasses Transformer by +0.3% in mIoU\ud835\udc36and +0.6% in mIoU\ud835\udc3c. With the Point-BERT strategy, Mamba3D achieves +0.1% higher mIoU\ud835\udc3ccompared to Point-BERT. While Mamba3D yields slightly lower results than \fXu Han, Yuan Tang, Zhaoxuan Wang, and Xianzhi Li 91.2 89.8 92.1 91.2 90.7 90.5 91 29.3 30 30.6 34.6 37.1 41.5 46.3 10 20 30 40 50 85 90 95 100 1 2 4 6 8 12 16 Training Time per Epoch (S) Overall Accuracy (%) OBJ_ONLY Time 91.1 89.5 92.1 91.6 91.2 1 1.9 3.9 7.7 11.6 0 4 8 12 85 90 95 100 32 64 128 256 384 FLOPs (G) Overall Accuracy (%) OBJ_ONLY FLOPs a) \ud835\udc8cin LNP b) \ud835\udc73tokens 90.2 90.5 90.5 92.1 82 86 90 94 Shuffle All Shuffle SSM Z-order No Order OBJ_ONLY c) Ordering Mamba3D Overall Accuracy (%) Figure 4: Ablation on (a) the parameter \ud835\udc58in the LNP block, (b) input patch sequence length \ud835\udc3f, and (c) ordering strategy. The overall accuracy (%), training time/epoch (s) and FLOPs (G) are reported. Table 4: Ablation on model architecture. Method OBJ_ONLY (%) \u2191 Params (M) \u2193 FLOPs (G) \u2193 \u2605Full 92.1 16.9 3.9 w/o LNP 90.9 -1.2 13.3 3.4 w/o bi-SSM 89.8 -2.3 4.4 2.5 \u2605tri-SSM 91.0 -1.1 17.9 3.9 \u2605one-SSM 90.9 -1.2 16.0 3.9 \u2022 LNP + Attn 90.9 -1.2 25.7 5.4 \u2605Token Flip 90.7 -1.4 16.9 3.9 Table 5: Ablation on K-norm. Method OBJ_ONLY (%) \u2191 Params (M) \u2193 FLOPs (G) \u2193 K-norm 92.1 16.93 3.86 w/o rela. dist. 91.6 -0.5 16.93 3.86 w/ K linear 90.9 -1.2 16.98 3.86 w/o linear 90.5 -1.6 16.91 3.86 w/o K-norm 89.2 -2.9 21.25 5.98 w/o Fc 88.8 -3.3 15.14 3.63 w/o concat. 88.6 -3.5 15.14 3.63 Point-MAE, it employs 17.8% fewer parameters and 31.4% fewer FLOPs. The segmentation experiments further demonstrate the effectiveness and efficiency of Mamba3D. 4.3 Ablation Study We conduct ablation studies on model structure and also investigate the effect of ordering strategies. We report the results of training from scratch on the ScanObjectNN (OBJ_ONLY) dataset. 4.3.1 Architecture Ablation. Results of ablation on architecture are shown in Table 4. Removing the LNP block (w/o LNP) and the bi-SSM block (w/o bi-SSM) separately results in a 1.2% and 2.3% degradation in overall accuracy (OA), respectively. To further validate the effect of the bi-SSM block, we design four variants. Firstly, we replace it with a self-attention [50] layer (LNP+Attn), which leads to a 1.2% reduction in OA. When using only a unidirectional SSM (one-SSM), the OA decreases by 1.2%. Exploring token flip as an alternative to the channel flip (Token Flip) results in a 1.4% OA degradation, and directly adding a token flip in bi-SSM block (tri-SSM) leads to a 1.1% drop. These results demonstrate the effectiveness of the C-SSM block for unordered points. Table 6: Ablation on K-pooling. Method OBJ_ONLY (%) \u2191 Params (M) \u2193 FLOPs (G) \u2193 K-pooling 92.1 16.93 3.86 w/ Maxpool 91.4 -0.7 16.93 3.86 w/o K-pool 89.8 -2.3 17.72 4.47 w/ Max + Avgpool 89.7 -2.4 16.93 3.86 w/ Avgpool 89.3 -2.8 16.93 3.86 4.3.2 K-norm Ablation. Results of ablation on K-norm are shown in Table 5. Removing K-norm entirely (w/o K-norm) decreases OA by 2.9%. We extensively verify the effectiveness of the K-norm operator defined in Eq. (5). Dropping the concatenated \ud835\udc39\ud835\udc36(w/o concat.) lowered OA to 88.6%, and removing \ud835\udc39\ud835\udc36completely (w/o \ud835\udc39\ud835\udc36) decreases OA by 3.3%. Without linear transformation (w/o linear), OA decreases by 1.6%, and using distinct linear transformations for \ud835\udc3eneighbors (K linear) leads to a 1.2% drop, underscoring Knorm\u2019s simplicity and efficacy. Even without the centralizing \ud835\udc39\ud835\udc36, the model achieved 91.6% OA. These results highlight the K-norm\u2019s role in effectively transmitting local information and improving local geometric capture. 4.3.3 K-pooling Ablation. More detailed ablation results for Kpooling are shown in Table 6. Replacing K-pooling with one MLP (w/o K-pool) leads to an increase of +0.8M in parameters and +0.61G in FLOPs, while the OA decreases by 2.3%, highlighting the simplicity and effectiveness of K-pooling. When K-pooling is substituted with Avgpooling, Maxpooling, or Max+Avgpooling, the OA is reduced by 2.8%, 0.7%, and 2.4%, respectively, indicating the efficacy of the simple K-pooling operator in aggregating local features. 4.3.4 Parameters and Ordering. We also analyze the model\u2019s performance under various model parameters, as depicted in Fig. 4(ab). In Fig. 4(a), we adjust the \ud835\udc58in LNP to change the size of the local patch graph. Results show that as the local neighborhood increases, so does the model training time, with the overall accuracy (OA) reaching its peak at \ud835\udc58=4. Results in Fig. 4(b) indicate that as the token length \ud835\udc3fincreases, so do the FLOPs, with the OA peaking at 92.1% when \ud835\udc3f=128. Lastly, in Fig. 4(c), we investigate ordering strategies and find that Mamba3D performs optimally without any ordering strategy applied. This suggests that Mamba3D effectively captures the semantic features from unordered points. \fMamba3D: Enhancing Local Features for 3D Point Cloud Analysis via State Space Model 5"
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.14977v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.14977v1",
|
| 3 |
+
"title": "Social Media and Artificial Intelligence for Sustainable Cities and Societies: A Water Quality Analysis Use-case",
|
| 4 |
+
"abstract": "This paper focuses on a very important societal challenge of water quality\nanalysis. Being one of the key factors in the economic and social development\nof society, the provision of water and ensuring its quality has always remained\none of the top priorities of public authorities. To ensure the quality of\nwater, different methods for monitoring and assessing the water networks, such\nas offline and online surveys, are used. However, these surveys have several\nlimitations, such as the limited number of participants and low frequency due\nto the labor involved in conducting such surveys. In this paper, we propose a\nNatural Language Processing (NLP) framework to automatically collect and\nanalyze water-related posts from social media for data-driven decisions. The\nproposed framework is composed of two components, namely (i) text\nclassification, and (ii) topic modeling. For text classification, we propose a\nmerit-fusion-based framework incorporating several Large Language Models (LLMs)\nwhere different weight selection and optimization methods are employed to\nassign weights to the LLMs. In topic modeling, we employed the BERTopic library\nto discover the hidden topic patterns in the water-related tweets. We also\nanalyzed relevant tweets originating from different regions and countries to\nexplore global, regional, and country-specific issues and water-related\nconcerns. We also collected and manually annotated a large-scale dataset, which\nis expected to facilitate future research on the topic.",
|
| 5 |
+
"authors": "Muhammad Asif Auyb, Muhammad Tayyab Zamir, Imran Khan, Hannia Naseem, Nasir Ahmad, Kashif Ahmad",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.SI",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.SI",
|
| 11 |
+
"cs.CL"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "LLM Fairness",
|
| 15 |
+
"gt": "This paper focuses on a very important societal challenge of water quality\nanalysis. Being one of the key factors in the economic and social development\nof society, the provision of water and ensuring its quality has always remained\none of the top priorities of public authorities. To ensure the quality of\nwater, different methods for monitoring and assessing the water networks, such\nas offline and online surveys, are used. However, these surveys have several\nlimitations, such as the limited number of participants and low frequency due\nto the labor involved in conducting such surveys. In this paper, we propose a\nNatural Language Processing (NLP) framework to automatically collect and\nanalyze water-related posts from social media for data-driven decisions. The\nproposed framework is composed of two components, namely (i) text\nclassification, and (ii) topic modeling. For text classification, we propose a\nmerit-fusion-based framework incorporating several Large Language Models (LLMs)\nwhere different weight selection and optimization methods are employed to\nassign weights to the LLMs. In topic modeling, we employed the BERTopic library\nto discover the hidden topic patterns in the water-related tweets. We also\nanalyzed relevant tweets originating from different regions and countries to\nexplore global, regional, and country-specific issues and water-related\nconcerns. We also collected and manually annotated a large-scale dataset, which\nis expected to facilitate future research on the topic.",
|
| 16 |
+
"main_content": "Introduction Real-time monitoring and observation of resources and infrastructure is a primary task towards a resilient infrastructure and sustainable cities [1]. This allows for taking appropriate recovery actions for the mitigation of risks and damages. Crowdsourcing is one of the effective ways used for real-time monitoring and feedback on infrastructure [2]. One of the key methods, widely explored in the literature, for crowdsourcing is conducting surveys to obtain citizens\u2019 feedback on different services, such as water quality, air quality, roads, infrastructure, and other societal challenges. These surveys can help in obtaining more detailed, contextual, and localized information [3]. These surveys are either conducted by asking citizens to fill in an online form or a questionnaire. More recently, mobile applications have also been developed for conducting such surveys, where the participants were asked to install and give feedback. However, these online and in-person surveys have several limitations [4]. One of the key limitations of such surveys is the limited scope, which means they can cover a limited number of people as people are often reluctant to install such applications as we noticed during the COVID-19 pandemic [5]. Moreover, it takes a lot of time to complete a survey and also needs to involve Email address: kashif.ahmad@mtu.ie (Kashif Ahmad) several human and other resources, thus, the frequency of such surveys is generally very low as it is costly and unfeasible to frequently conduct such surveys. These limitations of the current crowd-sourcing methods could be overcome by extracting information from social media outlets, such as Twitter and Facebook. Social media outlets have already been proven to be an effective source of communication and information spreading [6, 7]. Their capabilities to engage large volumes of audiences worldwide make them a preferred platform for discussing and conveying concerns over different domestic and global challenges. The literature already reports their effectiveness in a diversified set of societal, environmental, and technological topics [8, 9]. In this work, we explore the potential of social media as a crowd-sourcing source/medium of instant feedback on water quality. To this aim, an automatic solution is proposed that is able to collect and analyze citizens\u2019 feedback on water quality. The proposed system will not only engage a large number of participants, which is a key factor in meaningful feedback, but it will also be a continuous process and will keep collecting people\u2019s feedback continuously. One of the key advantages of the system is collecting and analyzing feedback without asking the citizens to fill in any online form/survey rather it will keep filtering and analyzing relevant social media posts in a privacypreserving manner. Preprint submitted to Journal of L AT EX Templates April 24, 2024 arXiv:2404.14977v1 [cs.SI] 23 Apr 2024 \fThe proposed system is composed of (i) a crawler, which is responsible for collecting social media posts (Tweets), (ii) a classification framework employing several NLP algorithms in a merit-based fusion to differentiate between water-related and irrelevant tweets, and (iii) topical analysis to automatically analyze and extract key water-related issues discussed in the tweets. For the training and evaluation of the text classification framework, we also collected and annotated a large-scale benchmark dataset, which will be made publicly available for further research in the domain. The key contributions of the work can be summarized as follows: \u2022 We propose an automatic tool to collect, analyze, and extract meaningful information from social media posts as a source of instant feedback on water quality, as a first step towards a sustainable water network. \u2022 We propose a merit-based fusion framework by combining several transformers-based NLP algorithms to differentiate between water-related and irrelevant tweets. \u2022 We also collected and annotated a large-scale benchmark dataset containing around 8,000 tweets. \u2022 We also perform topic modeling on the relevant tweets to automatically extract key water-related issues discussed in the relevant tweets. \u2022 We also analyze the origin of the water-related tweets and provide region and country-wise distribution of the water-related tweets collected by our system. This analysis shows the growing concern over this important societal challenge. The rest of the paper is organized as follows. Section 2 provides an overview of the related work. Section 3 discusses the proposed methodology. Section 4 covers the experimental setup, conducted experiments, and experimental results. Finally, Section 5 concludes the paper. 2. Related Work The literature already reports several interesting crowdsourcing-based solutions, which are mostly based on offline or online surveys for infrastructure monitoring and feedback on different public services [10]. The majority of the recent solutions rely on smartphones and other handheld devices by developing smart applications allowing users to give feedback on the infrastructure and services. For instance, Rapousis et al. [11] proposed QoWater, a client-to-server architecture-based mobile application allowing mobile users to give feedback on water quality. Similarly, Santani et al. [12] proposed CommuniSense, a mobile phone application for crowdsourcing to monitor road conditions in Nairobi. However, several challenges are associated with such applications for crowdsourcing [13]. One of the key limitations of such surveys is the limited scope, which means they can cover a limited number of people as, generally, people are found reluctant to install and use such mobile applications. A prime example of people\u2019s reluctance to such mobile applications is observed during COVID-19 when people showed concerns over such applications in terms of privacy, difficulty in usage, and battery consumption [5]. Moreover, it takes a lot of time to complete a survey and also needs to involve several human and other resources, thus, the frequency of such surveys is generally very low as it is costly and unfeasible to frequently conduct such surveys. These challenges could be overcome by extracting people\u2019s feedback on infrastructure and public services. The literature already provides some hints on the effectiveness of social media for real-time monitoring and instant feedback on different services. For instance, Want et al. [14] explore the potential of social media as a source of feedback on government services by analyzing citizens\u2019 opinions in a social media text. Water quality analysis is one of the key applications that recently got the attention of the community. To this aim, several interesting frameworks have been introduced. The majority of the existing works aim at sentiment analysis of social media posts to extract people\u2019s opinions on water quality. For instance, Lambert [15] proposed a sentiment analysis framework for analyzing users\u2019 feedback and perception of tap water quality. Similarly, Li et al. [16] performed sentiment analysis on social media posts about recycled water in China. Jiang et al. [17], on the other hand, analyzed the public\u2019s opinion on large hydro projects by performing sentiment analysis on relevant social media posts. To this aim, three different hydro projects in China are considered, and mixed opinions were noticed for the projects. More recently, water quality analysis from social media posts has also been introduced in MediaEval 2021 [18]. The task involved the retrieval of relevant multimedia content describing water quality in an Italian region. A couple of interesting solutions, incorporating different types of available information, are proposed in response to the task. For instance, Hanif et al. [19] fine-tuned exiting pre-trained deep-learning models namely VGGNet and BERT for retrieving relevant visual and textual content, respectively. Overall better results are reported for textual content. Ayub et al. [20] rather focused on textual content by employing three different NNs models including BERT, RoBERTa, and a custom LSTM both individually and jointly in a naive late fusion scheme. Despite the initial efforts in the domain, several interesting aspects of water quality analysis and automatic analysis of people\u2019s feedback on public services and infrastructure, in general, are unexplored. For instance, the majority of the initial efforts are based on sentiment analysis without extracting meaningful information from the content itself. The domain also lacks a large-scale benchmark dataset. To this aim, in this work, we collect and annotate a large-scale benchmark dataset on water quality analysis. We also extend the text classification framework with topic modeling to automatically extract key waterrelated issues discussed in social media. 2 \f3. Methodology Figure 1 provides the block diagram of the proposed system. As can be seen, the proposed system is composed of five steps. In the first step, a large number of Tweets have been collected. In the next step, these tweets are annotated in a crowd-sourcing study. The annotated dataset is then used to train/finetune Large Language Models (LLMs) for the classification of tweets into relevant and non-relevant tweets. In the fourth step, several merit-based fusion techniques are used to combine the classification scores obtained with the individual models. In the final step, topic modeling techniques are used to identify topics in the relevant tweets. In the next subsections, we provide a detailed description of each step. 3.1. Data Collection, Cleaning, and Annotation For data collection, we developed a crawler able to continuously collect data from different outlets of social media. As proof of concept, in the current implementation, data is collected from Twitter only. To this aim, we used a Python package namely Tweepy1 with different relevant keywords, such as waterpollution, water, watercrisis, watersmell, drinkingwater, watercolour, cleanwater, waterquality, plasticpollution, drinkingwater, watercrisis, savewater, waterislife, cleantheocean, plasticocean, endplasticpollution. The list of keywords is prepared in a data-driven manner by picking the keywords used in social media posts, blogs, newspapers etc., . We tried to include as many as possible keywords to the list to collect relevant and quality tweets. This resulted in a large collection of tweets, which were saved in a CSV file. After data collection, all the collected tweets are manually annotated by involving multiple volunteers in a crowd-sourcing activity. Before the annotation, the collected data is manually checked to remove less informative tweets. For example, we removed very short tweets without sufficient text or containing tags only. We also removed duplicate entries in the file. During the crowd-sourced activity, we manually analyzed a total of 8,000 tweets, which are annotated as relevant or nonrelevant. To ensure, the quality of the annotated data, each sample is checked by three different annotators and is labeled based on the majority votes. The participants of the crowd-sourcing activity are postgraduate students with sufficient knowledge of the domain. 3.2. Text Classification For text classification, we employed several LLMs both individually and jointly in a merit-based fusion technique to differentiate between relevant and non-relevant tweets. In the next subsections, we provide a detailed description of the classification and fusion process. 1https://www.tweepy.org/ Data Collection Data Annotation in Crowdsourcing Activity and Pre-processing Text Classification via LLMs M1 M2 Mn Regions/Location Extraction from the Text Merit-based Late Fusion C =W1c1+W2C2+ ... WnCn Key Issues Extraction via Topic Modeling Topics\u00a0 Topics Frequency Cluster of words by topic\u00a0 Figure 1: A block diagram of the proposed methodology. 3 \f3.2.1. Classification Via Individual Models In this work, we mainly rely on state-of-the-art transformerbased NLP models for the classification of tweets. In total, six different models are used. These models include the original BERT model, RoBERTa, ALBERT, DistilBERT, GPT, and Meta-LLAMA. The selection of these models is motivated by their proven performances in similar tasks, and we believe the evaluation of these models will provide a baseline for future work in the domain. A brief overview of these models is provided below. \u2022 BERT: It is one of the state-of-the-art NLP algorithms that have been widely used for a diversified list of NLP applications. Its ability to read/learn in both directions makes it a preferred choice in different text-processing applications. Several implementations of BERT are available. In this work, we used Tensorflow implementation. The model is composed of 12 layers and attention heads, and 110 million parameters. Our loss function is based on the Binary Cross entropy loss function while the Adaptive Moments (Adam) optimizer is used in the experiments. \u2022 RoBERTa: RoBERTa is another state-of-the-art transformer-based NLP model, and it uses self-attention for processing and generating contextualized representations of input text. One of the key advantages of RoBERTa over BERT is its training on a larger dataset and the use of a dynamic masking technique allowing the model to learn robust and generalizable representations of words. In this work, we fine-tuned the model on our dataset by using the Adam optimizer with a binary cross-entropy loss function. \u2022 ALBERT: It is a modified version of BERT with fewer memory requirements. ALBERT has a reduced number of parameters mainly due to factorized embedding parameterization and cross-layer parameter sharing. In this first technique, the large vocabulary embedding matrix is decomposed into two small matrices, separating the size of the hidden layers from the size of the vocabulary embedding. The cross-layer parameter sharing, on the other hand, prevents an increase in the number of parameters with the depth of the model. \u2022 DistilBERT: DistilBERT is another variant of the BERT model aiming at applications with less computational and memory requirements. The concept of knowledge distillation is adopted during pre-training allowing a significant reduction in parameters without a significant impact on the performance of the model. \u2022 GPT: Generative Pre-trained transformer (GPT) models represent a family of Neural Network (NNs)-based language prediction models built on the Transformer architecture [21]. These models are pre-trained on a huge volume of diverse text data. Currently, GPT is available in different versions. However, the first version of the model was introduced in 2018 by Open AI [21]. In this work, we used GPT version 3.5 turbo. It is composed of 175 billion parameters, which is significantly higher than the number of parameters used in its previous versions and other transformers, such as BERT. In this work, we used prompt engineering for the classification of tweets through GPT 3.5. \u2022 Meta-LLAMA: Large Language Model Meta AI (LLMA) is also a family of pre-trained LLMs. Similar to GPT, multiple versions of LLAMA are available having 7B to 70B parameters. In this work, we used LLAMA 2, which is an improved version of the base model LLAMA. Similar to the base model, LLAMA 2 is built on the Google transformer architecture with several interesting changes and improvements. For example, the RMSNorm pre-normalization, a SwiGLU activation function, and multi-query attention instead of multi-head attention and AdamW optimizer. The key differences between LLAMA 2 and the original LLAMA include a higher context length (i.e., 4096 compared to 2048 tokens) and grouped-query attention instead of multi-query attention. Similar to GPT 3.5, we used the prompt engineering method for text classification with LLAMA. 3.2.2. Fusion of the Models Our fusion methods are based on a late fusion scheme, where the scores/posterior probabilities of the individual models are accumulated for the final decision using equation 1. In the equation, S m1, S m2, S m3, ...S mn represent the scores/posterior probabilities obtained through the 1st, 2nd, , 3rd, and nth model, respectively while W1, W2, W3, ...Wn are the corresponding weights assigned to these models. S f = W1S m1 + W2S m2 + W3S m3 + .... + WnS mn (1) The weights are assigned to the models on the basis of their performances. To this aim, several weight optimization/selection methods, including PSO, Nelder Mead, BFGS, and Powell method, are employed. These methods seek a set of variable values (i.e., W1, W2, W3, ...Wn in our case) optimizing an objective function under a set of constraints. In this case, the fitness/objective function is based on accumulative classification error obtained on a validation set using equation 2. In the equation, Aacc represents the accumulative accuracy computed on the validation set. In this work, our goal is to find a set of weights to be assigned to the models that minimize the classification error. e = 1 \u2212Aacc (2) We note that the same fitness function is used by all the weight optimization methods employed in this work. These methods use different mechanisms and have their own pros and cons. A brief overview of each method is provided below. \u2022 PSO: Particle Swarm Optimization (PSO), which is a heuristic approach, has been widely used in the literature for different tasks. For instance, in several works, PSO has been used for the optimization of hyper-parameters of ML 4 \falgorithms, such as the number of layers, batch size, number of neurons, etc., in LSTMs and CNNs [22, 23]. Similarly, it has been also used for the hyper-parameter optimization of Federated Learning (FL) algorithms [24]. The literature also reports the effectiveness of the optimization technique in late fusion where the algorithm is used to assign optimal weights to the classifiers [25, 26]. The algorithm solves the optimization problem in three steps, iteratively; starting from a random set of candidate solutions, where each candidate solution is called a particle. At each iteration, each particle keeps track of its personal and global best solution in the swarm. The particles adjust two parameters namely (i) velocity and (ii) the position. The velocity of a particle is adjusted based on its own experience and the information shared by the other particles in the swarm. The position of particles is adjusted based on their current position, velocity, and distances between their current positions and personal and global best. The process continues until a global optimum is obtained. The key limitations of the method include a slow convergence rate, especially in high dimensional problems, and entrapment in local minima. Being one of the key optimization algorithms, PSO implementation is available in several libraries. In this work, we used the open-source library namely pyswarm2 for the implementation of the algorithm. \u2022 Nelder Mead Method: Similar to PSO, the Nelder Mead method has also been widely explored for different optimization tasks. For instance, Takenaga et al. [27] employed the method for computationally expensive optimization problems. Similarly, Ozaki et al. [28] used the algorithm for the hyper-parameter selection/optimization of a CNN model. The method has also been widely used for the fusion of classification algorithms in different visual and NLP applications [29, 8]. The method optimizes a set of variables leading to a minimum or maximum value of an objective function in a multidimensional space. To this aim, it uses a set of n + 1 test points (solutions), which are arranged as a simplex. The method then estimates the behavior of the objective function at each test point for new test points, which replace the old ones in an iterative manner. In this work, we used a Python open-source library, namely, SciPy3 for the implementation of the method. \u2022 Limited-memory Broyden Fletcher Goldfarb Shanno Algorithm (BFGS): Similar to PSO and Neldar Mead, BFGS and its variants have been proven very effective in different tasks, such as optimization hyper-parameters of deep learning models and fusion. For instance, Saputro et al. [30] employed the algorithm for parameter estimation on a geographically weighted ordinal logistic regression model. Maria et al. [31] employed the method along with other optimization techniques for the fusion of inducers\u2019 scores for media interestingness prediction. BFGS, 2https://pyswarms.readthedocs.io/en/latest/ 3https://scipy.org/ which is a local search optimization algorithm, belongs to the Quasi-Newton optimization family and aims at the optimization of the second-order derivative of the objective function. To obtain a set of optimal values, the algorithm computes the inverse of the Hessian matrix used for multivariate functions. To this aim, the algorithm approximates the inverse using a gradient that eliminates the need for inverse calculation at each step. One of the key limitations of the algorithm is its large memory requirement, and it becomes impractical to compute the inverse of the Hessian matrix with a larger number of input parameters. To overcome this limitation, several variations of the algorithms have been proposed. For instance, Limited BFGS/LBFGS [32] is one of the variants of the algorithms with fewer memory requirements. In this work, though we don\u2019t have a large number of inputs, we used the LBFGS implementation of the method. \u2022 Powell Method: Powell method is another interesting optimization method that has been widely used for similar tasks. For instance, Maria et al. [31] and [8] employed the method for merit-based late fusion of classifiers for media interestingness and water quality analysis, respectively. Similar to PSO, several variations of the algorithm have been proposed in the literature. The algorithm seeks the local minima of the objective function. The objective function, which is a real-valid function with multiple inputs, doesn\u2019t need to be differentiable. The algorithm finds the minima in several steps starting with a random selection and evaluation of initial points/solutions. A list of parameters is then randomly selected. A subset of the initial points with minimum error is then selected as parents to produce children for the next step for the next generation. The children/new points are then evaluated in the fifth step and the process is repeated again from the third step until a global minima is found. 3.3. Regions Extraction In this phase, we define different regions based on the locations associated with the tweets. This allows us to analyze the water quality or water-related issues in different regions of the world as each region may have specific issues. We note that this step is added to facilitate in region-wise topic modeling, where we aim to extract keywords used in water-related tweets from different parts of the world. To this aim, the location addresses associated with each tweet are fed into Chat GPT to identify the corresponding countries by mapping the addresses to the respective countries. To ensure the quality of the mapping, the identified countries and the associated addresses are meticulously verified. To further enhance the accuracy of the data, we applied filtering techniques to specific locations. For example, in cases where the user\u2019s location included the address \u2019Florida, FL,\u2019 we replaced it with \u2019USA\u2019. This replacement was applied wherever the specified keyword was encountered. As a result, we successfully extracted and verified 4707 accurate locations. The countries list is then provided to Chat GPT to 5 \fexpand the geographical scope by translating the unique countries into regions using Chat GPT. 3.4. Topic Modeling The final component of the methodology is based on BERTopic [33], which is a state-of-the-art topic modeling technique. One of the key advantages of topic modeling is its ability to quickly discover the hidden topical patterns present in the data. These hidden patterns could result in meaningful insights leading to useful data-driven decisions. In this work, we aim to automatically extract the hidden topical patterns in the water-related tweets to identify the key water-related issues and concerns expressed over the water quality in the tweets. The algorithm used in this work extracts topics from Tweets in three different steps starting from converting the tweets into embeddings, then reducing the dimensionality and clustering, and finally converting them into topics. The embeddings are obtained by a pre-trained model namely SentenceBERT. The dimensionality reduction and clustering are carried out through Uniform Manifold Approximation and Projection(UMAP) and HDBSCAN (Hierarchical DBSCAN), respectively. Finally, topics are extracted from the clustering using a modified form of TF-IDF (Term Frequency-Inverse Document Frequency) namely c-TF-IDF. The algorithm brings several advantages. For instance, it clusters documents based on both lexical and semantic similarities. Moreover, BERTopic provides a library with several packages allowing more accurate and better visualization of the clusters, topics, and probabilities. It also comes with a few limitations. For instance, its assumption that each document/tweet contains only one topic is its main limitation, though it is possible to have Tweets with multiple topics. We note that we also performed some pre-processing in addition to the data cleaning before topic modeling. For instance, we removed short and stop words, numbers, and alphanumeric characters. This allows us to remove irrelevant frequently used words. 4. Experiments and Results 4.1. Dataset Our final dataset, after removing less informative tweets during the manual analysis and annotation, contains a total of 7,930 tweets. Among these, 5,728 tweets are annotated as irrelevant while the remaining 2,202 tweets were classified as relevant. The dataset has been divided into three subsets namely (i) training, (ii) test, and (iii) validation set using a ratio of 70%, 20%, and 10%, respectively. The validation set is used for the computation of the classification error for the fitness function of the fusion methods. Table 1 provides some sample relevant and irrelevant tweets from the dataset. 4.2. Experimental Results The objectives of this work are multi-fold. On one side, we aim to extract flood-related tweets, and on the other hand, we want to automatically extract keywords from the relevant tweets. It is very possible that each country/region may have different water-related issues than others, thus, we are also interested in keywords/topics of tweets tweeted from a specific country/region. To achieve these objectives, we perform the following experiments. \u2022 Evaluation of the performance of several state-of-the-art LLMs individually. \u2022 Fusion of the classification scores obtained through the individual models in a merit-based fusion framework by employing several weight selection/optimization methods. \u2022 Topic modeling on all the relevant tweets. This will allow us to highlight key global water-related issues. \u2022 Topic modeling of the collection of tweets tweeted from a specific country/region. This will allow us to highlight the water-related issues specific to a particular region. In the next subsections, we provide a detailed analysis of the results of all the experiments. 4.2.1. Text Classification Results Table 2 provides the results of our first experiments, where we evaluate the performance of several LLMs in the application. We note that for GPT and LLAMA-2 we use the prompt engineering method with a few-shot (5-shot and 10-shot) classification setting without fine-tuning the models. As can be seen, overall similar results are obtained for BERT and its different variants and XLNET. However, the lowest results are observed with Meta-LLAMA-2. One of the potential reasons for the lowest performance of the model is the few-shot learning as the model may have limited generalization to classify the samples from the seen examples. Table 3 reports the results of our fusion experiment, where combine the classification scores of the best-performing individual models in a merit-based fusion scheme. In this experiment, we considered two experimental settings. In the first case, we combined the classification scores obtained with the top 5 performing models including BERT, RoBERTa, DistilBERT, ALBERT, and XLNET while in the second experiment, we considered the top 2 models namely BERT and ALBERT. Overall there is a slight improvement in the results of the fusion compared to the best-performing individual model. Generally, the fusion results in an improvement in the F1 score, however, the less improvement in this case could be the complexity of the dataset or the fewer variations in the individual models\u2019 results. As far as the comparison of the fusion methods is concerned, no significant differences have been observed. However, the performance of all the methods is higher when the top 2 best-performing models are used in the fusion compared to the top 5 models. In the case of top models, though there is no significant difference, the slightly lower performance could be due to the low-performing models that could adversely affect the performance of the fusion methods. 6 \fTable 1: Sample Tweets from the dataset. Relevant Samples Irrelevant Samples We have been receiving water of the worst quality from past 6 months. I want to bring this situation to your notice and solve this problem ASAP. Water is a basic need. Area : Adarsh Nagar, Bahadurgarh One of the most popular urban beaches in Gran Canaria, Las Canteras is a twokilometer ribbon of sand caressed by warm and calm water. Drinking contaminated water can transmit diseases and back in 2017 nearly 1.6 million people died from diarrheal diseases. 1/3 of those were children under the age of 5. #climatecrisis #water Wondering about #books about #water sports (canoeing, sailing, yachting, scuba diving, etc.)? Check out call number range The landmark research blames chemical #pollution from plastics, farm fertilisers and pharmaceuticals in the #water. Previously, it was thought the amount of #plankton had halved since the 1940s, but the #evidence gathered by the Scots suggests 90% has now vanished. Hope people leave water out in their gardens or balcony in any containers for all the beautiful wildlife x #water #wildlife #thirsty #animals x In face of recurring drought, cities seek security in wastewater recycling projects #security #projects #recycling #wastewater #water Removing pollution from water using water shaping tech #sketchup #depollution #watershaping #waterpollution In a larger portion of cases, #carpet #damage is treated efficiently and all the defects are repaired. Professional services take care of all the #Water #Damage #Restoration Sunshine Coast. The privatisation of water and power has been one of the biggest rip-offs of the British public in modern times. Time to jail those profiteering through pollution of our rivers and waterways! #water #corporategreed #utilities The theme this time is \u201dWater from Japanese restaurants\u201d. Is it true that there are many paid shops outside Japan? The popular article has exceeded 650pv Is water free at Japanese restaurants? Life without water is impossible. Save water. Save life. With every little drop, a day less to live on Earth. Your body depends on #water to survive. Every cell, tissue, and organ in your body needs water to work properly and for overall good health. Learn how to ensure you stay hydrated, and why it is important to do so, here in familydoctor Drinking contaminated #water can be harmful to one\u2019s health. #Cholera, #diarrhea, #dysentery, and #typhoid are just a few of the ailments it can induce. We\u2019ve worked with TheMixUK to explain what support is available for those struggling to pay for the increasing price of #Fuel and #Water bills. Take a read of the article here Clean Water is a necessity to daily life. Empower economically disadvantaged small communities to develop and sustain clean water supplies. Visit Central Florida Water Ski Sweepstakes 7 \fTable 2: Experimental results of the individual LLMs. LLM F1-score BERT 0.7686 ALBERT 0.7636 DistilBERT 0.7491 ROBERTA 0.7541 XLNET 0.76 Gpt-3.5 (5-shot) 0.7146 Gpt-3.5 (10-shot) 0.7246 Meta-LLAMA2 (5-shot) 0.5832 Meta-LLAMA2 (10-shot) 0.5876 Table 3: Evaluation of the fusion methods. Fusion Method F1-score Top 2 (BERT and ALBERT) Top 5 Simple Averaging 0.770 0.7630 PSO 0.772 0.770 Nelder Mead Method 0.776 0.771 Powell Method 0.7713 0.7680 BFGS 0.77 0.7687 4.2.2. Location Extraction and Topic Modeling Analysis In the topic modeling, we conducted two different experiments. In the first case, we analyzed and tried to discover hidden topical patterns in the complete collection of water-related tweets in the test set. Figure 2 provides the top 10 topics and the corresponding words extracted from the collection of relevant tweets through BERTopic. As can be seen, most of the topics and associated words are very relevant. The issues highlighted by the algorithm from the tweet collection include sanitation & access to water, plastic pollution in water reservoirs, saving and utilization of rainwater, irrigation & drought issues, environmental factors, filtering drinking water, heatwaves & heatwave, chemicals and tap water, etc., In the second experiment, the collected relevant tweets were divided into regions, which allowed us to discover topics in tweets relevant to or tweeted from certain regions. This experiment helps to discover people\u2019s concerns about this important topic of water-related issues including both local and global issues. As a first step, we extracted country names from the addresses associated with relevant tweets using ChatGPT. This resulted in a long list of countries from where water-related tweets were tweeted. We observed that very few tweets were recorded from certain countries. For example, our collection of relevant tweets contains a single tweet from Slovenia, Mozambique, El Salvador, and Grenada. To ensure a sufficient number of tweets from each country, we considered only those countries from which at least 70 tweets were tweeted. We note that there is no scientific reason behind this threshold (i.e., min 70 tweets per country), we simply wanted to make sure a sufficient number of countries in our list at the same time to ensure a sufficient number of tweets for our analysis from each country. Figure 3 provides the country-wise distribution of the relevant tweets in our dataset. A large portion of the tweets originated from the United States and the United Kingdom. This also indicates the interest of the people from these countries in this important societal challenge. Figure 4 provides the list of topics extracted from the tweets originating from different countries. Topic 0 to Topic 6 show the group of topics extracted from the tweet collections for Australia, Canada, India, Pakistan, South Africa, the United States, and the United Kingdom, respectively. Some of the topics and the associated words are less relevant compared to the others. For example, most of the words associated with topic 0, which is extracted from tweets originating from Australia, are not very relevant to water-related issues. However, on the other side, Topics 2 to Topic 6 are very relevant and helpful in highlighting the issues. For instance, Topic 2 stresses the careful usage of water in general and rainwater in particular. Topic 3 and Topic are about drinking water in one of the provinces of Pakistan and South Africa, respectively. Similarly, Topic 5 is based on heatwaves, wildlife, and water pollution. Finally, Topic 6 also includes relevant keywords, such as clean water and droughts. We also performed topic modeling on different geographic regions by combining tweets from all the countries in the region. These regions are formed on the basis of the geographic locations of the countries. To this aim, the list of countries is provided to Chat GPT resulting in five regions including Asia, Africa, America, Oceania, and Europe. Similar to countrywise topic modeling, we included the regions having at least 70 tweets. Figure 5 provides the distribution of relevant tweets from each region. As can be seen in the figure, overall, a higher number of tweets originated from America, Europe, and Asia. Figure 6 provides the summary of the topics extracted from the tweets originating from different regions. Topic 0 to topic 4 represent topics extracted from tweets originating from Africa, America, Asia, Europe, and Oceania, respectively. The majority of the topics and the associated keywords are very relevant to water quality except the topic extracted from the Oceania region. The topics are similar to what has been observed in the country-wise topic modeling, which indicates that the regions mostly have similar types of water-related issues or at least the topics/concerns are similar. 5."
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.15027v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.15027v1",
|
| 3 |
+
"title": "Three dimensional end-to-end simulation for kilonova emission from a black-hole neutron-star merger",
|
| 4 |
+
"abstract": "We study long-term evolution of the matter ejected in a black-hole\nneutron-star (BH-NS) merger employing the results of a long-term\nnumerical-relativity simulation and nucleosynthesis calculation, in which both\ndynamical and post-merger ejecta formation are consistently followed. In\nparticular, we employ the results for the merger of a $1.35\\,M_\\odot$ NS and a\n$5.4\\,M_\\odot$ BH with the dimensionless spin of 0.75. We confirm the finding\nin the previous studies that thermal pressure induced by radioactive heating in\nthe ejecta significantly modifies the morphology of the ejecta. We then compute\nthe kilonova (KN) light curves employing the ejecta profile obtained by the\nlong-term evolution. We find that our present BH-NS model results in a KN light\ncurve that is fainter yet more enduring than that observed in AT2017gfo. This\nis due to the fact that the emission is primarily powered by the\nlanthanide-rich dynamical ejecta, in which a long photon diffusion time scale\nis realized by the large mass and high opacity. While the peak brightness of\nthe KN emission in both the optical and near-infrared bands is fainter than or\ncomparable to those of binary NS models, the time-scale maintaining the peak\nbrightness is much longer in the near-infrared band for the BH-NS KN model. Our\nresult indicates that a BH-NS merger with massive ejecta can observationally be\nidentified by the bright and long lasting ($>$two weeks) near-infrared\nemission.",
|
| 5 |
+
"authors": "Kyohei Kawaguchi, Nanae Domoto, Sho Fujibayashi, Kota Hayashi, Hamid Hamidani, Masaru Shibata, Masaomi Tanaka, Shinya Wanajo",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "astro-ph.HE",
|
| 9 |
+
"cats": [
|
| 10 |
+
"astro-ph.HE",
|
| 11 |
+
"gr-qc"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Diffusion AND Model",
|
| 15 |
+
"gt": "We study long-term evolution of the matter ejected in a black-hole\nneutron-star (BH-NS) merger employing the results of a long-term\nnumerical-relativity simulation and nucleosynthesis calculation, in which both\ndynamical and post-merger ejecta formation are consistently followed. In\nparticular, we employ the results for the merger of a $1.35\\,M_\\odot$ NS and a\n$5.4\\,M_\\odot$ BH with the dimensionless spin of 0.75. We confirm the finding\nin the previous studies that thermal pressure induced by radioactive heating in\nthe ejecta significantly modifies the morphology of the ejecta. We then compute\nthe kilonova (KN) light curves employing the ejecta profile obtained by the\nlong-term evolution. We find that our present BH-NS model results in a KN light\ncurve that is fainter yet more enduring than that observed in AT2017gfo. This\nis due to the fact that the emission is primarily powered by the\nlanthanide-rich dynamical ejecta, in which a long photon diffusion time scale\nis realized by the large mass and high opacity. While the peak brightness of\nthe KN emission in both the optical and near-infrared bands is fainter than or\ncomparable to those of binary NS models, the time-scale maintaining the peak\nbrightness is much longer in the near-infrared band for the BH-NS KN model. Our\nresult indicates that a BH-NS merger with massive ejecta can observationally be\nidentified by the bright and long lasting ($>$two weeks) near-infrared\nemission.",
|
| 16 |
+
"main_content": "INTRODUCTION Neutron star (NS) mergers are known to be among the most promising targets of the ground-based gravitational-wave (GW) detectors (LIGO: Aasi et al. 2015, Virgo: Acernese et al. 2015, KAGRA: Kuroda 2010) as well as one of the most important sources of high-energy astrophysical transients, such as gamma-ray bursts (GRB, Paczynski 1991; Nakar 2007; Berger 2014; Abbott et al. 2017c), kilonovae (KN, Li & Paczynski 1998; Kulkarni 2005; Metzger et al. 2010; Kasen et al. 2013; Tanaka & Hotokezaka 2013), jet heated cocoons (Nakar & Piran 2017; Hamidani & Ioka 2023a,b), and synchrotron flares (Nakar & Piran 2011; Hotokezaka & Piran 2015; Hotokezaka et al. 2018; Margalit & Piran 2020). NS mergers are also considered to be important production sites of elements heavier than iron in the universe (Lattimer & Schramm 1974; Eichler et al. 1989; Freiburghaus et al. 1999; Cowan et al. 2021). The first detection of GWs from a binary neutron star (BNS) merger (GW170817; Abbott et al. 2017a) and its multi-wavelength electromagnetic (EM) counterparts (Abbott et al. 2017b) demonstrated that those simultaneous observations will provide a valuable opportunity to extend our knowledge of fundamental physics in the extreme \u2605E-mail: kyohei.kawaguchi@aei.mpg.de (strongly self-gravitating, high-density, and high-temperature) environments. Among NS mergers, the mergers of black-hole neutron-star (BHNS) binaries can provide us with interesting insights that are different from BNS mergers. While the mass ratios of the compact stars in BNS binaries are expected to close to unity, BH-NS binaries can be more asymmetric in the mass ratio, and hence, will provide valuable opportunity to study higher-order GW multipole moments (Abbott et al. 2021). Also, if the NS is tidally disrupted before reaching the innermost circular orbit of the BH, an applicable amount of NS matter can remain outside the remnant BH and be ejected from the system. Such ejecta formed during the NS tidal disruption as well as the matter subsequently ejected during the evolution of the remnant BH-tours system will be the source of various EM counterparts to the GW event. In addition, since BH-NS mergers can potentially produce a large amount of very low (\u22720.1) electron fraction (\ud835\udc4c\ud835\udc52) ejecta, the nucleosynthetic abundances can be different to those in the case of BNS mergers. In fact, it has been pointed out that BH-NS mergers can provide an explanation to the observed elemental abundances of a subclass of \ud835\udc5f-process-enhanced stars, so-called \"actinide-boosted\" stars (Wanajo et al. 2022). To extract the physical information from the observation of EM counterparts, accurate modeling of the light curves and spectra con\u00a9 20XX The Authors arXiv:2404.15027v1 [astro-ph.HE] 23 Apr 2024 \f2 K. Kawaguchi et al. sistent with the source properties are crucial. Since the detection of GW170817, light curve modeling of EM counterparts, particularly, for KNe has been significantly developed in this decade. In particular, the studies by employing numerical-simulation-based/motivated ejecta profiles and by performing radiative transfer (RT) simulations with realistic heating rates and/or detailed opacity tables enable us to directly connect the properties of the progenitor binary to the observables (e.g., Kasen et al. 2013, 2015; Barnes et al. 2016; Wollaeger et al. 2018; Tanaka et al. 2018; Wu et al. 2019; Kawaguchi et al. 2018; Hotokezaka & Nakar 2020; Kawaguchi et al. 2020; Korobkin et al. 2021; Bulla et al. 2021; Zhu et al. 2021; Barnes et al. 2021; Nativi et al. 2020; Kawaguchi et al. 2021; Wu et al. 2022; Just et al. 2022; Just et al. 2023). Previous studies showed that the complex ejecta profile in the presence of the multiple ejecta components of different mass ejection processes induces significant spatial dependences in radioactive heating as well as strong geometrical effects in radiative transfer, which have great impacts on the resulting light curves (Kasen et al. 2015; Kawaguchi et al. 2018; Kawaguchi et al. 2020; Bulla 2019; Zhu et al. 2020; Darbha & Kasen 2020; Korobkin et al. 2021; Almualla et al. 2021; Kedia et al. 2023). Hence, the employment of the realistic ejecta profile consistently taking multiple ejecta components into account is essential for the accurate prediction of KN light curves. One of the important missing links for the accurate prediction of KNe is the long-term hydrodynamics evolution of ejecta after the formation. While the ejecta formation takes place on a time scale of \u22721\u201310 s after the onset of a merger (Hayashi et al. 2022, 2023), the KN emission peaks in a much longer time scale of 0.1\u201310 d (Li & Paczynski 1998; Kulkarni 2005; Metzger et al. 2010; Kasen et al. 2013; Tanaka & Hotokezaka 2013), at which the homologous expansion of ejecta has been achieved. Since ejected matter can be accelerated by the ejecta pressure gradient and interact with different ejecta components during these epochs, the ejecta profile at the time of KN emission is non-trivial just from the ejecta properties at the time of formation. In fact, Rosswog et al. (2014) and Grossman et al. (2014) performed pseudo-Newtonian hydrodynamics simulations for BNS mergers, and studied the long-term evolution of the dynamical ejecta component until it reached the homologously expanding phase. They found that the thermal pressure induced by radioactive heating in ejecta significantly changes the ejecta morphology (see also Foucart et al. (2021)). Fern\u00e1ndez et al. (2015) and Fern\u00e1ndez et al. (2017) performed long-term simulations for BH-NS mergers to investigate the effect of the interplay between the dynamical and post-merger components and found that the interaction of the multiple ejecta components can modify the ejecta profile. Thus, to accurately predict KN light curves, it is also important to follow the hydrodynamics evolution of the multiple ejecta components until the homologously expanding phase. Recently, the development of numerical simulation techniques and the significant increase in the computational resources have enabled us to consistently follow the NS mergers from the onset of the merger to the time that ejecta formation saturates (Kiuchi et al. 2022; Fujibayashi et al. 2023, 2020b; Shibata et al. 2021; Hayashi et al. 2022; Kiuchi et al. 2022; Fujibayashi et al. 2023; Hayashi et al. 2023; Kiuchi et al. 2023; Just et al. 2023; Gottlieb et al. 2023; Kiuchi et al. 2024). In this paper, we study the KN emission associated with a BH-NS merger employing the results obtained by the numerical-relativity (NR) simulation and nucleosynthesis calculation consistently following the entire ejecta formation from the merger (Hayashi et al. 2022, 2023; Wanajo et al. 2022). In particular, we focus on the KN emission from \u22481 d after the onset of the merger for the model of a large amount of dynamical ejecta with \u22480.04\ud835\udc40\u2299in this paper.1 This paper is organized as follows: In Section 2, we describe the method employed in this study. In Section 3, we describe the BH-NS model we study in this work. In Section 4, we present the property of the ejecta obtained by the long-term hydrodynamics evolution. In Section 5, we present the KN light curve obtained by RT simulations. Finally, we discuss the implication of this paper in Section 6. Throughout this paper, \ud835\udc50denotes the speed of light. 2 METHOD 2.1 hydrodynamics simulation In a BH-NS merger, matter ejected by various mechanisms is expected to experience hydrodynamics interactions between different ejecta components before eventually reaching a homologous expansion phase at \u223c0.1 d (Kawaguchi et al. 2021). In order to obtain the spatial profile of the rest-mass density, elemental abundances, and radioactive heating rate after 0.1 d, which are necessary for accurate prediction of KN, we perform hydrodynamics simulations using the outflow data obtained by NR simulations as boundary conditions, as in our previous studies. To distinguish it from the NR simulation, the present hydrodynamics simulation is referred to as the HD simulation in this paper. The simulation code for the HD simulation is a 3D extension of the code developed in our previous studies (Kawaguchi et al. 2021, 2022, 2023). This code solves the relativistic Euler equations under a spherical coordinate system. In order to incorporate the effect of gravity, a fixed background metric for a non-rotating black hole expressed in isotropic coordinates is used. See Appendix A for the formulation of the basic equations. The effect of radioactive heating is incorporated in the same way as in the previous studies (Kawaguchi et al. 2021, 2022, 2023). See Appendix B for the method of particle tracing used to employ the nucleosynthesis results in the HD simulation. We note that the equatorial symmetry is imposed for the HD simulation following the setup of the NR simulation. For the equation of state (EOS), we consider both contributions from gas and radiation: the total pressure \ud835\udc43is given by \ud835\udc43= \ud835\udc43gas+\ud835\udc43rad with \ud835\udc43gas = \ud835\udc5bB\ud835\udc58B\ud835\udc47and \ud835\udc43rad = \ud835\udc4erad\ud835\udc474/3, where \ud835\udc5bB, \ud835\udc47, \ud835\udc58B, and \ud835\udc4erad are the baryon number density, temperature, Boltzmann constant, and radiation density constant, respectively. Here, we simplified the gas 1 During the submission process of this paper, LIGO and Virgo have detected GWs plausibly from a BH-NS merger (The LIGO Scientific Collaboration et al. 2024b). The alert shows that the system is likely to contain a NS, and the mass of the other object is likely to be in between 3 \ud835\udc40\u2299and 5 \ud835\udc40\u2299with a 50% probability. The probability for the matter outside the remnant object to be present after the merger is also high (> 99%). Hence, the system can be by chance similar to the BH-NS model studied in this paper (a binary of a 1.35 \ud835\udc40\u2299NS with the radius of \u224813.2 km and a 5.4 \ud835\udc40\u2299BH with the dimensionless spin of 0.75). We note that the amount of the dynamical ejecta is broadly the same (\u22480.04 \ud835\udc40\u2299) also for a BH-NS merger with the same NS mass, NS radius, and dimensionless BH spin but with a larger BH mass (8.1 \ud835\udc40\u2299) (Hayashi et al. 2022). The result of this paper indicates that, if it is a BH-NS merger with significant amount of the dynamical ejecta formation, this GW event may be associated with a kilonova of which near-infrared emission is bright and long-lasting. MNRAS 000, 1\u201320 (20XX) \fend-to-end simulation for KN emission from BH-NS merger 3 pressure assuming that atoms are fully ionized with an electron fraction of unity, and the gas pressure is dominated by the contribution from electrons (since the average atomic mass number is expected to be much larger than unity). We note that, although this simplification may overestimate the gas pressure component, the contribution of the gas pressure is found to be nevertheless subdominant. In fact, we confirm that the resulting ejecta profiles as well as the KN light curves are essentially unchanged even if we employ the ideal-gas EOS with the adiabatic index of \u0393 = 4/3, which corresponds to the case that the radiation pressure dominates. Note that the magnetic field effects are not taken into account in our present HD simulations. As a consequence, and due to the coarse grid resolution in the polar region, the relativistic jet outflow launched in the NR simulation is not well resolved in the present HD simulations. The previous study suggests that the presence of the jet may affect the ejecta profile and hence the KN light curves near the jet axis (Nativi et al. 2020; Klion et al. 2021). Since resolving the propagation of the relativistic jet in long-term three-dimensional simulations requires high computational costs, we leave the investigation of the effect of the jet for a future work. We employ the same time origin for the HD simulations as in the NR simulations. The uniform grids with \ud835\udc41\ud835\udf03and \ud835\udc41\ud835\udf19grid points are prepared for the polar angle \ud835\udf03and the longitudinal angle \ud835\udf19, respectively. For the radial direction, the following non-uniform grid structure is employed; for a given \ud835\udc57-th radial grid point ln \ud835\udc5f\ud835\udc57= ln \u0012\ud835\udc5fout \ud835\udc5fin \u0013 \ud835\udc57\u22121 \ud835\udc41\ud835\udc5f + ln \ud835\udc5fin, \ud835\udc57= 1 \u00b7 \u00b7 \u00b7 \ud835\udc41\ud835\udc5f+ 1, (1) where \ud835\udc5fin and \ud835\udc5fout denote the inner and outer radii of the computational domain, respectively, and \ud835\udc41\ud835\udc5fdenotes the total number of the radial grid points. In the present work, we employ (\ud835\udc41\ud835\udc5f, \ud835\udc41\ud835\udf03, \ud835\udc41\ud835\udf19) = (1024, 64, 128), and \ud835\udc5fin and \ud835\udc5fout are initially set to be 3, 000 km and 103 \ud835\udc5fin, respectively. We confirm that this grid resolution is sufficiently high enough for our purpose of the study by checking the results of the ejecta profile and KN light curves being semi-quantitatively unchanged for the HD simulation with (\ud835\udc41\ud835\udc5f, \ud835\udc41\ud835\udf03, \ud835\udc41\ud835\udf19) = (512, 32, 64) (less than 10% and 3% difference in the total bolometric luminosity at 1 d and 2 d, respectively). The hydrodynamics properties of the outflow are extracted at \ud835\udc5f= \ud835\udc5fext in the NR simulations of Hayashi et al. (2022, 2023), and the time-sequential data are employed as the inner boundary condition of the present HD simulations. The outflow data obtained from the NR simulation run out at \ud835\udc61> 1 s, and after then, the HD simulation is continued by setting a very small floor value to the rest-mass density of the inner boundary. To follow the evolution of ejecta even after the high-velocity edge of the outflow reaches the outer boundary of our HD simulation, the radial grid points are added to the outside of the original outer boundary, while at the same time the innermost radial grid points are removed so as to keep the total number of the radial grid points. By this prescription, the value of \ud835\udc5fin is increased in the late phase of the HD simulations. The outermost radial grids are added so that the location of the outer radial boundary, \ud835\udc5fout, is always 103\ud835\udc5fin. Note that the region of \ud835\udc5f\u227310\u22123\ud835\udc50\ud835\udc61is always covered with the computational domain up to \ud835\udc61= 0.1 d in the HD simulations. The so-called Courant\u2013Friedrichs\u2013Lewy (CFL) condition restricts the time steps in the HD simulation to ensure the numerical stability. For our setup, the time interval should be approximately less than the smallest value among \u0394\ud835\udc5fmin/\ud835\udc50, \ud835\udc5fin\u0394\ud835\udf03min/\ud835\udc50, and \ud835\udc5finsin\ud835\udf03min\u0394\ud835\udf19min/\ud835\udc50 with \ud835\udf03min, \u0394\ud835\udc5fmin, \u0394\ud835\udf03min, and \u0394\ud835\udf19min being the minimum cell center value of the \ud835\udf03coordinate and the minimum cell sizes of \ud835\udc5f, \ud835\udf03, and \ud835\udf19directions, respectively. For the present grid setup, the most strict constraint comes from the last condition of \ud835\udc5finsin\ud835\udf03min\u0394\ud835\udf19min/\ud835\udc50, and this restricts the time interval to be so small that the computational costs becomes practically quite high. To relax this condition, we average over the conservative variables of hydrodynamics in the direction of \ud835\udf19for all the cells located in \ud835\udf03\u2264\ud835\udf03c for each sub-step of the evolution. By this prescription, the HD simulation is kept numerically stable if the time interval is within \ud835\udc5finsin\ud835\udf03c\u0394\ud835\udf19min/\ud835\udc50. For the present study, we choose \ud835\udf03c to be \ud835\udf0b/24, while we confirm that the resulting LCs are essentially unchanged even if we employ \ud835\udf03c = \ud835\udf0b/12. 2.2 radiative-transfer simulation The light curves of KNe are calculated using a wavelength-dependent RT simulation code (Tanaka & Hotokezaka 2013; Tanaka et al. 2017, 2018; Kawaguchi et al. 2020; Kawaguchi et al. 2021). In this code, the photon transfer is simulated by a Monte Carlo method for given ejecta profiles composed of the density, velocity, and elemental abundance under the assumption of the homologous expansion. The timedependent thermalization efficiency is taken into account following an analytic formula derived by Barnes et al. (2016). The ionization and excitation states are determined under the assumption of the local thermodynamic equilibrium (LTE) by using the Saha\u2019s ionization and Boltzmann excitation equations. For the photon-matter interaction, bound-bound, bound-free, and free-free transitions, and electron scattering are taken into account for the transfer of optical and infrared photons (Tanaka & Hotokezaka 2013; Tanaka et al. 2017, 2018). The formalism of the expansion opacity (Friend & Castor 1983; Eastman & Pinto 1993; Kasen et al. 2006) and the new line list derived in Domoto et al. (2022) are employed for the bound-bound transitions. In this line list, the atomic data of VALD (Piskunov et al. 1995; Kupka et al. 1999; Ryabchikova et al. 2015) or Kurucz\u2019s database (Kurucz & Bell 1995) is used for \ud835\udc4d= 20\u201329, while the results of atomic calculations from Tanaka et al. (2020) are used for \ud835\udc4d= 30\u201388. For Sr II, Y I, Y II, Zr I, Zr II, Ba II, La III, and Ce III, which are the ions producing strong lines, the line data are replaced with those calibrated with the atomic data of VALD and NIST databases (Kramida et al. 2021). Note that, since our atomic data include only up to the triple ionization for all the ions, the early phase of the light curves (\ud835\udc61\u22640.5 d) may not be very reliable due to high ejecta temperature (see Banerjee et al. 2020 for the work taking the opacity contribution from higher ionization states into account). The RT simulations are performed from \ud835\udc61= 0.1 d to 30 d employing the density and internal energy profiles of the HD simulations at \ud835\udc61= 0.1 d and assuming the homologous expansion for \ud835\udc61> 0.1 d. The spatial distributions of the heating rate and elemental abundances are determined by the table obtained by the nucleosynthesis calculations referring to the injected time and angle of the fluid elements. Note that, as an approximation, the elemental abundances at \ud835\udc61= 1 d are used during the entire time evolution in the RT simulations to reduce the computational cost, but this simplified prescription gives an only minor systematic error on the resultant light curves as illustrated in Kawaguchi et al. (2021). A three-dimensional cylindrical grid is applied for storing the local elemental abundances and radioactive heating rate as well as for solving the local temperature and opacity. The 50, 50, and 32 cells are set to the cylindrical radius, vertical, and longitudinal directions, which cover the domain with the coordinate ranges of (0, 0.6 \ud835\udc50\ud835\udc61), (0, 0.6 \ud835\udc50\ud835\udc61), and (0, 2\ud835\udf0b), respectively. We confirm that the resulting light curves are unchanged by changing each cell numbers from 50, 50, and 32 cells to 40, 40, and 28 cells or changing the maximum cylindrical radius and vertical coordinate ranges from 0.6 \ud835\udc50\ud835\udc61to 0.75 \ud835\udc50\ud835\udc61. MNRAS 000, 1\u201320 (20XX) \f4 K. Kawaguchi et al. 3 THE BH-NS MODEL In this work, we employ the NR outflow profiles and nucleosynthetic data obtained in Hayashi et al. (2022, 2023) and Wanajo et al. (2022) as the input for the HD simulations. In particular, we employ the outflow data of model Q4B5H in Hayashi et al. (2022). For this model, a BH-NS binary of which the NS mass, BH mass and dimensionless spin are initially 1.35 \ud835\udc40\u2299, 5.4 \ud835\udc40\u2299(thus 4 times larger than the NS mass), and 0.75, respectively, is considered with the DD2 EOS (Banik et al. 2014). The poloidal magnetic field with the maximum strength of 5 \u00d7 1016 G is initially set in the NS, while the resulting ejecta profile is not sensitive to the initial magnetic-field strength and configuration (Hayashi et al. 2023). We set 6.6 \ud835\udc40\u2299as the BH mass of the metric employed in the HD simulations, which approximately agrees with the summation of the remnant BH mass and matter outside the BH measured at \ud835\udc61= 0.1 s. For model Q4B5H, the NS experiences significant tidal disruption before it reaches the inner-most stable circular orbit of the binary (\ud835\udc61\u224810 ms). This leads to the formation of massive ejecta and torus around the remnant BH. Ejecta formed at the time of the NS tidal disruption, which often referred to as the dynamical ejecta, are concentrated in the vicinity of equatorial plane and exhibit significant non-axisymmetric geometry. The dynamical ejecta typically have low electron fraction (0.03\u20130.07) because those are driven primarily by gravitational torque and do not go through significant weak processes in the merger. Subsequently, the magnetic field is amplified in the remnant torus, and the effective viscosity is induced by the magnetohydrodynamical turbulence, driven by the magnetorotational instability (Balbus & Hawley 1998). Initially, viscous heating in the torus is balanced with neutrino cooling. As the disk rest-mass density and temperature drop due to the expansion driven by angular momentum transport, neutrino cooling becomes inefficient, and viscosity-driven mass ejection sets in (\ud835\udc61\u22480.2\u20130.3 s). In parallel, magneto-centrifugal force in the central region might play a role for enhancing mass ejection. Mass ejection in this stage, which is referred to as the post-merger mass ejection, lasts for \u223c1\u201310 s. In contrast to the dynamical ejecta, since thermal and weak processes play important roles during the post-merger stages, the electron fraction of ejecta has a broad distribution in the range of 0.1\u20130.4 with its peak being 0.24. For model Q4B5H, the masses of the dynamical and post-merger ejecta are found to be 0.045 \ud835\udc40\u2299and 0.028 \ud835\udc40\u2299, respectively, at the end time of the NR simulation. It is worth being remarked that the combination of dynamical and post-merger ejecta approximately reproduces a solar-like \ud835\udc5f-process pattern (Wanajo et al. 2022). In this paper, we study the ejecta and KN property for one case of a BH-NS merger among available NR results as the first step for the end-to-end kilonova simulation. However, we should note that the disk and ejecta masses formed in BH-NS mergers can have large variety depending on the binary parameters, such as the BH and NS masses, BH spin, and NS radius (Rosswog 2005; Shibata & Taniguchi 2008; Etienne et al. 2009; Lovelace et al. 2013; Kyutoku et al. 2015; Foucart et al. 2018), as well as the adopted EOS (Hayashi et al. 2023). For example, the smaller amount of disk and ejecta would be formed for the case that the NS radius is smaller due to softer EOS, such as the SFHo EOS (Steiner et al. 2013; Hayashi et al. 2023). Hence, the resulting property of the KN light curves can also have a large diversity. Therefore, we emphasize that the ejecta and KN property found for model Q4B5H with the DD2 EOS may not be universal property for every case of BH-NS mergers, and we leave the investigation of the binary parameter and EOS dependences for a future work. 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.01 0.1 1 10 100 1000 total ut<-1 input Meje [Msun] t [s] Figure 1. Time evolution of the total rest mass in the computational domain of the HD simulation (the purple curve). The green curve denotes the same as for the purple curve but only for the matter which satisfies the geodesic criterion (\ud835\udc62\ud835\udc61< \u22121 where \ud835\udc62\ud835\udc61is the lower time component of the four velocity). The blue dashed curve with the label \u201cinput\" denotes the rest mass obtained by integrating the mass flux of the NR outflow data which is employed as the inner boundary condition of the HD simulation. The black dashed line denotes the time at which the NR outflow data run out. 4 RESULTS: HYDRODYNAMICS SIMULATION 4.1 Ejecta mass evolution Figure 1 shows the total rest mass in the computational domain as a function of time. We can consider that the ejecta has reached the homologously expanding phase at \ud835\udc61= 0.1 d, because the total internal energy of ejecta is smaller by 4 order of magnitudes than the total kinetic energy. In general, two distinct ejecta components are seen in Figure 1. One found in \ud835\udc61in \u223c0.1 s corresponds to the dynamical ejecta, and the other found in \ud835\udc61in \u22730.5 s corresponds to the post-merger ejecta. After the NR outflow data run out at \ud835\udc61\u22481 s, we impose a floor rest-mass density value to the inner boundary. It is clearly seen in Figure 1 that the total mass in the computational domain decreases after that time, indicating that the matter is artificially falling back and escaping through the inner boundary. This happens because the pressure support from the inner boundary vanishes after the outflow data run out. However, the total mass of the matter with gravitationally unbound orbits remains increasing even after the time when the NR outflow data run out, as the consequence of the acceleration of the matter in the presence of the thermal pressure gradient. After \ud835\udc61\u2248100 s, approximately all the ejecta matter remaining in the computational domain becomes gravitationally unbound, and the value of the total mass in the computational domain converges to 0.063 \ud835\udc40\u2299. This value is smaller than the ejecta mass estimated in Hayashi et al. (2023) by \u22480.01 \ud835\udc40\u2299. We interpret this discrepancy as a consequence of the mismatch in the employed EOS between the NR and HD simulations and the inconsistency of the matter flux at the inner boundary. In fact, Fern\u00e1ndez et al. (2015) show similar results: they performed BH-disk simulations to follow the formation of the post-merger wind ejecta and used the extracted ejecta property as MNRAS 000, 1\u201320 (20XX) \fend-to-end simulation for KN emission from BH-NS merger 5 the inner boundary condition of the subsequent simulation for longterm ejecta evolution in the same manner as our present work. They found that the mass of the post-merger wind ejecta which becomes gravitationally unbound in the subsequent simulation decreases by a factor of \u22482 from the values estimated in the BH-disk simulations. They interpreted this difference as a consequence of the discrepancy between the stresses at the inner boundary and those that would be obtained in a self-consistent simulation. Nevertheless, by performing the HD simulation with artificially modified inner boundary conditions, we confirmed that our main results are essentially the same and the modification to the resulting KN light curves is only minor: we perform a HD simulation in which the ejecta injection is sustained with the final value of the mass flux at 1 s after the NR outflow data run out. By this prescription, the total ejecta mass in the HD simulation at the homologously expanding phase increases by 0.01 \ud835\udc40\u2299, but the bolometric luminosity increases only at most \u224810% since the unbound matter increased by this prescription has the velocity only less than \u22720.05 \ud835\udc50and hence has a long diffusion time scale, which gives a minor contribution to the brightness of the emission. 4.2 Ejecta profiles at homologously expanding phase Figures 2, 3, and 4 show the rest-mass density and electron fraction (\ud835\udc4c\ud835\udc52) profiles of ejecta with two-dimensional various cross sections at \ud835\udc61= 0.1 d obtained by the HD simulation. Here, the value employed as the initial condition of the nucleosynthesis calculation is shown in the \ud835\udc4c\ud835\udc52profile (see Appendix B and Wanajo et al. (2022) for the detail). The center of mass for the matter with \ud835\udc4c\ud835\udc52< 0.1 is located in the direction of \ud835\udf19\u2248141\u25e6with \ud835\udf19being the longitudinal angle measured from the +\ud835\udc65axis. The longitudinal angles of the meridional planes shown in Figures 3 and 4 are selected to show the profiles in which the dynamical ejecta are approximately mostly (\u2018b)\u2019: \ud835\udf19\u2248156\u25e6), moderately (\u2018a)\u2019: \ud835\udf19\u224866\u25e6and \u2019c)\u2019: \ud835\udf19\u2248246\u25e6), and least (\u2018d)\u2019: \ud835\udf19\u2248336\u25e6) present. As we mentioned above, the entire ejecta have reached the homologously expanding phase at this epoch. Broadly speaking, the dynamical and post-merger ejecta are present around the regions where the cylindrical radius is larger and smaller than \u22480.05\u20130.1\ud835\udc50\ud835\udc61, respectively. Those two components are clearly distinguishable with the value of \ud835\udc4c\ud835\udc52. The value of \ud835\udc4c\ud835\udc52for the dynamical ejecta is typically below 0.1, which primarily reflects the original \ud835\udc4c\ud835\udc52values of the disrupted NS. On the other hand, the post-merger ejecta have wider range of \ud835\udc4c\ud835\udc52values from 0.1 to 0.4. The rest-mass density profile of the dynamical ejecta exhibits clear non-axisymmetric geometry, with its mass mostly distributed in the fan-like shape in 70\u25e6\u2272\ud835\udf19\u2272250\u25e6. The dynamical ejecta are extended up to \u22480.5\ud835\udc50\ud835\udc61in the cylindrical radius direction, while their vertical extent is \u22480.2\ud835\udc50\ud835\udc61. The aspect ratio of the cylindrical and vertical extents for the dynamical ejecta is close to unity. This is in contrast to the fact that the dynamical ejecta are launched initially confined around the equatorial plane within the latitudinal opening angle of \u223c 10\u25e6(Kyutoku et al. 2013; Foucart et al. 2014). As we show below, this ejecta expansion is due to thermal pressure enhanced by radioactive heating. On the other hand, the post-merger ejecta exhibit approximately an axisymmetric shape. It has two distinct components with one having approximately a spherical shape and the other having the cone-like shape. The former is concentrated in the region within \u22480.05\ud835\udc50\ud835\udc61while the latter is more extended in the vertical direction with the polar opening angle of \u224810\u25e6and the vertical extent reaches \u22480.25\ud835\udc50\ud835\udc61. As we show below, this complex geometry of the postmerger ejecta is realized by the interaction with the dynamical ejecta which significantly expand due to thermal pressure enhanced by radioactive heating. Figure 5 shows the rest-mass density and electron fraction profiles of ejecta on the equatorial and meridional planes at \ud835\udc61= 0.1 d obtained by the HD simulation but switching off radioactive heating. Under the presence of radioactive heating, the dynamical ejecta expand significantly due to the increase in thermal pressure and the inhomogeneities in the rest-mass density are also smoothed out, as clearly seen in Figures 2 and 3. These results are consistent with the finding of Rosswog et al. (2014); Grossman et al. (2014) in the context of BNSs, and of Fern\u00e1ndez et al. (2015); Darbha et al. (2021) in the context of BH-NSs. In fact, the resulting aspect ratio of the dynamical ejecta is found to be close to unity as the model H4 in Darbha et al. (2021). The radioactive heating rate of the dynamical ejecta in our model also agrees with that in Darbha et al. (2021) (see Figure 6). The comparison between Figure 4 and Figure 5 shows that the profile of the post-merger ejecta is affected by the modification of the dynamical eject profile. Figure 5 shows that, in the absence of radioactive heating, the post-merger ejecta exhibit a prolate shape with the extension of 0.1\ud835\udc50\ud835\udc61and 0.25\ud835\udc50\ud835\udc61in the equatorial and vertical directions, respectively. On the other hand, the radioactive heating significantly expands the dynamical ejecta, which compress the postmerger ejecta in 0.05\ud835\udc50\ud835\udc61\u2264\ud835\udc67\u22640.15\ud835\udc50\ud835\udc61and confine the ejecta in the region of \u22720.05\ud835\udc50\ud835\udc61as found in Figure 4. This happens because of the higher typical electron fraction of the post-merger ejecta. The higher electron fraction leads to the relatively small radioactive heating rate and hence small enhancement of the pressure of the ejecta compared to the dynamical component. Significant expansion of the dynamical ejecta and enforced confinement of the post-merger ejecta in the presence of radioactive heating are not found in the BNS models in our previous studies (Kawaguchi et al. 2021, 2022, 2023). This is because the dynamical ejecta of the present BH-NS model and the BNS models studied in Rosswog et al. (2014); Grossman et al. (2014) are massive compared to the post-merger ejecta and also much more confined around the equatorial plane compared to the BNS models in our previous studies. As a result, higher internal energy density and high thermal pressure are realized. Hence, the importance of the radioactive heating will depend on the density and isotopic-abundance profiles of ejecta, which can have a variety even among BH-NS mergers depending on the binary parameters or the adopted EOS. 5 RESULTS: KN LIGHT CURVES 5.1 bolometric light curves Figure 7 shows the bolometric luminosity calculated by the RT simulation employing the ejecta rest-mass density, elemental abundance, and radioactive heating rate profiles obtained by the combination of the results of the HD simulation and nucleosynthesis calculation (Wanajo et al. 2022). The total energy deposition rate taking the thermalization efficiency into account is also plotted in Figure 7. As we mentioned in Section 2, our atomic data include only up to the triple ionization for all the ions, and the opacity of ejecta in the early phase (\ud835\udc61\u22640.5 d) may be underestimated due to high temperature (\u227320, 000 K). Hence, hereafter, we only focus on the light curves after 1 d. For 1\u201310 d, the bolometric luminosity is approximately constant with the value of 1\u20132\u00d71041 erg/s. It decreases only slowly and the MNRAS 000, 1\u201320 (20XX) \f6 K. Kawaguchi et al. Figure 2. Rest-mass density and electron fraction (\ud835\udc4c\ud835\udc52) profiles on the equatorial plane at \ud835\udc61= 0.1 d. The yellow dotted lines denote the angles for which the meridional ejecta profiles are shown in Figures 3 and 4. The white dotted curves denote the longitudinal angle ranges in which the KN light curves shown in Figures 8 and 9 are obtained. The value employed as the initial condition of the nucleosynthesis calculation is shown in the \ud835\udc4c\ud835\udc52profile (see Appendix B and Wanajo et al. (2022) for the detail.) change is only by a factor of 2 during this epoch. However, after 10 d, the bolometric luminosity starts decreasing more rapidly, and it decreases by a factor of 5 during 10\u201330 d. This faint and longlasting emission is caused by the fact that it is primarily powered by the lanthanide-rich dynamical ejecta, in which a long photon diffusion time scale is realized by the large mass and high opacity. This behaviour of the bolometric luminosity is qualitatively the same as that found in the models with massive dynamical ejecta studied in the previous study (MS1Q3a75 and H4Q3a75 in Tanaka et al. (2014)). The bolometric luminosity converges to the total deposition rate after 20 d, which suggests that the entire thermal photons created in the ejecta immediately diffuse out from the ejecta after this epoch. As we show below, however, the viewing-angle dependence of the emission due to the aspherical profile of the ejecta opacity is still playing a role up to 30 d. Our present BH-NS KN model shows significantly distinct light curves from the observation of AT2017gfo. Specifically, our BH-NS model is fainter by a factor of 2 around \u223c1 d than AT2017gfo. However, due to the slow decrease in the bolometric luminosity, compared to AT2017gfo, our BH-NS KN model becomes comparably bright at 4 d, and brighter by a factor of 5 at 10 d. This result clearly shows that a BH-NS binary which we study particularly in this work is not likely to be the progenitor of AT2017gfo. Figure 8 shows the results of the isotropically equivalent bolometric light curves observed from various viewing angles for the present model. Focusing on the observer in the polar direction with \ud835\udf03\u226428\u25e6, the KN emission is brightest in b): 135\u25e6\u2264\ud835\udf19< 180\u25e6. This direction approximately matches to the longitudinal direction in which the dynamical ejecta have the most of their mass (see Figures 2 and 3). On the other hand, the faintest emission is observed from the direction in which the dynamical ejecta least present (\u2018d)\u2019: 315\u25e6\u2264\ud835\udf19< 360\u25e6). Nevertheless, the variation in the bolometric luminosity is not so large and it is always within 40%. This is reasonable because the observers with different longitudinal angles are in similar directions for the polar view \ud835\udf03\u226428\u25e6. On the other hand, the longitudinal variation is larger for the equatorial view (82\u25e6\u2264\ud835\udf03\u226490\u25e6). For this case, the KN emission is also brightest in b): 135\u25e6\u2264\ud835\udf19< 180\u25e6in which direction the dynamical ejecta is most present. By contrast, the bolometric luminosity is the faintest in a): 45\u25e6\u2264\ud835\udf19< 90\u25e6. This is because, in this direction, the relatively thin part of the dynamical ejecta present in \ud835\udc45\u22730.3\ud835\udc50\ud835\udc61around the equatorial plane (see Figure 3) suppresses radiation from the ejecta center (note that such suppression is not significant from the direction of c): 225\u25e6\u2264\ud835\udf19< 270\u25e6due to the absence of the low density ejecta above \ud835\udc45\u22480.3\ud835\udc50\ud835\udc61). Meanwhile, the emission from the post-merger ejecta enhances the luminosity in this view (82\u25e6\u2264\ud835\udf03\u226490\u25e6) in which the dynamical ejecta are least present (\u2018d)\u2019: 315\u25e6\u2264\ud835\udf19< 360\u25e6). The variation in the bolometric luminosity is larger for the equatorial view than that for the polar view, and it is larger than a factor of 2 for 1\u20137 d. The latitudinal viewing-angle dependence of the bolometric luminosity is not significant and the variation in the bolometric luminosity is always less than a factor of 2 in our present model except for the equatorial view in a): 45\u25e6\u2264\ud835\udf19< 90\u25e6. The dependence of the KN brightness on the latitudinal direction is weak in particular from the viewing angle of b): 135\u25e6\u2264\ud835\udf19< 180\u25e6, in which direction the KN emission is brightest. As we show below, the latitudinal viewingangle dependence is much weaker than that for BNS KNe. This is due to the fact that, for the present BH-NS KN model, the emission is dominated by the dynamical ejecta of which the aspect ratio is close to unity. In fact, compared with a previous study (Tanaka et al. 2014), our present BH-NS KN model shows a less significant viewing-angle dependence on the latitudinal direction. This is because the ejecta in this study have larger aspect ratio than those in the models of their previous study. This comparison indicates that the modification of the ejecta morphology due to radioactive heating has a great impact on the viewing-angle dependence of the KN emission. Hence, this work demonstrates the importance of modeling KN light curves taking the ejecta long-term evolution into account. Interestingly, the latitudinal viewing-angle dependence is still present in d): 315\u25e6\u2264\ud835\udf19< 360\u25e6even after 20 d at which the total bolometric luminosity converges to the total deposition rate (see MNRAS 000, 1\u201320 (20XX) \fend-to-end simulation for KN emission from BH-NS merger 7 Figure 3. Rest-mass density profiles on the meridional planes at \ud835\udc61= 0.1 d. The top left, top right, bottom left, and bottom right panels denote the profiles on the \ud835\udf19\u224866\u25e6, 156\u25e6, 246\u25e6, 336\u25e6planes, respectively (see also the left panel of Figure 2 for the location of each plane). \ud835\udc45denotes the cylindrical radius. Figure 7). This can be understood by the fact that the post-merger ejecta are present in between the high-density part of the dynamical ejecta and the observer in the direction of d): 315\u25e6\u2264\ud835\udf19< 360\u25e6 (see Figures 2 and 3). While the post-merger ejecta have a minor contribution to the luminosity in the late epoch due to their relatively low heating rate, they still contribute as an opacity source (because of the relatively high density) to prevent photons emitted in the high-density part of the dynamical ejecta diffusing out to the direction of d): 315\u25e6\u2264\ud835\udf19< 360\u25e6. Although it is not quantitatively significant, this long-lasting viewing-angle dependence due to the non-axisymmetric geometry of the ejecta might have an impact on estimating the total deposition rate in the ejecta from the late-time observation. 5.2 broad-band magnitudes Figure 9 shows the optical (the g and z bands) and near-infrared (the K-band) light curves observed from various viewing angles. As is the case for the bolometric luminosity, for the polar view (\ud835\udf03\u226428\u25e6), the gzK-bands are the brightest and the faintest in b): 135\u25e6\u2264\ud835\udf19< 180\u25e6 and in d): 315\u25e6\u2264\ud835\udf19\u2264360\u25e6, in which the dynamical ejecta are mostly and least present, respectively. The viewing-angle dependence of the emission is weak from the polar view, and the variation is always within 0.5 mag around the peak magnitudes. For the equatorial view (\ud835\udf03\u226528\u25e6), the gzK-band emission is the brightest in b): 135\u25e6\u2264\ud835\udf19< 180\u25e6, while the emission in a): 45\u25e6\u2264\ud835\udf19\u226490\u25e6becomes the faintest. The longitudinal viewingangle dependence of the emission is significant in the gz-bands, and it is always larger than 1 mag among different longitudinal directions. The variation in the K-band magnitude among different longitudinal directions is relatively small compared to that in the gz-bands, and it is always approximately within 1 mag among the all viewing angles. The g-band emission is fainter and declines faster than AT2017gfo even if it is observed from the brightest direction (\u2018b)\u2019: 135\u25e6\u2264 \ud835\udf19< 180\u25e6). The peak brightness in the z-band is comparable to the observation of AT2017gfo, but it declines much faster. In contrast, MNRAS 000, 1\u201320 (20XX) \f8 K. Kawaguchi et al. Figure 4. Same as Figure 3 but for electron fraction \ud835\udc4c\ud835\udc52(see also the left panel of Figure 2 for the location of each plane). the K-band emission is comparable to that of AT2017gfo in a few days, and then, it becomes brighter after 4 d. The K-band magnitude finally reaches its peak at \u224810 d after the onset of the merger with its emission brighter than AT2017gfo by more than 1 mag. Interestingly, the gz-band emission observed from b): 135\u25e6\u2264\ud835\udf19< 180\u25e6becomes slightly brighter in the equatorial direction than in the polar direction after 1 d for the present BH-NS model. This brightness dependence on the latitudinal direction is opposite compared to the BNS KN models, for which the emission becomes brighter in the polar direction2. The same latitudinal-angle dependence is also found for the emission observed in the direction of the ejecta bulk motion for the model in Darbha et al. (2021) in which the radioactive heating rate agrees with our model (model H4). The brighter emission in the equatorial plane is explained by the enhancement of the radiation 2 However, it should be noted that here we do not consider the impact that the short GRB jet might have on the polar ejecta and on the KN emission (see Hamidani et al. (2024)). energy flux due to the Doppler effect induced by the bulk motion of the ejecta. It is also important to have the aspect ratio of the dynamical ejecta close to unity to realize the present latitudinalangle dependence of the emission brightness: otherwise the Doppler effect can be obscured by the suppression of the emission due to the decrease in the projected area toward the observer for the case that the dynamical ejecta have a more oblate shape (see Darbha et al. (2021) for the discussion). 5.3 radiative-transfer effect of non-axisymmetric ejecta geometry To clarify the RT effect of the non-axisymmetric ejecta geometry, we perform a RT simulation for an axisymmetrized ejecta profile. The axisymmetrized ejecta profile is generated by averaging over the rest-mass density, specific internal energy, elemental abundances, and radioactive heating rate profiles obtained by the HD simulation at \ud835\udc61= 0.1 d with respect to the longitudinal direction. Note that the volume and mass in each grid cell are used as the weights of MNRAS 000, 1\u201320 (20XX) \fend-to-end simulation for KN emission from BH-NS merger 9 Figure 5. Rest-mass density and electron fraction (\ud835\udc4c\ud835\udc52) profiles on the equatorial plane at \ud835\udc61= 0.1 d for the HD simulation in which radioactive heating is turned off. the average for the rest-mass density and the latter three quantities, respectively. Figure 10 compares the isotropically equivalent bolometric luminosities and gzK-band light curves observed from the polar (0\u25e6\u2264\ud835\udf03\u226428\u25e6) and equatorial (82\u25e6\u2264\ud835\udf03\u226490\u25e6) directions between the axisymmetrized and fiducial models (the same as in Figures 8 and 9). For the fiducial model, the light curves observed from b): 135\u25e6\u2264\ud835\udf19< 180\u25e6, d): 315\u25e6\u2264\ud835\udf19< 360\u25e6(for the polar view), and a): 45\u25e6\u2264\ud835\udf19< 90\u25e6(for the equatorial view) are shown. The upper panels of Figure 10 show that the KN emission observed from the polar direction becomes slightly brighter for the axisymmetrized model than for the fiducial model except for the gband emission. This reflects the fact that the area of the dynamical ejecta projected toward the observer increases for the axisymmetrized model due to the longitudinal average. The bolometric light curves declines slightly earlier than the original fiducial model because the optical depth decreases due to the decrease in the rest-mass density of the dynamical ejecta for the axisymmetrized model. Nevertheless, the effect of the longitudinal average is found to be minor for the polar view, particularly, in the gzK-band magnitudes, for which the differences between the axisymmetrized model and fiducial model are always smaller than 0.5 mag for \ud835\udc61\u22650.5 d. The difference in the brightness between the axisymmetrized model and fiducial model is more pronounced for the emission observed from the equatorial direction. For the equatorial view, the bolometric luminosity observed from the longitudinal direction of the brightest region (\u2018b)\u2019: 135\u25e6\u2264\ud835\udf19< 180\u25e6) is brighter approximately by a factor of 1.5\u20132 for the fiducial model than that for the axisymmetrized model. The gzK-band magnitudes observed from the same direction are also brighter than those for the axisymmetrized model by \u223c1 mag. On the other hand, the KN brightness observed from the longitudinal direction of the faintest region (\u2018a)\u2019: 45\u25e6\u2264\ud835\udf19< 90\u25e6) is comparable to or slightly fainter for the fiducial model than that for the axisymmetrized model. This discrepancy in the equatorial brightness between the fiducial and axisymmetrized models is due to the difference in the ejecta aspect ratio: as a consequence of the longitudinal average, the polar projected area of the ejecta is larger MNRAS 000, 1\u201320 (20XX) \f10 K. Kawaguchi et al. 1x1011 1x1012 1x1013 1x1014 1x1015 1x1016 1x1017 1x1018 1x1019 1x1020 0.01 0.1 1 10 100 1000 Our HD simulation H4 (Darbha et al. 2021) radioactive heating rate [erg/s/g] t [s] Figure 6. Mass weighted average of the total specific radioactive heating rate in our HD simulation. The specific heating rate of model H4 in Darbha et al. (2021) is also shown. 1x1040 1x1041 1x1042 1 10 Lbol Ldep AT2017gfo L [erg/s] t [day] Figure 7. Total bolometric luminosity and total energy deposition rate for model Q4B5H. The isotropically equivalent bolometric luminosity observed in AT2017gfo with the distance of 40 Mpc is shown by the filled circles adopting the data in Waxman et al. (2018), which assume a black-body fit to the photo-metric observations. Note that the bolometric light curve before 1 d is hidden since it is not reliable due to the lack of opacity data in the high temperature regime (\u227320, 000 K). than that in the equatorial direction for the axisymmetrized model, which makes photons to preferentially diffuse in the polar direction and thus the equatorial brightness to be fainter. 5.4 Comparison with various BNS KN models Figure 11 compares the gzK-band light curves among the present BH-NS KN model and various BNS KN models obtained in our previous studies (Kawaguchi et al. 2021, 2022, 2023). For BNS KN models, three cases are shown as representative: a case in which the remnant massive NS (MNS) survives for a short time (the dashed curves; SFHo-125145, Kiuchi et al. (2022); Fujibayashi et al. (2023); Kawaguchi et al. (2023)), a case in which the remnant MNS survives for a long time (the dash-dot curves; DD2-135135, Fujibayashi et al. (2020b); Kawaguchi et al. (2022)), and a case in which large-scale magnetic field significantly plays a role in the long-surviving remnant MNS (the dotted curves; MNS75a, Shibata et al. (2021); Kawaguchi et al. (2022)). We note that the BNS KN models are obtained by imposing axisymmetry in all the post-merger NR simulations, subsequent HD simulations, and RT simulations. For the BH-NS model, we show the light curves observed from b): 135\u25e6\u2264\ud835\udf19< 180\u25e6, d): 315\u25e6\u2264\ud835\udf19< 360\u25e6(for the polar view), and a): 45\u25e6\u2264\ud835\udf19< 90\u25e6(for the equatorial view), which represent the longitudinal directions for the brightest and faintest emission, respectively. The gz-band emission observed from the polar direction (0\u25e6\u2264\ud835\udf03\u2264 20\u25e6) for the present BH-NS KN model is by 0.5\u20131 mag brighter than that for the BNS models in which the remnant MNS survives only for a short time (< 10 ms, SFHo-125145), but is by \u22481 mag fainter than that for the BNS models in which the remnant MNSs survive for a long time (> 1 s, DD2-135135 and MNS75a). On the other hand, the gz-band emission observed from the equatorial direction (86\u25e6\u2264\ud835\udf03\u226490\u25e6) is comparably bright or brighter than those for the BNS models in which remnant MNSs survive for a long time except for the z-band emission of model MNS75a. This is due to the fact that the BNS KN models show stronger latitudinal viewing-angle dependence than the BH-NS KN model and become significantly faint in the equatorial view. The difference in the latitudinal viewingangle dependence reflects the fact that the dynamical ejecta are the primary source of the emission in the optical wavelength for the BHNS model, while for the BNS models, the post-merger ejecta are main source of the emission and the dynamical ejecta are mostly acting as the opacity source rather than the emission source (lanthanide curtain effect; Kasen et al. 2015; Kawaguchi et al. 2018; Kawaguchi et al. 2020; Bulla 2019; Zhu et al. 2020; Darbha & Kasen 2020; Korobkin et al. 2021). We note that, in the BNS cases, enhancement of the brightness due to the Doppler effect is obscured by the latitudinalangle dependence of the emission induced by the angle-dependent opacity of the dynamical ejecta. The K-band emission for the present BH-NS KN model has comparable peak brightness to that for the BNS models without significant large-scale magnetic field effect in the remnant NS (SFHo-125145 and DD2-135135). However, it is only the BH-NS model that maintains the K-band brightness within 1 mag of its peak for a twoweek period. The BNS models in which the remnant MNSs survive for short and long periods of time become fainter than the BH-NS model after 1\u20132 d and 5\u20137 d, respectively. The BNS model in which large-scale magnetic field significantly plays a role in the remnant NS shows bright K-band emission for a week, but the brightness declines much faster than that for the BH-NS model. Hence, the observation of a KN with long-lasting near-infrared emission which is bright for more than two weeks will indicate that the progenitor of a KN is a BH-NS merger with massive ejecta (in particular dynamical ejecta) formation. 6 SUMMARY AND DISCUSSIONS In this paper, we studied the long-term evolution of the matter ejected in a BH-NS merger by employing the results of the NR simulation and nucleosynthesis calculation, in which both dynamical and postmerger ejecta are followed consistently. In particular, we employed the results for the merger of a 1.35 \ud835\udc40\u2299NS and 5.4 \ud835\udc40\u2299BH with the MNRAS 000, 1\u201320 (20XX) \fend-to-end simulation for KN emission from BH-NS merger 11 1x1040 1x1041 1x1042 1 10 a) \u03c6=45-90[deg] b) \u03c6=135-180[deg] c) \u03c6=225-270[deg] d) \u03c6=315-360[deg] AT2017gfo L [erg/s] t [day] 0\u00b0\u2264\u03b8<28\u00b0 1x1040 1x1041 1x1042 1 10 a) \u03c6=45-90[deg] b) \u03c6=135-180[deg] c) \u03c6=225-270[deg] d) \u03c6=315-360[deg] AT2017gfo L [erg/s] t [day] 82\u00b0\u2264\u03b8<90\u00b0 1x1040 1x1041 1x1042 1 10 \u03b8=0-28[deg] \u03b8=41-51[deg] \u03b8=82-90[deg] AT2017gfo L [erg/s] t [day] a) 45\u00b0\u2264\u03c6<90\u00b0 1x1040 1x1041 1x1042 1 10 \u03b8=0-28[deg] \u03b8=41-51[deg] \u03b8=82-90[deg] AT2017gfo L [erg/s] t [day] b) 135\u00b0\u2264\u03c6<180\u00b0 1x1040 1x1041 1x1042 1 10 \u03b8=0-28[deg] \u03b8=41-51[deg] \u03b8=82-90[deg] AT2017gfo L [erg/s] t [day] c) 225\u00b0\u2264\u03c6<270\u00b0 1x1040 1x1041 1x1042 1 10 \u03b8=0-28[deg] \u03b8=41-51[deg] \u03b8=82-90[deg] AT2017gfo L [erg/s] t [day] d) 315\u00b0\u2264\u03c6<360\u00b0 Figure 8. Isotropically equivalent bolometric luminosities observed from various viewing angles for model Q4B5H. The top panels denote the comparison among the results for different longitudinal directions, while the middle and bottom panels denote the comparison among the results for different latitudinal directions. The isotropically equivalent bolometric luminosity observed in AT2017gfo with the distance of 40 Mpc is also shown by the filled circles adopting the data in Waxman et al. (2018), which assume a black-body fit to the photo-metric observations. Note that the light curves before 1 d are hidden since they are not reliable due to the lack of opacity data in the high temperature regime (\u227320, 000 K). MNRAS 000, 1\u201320 (20XX) \f12 K. Kawaguchi et al. 16 17 18 19 20 21 22 23 0.5 1 2 3 4 5 7 10 14 20 g z K a) \u03c6=45-90[deg] b) \u03c6=135-180[deg] c) \u03c6=225-270[deg] d) \u03c6=315-360[deg] AB magnitude t [day] D=40 Mpc, 0\u00b0\u2264\u03b8<28\u00b0 16 17 18 19 20 21 22 23 0.5 1 2 3 4 5 7 10 14 20 g z K a) \u03c6=45-90[deg] b) \u03c6=135-180[deg] c) \u03c6=225-270[deg] d) \u03c6=315-360[deg] AB magnitude t [day] D=40 Mpc, 82\u00b0\u2264\u03b8<90\u00b0 16 17 18 19 20 21 22 23 0.5 1 2 3 4 5 7 10 14 20 g z K \u03b8=0-28[deg] \u03b8=41-51[deg] \u03b8=82-90[deg] AB magnitude t [day] D=40 Mpc, a) 45\u00b0\u2264\u03c6<90\u00b0 16 17 18 19 20 21 22 23 0.5 1 2 3 4 5 7 10 14 20 g z K \u03b8=0-28[deg] \u03b8=41-51[deg] \u03b8=82-90[deg] AB magnitude t [day] D=40 Mpc, b) 135\u00b0\u2264\u03c6<180\u00b0 16 17 18 19 20 21 22 23 0.5 1 2 3 4 5 7 10 14 20 g z K \u03b8=0-28[deg] \u03b8=41-51[deg] \u03b8=82-90[deg] AB magnitude t [day] D=40 Mpc, c) 225\u00b0\u2264\u03c6<270\u00b0 16 17 18 19 20 21 22 23 0.5 1 2 3 4 5 7 10 14 20 g z K \u03b8=0-28[deg] \u03b8=41-51[deg] \u03b8=82-90[deg] AB magnitude t [day] D=40 Mpc, d) 315\u00b0\u2264\u03c6<360\u00b0 Figure 9. gzK-band light curves for model Q4B5H observed from various viewing angles with the distance of 40 Mpc. The top panels denote the comparison among the results for different longitudinal directions, while the middle and bottom panels denote the comparison among the results for different latitudinal directions. The data points denote the AB magnitudes of AT2017gfo taken from Villar et al. (2017). MNRAS 000, 1\u201320 (20XX) \fend-to-end simulation for KN emission from BH-NS merger 13 1x1040 1x1041 1x1042 1 10 2D model b) \u03c6=135-180[deg] d) \u03c6=315-360[deg] L [erg/s] t [day] 0\u00b0\u2264\u03b8<28\u00b0 16 17 18 19 20 21 22 23 0.5 1 2 3 4 5 7 10 14 20 g z K 2D model b) \u03c6=135-180[deg] d) \u03c6=315-360[deg] AB magnitude t [day] D=40 Mpc, 0\u00b0\u2264\u03b8<28\u00b0 1x1040 1x1041 1x1042 1 10 2D model b) \u03c6=135-180[deg] a) \u03c6=45-90[deg] L [erg/s] t [day] 82\u00b0\u2264\u03b8<90\u00b0 16 17 18 19 20 21 22 23 0.5 1 2 3 4 5 7 10 14 20 g z K 2D model b) \u03c6=135-180[deg] a) \u03c6=45-90[deg] AB magnitude t [day] D=40 Mpc, 82\u00b0\u2264\u03b8<90\u00b0 Figure 10. Comparison of the isotropically equivalent bolometric luminosities (left) and gzK-band light curves (right) between the fiducial (the same as in Figures 8 and 9) and axisymmetrized (labeled as \u201c2D model\u201d) models. The top and bottom panels denote the light curves observed from 0\u25e6\u2264\ud835\udf03\u226428\u25e6and 82\u25e6\u2264\ud835\udf03\u226490\u25e6, respectively. The solid and dashed curves denote the light curves of the axisymmetrized model and those for the fiducial model observed from b): 135\u25e6\u2264\ud835\udf19< 180\u25e6, respectively. The dotted curves in the upper and bottom panels denote the light curves of the fiducial model observed from d): 315\u25e6\u2264\ud835\udf19< 360\u25e6and a): 45\u25e6\u2264\ud835\udf19< 90\u25e6, respectively. dimensionless spin of 0.75. We confirmed the finding in the previous studies that, thermal pressure induced by radioactive heating in the ejecta could significantly modify the morphology of the ejecta. In our studied case of a BH-NS binary, the dynamical ejecta expand significantly and the aspect ratio becomes close to unity with the fine structure being smeared out in the presence of radioactive heating. On the other hand, the post-merger ejecta were compressed and confined in the region with the radial velocity \u22720.05 \ud835\udc50due to the significant expansion of the dynamical component. We then computed the KN light curves employing the ejecta profile obtained by the HD simulation of the ejecta matter. We found that our present BH-NS model results in KN light curves that are fainter but longer lasting than those observed in AT2017gfo, reflecting the fact that the emission is primarily powered by the lanthanide-rich massive dynamical ejecta. The optical-band emission is comparable to or fainter than those for the various BNS models obtained in our previous studies. While the peak brightness of the near-infrared emission is also comparable to the BNS models, the time-scale maintaining the brightness is much longer, and the emission comparable to the peak brightness within 1 mag is sustained for more than two weeks for the BH-NS model. The wide-field infrared observations with the ground-based telescopes, such as VISTA (Ackley et al. 2020), WINTER (Frostig et al. 2022) and PRIME (Kondo et al. 2023), can detect such bright infrared KN emission up to \u224814 d if the distance to the event is within 150 Mpc since the K-band emission will be apparently brighter than 21 mag for all the viewing angles. However, the field of views of infrared telescopes are typically not as large as those for the optical telescopes for a given sensitivity (Nissanke et al. 2013). Therefore, a tight constraint of the localization area by the GW data analysis or the follow-up observation within \u22481 d in the optical MNRAS 000, 1\u201320 (20XX) \f14 K. Kawaguchi et al. -19 -18 -17 -16 -15 -14 -13 -12 -11 0.5 1 2 3 4 5 7 10 16 20 14 15 16 17 18 19 20 21 22 DD2-135135 SFHo-125145 MNS75a b) \u03c6=135-180 [deg] d) \u03c6=315-360 [deg] AB absolute magnitude AB apparent magnitude [40 Mpc] t [day] g-band; 0\u00b0\u2264\u03b8<20\u00b0 -19 -18 -17 -16 -15 -14 -13 -12 -11 0.5 1 2 3 4 5 7 10 16 20 14 15 16 17 18 19 20 21 22 DD2-135135 SFHo-125145 MNS75a b) \u03c6=135-180 [deg] a) \u03c6=45-90 [deg] AB absolute magnitude AB apparent magnitude [40 Mpc] t [day] g-band; 86\u00b0\u2264\u03b8<90\u00b0 -19 -18 -17 -16 -15 -14 -13 -12 -11 0.5 1 2 3 4 5 7 10 16 20 14 15 16 17 18 19 20 21 22 DD2-135135 SFHo-125145 MNS75a b) \u03c6=135-180 [deg] d) \u03c6=315-360 [deg] AB absolute magnitude AB apparent magnitude [40 Mpc] t [day] z-band; 0\u00b0\u2264\u03b8<20\u00b0 -19 -18 -17 -16 -15 -14 -13 -12 -11 0.5 1 2 3 4 5 7 10 16 20 14 15 16 17 18 19 20 21 22 DD2-135135 SFHo-125145 MNS75a b) \u03c6=135-180 [deg] a) \u03c6=45-90 [deg] AB absolute magnitude AB apparent magnitude [40 Mpc] t [day] z-band; 86\u00b0\u2264\u03b8<90\u00b0 -19 -18 -17 -16 -15 -14 -13 -12 -11 0.5 1 2 3 4 5 7 10 16 20 14 15 16 17 18 19 20 21 22 DD2-135135 SFHo-125145 MNS75a b) \u03c6=135-180 [deg] d) \u03c6=315-360 [deg] AB absolute magnitude AB apparent magnitude [40 Mpc] t [day] K-band; 0\u00b0\u2264\u03b8<20\u00b0 -19 -18 -17 -16 -15 -14 -13 -12 -11 0.5 1 2 3 4 5 7 10 16 20 14 15 16 17 18 19 20 21 22 DD2-135135 SFHo-125145 MNS75a b) \u03c6=135-180 [deg] a) \u03c6=45-90 [deg] AB absolute magnitude AB apparent magnitude [40 Mpc] t [day] K-band; 86\u00b0\u2264\u03b8<90\u00b0 Figure 11. Comparison of the bolometric and gzK-band light curves among the present BH-NS KN model and various BNS KN models. For BNS KN models, three cases are shown: a case in which the remnant MNS survives for a short time (the dashed curves; SFHo-125145, Kiuchi et al. (2022); Fujibayashi et al. (2023); Kawaguchi et al. (2023)), a case in which the remnant MNS survives for a long time (the dash-dotted curves; DD2-135135, Fujibayashi et al. (2020b); Kawaguchi et al. (2022)), and a case in which large-scale magnetic field significantly plays a role in the long-surviving remnant MNS (the dotted curves; MNS75a, Shibata et al. (2021); Kawaguchi et al. (2022)). Note that the light curve for model SFHo-125145 in the top-right panel is below the plot range. MNRAS 000, 1\u201320 (20XX) \fend-to-end simulation for KN emission from BH-NS merger 15 bands is crucial to detect the KN emission unless the event occurs as close as in the case of AT2017gfo. Once a KN with long-lasting near-infrared emission is found, follow-up observations in the radio band may also be useful to support the presence of massive dynamical ejecta, by finding the synchrotron radio flares with the relatively delayed peak time of \u223c10 yr (Kyutoku et al. 2013). We found that the non-axisymmetric geometry of the ejecta induces various interesting radiative-transfer effects in the viewingangle dependence of the KN emission. In particular, we found the Doppler effect induced by the bulk velocity of the ejecta to the emission, which is pointed out by Fern\u00e1ndez et al. (2017) and Darbha et al. (2021), is in fact present. Due to this effect, the optical light curves observed from the direction of the bulk ejecta motion show a slightly inverted latitudinal angle dependence to those found in the BNS models: The optical-band emission observed from b): 135\u25e6\u2264\ud835\udf19< 180\u25e6 becomes slightly brighter in the equatorial direction than in the polar direction for the present BH-NS model. Since the KNe emission becomes fainter in the equatorial direction than in the polar direction for BNS mergers, our results suggest that, for the edge-on view, the KN emission for BH-NS mergers can be brighter in the optical-band than that of BNS mergers. Our results indicate that the long-lasting near-infrared emission is the key to distinguish the types of progenitors by the KN observation. If the K-band emission of which brightness comparable to its peak is maintained for more than two weeks, it may indicate that the progenitor is a BH-NS merger with massive ejecta formation. This is consistent with our finding in the previous study (Kawaguchi et al. 2020). On the other hand, only from the optical emission, the BH-NS KN light curves can be similar to those associated with BNS mergers, and hence, it may be difficult to infer the information of the progenitor. We should note that the ejecta mass and hence the brightness of the KN of BH-NS mergers can have large variety depending on the binary parameters, such as the BH and NS masses, BH spin, and NS radius (Rosswog 2005; Shibata & Taniguchi 2008; Etienne et al. 2009; Lovelace et al. 2013; Kyutoku et al. 2015; Foucart et al. 2018), as well as on the adopted EOS (Hayashi et al. 2023). We also note that the assumption of LTE employed in our RT simulation will not be valid in the region where the rest-mass density has been significantly dropped. It is implied in Hotokezaka et al. (2021); Pognan et al. (2022) that the matter temperature can be higher than that estimated under the assumption of LTE if non-LTE effects take place. In such a case, the infrared emission can be dimmer with the combination of the suppression of the neutral and poorly ionized atoms (Kawaguchi et al. 2021, 2022, 2023). Hence, we should note that the absence of the long-lasting bright near-infrared emission does not necessarily rule out the possibility that the progenitor of the observed KN is a BH-NS merger. So far, four candidates have been reported for BH-NS GW events: GW190814 (Abbott et al. 2020), GW200105/GW200115 (Abbott et al. 2021), and GW230529 (The LIGO Scientific Collaboration et al. 2024a). Among them, according to the inferred masses and spins of the binary, the latest GW event, GW230529, was most likely to be accompanied by EM counterparts. Unfortunately, the EM counterpart was not found in GW230529 due to the poorly constrained sky localization, although the luminosity distance to the event was relatively close (201+102 \u221296 Mpc with the error bar being the 90% credible intervals). Nevertheless, the discovery of this system increases the expected rate of the GW detection of a BH-NS merger with EM counterparts in the future. For this event, (under the assumption that this event was a BH-NS merger) the ratio of the BH mass to the NS mass and the dimensionless BH spin were less than \u22484 and larger than \u22480, respectively. For such a case of a BH-NS merger, the ratio of the post-merger ejecta mass to the dynamical one can be larger compared to the BH-NS model which we studied in this paper (Hayashi et al. 2021). This indicates that the resulting KN may become bluer than the present result, while it is not always trivial since the long-term hydrodynamics evolution of ejecta may also differ. Hence, the systematic study on the KNe for various configurations of BH-NS binaries would be crucial to quantitatively interpret the EM observational data in the future. There are a number of KN candidates reported which are associated with the observation of GRBs: GRB050709 (Jin et al. 2016), GRB060614 (Jin et al. 2015; Yang et al. 2015), GRB130603B (Berger et al. 2013; Tanvir et al. 2013), GRB160821B (Lamb et al. 2019; Troja et al. 2019), GRB211211A (Rastinejad et al. 2022; Troja et al. 2022; Gompertz et al. 2023), and GRB230307A (Levan et al. 2024). In Figure 12, we compare our present BH-NS KN model with these observational data. The optical and near-infrared brightness of KN candidates found in GRB211211A and GRB230311 are comparable to that of AT2017gfo. We find that our present BH-NS KN model is too faint to explain the optical brightness of these KN candidates at a few days, while the K-band emission of our present BH-NS KN model after 4 d is too bright to be consistent with the later time upper limits. Our present BH-NS KN model is also too faint in the optical bands to explain the KN candidates found in GRB050709, GRB060614, and GRB160821B after \u22482 d. The K-band brightness of GRB160821B at 4.3 d is comparable to that of our present BHNS KN model, while the BNS model in which the remnant MNS survives for a long time (> 1 s, DD2-135135 in Figure 11) also has comparable K-band brightness at that epoch. Interestingly, despite the bright and long-lasting K-band emission, our present BH-NS model has fainter H-band emission at \u223c10 d than that observed in GRB130603B. This is due to the fact that the KN of our present BH-NS model is very red and the peak of the red-shifted spectrum is located in the wavelength longer than the H-band at that epoch. In summary, currently we do not find a KN candidate that can be only explained by our present BH-NS model with significant dynamical ejecta formation. However, as we mentioned above, we cannot rule out the possibility that some of those KN candidates are KNe associated with BH-NS mergers, since BH-NS KNe can have a large diversity reflecting the variety of binary parameters as well as the adopted EOS. We found more than a factor of 2 variation in the KN brightness depending on the viewing angle in our present BH-NS model. Such a variation in the brightness can induce the same degree of the systematic error in conducting the ejecta parameter estimation for the ejecta properties, such as the mass, velocity, and effective ejecta opacity, from the observational data. We should also note that we only focus on one single case of a BH-NS merger with the DD2 EOS, and it is not clear whether the property of KN is always the same for other setups of BH-NS mergers. For example, if the longitudinal opening angle of the ejecta is close to 2\ud835\udf0b, the BH-NS KN can have the viewing-angle dependence in the brightness comparably strong to those of BNS mergers as we indeed see in the results of the axisymmetrized model (see Fig. 10). We further should note that uncomprehended systematic errors in the opacity and heating rate can induce large systematic errors in the ejecta parameter inference. In particular, the latter can be severe for KNe from BH-NS mergers since the uncertainty is more significant for the ejecta with low values of \ud835\udc4c\ud835\udc52(< 0.24, see Barnes et al. (2021); Zhu et al. (2021)). Hence, it is essential to consider that these systematic errors can significantly alter the results of the ejecta parameter inference, and those estimated values should be used with a great caution. MNRAS 000, 1\u201320 (20XX) \f16 K. Kawaguchi et al. 21 22 23 24 25 26 27 28 1 10 V R I Apparent magnitude [Vega] t [day] GRB050709 19 20 21 22 23 24 25 26 27 28 1 10 V R I Apparent magnitude [Vega] t [day] GRB060614 23 24 25 26 27 28 29 1 10 r H Apparent magnitude [AB] t [day] GRB130603B 22 23 24 25 26 27 28 29 1 10 g r i z H K Apparent magnitude [AB] t [day] GRB160821B 20 21 22 23 24 25 26 1 10 g r i J K Apparent magnitude [AB] t [day] GRB211211A 19 20 21 22 23 24 25 26 27 28 1 10 g r i z K Apparent magnitude [AB] t [day] GRB230307A Figure 12. Comparison between the present BH-NS KN model and GRB KN candidates. The solid and dashed curves denote the polar light curves in the observer frame (0\u25e6\u2264\ud835\udf03\u226428\u25e6) for the present BH-NS KN model observed from b): 135\u25e6\u2264\ud835\udf19< 180\u25e6and d): 315\u25e6\u2264\ud835\udf19< 360\u25e6, respectively. The square and triangle symbols denote, respectively, the observed magnitudes and upper-limits of the optical and near-infrared counterparts of GRBs taken from Jin et al. (2016, 2015); Yang et al. (2015); Berger et al. (2013); Tanvir et al. (2013); Lamb et al. (2019); Troja et al. (2019); Rastinejad et al. (2022); Troja et al. (2022); Gompertz et al. (2023); Levan et al. (2024). The afterglow models which broadly reproduce the models in the literature are also plotted in the dotted curves. MNRAS 000, 1\u201320 (20XX) \fend-to-end simulation for KN emission from BH-NS merger 17 ACKNOWLEDGEMENTS Numerical computation was performed on Yukawa21 at Yukawa Institute for Theoretical Physics, Kyoto University and the Yamazaki, Sakura, Cobra, and Raven clusters at Max Planck Computing and Data Facility, and the Cray XC50 at CfCA of the National Astronomical Observatory of Japan. ND acknowledges support from Graduate Program on Physics for the Universe (GP-PU) at Tohoku University. This work was supported by Grant-in-Aid for Scientific Research of JSPS/MEXT (20H00158, 21H04997, 22KJ0317, 23H00127, 23H04894, 23H04900, 23H05432, and 23H01172) and JST FOREST Program (JPMJFR212Y). DATA AVAILABILITY Data and results underlying this article will be shared on reasonable request to the corresponding author."
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.15034v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.15034v1",
|
| 3 |
+
"title": "Deep Multi-View Channel-Wise Spatio-Temporal Network for Traffic Flow Prediction",
|
| 4 |
+
"abstract": "Accurately forecasting traffic flows is critically important to many real\napplications including public safety and intelligent transportation systems.\nThe challenges of this problem include both the dynamic mobility patterns of\nthe people and the complex spatial-temporal correlations of the urban traffic\ndata. Meanwhile, most existing models ignore the diverse impacts of the various\ntraffic observations (e.g. vehicle speed and road occupancy) on the traffic\nflow prediction, and different traffic observations can be considered as\ndifferent channels of input features. We argue that the analysis in\nmultiple-channel traffic observations might help to better address this\nproblem. In this paper, we study the novel problem of multi-channel traffic\nflow prediction, and propose a deep \\underline{M}ulti-\\underline{V}iew\n\\underline{C}hannel-wise \\underline{S}patio-\\underline{T}emporal\n\\underline{Net}work (MVC-STNet) model to effectively address it. Specifically,\nwe first construct the localized and globalized spatial graph where the\nmulti-view fusion module is used to effectively extract the local and global\nspatial dependencies. Then LSTM is used to learn the temporal correlations. To\neffectively model the different impacts of various traffic observations on\ntraffic flow prediction, a channel-wise graph convolutional network is also\ndesigned. Extensive experiments are conducted over the PEMS04 and PEMS08\ndatasets. The results demonstrate that the proposed MVC-STNet outperforms\nstate-of-the-art methods by a large margin.",
|
| 5 |
+
"authors": "Hao Miao, Senzhang Wang, Meiyue Zhang, Diansheng Guo, Funing Sun, Fan Yang",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.LG",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.LG",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Temporal AND Graph",
|
| 15 |
+
"gt": "Accurately forecasting traffic flows is critically important to many real\napplications including public safety and intelligent transportation systems.\nThe challenges of this problem include both the dynamic mobility patterns of\nthe people and the complex spatial-temporal correlations of the urban traffic\ndata. Meanwhile, most existing models ignore the diverse impacts of the various\ntraffic observations (e.g. vehicle speed and road occupancy) on the traffic\nflow prediction, and different traffic observations can be considered as\ndifferent channels of input features. We argue that the analysis in\nmultiple-channel traffic observations might help to better address this\nproblem. In this paper, we study the novel problem of multi-channel traffic\nflow prediction, and propose a deep \\underline{M}ulti-\\underline{V}iew\n\\underline{C}hannel-wise \\underline{S}patio-\\underline{T}emporal\n\\underline{Net}work (MVC-STNet) model to effectively address it. Specifically,\nwe first construct the localized and globalized spatial graph where the\nmulti-view fusion module is used to effectively extract the local and global\nspatial dependencies. Then LSTM is used to learn the temporal correlations. To\neffectively model the different impacts of various traffic observations on\ntraffic flow prediction, a channel-wise graph convolutional network is also\ndesigned. Extensive experiments are conducted over the PEMS04 and PEMS08\ndatasets. The results demonstrate that the proposed MVC-STNet outperforms\nstate-of-the-art methods by a large margin.",
|
| 16 |
+
"main_content": "Introduction As a typical spatio-temporal prediction task, traffic prediction has drawn considerable research attention in recent years due to the increasing amount of urban traffic and its significant impacts on real-world application. Accurate traffic forecasting is particularly useful to support Intelligent Transportation Systems (ITS), and can facilitate many real applications such as travel route planning(Huang, Xu, and Weng 2020), and travel time estimation(Wang et al. 2018). Traditional statistics-based prediction approaches, such as ARIMA (Williams and Hoel 2003) and VAR (Chandra and Al-Deek 2009) have been widely used in road segment-level traffic flow prediction, and achieved promising performance. Predicting the traffic flows over a large Copyright \u00a9 2020, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. road network, however, is a much more difficult task due to the very complex and non-linear spatio-temporal dependencies among the traffic data over different road links. Thus statistics-based models become less effective to handle the road network-level traffic prediction. With the recent advances of deep learning techniques, various deep learning models (Wang, Cao, and Yu 2020) are employed for traffic flow prediction and has achieved remarkable performance gains. ST-ResNet (Zhang, Zheng, and Qi 2017) was proposed to collectively forecast the inflow and outflow in each region of a city. (Yao et al. 2019) proposed a Spatio-Temporal Dynamic Network (STDN) model for road network based traffic prediction. Diffusion convolution recursive neural network (DCRNN) (Li et al. 2018) integrated diffusion convolution and Seq2Seq structure for traffic flow prediction. Graph WaveNet (Wu et al. 2019) combined GCN with dlated casual convolution to capture the spatial-temporal dependencies of the traffic flows. STGCN (Yu, Yin, and Zhu 2018) used ChebNet graph convolution and 1D convolution to forecast the traffic flows in each road of a road network. GMAN (Zheng et al. 2020) proposed to utilize the attention mechanism to effectively extract spatial and temporal features for traffic prediction. However, existing works mainly focus on capturing the local spatial correlations of the traffic data, which follows the First Law of Geography (Tobler 1970): \u201dNear things are more related than distant things\u201d, but cannot fully reflect the global spatial dependencies. For example, previous work (Yao et al. 2018) showed that two regions with similar POI distribution or functionality(i.e., both commercial area), even though they are not geographically close to each other, can present very similar patterns on the semantic space of the spatio-temporal data (e.g., traffic flow). Such global spatial dependencies are not carefully considered by existing deep learning based approaches. Another limitation of existing methods is that the diverse impacts of the traffic observations on the traffic flow prediction task is largely ignored. As shown in Figure 1, different types of traffic observations may have different impacts on traffic flows. Figure 1(a) shows the relationship between traffic flow and traffic speed. From the picture1(a), one can see that traffic flow and speed are negatively correlated. That is to say the traffic speed will slow arXiv:2404.15034v1 [cs.LG] 23 Apr 2024 \f2018-01-01 2018-01-05 2018-01-09 2018-01-13 2018-01-17 0 125 250 375 500 Traffic Flow 50 55 60 65 70 75 Vehicle Speed (a) Traffic low vs Vehicle speed 2018-01-01 2018-01-05 2018-01-09 2018-01-13 2018-01-17 0 125 250 375 500 Traffic Flow 0.0 0.4 0.8 1.2 1.6 Road occupation \u00d710 1 (b) Traffic flow vs Road occupancy Figure 1: Relationship between traffic flow and two traffic observation features (vehicle speed and road occupancy) down with the increase of traffic flows, and vice versa. Figure 1(b) shows the relationship between traffic flow and the road occupancy where the change of road occupancy follows the change of traffic flows. Both traffic speed and road occupancy have impacts on traffic flows, but the two relationships are quite different which is like the idea in MMRate(Wang et al. 2014). However, it is not considered in previous works how to model the influence of different traffic observation on the task of traffic flow prediction. To address the above issues, in this paper we propose a deep multi-view channel-wise spatial-temporal network model named MVC-STNet for traffic flow prediction. To model the different relations between various input channels representing traffic flow, road occupy and vehicle speed, and the prediction, channel-wise graph convolutional network (CGCN) is proposed. CGCN can learn the data representations of each channel first, and then fuse them in a parametric-matrix-based way (Zhang, Zheng, and Qi 2017). To effectively capture the local and global spatial correlations, localized and globalized spatio-temporal graphs are constructed to learn the two spatial representations, and then a multi-view fusion module is proposed to fuse the localized and globalized data representations. Additionally, LSTM is also used to learn the sequential dependency of the traffic flows. Considering the external context features including holidays and weather can also significantly influence traffic flows, the external features are also incorporated into our model. We summarize our main contributions as follows: \u2022 A novel deep learning framework MVC-STNet is presented to perform spatio-temporal knowledge extraction for traffic flow prediction. By considering the spatial and temporal features exhaustively, the proposed model can effectively capture the complex spatial and temporal correlations. \u2022 We propose a channel-wise graph neural network that can adaptively learn the different influences of input channels on traffic prediction. To the best of our knowledge, this is the first graph neural network based model for traffic flow prediction that considers the divergence between different input channels. \u2022 We conduct experiments on two real world traffic datasets. The results show that our model is consistently and significantly better than existing state-of-the-art methods. The remainder of the paper is organized as follows. Section 2 will review related work. Section 3 will give a formal problem definition. Section 4 will first show the model framework and then introduce the model in detail. Evaluations are given in Section 5, followed by the conclusion in Section 6. Related Work This work is highly relevant to the research topics of traffic flow prediction and graph convolutional network. Next, we will review related works from the above two aspects. Traffic flow prediction. As a typical spatio-temporal prediction task, traffic flow prediction has been studied for decades in intelligent transportation systems (Wang, Cao, and Yu 2020; Yao et al. 2019). Traditionally, statistic-based time series prediction models such as ARIMA (Williams and Hoel 2003) and SVR (Castro-Neto et al. 2009) are widely used for predicting traffic flows on a single road. Due to the limited learning capacity, these statistic-based approaches cannot effectively capture the complex spatiotemporal dependencies of the traffic data over a large road network. Recently, various deep learning based methods are broadly applied in traffic flow prediction and these models have achieved much better performance than traditional statistic-based shallow models, such as ST-ResNet (Zhang, Zheng, and Qi 2017) and ConvLSTM (Xingjian et al. 2015). SeqST-GAN (Wang et al. 2020) was proposed to perform multi-step traffic flow prediction of a city in an adversarial learning way. Above mentioned works mainly applied CNN to capture the spatial correlation by treating the traffic data of an entire city as images, or combined CNN and RNN models to capture both the spatial and temporal correlations. However, CNN based models cannot well model the semantic spatial correlation of the traffic data and the global spatial structure of a city. To address this issue, some recent works try to use graph neural network to perform road network level traffic prediction. (Li et al. 2018) proposed the diffusion Convolutional Recurrent Neural Network (DCRNN) to model the traffic flow as a diffusion process on a directed road graph. A Spatio-Temporal Graph Convolutional Networks was proposed to tackle the time series prediction problem in traffic forecasting. (Zheng et al. 2020) proposed a graph multi-attention network (GMAN) to predict traffic conditions for time steps ahead at different locations on a road network graph. However, complex \fspatial dependencies which contains local and global spatial features are not well considered in these models. Graph Convolutional Network. Graph convolutional network (GCN) was widely studied in recent years (Qu, Bengio, and Tang 2019). (Estrach et al. 2014) first proposed the graph convolution operation in Fourier domain through the graph Laplacian. Then Chebyshev expansion of the graph Laplacian was employed to improve the inference efficiency (Defferrard, Bresson, and Vandergheynst 2016). (Kipf and Welling 2017) simplified the convolution operation which only aggregated the node features from their neighbors. GAT (Veli\u02c7 ckovi\u00b4 c et al. 2018) introduced the attention mechanism to aggregate node features with the learned wights. GraphSAGE (Hamilton, Ying, and Leskovec 2017) proposed a general, inductive framework that leveraged node feature information (e.g., text attributes) to efficiently generate node embedding. However, these GCN based models treat the input features equally, but ignore the different impacts of node features on prediction tasks. Problem Formulation In this section, we will first give some definitions to help us state the studied problem. Then a formal problem formulation will be given. Definition 1 Traffic network G we denote the traffic network at time slot t as Gt = {V t, Et, At}, where |V t| = N is the set of vertices, N denotes the number of vertices that represent road segments in real world, Et denotes the set of edges, indicating the connectivity between the nodes, for example, if two segments in real world are connected, an edge exists between the corresponding nodes. Note that the traffic network can be either directed or undirected, and At represents the adjacency matrix. Definition 2 Traffic network feature matrix X we define the traffic network feature matrix at time slot t as Xt \u2208 RN\u00d7C, where C is the dimension of the node features. The traffic network feature matrix represents the observations of G at the time step t. Problem Definition 1 Given the spatio-temporal traffic network and graph feature matrix {Xt, Gt|t = t1, . . . , tT } over T time slots, and external context data matrix E (e.g., weather, holiday, etc.), our goal is to to predict the traffic flow Y t in the next time slot. Deep Multi-View Channel-wise Spatio-Temporal Network Figure 2 shows the framework of the proposed MVC-STNet model. As shown in the figure, the model contains four major steps. First, we split the raw input traffic network data into n parts with each part indicating a channel. The local and global spatial-temporal graphs are constructed from the geographical and semantic views, respectively. Next, several channel-wise GCN (CGCN) layers are stacked to learn the hidden feature of each channel which represents traffic flow, vehicle speed or road occupancy. From the picture 1, we assume that different channels may have different impacts on task prediction. The stacked CGCN layers aim to capture the spatial dependencies of the data and map the channel-wise data into a high-dimensional embedding latent space. Meanwhile, it also can adaptively learn the hidden relations between input channels and prediction. Third, after the multi-view fusion, the learned spatial features are input into stacked LSTM layers to learn the temporal dependencies. Finally, we concatenate the learned spatio-temporal representations and the learned external features for prediction. Next, we will elaborate these steps in detail in the following subsections. Local and Global Spatial-Temporal Graph Construction We intend to build a model that can directly capture the influence of each node on its local neighbors and global neighbors. We use Ag \u2208RN\u00d7N and As \u2208RN\u00d7N to denote the local and global adjacency matrix of the spatial graph, respectively. Based on the first Law of Geography (Tobler 1970): \u201dNear things are more related than distant things\u201d, we first construct the local spatial graph. If two nodes are connected with each other geographically, there is an edge between them. The corresponding value in the adjacency matrix is set to be the reciprocal of the distance between the two nodes. The geographical adjacency matrix can be formulated as follows: Ai,j g = \u001a 1 dis, if vi connects to vj 0, otherwise (1) where dis denotes the geographical distance between two nodes vi and vj. However, the First Law of Geography may not fully reflect the spatial correlations of the traffic flows in urban areas that is known as the global spatial correlations or semantic spatial correlations. For example, a commercial area may have few traffic flows coming from a park, although they are geographically close to each other; while a residential district far away may have a large number of people flowing into the commercial area. To tackle this problem, we construct the adaptive global adjacency matrix which was used in AGCRN (Bai et al. 2020). First, we randomly initialize a learnable node embedding: EA \u2208RN\u00d7de for all nodes, where de denotes the dimension of node embedding, and each row of EA represents the embedding of a specific node. Then we can infer the semantic spatial dependencies between each pair of nodes by multiplying EA and ET A as follows: As = Softmax(ReLU(EAET A) (2) where Softmax is used to normalize the adaptive matrix. Note that the globalized adjacency matrix changes over time. This process is similar as constructing the graph based on nodes similarity. Multi-View Channel-wise Graph Convolutional Network The localized spatial graphs and the globalized spatial graphs are next input into the Multi-View Channel-wise Graph Convolutional Network for modeling the geographical and semantic spatial correlations. As the input features \f\ud835\udc3a\ud835\udc52\ud835\udc5c\ud835\udc54\ud835\udc5f\ud835\udc4e\ud835\udc5d\u210e\ud835\udc56\ud835\udc50\ud835\udc4e\ud835\udc59\ud835\udc49\ud835\udc56\ud835\udc52\ud835\udc64 \ud835\udc46\ud835\udc52\ud835\udc5a\ud835\udc4e\ud835\udc5b\ud835\udc61\ud835\udc56\ud835\udc50\ud835\udc49\ud835\udc56\ud835\udc52\ud835\udc64 \ud835\udc34\ud835\udc54 \ud835\udc34\ud835\udc60 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \ud835\udc45\ud835\udc52\ud835\udc59\ud835\udc62 \ud835\udc45\ud835\udc52\ud835\udc59\ud835\udc62 \ud835\udc45\ud835\udc52\ud835\udc59\ud835\udc62 \ud835\udc45\ud835\udc52\ud835\udc59\ud835\udc62 \ud835\udc45\ud835\udc52\ud835\udc59\ud835\udc62 \ud835\udc45\ud835\udc52\ud835\udc59\ud835\udc62 \u2026 \ud835\udc36\u210e\ud835\udc4e\ud835\udc5b\ud835\udc5b\ud835\udc52\ud835\udc591 \ud835\udc36\u210e\ud835\udc4e\ud835\udc5b\ud835\udc5b\ud835\udc52\ud835\udc59\ud835\udc5b \ud835\udc40\ud835\udc62\ud835\udc59\ud835\udc61\ud835\udc56\ud835\udc49\ud835\udc56\ud835\udc52\ud835\udc64 \ud835\udc39\ud835\udc62\ud835\udc60\ud835\udc56\ud835\udc5c\ud835\udc5b \ud835\udc3c\ud835\udc5b\ud835\udc5d\ud835\udc62\ud835\udc61 \ud835\udc36\u210e\ud835\udc4e\ud835\udc5b\ud835\udc5b\ud835\udc52\ud835\udc59-\ud835\udc64\ud835\udc56\ud835\udc60\ud835\udc52\ud835\udc3a\ud835\udc36\ud835\udc41\ud835\udc59\ud835\udc4e\ud835\udc66\ud835\udc52\ud835\udc5f \ud835\udc5d\ud835\udc5f\ud835\udc52\ud835\udc51\ud835\udc56\ud835\udc50\ud835\udc61\ud835\udc56\ud835\udc5c\ud835\udc5b Figure 2: The framework of MVC-STNet.(Relu is a non-linear activation function) are treated equally by the traditional GCN (Kipf and Welling 2017), the different influences of various features on the prediction is ignored. To address this issue, we propose a channel-wise graph convolutional network (CGCN) to first learn the data representation of each channel separately, and then fuse them together. Moreover, we propose a multi-view fusion module for modeling both localized and globalized spatial correlations, which can be formulated as follows: Ht g = CGCN(Xt, Ag) Ht s = CGCN(Xt, As) Ht mv = Ht g + Ht s (3) where Ht g, Ht s and Ht mv are localized spatial hidden features, globalized spatial hidden features and multi-view fused spatial features respectively, CGCN(\u00b7) denotes the proposed channel-wise graph convolution network. Channel-wise Graph Convolutional Network Recently, generalizing convolutional networks to graph data have attracted considerable research interest. In this paper, we consider to use spectral convolutions (Kipf and Welling 2017) on the constructed spatial graphs, which can be formulated as follows: f(Xt, A) = \u03c3(D\u22121 2 e AD\u22121 2 XtW t) (4) where f(\u00b7) represents the GCN operation, e A = A+IN is the adjacency matrix of G with added self-connections, e Dii = P j e Aij is the degree matrix , W t represents the learnable weight matrix, and \u03c3(\u00b7) is the activation function. \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 \ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc361 \ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc362 \ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc36\ud835\udc5b\ud835\udc5b \u2026 \u2026 \ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45 \ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45 \ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45\ud835\udc45 \ud835\udc4a\ud835\udc4a 1\ud835\udc4a\ud835\udc4a 2 \ud835\udc4a\ud835\udc4a \ud835\udc5b\ud835\udc5b \u2026 Figure 3: The illustration of channel-wise graph convolutional network.(Relu is a non-linear activation function) However, the above GCN operation cannot model the different influences of various input features on the final prediction. To address this issue, we propose a channel-wise graph convolutional network (CGCN) to separately model relations between each input features and output. Figure 3 shows the framework of the proposed CGCN. We first split the input graph features Xt \u2208RN\u00d7C by channels to get the channel-wise spatial graph features Xt i \u2208RN\u00d71. Then we input the Xt i into the stacked GCN layer which is shared by all channel-wise graph features. The learned i-th localized spatial hidden features can be formulated as follows: Ht i,g,l+1 = \u03c3(D\u22121 2 f AgD\u22121 2 Ht i,g,lW t l ) (5) where Ht g,0 is equal to Xt i, W t l is the a trainable matrix of filter parameters in the l-th graph convolutional layer. We \fuse CGCNi(Xt i, Ag) to denote the localized GCN operation. Similarly, the globalized graph convolutional operation for i-th channel can be defined as: Ht i,s,l+1 = \u03c3(D\u22121 2 AsD\u22121 2 Ht i,s,lW t l ) (6) We use CGCNi(Xt i, As) to represent the globalized GCN operation. As shown in Figure 1, with the change of traffic flow, the speed and occupancy show different trends. Inspired by this observation, We propose a novel channel-fusion method to fuse the latent representations of all channel features. This method aims to automatically learn the relations between outputs and each input features. We employ the parametricmatrix-based (Zhang, Zheng, and Qi 2017) fusion method to fuse the n outputs of stacked CGCN layers as follows: Ht g = W1 \u2299Ht 1,g + W2 \u2299Ht 2,g + \u00b7 \u00b7 \u00b7 + Wn \u2299Ht n,g Ht s = W1 \u2299Ht 1,s + W2 \u2299Ht 2,s + \u00b7 \u00b7 \u00b7 + Wn \u2299Ht n,s (7) where Wi(i \u2208{1, . . . , n}) are the learnable parameters that adjust the degrees affected by n channels, Ht \u03b1\u03b2(\u03b1 \u2208 {1, . . . , n}, \u03b2 \u2208{g, s}) are the learned spatial representations of n channels\u2019 feature. Learning Temporal Dependencies with LSTM Besides the spatial correlations, traffic flow forecasting also involves complex temporal correlations. We input the extracted spatial features into LSTM layers as follows for temporal feature learning. f t = \u03c3(Wf[ht\u22121, Ht mv] + bf), it = \u03c3(Wi[ht\u22121, Ht mv] + bi), ct = ft \u2299ct\u22121 + it \u2299tanh(Wc[ht\u22121, Ht mv] + bc), ot = \u03c3(Wo[ht\u22121, Ht mv] + bo), ht = ot \u2299tanh(ct). (8) where f t, it, ct, ot, ht are forget gate, input gate, memory cell, output gate and hidden state, respectively. Integrating the External Features External context features may significantly affect the traffic flows. For example, the patterns of traffic on weekdays and weekends can be quite different, while rainstorms may dramatically decrease the traffic flows. By considering the external context features including weather conditions and holidays, we design an external feature extractor which is defined as : et = FC(Embedding(Et)) (9) where et is the learned external feature representation, FC(\u00b7) represents the multi-layer perception model. Finally, we concatenate the learned spatial-temporal graph representations and external feature representation for traffic flow prediction. \u02c6 Y t = FC(Concat(ht, et)) (10) where Concat(\u00b7) denotes the concatenation operation. Algorithm 1 Deep Multi-View Channel-wise Spatio-Temporal Network Input: G: Spatial-temporal traffic network X: Spatialtemporal graph signal matrix Output: Parameter set \u0398 1: Initialize parameters \u0398 2: while not converge do 3: 0 \u2190t, t is the t-th time slot 4: while t < T do 5: Sample XT \u2208X, Gt \u2208G 6: Ht mv \u2190Learning spatial correlations with multi-view channel-wise GCN through Eq. 3 7: ht \u2190Learning temporal correlations with LSTM by Eq. 8 8: et \u2190External feature learning by Eq.9 9: \u02c6 Y t \u2190Predict traffic flows with Eq.10 10: update \u0398 based on Objective function 11: t \u2190t + 1 12: end while 13: return \u0398 14: end while Table 1: Dataset Description Dataset PeMS04 PeMS08 Area San Francisco Bay San Bernaridino Detectors 3848 1979 Time span 01/01/2018\u223c28/02/2018 01/07/2016\u223c31/08/2016 Time interval 5 mins 5 mins Nodes 307 170 # of time intervals 16992 17847 External Features Days Weekday, weekend, holiday, etc Weather conditions Temperature, rain, snow, etc. Overall Objective Function The final loss function of MVC-STNet is as follows: Loss = 1 L L X t=1 || \u02c6 Y t \u2212Y t||2 (11) where L is the training sample size, \u02c6 Y t is the prediction and Y t is the ground truth. The pseudo-code of the algorithm is shown in Algorithm 1. Experiment Dataset and Experiment Setup Dataset We use two datasets that are widely used in graph traffic flow prediction for evaluation: PeMS04, and PeMS08. The details of the datasets are introduced as follows. PeMS04 This traffic dataset is collected in San Francisco Bay Area. It contains the traffic data collected by 3848 detectors on 29 roads. The time span of this dataset is from January to February in 2018. We use the first 54 days data for training and validating, and the remaining data are for testing. PeMS08 This dataset is collected in San Bernaridino from July to August in 2016. It contains the traffic data collected by 1979 detectors on 8 roads. We use the first 55 days for \fTable 2: RMSE and MAE comparison among different methods Model PeMS04 PeMS08 RMSE MAE RMSE MAE HA 47.80 32.73 43.32 30.09 ARIMA 55.18 36.84 48.88 34.27 FC-LSTM 43.18 29.52 39.94 26.80 STGCN 42.37 30.69 37.83 27.66 DCRNN 39.86 26.78 33.62 25.44 T-GCN 39.45 27.69 34.43 24.92 MVC-STNet 37.61 23.83 32.88 21.40 training and validating,and the remaining 7 days data for testing. We also use some external features including weather, holiday and weekends. Whether the day is weekday, weekend or holiday is also considered as the people mobility patterns on holidays and regular days are quite different. The descriptions on the two datasets and external features are shown in Table 1. Baselines We compare the proposed MVC-STNet with the following baseline methods. \u2022 HA Historical Average(HA) uses the average historical data as the prediction of the future. \u2022 ARIMA Auto-Regressive Integrated Moving Average (ARIMA) (Williams and Hoel 2003) is a classic statisticsbased method for time series prediction. \u2022 FC-LSTM FC-LSTM (Sutskever, Vinyals, and Le 2014) uses RNN with fully connected LSTM hidden units to capture the non-linear temporal dependencies for traffic prediction. \u2022 STGCN STGCN (Yu, Yin, and Zhu 2018) applies ChebNet-GCN and 1D convolution to extract spatial and temporal dependencies for traffic prediction. \u2022 DCRNN DCRNN (Li et al. 2018) uses graph convolution networks to capture the spatial correlations and the encoder-decoder architecture with scheduled sampling to capture the temporal correlations for traffic prediction. \u2022 T-GCN T-GCN (Zhao et al. 2019) combines the graph convolutional network (GCN) and the gated recurrent unit (GRU) for traffic prediction To further evaluate the effectiveness of different components in our model, we also compare the full version MVC-STNet with the following variants: \u2022 GCN-STNet This model removes the Channel-wise Convolutional network and the multi-view fusion module. It only considers the local spatial correlations. By comparing with it, we test whether the proposed CGCN(\u00b7) and multi-view fusion is useful for improving the prediction performance. \u2022 CGCN-STNet This model does not consider the features of the globalized spatial-temporal graph. Through comparing with this model, we test whether integrating the global spatial graph is helpful to capture the complex spatial features. 0 50 100 150 200 The number of epochs 0 75 150 225 Loss value PeMS04 PeMS08 Figure 4: Loss curves of MVC-STNet on the two datasets \u2022 MV-STNet This model drops the CGCN layer while only use the tradiction GCN layer (Kipf and Welling 2017) to capture the spatial correlations. Through comparing with it, we test whether the proposed CGCN method can model the divergence between channels. Evaluation metric We adopt mean absolute error (MAE) and root mean square error (RMSE) defined as follows as the evaluation metrics. MAE = 1 n n X t=1 | \u02c6 Yt\u2212Yt|, RMSE = v u u t 1 n n X t=1 || \u02c6 Yt \u2212Yt||2 (12) where \u02c6 Y t is the prediction, and Y t is the ground truth. Implement details We implement our model with Pytorch framework on NVIDIA RTX3090 GPU. The model parameters are set as follows. The input data size for PeMS04 dataset is 3\u00d7307\u00d73 where the first 3 is the previous time slot length used for prediction, 307 is the number of the nodes, the last 3 is the number of channels that represent flow, speed and occupy, for PeMS08 dataset is 3 \u00d7 170 \u00d7 3, where 170 represents the number of the nodes. The CGCN model contains 3 layers whose hidden feature dimensions are 16, 32, and 64. The final LSTM contains 2 layers, whose hidden dimension are all 256. The output of PeMS04 is 1 \u00d7 307 \u00d7 1, and the output of PeMS08 is 1 \u00d7 170 \u00d7 1. The baseline methods are implemented based on the original papers or we use the publicly available code. The parameters of baseline methods are set based on the original papers. Note that we normalize the traffic data into [0, 1] to facility the feature learning. \fDataset Methods RMSE MAE PeMS04 GCN-STNet 40.77 26.83 CGCN-STNet 38.47 24.83 MV-STNet 38.91 25.12 MVC-STNet 37.61 23.83 PeMS08 GCN-STNet 37.33 25.63 CGCN-STNet 34.48 22.93 MV-STNet 33.90 22.44 MVC-STNet 32.88 21.40 Table 3: RMSE and MAE comparison with variant methods Convergence of the algorithm Figure 4 shows the training loss curves of the algorithm on the two datasets. One can see that MVC-STNet converges after about 50 epochs on the two datasets, and then becomes stable. It shows the proposed model can quickly converge. In the following experiments, we run MVC-STNet with 50 epochs on both datasets. Comparison with Baselines Table 2 shows the performance comparison among different methods over the two datasets. The best results are highlighted with bold font. It shows that the proposed MVC-STNet achieves the best performance over both datasets. Traditional statistics-based methods ARIMA and HA achieve the worse performance among all the methods. It is not surprising because ARIMA and HA only use the time series data of each node, but ignore the spatial dependency. On PeMS04 dataset, compared with the best results achieved by baselines, MVC-STNet reduces RMSE of the traffic flow prediction from 39.45 achieved by T-GCN to 37.61, and MAE from 26.78 achieved by DCRNN to 23.83. MVC-STNet reduces the RMSE from 33.62 to 32.88, and MAE from 24.92 to 21.40. The decrease trends of RMSE and MAE over PeMS08 dataset are smaller than that over PeMS04. This is because the number of nodes in the traffic network of PeMS08 is smaller than that of PeMS04, which means that the spatial correlations is more complex in PeMS04. The results in Table 2 show that the proposed MVC-STNet is superior to existing state-of-the-art spatiotemporal learning approaches. Comparison with Variant Models To study whether the components in MVC-STNet are all helpful to the prediction task, we compare with its variants GCN-STNet, CGCN-STNet, and MV-STNet. The result is shown in Table 3. One can that CGCN and multi-view fusion module are all useful to the model as removing any one of them will increase the prediction error. On PeMS04 dataset, considering the divergence between channels seems more important, while the multi-view fusion operation is more important on PeMS08 dataset. Combining these components together achieves the lowest RMSE and MAE, demonstrating that all of them are useful to the studied problem. Case Study To further intuitively illustrate how accurately our model can predict the traffic flows, we visualize the predicted traffic 2016-08-24 2016-08-25 2016-08-27 2016-08-29 2016-08-31 0 125 250 375 500 Ground truth Prediction 2018-08-24 2016-08-25 2016-08-27 2016-08-29 2016-08-31 0 100 200 300 400 Ground truth Prediction 2018-02-24 2018-02-25 2018-02-26 2018-02-27 2018-02-28 0 150 300 450 600 Ground truth Prediction 2018-02-24 2018-02-25 2018-02-26 2018-02-27 2018-02-28 100 200 300 400 Ground truth Prediction Figure 5: Prediction vs ground truth on two datasets(top to down: node 7 and node 15 in PeMS04, node 20 and node 29 in PeMS08) flows and the ground truth in Figure 5. Due to space limitation, we only show a case study on the selected four nodes of the traffic network on the two datasets. From top to down, the upper two figures show the predicted traffic flows and the ground truth on nodes 7 and 15 of the PeMS04 dataset, and the lower two figures show the prediction and the ground truth on the nodes 20 and 29 of the PeMS08 dataset. One can see that the red curves of prediction can accurately trace the blue curves of the ground truth. The figure also shows that the two datasets present obvious periodical change characteristics, which is consistent with the traffic mobility patterns in cities. Our model can perfectly capture the periodicity of the data due to the usage of LSTM. Furthermore, the results show that our proposed MVC-STNet model can capture the spatial and temporal dependencies effectively."
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.15045v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.15045v1",
|
| 3 |
+
"title": "Multi-Head Mixture-of-Experts",
|
| 4 |
+
"abstract": "Sparse Mixtures of Experts (SMoE) scales model capacity without significant\nincreases in training and inference costs, but exhibits the following two\nissues: (1) Low expert activation, where only a small subset of experts are\nactivated for optimization. (2) Lacking fine-grained analytical capabilities\nfor multiple semantic concepts within individual tokens. We propose Multi-Head\nMixture-of-Experts (MH-MoE), which employs a multi-head mechanism to split each\ntoken into multiple sub-tokens. These sub-tokens are then assigned to and\nprocessed by a diverse set of experts in parallel, and seamlessly reintegrated\ninto the original token form. The multi-head mechanism enables the model to\ncollectively attend to information from various representation spaces within\ndifferent experts, while significantly enhances expert activation, thus deepens\ncontext understanding and alleviate overfitting. Moreover, our MH-MoE is\nstraightforward to implement and decouples from other SMoE optimization\nmethods, making it easy to integrate with other SMoE models for enhanced\nperformance. Extensive experimental results across three tasks: English-focused\nlanguage modeling, Multi-lingual language modeling and Masked multi-modality\nmodeling tasks, demonstrate the effectiveness of MH-MoE.",
|
| 5 |
+
"authors": "Xun Wu, Shaohan Huang, Wenhui Wang, Furu Wei",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"cs.AI",
|
| 12 |
+
"cs.LG"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "Mixture AND of AND Experts",
|
| 16 |
+
"gt": "Sparse Mixtures of Experts (SMoE) scales model capacity without significant\nincreases in training and inference costs, but exhibits the following two\nissues: (1) Low expert activation, where only a small subset of experts are\nactivated for optimization. (2) Lacking fine-grained analytical capabilities\nfor multiple semantic concepts within individual tokens. We propose Multi-Head\nMixture-of-Experts (MH-MoE), which employs a multi-head mechanism to split each\ntoken into multiple sub-tokens. These sub-tokens are then assigned to and\nprocessed by a diverse set of experts in parallel, and seamlessly reintegrated\ninto the original token form. The multi-head mechanism enables the model to\ncollectively attend to information from various representation spaces within\ndifferent experts, while significantly enhances expert activation, thus deepens\ncontext understanding and alleviate overfitting. Moreover, our MH-MoE is\nstraightforward to implement and decouples from other SMoE optimization\nmethods, making it easy to integrate with other SMoE models for enhanced\nperformance. Extensive experimental results across three tasks: English-focused\nlanguage modeling, Multi-lingual language modeling and Masked multi-modality\nmodeling tasks, demonstrate the effectiveness of MH-MoE.",
|
| 17 |
+
"main_content": "Introduction Large capacity models, such as Large Language Models (LLMs) (Zhao et al., 2023; Pham et al., 2023; Chung et al., 2022; OpenAI, 2023) and Large Multi-modal Mod1Tsinghua University, Beijing, China 2Microsoft Research, Beijing, China. Correspondence to: Shaohan Huang <shaohanh@microsoft.com>. (a) SMoE MH-MoE Activation: 8.33% Activation: 90.71% (b) RGB Input Sub-tokens Assign Figure 1. (a) Expert activation distribution on XNLI (Conneau et al., 2018), encompassing 6 parallel expert layers with 32 experts per layer. SMoE has many \u201cdead\u201d experts (dark) which are not activated, while MH-MoE leading to significantly increased usage of these experts. Experts activation ratio is determined by calculating the ratio of each expert\u2019s selection frequency in each MoE layer to the total number of tokens, where those exceeding a threshold (<1) are considered activated. (b) MH-MoE showcases finer-grained understanding by distributing sub-tokens split from semantically-rich patches to more distinct experts to capture semantic information. Brighter regions indicate that subtokens from this patch are distributed to a greater number of diverse experts, while darker regions indicate that sub-tokens are assigned to more of the same experts. els (LMMs) (Wang et al., 2022; Peng et al., 2023), have demonstrated their efficacy across various domains and tasks. To further enhance performance, a reliable approach involves scaling up these models by augmenting the parameter count (Fedus et al., 2022). But for most of these densely-activated large-capacity models (referred to as Dense models), which utilize all their parameters to process all inputs, the extremely large size of these models significantly reduces inference speed, further limiting their practicality. A promising alternative, facilitating model scalability while mitigating the burdensome computational costs, resides in Sparse Mixtures of Experts (SMoE) (Shazeer et al., 2017b; Du et al., 2021; Chi et al., 2022; Clark et al., 2022). 1 arXiv:2404.15045v1 [cs.CL] 23 Apr 2024 \fMulti-Head Mixture-of-Experts MH-MoE Assign SMoE Assign Expert3 English\uff1a during the wildlife safari, I used my high-resolution camera to capture stunning photographs of lions, elephants, and giraffes in their natural habitat, creating unforgettable memories of the adventure. Italian\uff1a dopo una lunga giornata di lavoro, non vedo l'ora di rilassarmi nella mia camera (means bedroom) da letto, che ho decorato con colori caldi e tessuti morbidi per creare un ambiente accogliente e tranquillo. camera Inputs Tokenization & Embedding Vision Data Language Data \ud835\udefc Router Embeddings \u210e \u210e Token Assign to Experts or There are three person. (Lacking too many details) Camera means Multi-head Layer \ud835\udefc Router \u210e Expert3 Expert2 Expert1 Expert4 In Italian, it means In English, It means He presses his hands against his chest, earnestly speaking towards the left side. He stretched out a finger, as if to ask a question. \u210e Merge Layer \u210e Figure 2. Workflow for MH-MoE on both vision and language data. For vision data, different heads routed to different experts try to capture different aspects of details within patches and relations between patches. For language data, different heads attend to capture the varying contexts of false cognates across different languages (e.g., Italian and English) or polysemous words within a single language. In contrast to Dense model, SMoE contains parallel feedforward neural networks (referred to as experts) within each building block, and strategically activates distinct experts for specific input tokens via a router, thereby yielding noteworthy efficiency enhancements. GShard (Lepikhin et al., 2020) scales a Dense model from 2B to 600B parameters with lower training costs than a 100B Dense model. And recently, Mixtral 8\u00d77B (Jiang et al., 2024), a SMoE model containing 8 experts (7B parameter in total) is shown to outperform or matches LLaMA-2 70B (Touvron et al., 2023) and GPT-3.5. Despite its success, SMoE has some drawbacks: (1) Low experts activation, which means that only a small subset of experts are activated during optimization and inference, e.g., 8.33% activation ratio shown in Figure 1 (a), while the majority of them are not used at all (see the dark area). As a result, SMoE fails to utilize the full expressive power of these experts, especially when the number of experts is large, which significantly limits effectiveness and scalability of SMoE. (2) Absence of fine-grained analytical capabilities. The current tokenization patterns impose limitations on the model\u2019s capacity to grasp multiple semantic interpretations linked to individual tokens. In the context of visual data, dividing images into patches for tokenization may either neglect finer image details when using larger patches or escalate computational requirements when employing smaller ones. For language data, the tokenization of false cognates across different languages or polysemous words within a single language results in them being represented by the same tokens, despite carrying distinct meanings. This can subsequently lead to confusion within the models. To tackle the above issues, we propose Multi-Head Mixture-of-Experts (MH-MoE). The workflow of MHMoE is illustrated in Figure 2. By employing a multihead mechanism to split each input token into multiple sub-tokens and distribute them to different experts, MHMoE achieves denser expert activation without an increase in computational and parameter complexity. Specifically, as shown in Figure 2, when provided with a single input token, MH-MoE activates four experts by splitting it into four sub-tokens, whereas SMoE only activates one expert. Furthermore, the allocation of sub-tokens to distinct experts enables the model to simultaneously focus on information from various representation spaces within different experts, ensuring a more granular understanding for subtle differences in both vision and language patterns. See in Figure 2, sub-tokens assigned to Experts 3 and 2 capture a detailed understanding of each character\u2019s actions within an image patch, while those assigned to Experts 1 and 4 explicitly model the semantics of the false cognate \u2018camera\u2019. After expert processing, sub-tokens are seamlessly reintegrated into the original token form, thereby circumventing any additional computational burden in subsequent non-parallel layers, e.g., attention layer, while also integrating semantic information captured from multiple experts MH-MoE maintains following strengths: (1) Higher experts activation & better scalability. MH-MoE can alleviate lower expert activation problem and significantly enhance the usage of larger experts by enabling optimization of almost all of experts, e.g., achieving 90.71% activation in Figure 1 (a), allowing for more efficient scaling of model capacity. (2) Finer-grained understanding ability. Multi-head mechanism adopted in MH-MoE assign sub-tokens to different experts, enabling to jointly attend to information from different representation spaces at different experts, and finally achieving better finer-grained understanding ability. For example, refer to the bright area in Figure 1 (b), where sub-tokens are distributed among a more diverse set of experts, facilitating the capture of semantically-rich information. (3) Seamless integration. The implementation of MH-MoE is remarkably straightforward and decoupled from other SMoE optimization methods (e.g., GShard (Lepikhin et al., 2020)), making it very easy to integrate them together to achieve better performance. We evaluate the proposed MH-MoE on three model pretraining and fine-tuning setting: English-focused language modeling, Multi-lingual language modeling and Masked multi-modality modeling. Extensive experimental among 2 \fMulti-Head Mixture-of-Experts these three tasks demonstrate the effectiveness of MHMoE. 2. Background Sparse Mixture of Experts. Sparse Mixture-of-Experts (SMoE) (Shazeer et al., 2017b; Du et al., 2021; Chi et al., 2022; Clark et al., 2022) enhances model capacity while maintaining a constant computational demand, thus achieving better performance than densely-activated models on various tasks (Lepikhin et al., 2021; Kumatani et al., 2021; Zhao et al., 2023; Pham et al., 2023) and being emerged as a pivotal advancement in the field of deep learning. Different from densely-activated models, each MoE layer consists of N independent Feed-Forward Networks (FFN) {f FFN i }N i=0 as the experts, along with a gating function g (\u00b7) to model a probability distribution indicating the weights over these experts\u2019 outputs. For the hidden representation h \u2208Rd of each input token, the gating value of routing h to expert f FFN i is denoted as: g \u0000f FFN i \u0001 = exp (h \u00b7 ei) / N X j=0 exp (h \u00b7 ej) , (1) where ei denotes the trainable embedding of the i-th expert and PN i=0 g \u0000f FFN i \u0001 = 1. Then, the corresponding k experts, according to the top-k gated values, are activated and the output O of the MoE layer is O = h + X i\u2208\u03a6 g \u0000f FFN i \u0001 \u00b7 f FFN i (h) . (2) where \u03a6 denote activated experts set and |\u03a6| = k. Routing Mechanism in SMoE. As described above, the most commonly used routing mechanism involves selecting the top-k experts from N experts, where k \u226a N (Shazeer et al., 2017a), e.g., k = 2 and N = 2048 in GShard (Lepikhin et al., 2020). Such a routing mechanism allows the combination of data parallelism and expert parallelism. Yang et al. (2021) and Lepikhin et al. (2020) suggest that larger values of k often contribute to better model performance. However, with the increase in the value of k, training models with conventional top-k routing implementation becomes much less efficient (Lepikhin et al., 2020). In this paper, we introduce MH-MoE, a simple but efficient manner to make denser expert activation without an increase in computational complexity. 3. Method The full architecture of MH-MoE can be seen in Figure 3, MH-MoE addresses low experts activation and confusion over ambiguity of tokens issues by applying a multi-head mechanism to split each token into sub-tokens and route them to various experts to achieve denser expert activation as well as deeper understanding. 3.1. Multi-Head Mixture-of-Experts Concretely, we denote a sequence of inputs tokens by X \u2208 Rl\u00d7d, where l is the number of tokens and d represents the length of token dimension. In MH-MoE, each parallel layer contains a set of N experts, each presented as {f FFN i : R d h \u2192R d h }N i=0, h denotes the number of heads in multihead mechanism, which is decoupled from the head in the multi-head self-attention layer. For clarity, we describe the operation of a single MH-MoE layer here only. First, X is projected by a multi-head layer with parameter matrices Whead \u2208Rd\u00d7d, \u02c6 X = X \u00b7 W\u22a4 head (3) where \u02c6 X \u2208Rl\u00d7d. After that, every token in \u02c6 X is split into h sub-tokens along the token dimensions, and these subtokens are arranged in parallel according to the original token sequence, forming a new feature space \u00a8 X \u2208R(l\u00d7h)\u00d7 d h as: \u00a8 X = \ud875\udfcbs( \u02c6 X) = \uf8ee \uf8ef \uf8f0 h z }| { x0 0, . . . , x0 h\u22121, . . . , xi j, xi j+1, . . . , xl h\u22121 | {z } l\u00d7h \uf8f9 \uf8fa \uf8fb, (4) where function \ud875\udfcbs denotes the token splitting operation: Rl\u00d7d \u2192R(l\u00d7h)\u00d7 d h , and each sub-token is presented as xi j \u2208R d h , meaning it is the the jth sub-token split from the ith token. Then all these sub-tokens are fed into the gating function g(\u00b7). The gating value of routing a certain sub-token xi j into the pth expert is computed as g \u0000f FFN p \u0001 = exp \u0000xi j \u00b7 ep \u0001 PN \u03be=0 exp \u0000xi j \u00b7 e\u03be \u0001, (5) where ep \u2208R d h is the learnable embedding of the pth expert. In this paper, we mainly focus on top-k routing, i.e., only the experts with the largest top-k routing score is activated. \u03a6 = Topk \u0000g \u0000f FFN\u0001\u0001 denote the set of activated experts and |\u03a6| = k. Then xi j is processed by these activated experts as following, oi j = xi j + X p\u2208\u03a6 g \u0000f FFN p \u0001 \u00b7 f FFN p \u0000xi j \u0001 . (6) After that, all obtained oi j are rearranged in the original 3 \fMulti-Head Mixture-of-Experts Transformer Block FFN1 FFN2 FFN3 FFN4 Expert Networks \ud835\udc86\ud835\udfcf \ud835\udc86\ud835\udfd0 \ud835\udc86\ud835\udfd1 \ud835\udc86\ud835\udfd2 Router Expert Embeddings Hidden States \u2026 \ud835\udc89 Dot Product Routing Scores Sequence Direction Transformer Block Hidden States Transformer Block FFN1 FFN2 FFN3 FFN4 Expert Networks \ud835\udc86\ud835\udfcf \ud835\udc86\ud835\udfd0 \ud835\udc86\ud835\udfd1 \ud835\udc86\ud835\udfd2 Router Expert Embeddings Hidden States \u2026 \ud835\udc89 Dot Product Routing Scores Sequence Direction Transformer Block Hidden States Multi-head Layer \u2026 \u2026 \u2026 Merge Layer \u2026 Transformer Block FFN1 FFN2 FFN3 FFN4 Expert Networks \ud835\udc86\ud835\udfcf \ud835\udc86\ud835\udfd0 \ud835\udc86\ud835\udfd1 \ud835\udc86\ud835\udfd2 Router Expert Embeddings Hidden States \u2026 \ud835\udc89 Dot Product Routing Scores Sequence Direction Transformer Block Hidden States Transformer Block FFN1 FFN2 FFN3 FFN4 Expert Networks \ud835\udc86\ud835\udfcf \ud835\udc86\ud835\udfd0 \ud835\udc86\ud835\udfd1 \ud835\udc86\ud835\udfd2 Router Expert Embeddings Hidden States \u2026 \ud835\udc89 Dot Product Routing Scores Sequence Direction Transformer Block Hidden States Multi-head Layer \u2026 \u2026 \u2026 Merge Layer \u2026 (a) SMoE (b) MH-MoE Figure 3. Illustration of a typical SMoE layer and the proposed MH-MoE layer. (a) An SMoE layer consists of a router and expert networks, where the experts are sparsely activated according to dot-product token-expert routing scores. (b) MH-MoE introduces additional two MLP layers, namely the multi-head layer and merge layer, and a Token-Splitting-Merging (TSM, Eq. 4 and Eq. 8) operation incorporated between these two MLPs. order of sub-tokens and integrated together as O = \uf8ee \uf8ef \uf8f0 h z }| { o0 0, . . . o0 h\u22121, . . . , oi j, oi j+1, . . . , ol h\u22121 | {z } l\u00d7h \uf8f9 \uf8fa \uf8fb, (7) where O \u2208R(l\u00d7h)\u00d7 d h . After that, O is transformed back the into original token form by a token merging operation \ud875\udfcbm: R(l\u00d7h)\u00d7 d h \u2192Rl\u00d7d: \u00af X = \ud875\udfcbm (O)\u22a4, (8) where \u00af X \u2208Rl\u00d7d. Finally, \u00af X is projected by a merge layer with parameter matrices Wmerge \u2208Rd\u00d7d to effective integration of multiple features oi j capturing detailed information from different expert representation spaces. The operation is presented as following: \u02d8 X = \u00af X \u00b7 W\u22a4 merge. (9) Then we get the final output \u02d8 X of the single MH-MoE layer. We name the token splitting (Eq. 4) and token merging (Eq. 8) operations together as the Token-Splitting-Mergin (TSM) operation. By implementing the aforementioned operations, we have effectively increased the average volume of data routed to a specific expert by a factor of h, as demonstrated in Eq. 4. Consequently, this achievement has resulted in denser expert activation. Furthermore, the allocation of sub-tokens to distinct experts within MH-MoE enables us to collectively capture semantic information from diverse feature spaces across these experts, thereby enhancing the model\u2019s ability to achieve a finer-grained understanding. The operations mentioned above ensure that the shapes of the input and output in the MH-MoE layer remain unchanged. Consequently, no additional computational cost is introduced in the subsequent block. Specifically, we introduce a hyperparameter \u03b2 to scale the inner dimensions of each expert, aiming to balance the parameters introduced by the multi-head layer and merge layer, aligning the model\u2019s parameters and computational complexity with the original SMoE. As the Pytorch-like style pseudocode of MH-MoE shown in Appendix E, MH-MoE is characterized by its overall simplicity of implementation, necessitating minimal modifications to the SMoE implementation. Additionally, it is decoupled from other SMoE optimization strategies (Lepikhin et al., 2020; Chi et al., 2022), thereby facilitating its convenient integration with other optimized SMoE frameworks to enhance performance. 3.2. Training Objectives The training objective of MH-MoE involves the simultaneous minimization of both the loss associated with the target task and an auxiliary load balancing loss. Load balancing loss. As described in Section 2, there is usually an expert load imbalance problem (Xie et al., 2023; Lepikhin et al., 2020). So, following (Lepikhin et al., 2020; Fedus et al., 2022), given the sub-token set \u00a8 X (depicted in Eq. 4) and the frequency tp of how many sub-tokens are routed to the pth expert, we compute the load balancing loss Lbalance via: Lbalance = N | \u00a8 X| N X p=1 X xi j\u2208\u00a8 X tp \u00b7 g \u0000f FFN p \u0001 , (10) where N denotes the number of experts, | \u00a8 X| is the number of sub-tokens contained in \u00a8 X. g \u0000f FFN p \u0001 is the gating function depicted in Eq. 5, denoting the gating value of routing a certain sub-token xi j into the pth expert. 4 \fMulti-Head Mixture-of-Experts (a) (b) (c) Figure 4. Perplexity on validation dataset during the training phase reported for Dense, X-MoE and MH-MoE across three pretraining tasks. (a) English-focused language modeling. (b) Multi-lingual language modeling. (c) Masked multi-modal modeling Task specific loss. The term Ltask is dependent on the particular task that MH-MoE is designed to learn. For instance, during pre-training, we utilize the language modeling loss (Radford et al., 2018), whereas the model predicts the next word in a sequence. So, the overall training objective is to minimize: L = Ltask + \u03b1Lbalance, (11) where \u03b1 is a coefficient for load balancing. 4. Experiments 4.1. Experimental Setup Compared Baselines. We include two baseline models for comparison purposes: (1) Dense, which represents a Transformer decoder without the incorporation of sparselyactivated parallel modules (i.e., SMoE layer). (2) X-MoE, which is our implementation based on the approach proposed by Chi et al. (2022). We build our MH-MoE upon X-MoE and uses identical settings to those employed in XMoE. Note that the all these models are pre-trained using the same training data as MH-MoE, and we ensure that the parameter count of our model remains consistent with or lower than that of X-MoE, ensuring a fair and equitable comparison. A detailed analysis and comparison about parameter and computational complexity can be found in Section 5.3 and Table 11. Pre-training Data. We detail the pre-training data of MHMoE, demonstrating its effectiveness in enabling denser expert activation and finer-grained understanding through a series of experiments. These experiments are organized into three thematic categories: (1) For the English-focused experiments, we pretrain both the baseline models and MH-MoE on the RedPajama dataset (Computer, 2023), which is an open-source pre-training dataset comprising sources such as Common Crawl, C4 (Raffel et al., 2020), Wikipedia, and additional curated datasets. The pretraining is conducted using GPT tasks to predict the next word in a sequence. (2) In the context of multilingual representation, we pretrain the baseline models and MH-MoE on the multilingual Wikipedia, following the approach described in XLM (Lample & Conneau, 2019), again utilizing GPT tasks. (3) For the multimodal domain, we pretrain all compared baselines and MH-MoE on masked multi-modality modeling task on both monomodal and multimodal data (14M images, 160GB documents and 21M image-text pairs following Wang et al. (2022)), and we present the details of these pre-training data in Appendix A. Model Architecture and Hyperparameters. For all experiments, we use the X-MoE Chi et al. (2022) as our backbone architecture to build our MH-MoE, which has shown better performance than prior SMoE models such as Switch Transformers (Fedus et al., 2022) on crosslingual understanding benchmarks. For English-focused Language Modeling and Multi-lingual Language Modeling, we construct Dense, X-MoE and MH-MoE using the Transformer (Vaswani et al., 2017) decoder (L = 12, H = 768, A = 12) with the GPT-41 vocabulary as the backbone architecture. The pre-training procedure takes 14 days on 2 NVIDIA DGX-2 Stations. For Masked Multi-modal Modeling, we build Dense, X-MoE and MH-MoE following the same Transformer encoder architecture as BEiT v3 (Wang et al., 2022). The pre-training procedure takes 4 days on 2 NVIDIA DGX-2 Stations. For all three pre-training tasks, we set the head number h = 4. More details about architecture and training hyperparameters can be found in Appendix B and C. 4.2. Perplexity Evaluation We examined the validation perplexity curves for all pretrained models and pre-training tasks under two expert settings (8 experts and 32 experts). The perplexity trends are depicted in Figure 4, with the final perplexity values listed in Table 1. We can observe that as training progresses: 1) the perplexity of our MH-MoE remained lower in comparison to the compared baselines, indicating more effective learning; 2) MH-MoE achieved the lowest perplexity across three distinct experimental setups; 3) an increase in the number of experts led to a corresponding decrease in the perplexity of MH-MoE, suggesting that the model ben1https://github.com/openai/tiktoken 5 \fMulti-Head Mixture-of-Experts Table 1. Results of upstream perplexity evaluation. We report the validation perplexity cross two setting: 8 experts and 32 experts. Model Perplexity \u2193 8 Experts 32 Experts English-focused language modeling Dense (without Experts) 16.23 16.23 X-MoE 14.82 11.96 MH-MoE (Ours) 12.72 10.28 Multi-lingual language modeling Dense (without Experts) 8.56 8.56 X-MoE 7.19 6.02 MH-MoE (Ours) 6.26 5.09 Masked multi-modal modeling Dense (without Experts) 17.95 17.95 X-MoE 16.34 12.68 MH-MoE (Ours) 14.73 10.87 efits from enhanced representation learning capabilities as more experts are incorporated. These results collectively demonstrate the superiority of MH-MoE in terms of learning efficiency and language representation across multiple pre-training paradigms. 4.3. Downstream Evaluation For each pre-training task, we conduct corresponding downstream evaluation to validate the efficacy of MHMoE. English-focused Language Modeling. We evaluate our models on a total of 9 different zero-shot benchmarks to assess their abilities across various natural language tasks like common sense reasoning, general language understanding and knowledge understanding using the LLM Evaluation Harness (Gao et al., 2023). As shown in Table 2, comparing X-MoE with the Dense model, X-MoE show notable improvement, indicating that SMoE models (e.g., XMoE) benefit from the large model capacity. Overall, for all benchmarks, our MH-MoE obtains the best performance, achieving an average performance gain of 1.1 for 8 experts setting and 1.5 for 32 experts setting compared to X-MoE, demonstrating the effectiveness of our proposed multi-head mechanism on modeling English-focused language. Multi-lingual Language Modeling. We evaluate our multi-lingual language models on the cross-lingual natural language inference (XNLI) corpus (Conneau et al., 2018), which is the extension of the multi-genre NLI (MultiNLI) corpus to 14 languages. We follow the LLM Evaluation Harness pipeline and use the zero-shot setting to evaluate the multi-lingual ability. Table 3 presents the zero-shot evaluation results on XNLI task. Similarly, X-MoE benefit from the large model capacity and show notable improvement compared with Dense model. Overall, MH-MoE obtains the best performance, surpassing X-MoE by an average performance gain of 0.6 for 8 experts setting and 0.8 for 32 experts setting. Comparing MH-MoE with the X-MoE, it shows that MH-MoE models provide consistent gains on downstream tasks, demonstrating the effectiveness of our proposed multi-head mechanism on modeling cross-lingual natural language. Masked Multi-modal Modeling. We evaluate on the widely used vision-language understanding and generation benchmarks, including visual question answering (Goyal et al., 2017), visual reasoning (Suhr et al., 2019) and image captioning (Lin et al., 2014). We report vqa-score on VQAv2, accuracy for NLVR2. For COCO image captioning, we report BLEU@4 (B@4), METEOR (M), CIDEr (C), and SPICE (S). Table 4 presents the evaluation results. For VQA task, MH-MoE outperforms both Dense and X-MoE by a large margin, e.g., 4.24 and 1.69 points gain on test-dev split, respectively. For visual reasoning task, MH-MoE beats all these two baselines on both dev (1.5 points gain than X-MoE) and test-P split (1.7 points gain than X-MoE). For image captioning task, MH-MoE surpasses X-MoE by 4.2%, 10.2%, 9.4% in terms of B@4, M and S, respectively. Above results show that X-MoE exhibits enhanced visual information comprehension, which also validates the effectiveness of our proposed multi-head mechanism in capturing diverse semantic and detailed information within visual data. 4.4. Ablation Studies This section presents experimental analysis to demonstrate the functionality of MH-MoE. In all comparative experiments, we ensure parameter equality across models by adjusting the internal dimensions of the experts. Number of Heads h. We conduct experiments by adjusting the number of heads (h = 2, 4, 6, 8, and 12) in MHMoE. As shown in Table 5, we find that across all settings of h, our model consistently outperforms the X-MoE, demonstrating the effectiveness of MH-MoE. Besides, as the value of h increases, we observe an initial improvement followed by a decline in our model\u2019s performance. This leads us to hypothesize that when h \u22646 the enhancement in performance benefits from the multi-head mechanism by activating a greater number of experts, thereby enhancing the model\u2019s effectiveness and capturing a wider range of fine-grained token information. However, as h continues to increase beyond 6, the excessive subdivision of tokens may inadvertently impair their original semantic content, resulting in a decrease in model performance. Effect of MH-MoE Components. As shown in Figure 3 (b), the multi-head mechanism utilized in our MH-MoE primarily incorporates two components: the Multilayer Perceptron (MLP) layers, including the multi-head layer (Eq. 3) and merge layer (Eq. 9), and the Token-SplittingMerging (TSM) operation (Eq. 4 and Eq. 8). We conduct 6 \fMulti-Head Mixture-of-Experts Table 2. Accuracy / accuracy-normalization scores for language understanding tasks using the LLM Evaluation Harness (Gao et al., 2023). Model ARC-Challenge ARC-Easy RTE BookQA Winogrande PiQA BoolQ HellaSwag TruthfulQA (mc1/mc2) Avg Dense 18.1/23.3 44.9/39.7 51.5 17.1/29.0 48.2 66.6 55.0 29.7/34.1 24.1/39.3 37.2 Experts Number N = 8 X-MoE 19.0/24.7 48.3/42.0 52.7 17.4/29.8 50.3 67.9 58.4 31.4/35.7 24.3/40.2 38.7 MH-MoE 19.6/25.2 50.2/42.2 53.0 18.2/30.3 51.1 68.7 59.6 33.2/40.3 24.7/40.9 39.8 Experts Number N = 32 X-MoE 19.4/24.8 50.4/42.5 52.7 17.8/30.0 51.3 68.8 52.8 33.4/40.1 24.3/39.1 39.1 MH-MoE 21.4/26.8 50.6/44.8 53.4 18.8/31.6 53.8 69.3 56.6 35.0/42.1 24.8/39.5 40.6 Table 3. Accuracy / accuracy-normalization scores on multilingual understanding tasks using the LLM Evaluation Harness (Gao et al., 2023). Model bg de el en es fr hi ru sw th tr ur vi zh Avg Dense 33.1 33.3 33.0 35.1 32.8 34.4 33.6 34.2 33.3 33.1 33.3 33.9 33.5 32.9 33.5 Experts Number N = 8 X-MoE 33.9 33.4 33.4 37.3 33.3 35.9 34.5 35.0 33.5 33.6 33.4 34.2 33.3 33.2 34.1 MH-MoE 34.4 33.2 33.9 40.1 34.0 36.4 34.6 35.2 33.8 34.4 33.3 34.7 34.6 33.5 34.7 Experts Number N = 32 X-MoE 34.5 34.5 33.4 39.6 33.1 35.3 34.1 35.4 33.6 34.7 33.7 33.6 34.5 33.3 34.5 MH-MoE 35.8 35.6 34.1 40.7 33.9 36.7 34.4 36.3 34.3 36.0 34.1 34.3 35.2 33.6 35.3 Table 4. Results of visual question answering, visual reasoning, and image captioning tasks. Model VQAv2 NLVR2 COCO Captioning test-dev test-std dev test-P B@4 M C S Dense 65.9 66.0 73.8 74.2 35.9 29.3 120.5 19.6 Experts Number N = 8 X-MoE 68.4 69.7 75.5 76.1 38.1 30.2 122.9 21.3 MH-MoE 70.1 71.4 77.0 77.8 39.7 33.1 124.1 23.0 Harness XNLI X-MoE MH-MoE h = 4 MH-MoE h = 8 Figure 5. Distribution of expert activation in X-MoE and MHMoE on both Harness (Gao et al., 2023) and XNLI (Conneau et al., 2018) corpus, encompassing 6 SMoE layers with 32 experts per layer. The top of the heatmap is the first SMoE layer while the bottom is the last. Experts activation ratio is determined by calculating the ratio of each expert\u2019s selection frequency in each MoE layer to the total number of tokens. a detailed analysis of the effectiveness of each component within our model, as well as the necessity of their integration. The results are presented in Table 6. A comparative analysis between Dense v.s. Densew/o MLP, as well as X-MoE v.s. X-MoEw/ MLP, reveals that introduction of the MLP layer does not enhance the model\u2019s performance. Similarly, when comparing MH-MoE with MH-MoEw/o MLP, it becomes evident that the inclusion of only the MLP, in the absence of the TS, also does not yield any improvement in the model\u2019s effectiveness. The parameter quantities of the models being compared pairwise are equal. An intriguing observation is made when comparing MHMoE with MH-MoEw/o TS. Introducing Token-SplittingMerging (TSM) alone, without MLP, results in a slight increase in model performance. In contrast, a significant enhancement in model performance is only achieved when both MLP and TS are incorporated simultaneously. We hypothesize that introduction of TS, without the integration of MLP, activates more experts, but the segmentation and merging of the model appears overly straightforward and abrupt in its execution. This limitation hinders the model\u2019s ability to meaningfully segment tokens into sub-tokens and effectively merge the diverse information gathered from different expert spaces. Number of MLP layers. We explore the impact of varying the number of layers (n = 0, 1, 2, 3) in MLP on MHMoE performance. For configurations exceeding a single layer, ReLU activation functions were incorporated between MLP layers to ensure the non-linearity of transformations. The parameter quantities of the models being compared are equal. Upon analyzing the results in Table 7, we observe that increasing the number of MLP layers beyond one had a negligible impact on the model\u2019s performance. This indicates that a single-layer MLP is sufficient for accomplishing token segmentation and fusion. 5. Analysis 5.1. Experts Activation Analysis Experts Activation. We visualize the activation of each expert varies across parallel expert layers for X-MoE and MH-MoE at Figure 5. It can be observed that: 1) X-MoE demonstrate a more skewed distribution, wherein a significant portion of experts remain inactivated all the time. 2) Our MH-MoE achieves a denser expert activation compared to X-MoE, effectively mitigating the issue of low expert utilization. 3) As the number of heads h increases, the 7 \fMulti-Head Mixture-of-Experts Table 5. Comparison results for different head number h. S-Dim denotes the dimension length of sub-tokens. Model Heads h S-Dim Perplexity X-MoE 14.82 MH-MoE 2 384 12.87 4 192 12.72 6 128 12.41 8 96 12.95 12 64 13.28 Table 6. Ablation studies of MH-MoE components: MLP layers and the TokenSplitting-Merging (TSM, Eq. 4 and Eq. 8) operation. Model MLP TSM Perplexity Dense \u2717 \u2717 16.23 Densew/ MLP \u2713 \u2717 16.40 X-MoE \u2717 \u2717 14.82 X-MoEw/ MLP \u2713 \u2717 14.77 MH-MoEw/o TS \u2713 \u2717 14.77 MH-MoEw/o MLP \u2717 \u2713 13.97 MH-MoE \u2713 \u2713 12.72 Table 7. Comparison results for different numbers of MLP layers n. The results are averaged over five runs. n Upstream Downstream Perplexity RTE PIQA Winogrande 0 13.97 52.9 68.2 51.7 1 12.72 53.4 69.3 53.8 2 12.66 54.0 68.8 53.3 3 12.87 53.1 68.8 52.7 (a) Upstream (b) Downstream Figure 6. Upstream and downstream results for scaling up the number of experts in X-MoE and MH-MoE. (a) Training perplexity (\u2193) when scaling the number of experts. (b) Downstream performance (accuracy scores \u2191) on hellaswag when scaling the number of experts. Figure 7. Comparison for sub-tokens assign diversity (the number of different experts they are routed to) for P&F and Non P&F tokens. P&F tokens refer to the polysemous and false cognate words identified by GPT-4, while Non P&F tokens represent the remaining words. expert activation frequency in MH-MoE also rises. Scalability. We explore the scalability for both X-MoE and MH-MoE by scaling up the number of experts from 8 to 256 (about 7B parameters). For upstream performance, as shown in Figure 6 (a), with the increase of experts, our MHMoE could bring more gains. It is because MH-MoE could mitigate the low expert activation problem effectively. With this ability, the superiority of the large-scale SMoE model will be better exerted, thereby achieving the improvement of the upper bound of SMoE with more experts. Detailed validation perplexity curves for these scaling up experiments can be found in Figure 9 at Appendix F. For downstream performance shown in Figure 6 (b), for X-MoE, expert number = 64 is the upper bound, meaning that continuing to increase the number of experts will not bring any gain. Our MH-MoE not only has a performance advantage over the X-MoE with the same number of experts, but also improves the upper bound from 64 to 256, which demonstrates the effectiveness of the scalability of our MH-MoE 100k 200k 250k RGB 100k 200k 250k RGB Figure 8. Assign diversity of sub-tokens split from different patches in vision data with respect to training steps (100k \u2192 200k \u2192250k steps). Brighter regions indicate sub-tokens split from this patch are distributed to a greater number of diverse experts. on downstream tasks. 5.2. Fine-grained understanding Analysis In Section 4, our model excels in multiple upstream and downstream tasks, demonstrating superior fine-grained modeling capabilities, both for languages and images. In this section, we delve into a more granular analysis to validate how the multi-head mechanism aids MH-MoE in capturing diverse and intricate semantic information that is often challenging to comprehend, e.g., polysemous and false cognates words (denoted as PF tokens) in languages, and semantically-rich areas in images. Note that for languages data, we utilized the GPT-4 API (OpenAI, 2023) to extract polysemous words and false cognates from the XNLI (Conneau et al., 2018) corpus, and the corresponding prompt can be found in Table 12. Experts Assign within Token. For languages data, we compute and compare the divergence levels (i.e., the number of different experts these sub-tokens are routed to) of sub-tokens split from PF tokens and Non-PF tokens. We conduct on MH-MoE with 8 heads (h=8) and represent the divergence of each token by calculating the mean divergence across the model\u2019s various layers. The results, presented in Figure 7, clearly demonstrate that the distribution of divergence for PF tokens is significantly skewed towards the right when compared to that of Non-PF tokens. This indicates that, in the MH-MoE\u2019s inference process, PF tokens route their sub-tokens to a greater number of different experts, thereby capturing diverse semantic information in 8 \fMulti-Head Mixture-of-Experts contrast to Non-PF tokens for a better polysemous and false cognates word modeling. For image data, we analyzed how the divergence levels of different patches evolve during the training process, as illustrated in Figure 8. Interestingly, we observe that as the training steps increase, the divergence levels gradually increase in high-frequency texture regions (or regions with rich semantics), while the divergence levels in lowfrequency texture regions gradually decrease. This indicates that during the training process, MH-MoE tends to route tokens from areas with complex textures to a greater variety of experts, thereby enhancing the finer-grained understanding of the semantics in that region. For more visualization examples, please refer to the Figure 10 at Appendix G. 5.3. Complexity & Parameter Analysis. We present a analysis of Complexity & Parameter for XMoE and MH-MoE in Appendix D, to validate that for all experiments setting, the computational and parameter cost of our MH-MoE are both lower than SMoE. Besides, a detailed parameter count for all experiments and comparable models can be seen in Table 11. 6."
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.15065v1.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.15065v1",
|
| 3 |
+
"title": "Formal Verification of Graph Convolutional Networks with Uncertain Node Features and Uncertain Graph Structure",
|
| 4 |
+
"abstract": "Graph neural networks are becoming increasingly popular in the field of\nmachine learning due to their unique ability to process data structured in\ngraphs. They have also been applied in safety-critical environments where\nperturbations inherently occur. However, these perturbations require us to\nformally verify neural networks before their deployment in safety-critical\nenvironments as neural networks are prone to adversarial attacks. While there\nexists research on the formal verification of neural networks, there is no work\nverifying the robustness of generic graph convolutional network architectures\nwith uncertainty in the node features and in the graph structure over multiple\nmessage-passing steps. This work addresses this research gap by explicitly\npreserving the non-convex dependencies of all elements in the underlying\ncomputations through reachability analysis with (matrix) polynomial zonotopes.\nWe demonstrate our approach on three popular benchmark datasets.",
|
| 5 |
+
"authors": "Tobias Ladner, Michael Eichelbeck, Matthias Althoff",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.LG",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.LG",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Graph AND Structure AND Learning",
|
| 15 |
+
"gt": "Graph neural networks are becoming increasingly popular in the field of\nmachine learning due to their unique ability to process data structured in\ngraphs. They have also been applied in safety-critical environments where\nperturbations inherently occur. However, these perturbations require us to\nformally verify neural networks before their deployment in safety-critical\nenvironments as neural networks are prone to adversarial attacks. While there\nexists research on the formal verification of neural networks, there is no work\nverifying the robustness of generic graph convolutional network architectures\nwith uncertainty in the node features and in the graph structure over multiple\nmessage-passing steps. This work addresses this research gap by explicitly\npreserving the non-convex dependencies of all elements in the underlying\ncomputations through reachability analysis with (matrix) polynomial zonotopes.\nWe demonstrate our approach on three popular benchmark datasets.",
|
| 16 |
+
"main_content": "Introduction A graph neural network extends the typical notion of feedforward neural networks to graph inputs (Kipf and Welling, 2017). Each node in the graph is associated with a feature vector, which is iteratively updated by exchanging information with neighboring nodes using their feature vectors over multiple message-passing steps. They have shown to achieve state-of-the-art results in a variety of fields (Wu et al., 2020), including advances in drug discovery (Zhang et al., 2021), recommender systems in social networks (Ying et al., 2018), and have also been applied in safety-critical environments such as cooperative autonomous driving (Chen et al., 2021). However, it is well known that neural networks are sensitive to adversarial attacks (Goodfellow et al., 2015), where minor perturbations to the input can lead to unexpected predictions. Adversarial examples have also extensively been studied for graph neural networks (Dai et al., 2018; G\u00a8 unnemann, 2022), where both the node features and the graph structure can be perturbed. As graph neural networks are a generalization of many other network architectures to non-Euclidean input data (Bronstein et al., 2017), the existence of adversarial examples is not surprising. Thus, neural networks need to be formally verified before they can be safely deployed (Brix et al., 2023; K\u00a8 onig et al., 2024). \u00a92024 Tobias Ladner, Michael Eichelbeck, and Matthias Althoff. License: CC-BY 4.0, see https://creativecommons.org/licenses/by/4.0/. arXiv:2404.15065v1 [cs.LG] 23 Apr 2024 \fLadner, Eichelbeck, and Althoff 1.1 Related Work Most state-of-the-art verifiers only consider standard, feedforward neural networks (Brix et al., 2023; K\u00a8 onig et al., 2024): These can generally be categorized into complete and incomplete algorithms (K\u00a8 onig et al., 2024). Complete algorithms (Huang et al., 2017; Katz et al., 2017) compute the exact output of a neural network given perturbations on the input. This allows one to either verify given specifications or to extract a counterexample. However, it has been shown that verifying a neural network with ReLU activations requires solving an exponential number of linear subproblems as this problem is NP-hard (Katz et al., 2017). Thus, many existing verifiers use incomplete but sound algorithms (Brix et al., 2023), which can verify given specifications by relaxing the problem; however, this relaxation might prevent them from extracting a counterexample when the specification could not be verified. These verifiers can again be categorized into optimization-based approaches and approaches using reachability analysis. Optimization-based approaches formulate relaxed constraints for the activation functions in a neural network. This relaxed problem is then solved using satisfiability modulo theories (SMT) or mixed integer programming (MIP) solvers (Zhang et al., 2018; Katz et al., 2019; M\u00a8 uller et al., 2022; Tjeng et al., 2019; Dutta et al., 2018), or symbolic interval propagation (Henriksen and Lomuscio, 2020; Singh et al., 2019; Brix and Noll, 2020). These algorithms can be improved using branch-and-bound strategies (Bunel et al., 2020), where the problem is divided into simpler subproblems. For example, one can split ReLU neurons into their linear parts (Botoeva et al., 2020; Singh et al., 2018b). Such branch-and-bound strategies (Wang et al., 2021; Ferrari et al., 2022; Shi et al., 2023) are currently the dominant strategies in state-of-the-art verifiers (Brix et al., 2023). On the other hand, one can use reachability analysis to verify a neural network by computing an enclosure of the output set. This is realized by propagating the perturbed input set through each layer of the neural network and bounding all approximation errors. Early approaches propagate convex set representations through neural networks, such as intervals (Pulina and Tacchella, 2010) and zonotopes (Gehr et al., 2018; Singh et al., 2018a). Non-convex set representations can improve the verification results as the exact output set can be non-convex due to the nonlinearity within the network. These approaches use Taylor models (Ivanov et al., 2021; Bogomolov et al., 2019; Huang et al., 2022), star sets (Bak, 2021; Lopez et al., 2023), and polynomial zonotopes (Kochdumper et al., 2023; Ladner and Althoff, 2023) to verify neural networks. Branch-and-bound strategies are also used in approaches using reachability analysis (Xiang et al., 2018). To the best of our knowledge, there exist only a few approaches considering the formal verification of graph neural networks. As with feedforward neural networks (Katz et al., 2017), the theoretical limits of the graph neural networks verification problem have been discussed (S\u00a8 alzer and Lange, 2023). Thus, most existing methods for verifying graph neural networks again employ incomplete but sound algorithms: Some approaches (Z\u00a8 ugner and G\u00a8 unnemann, 2019; Bojchevski and G\u00a8 unnemann, 2019) formulate uncertainty in the semisupervised node classification setting as an optimization problem, where uncertain node features (Z\u00a8 ugner and G\u00a8 unnemann, 2019) and uncertainty in the graph structure (Bojchevski and G\u00a8 unnemann, 2019) are considered separately. The network architecture in the latter approach only has a single, slightly altered message-passing step. This approach is extended 2 \fGraph Convolutional Network Verification 2 h. . . i 3 h. . . i 1 h. . . i 4 h. . . i 5 h. . . i 6 h. . . i 7 h. . . i Presence of edge unknown Uncertain node features \u2282Rc Figure 1: Graph G with uncertain node features and uncertain graph structure. to restrict both the global and the local uncertainty of the graph (Jin et al., 2020a). Another approach (Wu et al., 2022) verifies uncertain node features in graph neural networks for job schedulers by unrolling them into feedforward neural networks and verifies them using reachability analysis. It is also worth mentioning that probabilistic guarantees can be achieved using randomized smoothing (Jia et al., 2020; Bojchevski et al., 2020), and one can try to defend adversarial attacks (Jin et al., 2020b); however, these approaches do not provide formal guarantees. 1.2 Contributions Our contributions are as follows: \u2022 We present the first approach to verify graph convolutional networks with uncertain node features and an uncertain graph structure as input (Fig. 1). \u2022 The considered architecture of the graph convolutional network is generic and can have any element-wise activation function. \u2022 Our approach allows us to verify the graph neural network over multiple messagepassing steps given an uncertain graph input. \u2022 We explicitly preserve the non-convex dependencies of all involved variables through all layers of the graph neural network using (matrix) polynomial zonotopes. \u2022 Our verification algorithm has polynomial time complexity in the number of uncertain input features and in the number of uncertain edges. \u2022 We demonstrate our approach on three popular benchmark datasets with added perturbations on the node features and the graph structure. \u2022 Our approach will be made publicly available with the next release of CORA (Althoff, 2015). This work is structured as follows: In Sec. 2, we introduce all required preliminaries and the problem statement, followed by defining the matrix variant of polynomial zonotopes in Sec. 3. Our verification approach is described in Sec. 4: We first show that graph-based 3 \fLadner, Eichelbeck, and Althoff layers in neural networks can be computed exactly using matrix polynomial zonotopes with only uncertain input features. The required adaptations when also the graph structure is uncertain are described subsequently. Finally, we show experimental results in Sec. 5 and draw conclusions in Sec. 6. 2 Background 2.1 Notation We denote scalars and vectors by lowercase letters, matrices by uppercase letters, and sets by calligraphic letters. The i-th element of a vector v \u2208Rn is written as v(i). The element in the i-th row and j-th column of a matrix A \u2208Rn\u00d7m is written as A(i,j), the entire i-th row and j-th column are written as A(i,\u00b7) and A(\u00b7,j), respectively. The concatenation of A with a matrix B \u2208Rn\u00d7o is denoted by [A B] \u2208Rn\u00d7(m+o). The empty matrix is written as [ ]. We denote with In the identity matrix of dimension n \u2208N. The symbols 0 and 1 refer to matrices with all zeros and ones of proper dimensions, respectively. Given n \u2208N, we use the shorthand notation [n] = {1, . . . , n}. The cardinality of a discrete set D is denoted by |D|. Let D \u2286[n], then A(D,\u00b7) denotes all rows i \u2208D in lexicographic order; this is used analogously for columns. Let S \u2282Rn be a set and f : Rn \u2192Rm be a function, then f(S) = {f(x) | x \u2208S}. An interval with bounds a, b \u2208Rn is denoted by [a, b], where a \u2264b holds element-wise. 2.2 Neural Networks Let us introduce the neural network architectures we consider in this work. We start by stating a general formalization of a neural network and, afterward, several types of layers. Definition 1 (Neural Networks (Bishop and Nasrabadi, 2006, Sec. 5.1)) Let x \u2208 Rn0 be the input of a neural network \u03a6 with \u03ba layers, its output y = \u03a6(x) \u2208Rn\u03ba is obtained as follows: h0 = x, hk = Lk(hk\u22121), k \u2208[\u03ba], y = h\u03ba, where Lk : Rnk\u22121 \u2192Rnk represents the operation of layer k. Standard, non-graph-based neural networks are usually composed of alternating linear layers and nonlinear activation layers: Definition 2 (Linear Layer) A linear layer is defined by the operation hk = LLIN k (hk\u22121) = Wkhk\u22121 + bk, with weight matrix Wk \u2208Rnk\u00d7nk\u22121, and bias vector bk \u2208Rnk. Definition 3 (Activation Layer) An activation layer is defined by the operation hk = LACT k (hk\u22121) = \u03c3k(hk\u22121), 4 \fGraph Convolutional Network Verification where \u03c3k(\u00b7) is the respective element-wise nonlinear activation function, e.g., sigmoid or ReLU. Graph neural networks generalize standard neural networks and additionally take a graph G = (N, E) as an input, where N \u2282N denotes the set of nodes and E \u2286N \u00d7 N the set of edges of G. For each node i \u2208N, we associate a feature vector X(i,\u00b7) \u2208R1\u00d7c0 with c0 input features, as illustrated in Fig. 1. These feature vectors of all |N| nodes are stacked vertically to obtain the input feature matrix X \u2208R|N|\u00d7c0. Graph neural networks contain message-passing layers in which neighboring nodes exchange information. In this work, we consider the well-established graph convolutional layer (Kipf and Welling, 2017), which combines a node-level linear layer and a message-passing layer: Definition 4 (Graph Convolutional Layer (Kipf and Welling, 2017, Eq. 2)) Given are a weight matrix W \u2208Rck\u22121\u00d7ck, an adjacency matrix A \u2208R|N|\u00d7|N| of a graph G, and an input Hk\u22121 \u2208R|N|\u00d7ck\u22121. Let \u02dc A = A + I|N| be the adjacency matrix with added self-loops and \u02dc D = diag(1 \u02dc A) \u2208R|N|\u00d7|N| be the diagonal degree matrix. The computation for a graph convolutional layer k is computed as Hk = LGC k (Hk\u22121, G) = \u02dc D\u22121 2 \u02dc A \u02dc D\u22121 2 Hk\u22121Wk. The term P = \u02dc D\u22121 2 \u02dc A \u02dc D\u22121 2 computes the message passing between nodes. The adjacency matrix A can also be a weighted adjacency for graphs with scalar edge weights (Kipf and Welling, 2017, Sec. 7.2). Please note that related verification approaches considering uncertainty in the graph structure (Bojchevski and G\u00a8 unnemann, 2019; Jin et al., 2020a) consider \u02dc D\u22121 \u02dc A instead of \u02dc D\u22121 2 \u02dc A \u02dc D\u22121 2 in their message passing step. This is justified by the argument that it corresponds to the personalized page rank matrix, which has a similar spectrum. However, without appropriate approximation errors, how to verify the original graph neural network remains unknown using those approaches. Depending on the use case, we let a graph neural network \u03a6 return a node-level or graph-level output. For a node-level output, the output is simply the feature matrix of the last layer: Y = \u03a6(X, G) \u2208R|N|\u00d7c\u03ba. For a graph-level output, we aggregate all node feature vectors into a single graph feature vector. Thus, y = \u03a6(X, G) \u2208Rn\u03ba. This is realized using a pooling layer, which is computed as follows: Definition 5 (Global Pooling Layer) A global pooling layer aggregates all node feature vectors Hk\u22121 \u2208R|N|\u00d7ck\u22121 within a graph G into a single graph feature vector hk \u2208Rck\u22121 as follows: hk = LGP k (Hk\u22121, G) = \u03c8k(Hk\u22121), where \u03c8k(\u00b7) denotes a permutation invariant aggregation function across all nodes, e.g., sum, mean, or maximum. For example, \u03c8k(Hk\u22121) = (1Hk\u22121)\u22a4 (1) computes a summation across all nodes in a global pooling layer k. For graph neural networks with a graph-level output, there can be regular linear and activation layers after the pooling layer. 5 \fLadner, Eichelbeck, and Althoff 2.3 Set-Based Computing We verify neural networks using continuous sets. For an input set X \u2282Rn0 of a neural network \u03a6, the exact output set Y\u2217= \u03a6(X) is computed by H\u2217 0 = X, H\u2217 k = Lk(H\u2217 k\u22121), k \u2208[\u03ba], Y\u2217= H\u2217 \u03ba. (2) Polynomial zonotopes are a well-suited set representation to verify graph neural networks due to their polynomial computational complexity and precise outputs of the required operations. We briefly introduce polynomial zonotopes and all required operations, followed by an example. Definition 6 (Polynomial Zonotope (Kochdumper and Althoff, 2020)) Given are an offset c \u2208Rn, a generator matrix of dependent generators G \u2208Rn\u00d7h, a generator matrix of independent generators GI \u2208Rn\u00d7q, and an exponent matrix E \u2208Np\u00d7h 0 with an identifier id \u2208Np. A polynomial zonotope1 PZ = \u27e8c, G, GI, E\u27e9PZ is defined as PZ := \uf8f1 \uf8f2 \uf8f3c + h X i=1 p Y k=1 \u03b1 E(k,i) k ! G(\u00b7,i) + q X j=1 \u03b2jGI(\u00b7,j) \f \f \f \f \f \f \u03b1k, \u03b2j \u2208[\u22121, 1] \uf8fc \uf8fd \uf8fe. The identifier id is used to keep track of the dependencies of the factors \u03b1k between different polynomial zonotopes. Given two polynomial zonotopes PZ1 = \u27e8c1, G1, GI,1, E1\u27e9PZ , PZ2 = \u27e8c2, G2, GI,2, E2\u27e9PZ \u2282Rn, the Minkowski sum is computed by (Kochdumper and Althoff, 2020, Prop. 8) PZ1 \u2295PZ2 = {x1 + x2 | x1 \u2208PZ1, x2 \u2208PZ2} = \u001c c1 + c2, \u0002 G1 G2 \u0003 , \u0002 GI,1 GI,2 \u0003 , \u0014E1 0 0 E2 \u0015\u001d PZ , (3) and given A \u2208Rm\u00d7n, b \u2208Rm, the affine map is computed by (Kochdumper and Althoff, 2020, Prop. 9) APZ1 + b = {Ax + b | x \u2208PZ1} = \u27e8Ac1 + b, AG1, AGI,1, E1\u27e9PZ . (4) Crucially for our approach, the quadratic map can be evaluated exactly for polynomial zonotopes. The quadratic map is usually used to evaluate higher-order polynomials over polynomial zonotopes to enclose nonlinear functions. Proposition 7 (Quadratic Map (Kochdumper, 2022, Prop. 3.1.30)) Given two polynomial zonotopes PZ1 = \u27e8c1, G1, [ ], E1\u27e9PZ \u2282Rn1, PZ2 = \u27e8c2, G2, [ ], E2\u27e9PZ \u2282Rn2 with 1. As in Kochdumper (2022), we adapt the definition from Kochdumper and Althoff (2020) and do not integrate the offset c into the generator matrix G and omit the identifier vector almost always for simplicity. 6 \fGraph Convolutional Network Verification \u22121 0 1 \u22121 0 1 x(1) x(2) \u22121 0 1 0 0.5 1 x(1) x(2) PZ PZ = quadMap(PZ, PZ, Q) Samples Figure 2: Visualization of the quadratic map using the polynomial zonotope PZ from Example 1. h1 and h2 generators, respectively, a common identifier vector, and Q = {Q1, . . . , Qn}, Qi \u2208Rn1\u00d7n2, then the quadratic map is computed as follows: PZ = quadMap(PZ1, PZ2, Q) = \uf8f1 \uf8f4 \uf8f2 \uf8f4 \uf8f3 \uf8ee \uf8ef \uf8f0 x\u22a4 1 Q1x2 . . . x\u22a4 1 Qnx2 \uf8f9 \uf8fa \uf8fb \f \f \f \f \f \f \f x1 \u2208PZ1, x2 \u2208PZ2 \uf8fc \uf8f4 \uf8fd \uf8f4 \uf8fe = D c, h b G1 b G2 G1 . . . Gh i , \u0002 \u0003 , \u0002 E1 E2 E1 . . . Eh \u0003E PZ \u2282Rn, where c = \uf8ee \uf8ef \uf8f0 c\u22a4 1 Q1c2 . . . c\u22a4 1 Qnc2 \uf8f9 \uf8fa \uf8fb, b G1 = \uf8ee \uf8ef \uf8f0 c\u22a4 2 Q\u22a4 1 G1 . . . c\u22a4 2 Q\u22a4 n G1 \uf8f9 \uf8fa \uf8fb, b G2 = \uf8ee \uf8ef \uf8f0 c\u22a4 1 Q1G2 . . . c\u22a4 1 QnG2 \uf8f9 \uf8fa \uf8fb, Gj = \uf8ee \uf8ef \uf8f0 G\u22a4 1(\u00b7,j)Q1G2 . . . G\u22a4 1(\u00b7,j)QnG2 \uf8f9 \uf8fa \uf8fb, and Ej = E2 + E1(\u00b7,j)1, j \u2208[h1]. The output PZ has O(h1h2) generators. In this work, we only use matrices Qi with entries consisting of zeros and ones, which effectively selects which dimensions of the polynomial zonotopes are multiplied as part of a quadratic map. We illustrate this by an example: Example 1 Let us consider the set { \u0002 \u03b11 \u03b13 1+0.1\u03b12 \u03b12 1 \u0003\u22a4| \u03b11, \u03b12 \u2208[\u22121, 1]} \u2282R3. This set can be represented as a polynomial zonotope as follows: PZ = *\uf8ee \uf8f0 0 0 0 \uf8f9 \uf8fb, \uf8ee \uf8f0 1 0 0 0 0 1 0.1 0 0 0 0 1 \uf8f9 \uf8fb, \uf8ee \uf8f0 \uf8f9 \uf8fb, \u00141 3 0 2 0 0 1 0 \u0015+ PZ , which we visualize in Fig. 2 (left). The set { \u0002 \u03b13 1 (\u03b13 1+0.1\u03b12)2\u0003\u22a4| \u03b11, \u03b12 \u2208[\u22121, 1]} \u2282R2 can be computed from PZ using the quadratic map with Q = {Q1, Q2}, where Q1 = \uf8ee \uf8f0 0 0 1 0 0 0 0 0 0 \uf8f9 \uf8fb, Q2 = \uf8ee \uf8f0 0 0 0 0 1 0 0 0 0 \uf8f9 \uf8fb. 7 \fLadner, Eichelbeck, and Althoff Thus, PZ = quadMap(PZ, PZ, Q) = \u001a\u0014x\u22a4Q1x x\u22a4Q2x \u0015 \f \f \f \f x \u2208PZ \u001b = \u001c\u00140 0 \u0015 , \u00141 0 0 0 0 1 0.2 0.01 \u0015 , \u0014 \u0015 , \u00143 6 3 0 0 0 1 2 \u0015\u001d PZ , where we compacted PZ by removing zero-length generators and adding generators whose dependent factors have equal exponents. The resulting PZ is visualized in Fig. 2 (right). Please note that the quadratic map in Prop. 7 is defined for polynomial zonotopes with a common identifier vector. We can adjust two polynomial zonotopes with different identifiers by extending the exponent matrix accordingly (Kochdumper, 2022, Prop. 3.1.5). 2.4 Verification of Feedforward Neural Networks Finally, we briefly introduce the main steps to propagate a polynomial zonotope through a standard, non-graph-based neural network (Def. 1). Since the set propagation through a neural network (2) cannot be computed exactly in general, we have to enclose the output of each layer: Proposition 8 (Image Enclosure (Kochdumper et al., 2023, Sec. 3)) Let Hk\u22121 \u2287 H\u2217 k\u22121 \u2282Rnk\u22121 be an input set to layer k, then Hk = enclose(Lk, Hk\u22121) \u2287H\u2217 k \u2282Rnk computes an outer-approximative output set. If the layer k is nonlinear (Def. 3), the output Hk has at most nk more generators than Hk\u22121. Using polynomial zonotopes, the output of a linear layer can be computed exactly as stated in (4). However, the output of activation layers needs to be enclosed to obtain a sound outer approximation. We summarize the six main steps to enclose a nonlinear layer next and visualize them in Fig. 3: As we only consider element-wise activation functions, we can enclose each neuron individually (step 1). In step 2, we find bounds for our input set. Next, we approximate the activation function using a polynomial (step 3) and find an appropriate approximation error (step 4). Finally, the chosen polynomial is evaluated over the input set (step 5), and the output is enclosed using the approximation error (step 6), where one generator for each neuron of the current layer is added using (3). While we have depicted the steps in Fig. 3 using a polynomial of order one, higher-order polynomials can be used to obtain a tighter enclosure (Ladner and Althoff, 2023). The higher-order polynomials are evaluated over the input polynomial zonotopes using multiple applications of Prop. 7. 2.5 Problem Statement Given an uncertain graph G = (N, E) with nodes N \u2282N and edges E = E\u2217\u222ae E \u2286N \u00d7 N consisting of fixed edges E\u2217and uncertain edges e E, an uncertain input feature matrix X \u2282 8 \fGraph Convolutional Network Verification Input Output Steps 1 & 2 Input Output Steps 3 & 4 Input Output Steps 5 & 6 \u03c3(x) Set Bounds Polynomial Approximation error Figure 3: Main steps of enclosing a nonlinear layer. Step 1: Evaluate nonlinear function element-wise. Step 2: Find bounds of the input set. Step 3: Find an approximating polynomial. Step 4: Find the approximation error. Step 5: Evaluate polynomial over the input set. Step 6: Add the approximation error. R|N|\u00d7c0, a graph neural network \u03a6, and an unsafe set S \u2282Rn\u03ba where n\u03ba denotes the dimension of the output of \u03a6, we want to compute an outer-approximative output set Y such that it encloses the output for all possible graph inputs: \u2200E \u2286e E : \u03a6(X, \u0000N, E\u2217\u222aE \u0001 ) \u2286Y. We can then verify the given specification by showing that: Y \u2229S = \u2205. 3 Matrix Polynomial Zonotopes Before we present our approach, we introduce an extension to polynomial zonotopes, namely matrix polynomial zonotopes. Graph convolutional layers require a matrix Hk\u22121 \u2208R|N|\u00d7ck\u22121 as input (Def. 4) so that a set-based evaluation requires propagating uncertain matrices Hk\u22121 \u2282R|N|\u00d7ck\u22121 through all layers, which we want to represent as polynomial zonotopes; however, a (standard) polynomial zonotope is not defined for matrices (Def. 6). Thus, we define its matrix variant and a few required operations on them in this section. These operations are specifically tailored to facilitate the verification of graph neural networks; however, the concepts are generic and have applications elsewhere. Definition 9 (Matrix Polynomial Zonotope) Given are an offset C \u2208Rn\u00d7m, dependent generators G \u2208Rn\u00d7m\u00d7h, independent generators GI \u2208Rn\u00d7m\u00d7q, and an exponent matrix E \u2208Np\u00d7h 0 with an identifier id \u2208Np. A matrix polynomial zonotope PZ = \u27e8C, G, GI, E\u27e9PZ is defined as PZ := \uf8f1 \uf8f2 \uf8f3C + h X i=1 p Y k=1 \u03b1 E(k,i) k ! G(\u00b7,\u00b7,i) + q X j=1 \u03b2jGI(\u00b7,\u00b7,j) \f \f \f \f \f \f \u03b1k, \u03b2j \u2208[\u22121, 1] \uf8fc \uf8fd \uf8fe. 9 \fLadner, Eichelbeck, and Althoff The Minkowski sum of two matrix polynomial zonotopes PZ1 = \u27e8C1, G1, GI,1, E1\u27e9PZ , PZ2 = \u27e8C2, G2, GI,2, E2\u27e9PZ \u2282Rn\u00d7m, is computed analogously to (3): PZ1 \u2295PZ2 = {x1 + x2 | x1 \u2208PZ1, x2 \u2208PZ2} = \u001c C1 + C2, \u0002 G1 G2 \u0003 , \u0002 GI,1 GI,2 \u0003 , \u0014E1 0 0 E2 \u0015\u001d PZ , (5) where the concatenation of the generators is along the last dimension. Given the matrices A1 \u2208Rk\u00d7n, A2 \u2208Rm\u00d7k, and the vectors b1 \u2208Rk\u00d7m, b2 \u2208Rn\u00d7k, an affine map is computed analogously to (4): A1PZ1 + b1 = {A1x + b1 | x \u2208PZ1} = \u27e8A1C1 + b1, A1G1, A1GI,1, E1\u27e9PZ , PZ1A2 + b2 = {xA2 + b2 | x \u2208PZ1} = \u27e8C1A2 + b2, G1A2, GI,1A2, E1\u27e9PZ , (6) where the matrix multiplications are broadcast across all generators. Reshaping and transposing a matrix polynomial zonotope are computed by applying the respective operation on the center matrix and each generator matrix. In particular, reshaping a matrix polynomial zonotope into a vector by stacking it column-wise results in a standard polynomial zonotope, which we indicate by a vector decoration (\u20d7 \u25a1). This allows us, for example, to seamlessly use a matrix polynomial zonotope Hk\u22121 \u2282R|N|\u00d7ck\u22121 during the enclosure of an activation layer k by first reshaping it: \u20d7 Hk\u22121 \u2282R|N|\u00b7ck\u22121, then obtain \u20d7 Hk \u2282R|N|\u00b7ck using Prop. 8, and finally reshape it back to its original shape: Hk \u2282R|N|\u00d7ck. During the verification of graph neural networks, we also require the computation of matrix multiplication on two matrix polynomial zonotopes. This operation can be computed using Prop. 7 without inducing additional outer approximations: Lemma 10 (Matrix Multiplication on Matrix Polynomial Zonotopes) Given two matrix polynomial zonotopes M1 \u2282Rn\u00d7k, M2 \u2282Rk\u00d7m with h1 and h2 generators, respectively, then the matrix multiplication M3 = M1 \u22a1M2 = {(M1M2) | M1 \u2208M1, M2 \u2208M2}, is obtained by \u20d7 M3 = quadMap \u0010 \u20d7 M1, \u20d7 M2, Q \u0011 \u2282Rn\u00b7m, where Q = {Q1,1, Q2,1, . . . , Qn,1, Q1,2, . . . , Qn,m}. Let vi = [i . . . n(k \u22121) + i] and wj = [k(j \u22121) + 1 . . . k(j \u22121) + k] be the respective indices involved to compute the (i, j)-th entry, then Qi,j = sparse(vi, wj, nk, km) \u2208R(nk)\u00d7(km) with ones in positions (vi(l), wj(l)), \u2200l \u2208[k], and zeros otherwise. The output M3 has O(h1h2) generators. Proof The statement follows directly from Prop. 7 and the construction of Qi,j. The number of generators also directly follows from Prop. 7. We want to stress that Lemma 10 can be efficiently computed using matrix broadcasting, as effectively the center matrix and each generator matrix from one set is multiplied with the center matrix and each generator matrix of the other set. This broadcasting is also parallelizable and efficiently computed on a GPU, which makes our approach scalable. 10 \fGraph Convolutional Network Verification 4 Formal Verification of Graph Convolutional Networks In this section, we demonstrate how to generalize the verification of standard neural networks (Kochdumper et al., 2023; Ladner and Althoff, 2023) to graph convolutional networks. We start by (i) explaining how to verify graph neural networks that have only uncertain node features, and then (ii) describe the adaptations where, additionally, the graph structure is unknown. Moreover, we show (iii) how a subgraph can be efficiently extracted in cases where not the entire graph is relevant to verify the specification. 4.1 Verification with Uncertain Node Features Uncertainty in the node features requires us to define how the graph-specific layers can be enclosed for an uncertain input. Using matrix polynomial zonotopes, the enclosure of a graph convolutional layer (Def. 4) does not induce any additional outer approximation. Proposition 11 (Enclosure of Graph Convolutional Layer) Given are a weight matrix Wk \u2208Rck\u22121\u00d7ck, a graph G = (N, E), and an input Hk\u22121 \u2282R|N|\u00d7ck\u22121 represented as a matrix polynomial zonotope. Let A \u2208R|N|\u00d7|N| be the adjacency matrix of G, \u02dc A = A + I|N|, and let \u02dc D = diag(1 \u02dc A) \u2208R|N|\u00d7|N| be the diagonal degree matrix. The exact output of a graph convolutional layer k in Def. 4 is computed by Hk = LGC k (Hk\u22121) = \u02dc D\u22121 2 \u02dc A \u02dc D\u22121 2 Hk\u22121Wk. Proof As the graph convolutional layer is composed of a left and a right matrix multiplication, the computation is exact using (6). The enclosure of a pooling layer (Def. 5) with a summation as aggregation function as in (1) is obtained analogously. Proposition 12 (Enclosure of Summation Pooling Layer) Given are a graph G and an input Hk\u22121 \u2282R|N|\u00d7ck\u22121 represented as a matrix polynomial zonotope. The exact output of a pooling across all nodes via summation is computed by Hk = LGP k (Hk\u22121, G) = (1Hk\u22121)\u22a4. Proof As the pooling layer is computed by a left matrix multiplication, the computation is exact using (6). Thus, the graph-based layers can be computed without inducing additional outer approximations using matrix polynomial zonotopes when we only have uncertain node features. 4.2 Verification with Uncertain Graph Structure Verifying graph neural networks becomes more difficult if the presence of some edges is unknown in an uncertain graph G. This case requires us to enclose the outputs of all possible graph inputs (Sec. 2.5). We enclose these outputs by computing an outer-approximative output set of an equivalent graph with uncertain edge weights: Let G have fixed edges E\u2217 11 \fLadner, Eichelbeck, and Althoff and uncertain edges e E. Then, we set the edge weight to 1 for edges in E\u2217and to [0, 1] for edges in e E. This uncertainty requires a set-based evaluation of the message passing P = \u02dc D\u22121 2 \u02dc A \u02dc D\u22121 2 in graph convolutional layers (Def. 4). In particular, we now have an uncertain (weighted) adjacency matrix A \u2282R|N|\u00d7|N| containing the respective edge weights, which in turn leads to an uncertain degree matrix \u02dc D \u2282R|N|\u00d7|N|, and eventually, an uncertain message passing P\u2217= \u02dc D\u22121 2 \u02dc A \u02dc D\u22121 2 . (7) Please note that analogous holds if the graph has uncertain scalar edge weights. Subsequently, we detail the required steps to compute an enclosure of the message passing P \u2287P\u2217 using matrix polynomial zonotopes (Def. 9). Please compare these steps with the definition of a graph convolutional layer (Def. 4). We construct the uncertain adjacency matrix as a matrix polynomial zonotope A \u2282R|N|\u00d7|N|, where each generator of A corresponds to one uncertain edge. Then, \u02dc A = A + I|N| (8) adds self-loops to the adjacency matrix. Analogously to Prop. 12, we compute the diagonal entries of the degree matrix \u02dc D by summing across all rows of \u02dc A using (6): \u02dc Ddiag = (1 \u02dc A)\u22a4. (9) To obtain \u02dc D\u22121 2 , we note that the inverse of a diagonal matrix is given by the inverse of each entry on the main diagonal. Additionally, we are required to compute the square root of each entry individually. However, polynomial zonotopes are not closed under these operations. Thus, we enclose the output of the inverse square root function using Prop. 8. The function is already applied element-wise, hence it suffices to provide an appropriate approximation error: Lemma 13 (Approximation Error of Inverse Square Root) Given a polynomial p(x) = ax + b and bounds [l, u] \u2282R+, then the maximum approximation error d = max x\u2208[l,u] |f(x) \u2212p(x)| = |f(x\u2217) \u2212p(x\u2217)|, where x\u2217\u2208 \u001a l, 3 q (1/ 2a)2, u \u001b \u2229[l, u]. Proof The approximation error d has to lie on the extreme point: d dx (f(x) \u2212p(x)) ! = 0 \u21d0 \u21d2 \u22121 2x\u22123 2 \u2212a = 0 \u21d0 \u21d2 x\u22123 2 = \u22122a = \u21d2 x = 3 q (1/ 2a)2, or on a boundary point l, u if the extreme point lies outside [l, u] due to monotonicity. 12 \fGraph Convolutional Network Verification 1 2 3 4 5 6 7 8 0.4 0.6 0.8 Input x Output Inverse square root x\u22121/ 2 Approx. polynomial p(x) Approx. error d Figure 4: Enclosure of the inverse square root function. The x-axis corresponds to the degree of a node in \u02dc D, and the y-axis to the respective entry in \u02dc D\u22121 2 . An example of the enclosure of the inverse square root function for a polynomial found via regression is shown in Fig. 4. A tighter enclosure can be obtained using higher-order polynomials (Ladner and Althoff, 2023). Thus, we can enclose the diagonal entries of the degree matrix using Prop. 8: b D \u22121 2 diag = enclose \u0010 x 7\u2192x\u22121 2 , \u02dc Ddiag \u0011 \u2287\u02dc D \u22121 2 diag, (10) and place the entries b D \u22121 2 diag on the main diagonal of b D\u22121 2 = diag \u0012 b D \u22121 2 diag \u0013 \u2287 \u02dc D\u22121 2 . (11) This is computed by first projecting b D \u22121 2 diag \u2282R|N| into a higher-dimensional space with zeros in the new dimensions: \u20d7 b D\u22121 2 = I|N|2(\u00b7,K) b D \u22121 2 diag \u2282R|N|2, (12) where K = {1, |N| + 2, . . . , |N|2} contains the indices of the diagonal entries of a diagonal matrix, and then reshaping the polynomial zonotope to obtain b D\u22121 2 \u2282R|N|\u00d7|N|. To obtain the entire uncertain message passing P, we compute the matrix multiplication on the involved matrix polynomial zonotopes b D\u22121 2 and \u02dc A using Lemma 10: Proposition 14 (Enclosure of Uncertain Message Passing) Given an uncertain adjacency matrix A with h generators, then P = b D\u22121 2 \u22a1\u02dc A \u22a1b D\u22121 2 \u2287P\u2217, encloses the message passing with O(h3) generators. Proof The enclosure is computed using a set-based evaluation of the message passing in Def. 4 using (8)\u2013(12) and Lemma 10. These steps are computed using affine maps (6) and matrix multiplications of polynomial zonotopes (Lemma 10), which are exact, and 13 \fLadner, Eichelbeck, and Althoff the enclosure of \u02dc Ddiag using Prop. 8 with the approximation error in Lemma 13, which is outer-approximative. Thus, the enclosure of the message passing is sound. Number of generators: Affine maps do not increase the number of generators (6). The enclosure of \u02dc Ddiag in (10) adds one generator for each node with an uncertain degree (Prop. 8), which are at most 2h as each uncertain edge in A has two adjacent nodes. Finally, two applications of the matrix multiplication on matrix polynomial zonotopes (Lemma 10) obtains the O(h3) generators of P. After obtaining the uncertain message passing P, we can enclose the output set of a graph convolutional layer as follows: Proposition 15 (Enclosure of Graph Convolutional Layer) Given are a weight matrix Wk \u2208Rck\u22121\u00d7ck, an uncertain graph G, and an uncertain input Hk\u22121 \u2208R|N|\u00d7ck\u22121 with h1 generators. Let P \u2282R|N|\u00d7|N| be the uncertain message passing according to Prop. 14 with O(h3 2) generators. The output for a graph convolutional layer k (Def. 4) is enclosed by Hk = enclose \u0000LGC k , Hk\u22121, P \u0001 = (P \u22a1Hk\u22121)Wk \u2286LGC k (Hk\u22121, G), with O(h1h3 2) generators. Proof The enclosure follows directly from the enclosure of the message passing (Prop. 14), the matrix multiplication on polynomial zonotopes (Lemma 10), and the affine map (6). Given the number of generators of Hk\u22121 and P, the number of generators of Hk follows from Lemma 10. Our approach defines the enclosure layer-wise and thus realizes an arbitrary concatenation of the considered layers. To demonstrate the polynomial time complexity in the number of uncertain edges and input features for an entire graph neural network with multiple message-passing steps, let us consider Alg. 1: The graph neural network has \u03ba\u2032 message-passing steps, each consisting of one graph convolutional layer and one activation layer (lines 3 to 6). For networks with a node-level output, the output of the last messagepassing step is directly the output of the network. For networks with a graph-level output, the output is passed to a global pooling layer and optionally followed by standard, nongraph-based layers (lines 11 to 14). With this algorithm, we can state the main theorem of this work: Theorem 16 Given a neural network \u03a6 with \u03ba layers and \u03ba\u2032 message passing steps, an uncertain graph G = (N, E) with |N| nodes and he uncertain edges, and an uncertain input X \u2282R|N|\u00d7c0 with hx generators, then Alg. 1 satisfies the problem statement in Sec. 2.5. More specifically, the number of generators of the computed output Y is given by: hy \u2208O \u0010 h3\u03ba\u2032 e (hx + |N|cmax) + (\u03ba \u22122\u03ba\u2032)nmax \u0011 , where cmax := maxk\u2032\u2208[\u03ba\u2032] c2k\u2032 denotes the maximum number of features within the graph layers and nmax := maxk\u2208{2\u03ba\u2032+2,...,\u03ba} nk denote the maximum number of output neurons of the non-graph-based layers after the global pooling layer. 14 \fGraph Convolutional Network Verification Algorithm 1 Enclosing the Output of a Graph Neural Network Require: Neural network \u03a6, number of layers \u03ba, number of message passing steps \u03ba\u2032, input set X, graph G. 1: H0 \u2190X 2: P \u2190Compute message passing based on G \u25b7Prop. 14 3: for k\u2032 = 2, . . . , 2\u03ba\u2032 do \u25b7Graph-based layers 4: Hk\u2032\u22121 \u2190enclose \u0000LGC k\u2032\u22121, Hk\u2032\u22122, P \u0001 \u25b7Prop. 15 5: Hk\u2032 \u2190enclose \u0000LACT k\u2032 , Hk\u2032\u22121 \u0001 \u25b7Prop. 8 6: end for 7: if \u03ba = 2\u03ba\u2032 then \u25b7Graph-level output 8: Y \u2190H\u03ba 9: else \u25b7Node-level output 10: H2\u03ba\u2032+1 \u2190LGP 2\u03ba\u2032+1(H2\u03ba\u2032, G) \u25b7Global pooling layer, Prop. 12 11: for k = 2\u03ba\u2032 + 2, 2\u03ba\u2032 + 4, . . . , \u03ba do \u25b7Standard, non-graph-based layers 12: Hk \u2190LLIN k (Hk\u22121) \u25b7Def. 2 13: Hk+1 \u2190enclose \u0000LACT k+1 , Hk \u0001 \u25b7Prop. 8 14: end for 15: Y \u2190H\u03ba 16: end if 17: return Enclosure of output set Y \u2287Y\u2217 Proof The problem statement is satisfied as each step to compute Y is either exact (Prop. 12, (4)) or outer-approximative (Prop. 14, Prop. 15, and Prop. 8), and the specification can be checked as in previous approaches using polynomial zonotopes (Kochdumper et al., 2023; Ladner and Althoff, 2023). The message passing P has O(h3 e) generators (Prop. 14). The enclosure of a nonlinear layer adds at most one generator for each output neuron (Prop. 8). The global pooling layer (Prop. 12) and linear layers (4) do not change the number of generators. Thus, the number of generators of Y in Alg. 1 is: hy \u2208O \u0012 \u03ba\u2032 message passing steps (lines 3 to 6) z }| { h3 e \u00b7 \u0000h3 e \u00b7 (\u00b7 \u00b7 \u00b7 h3 e \u00b7 hx | {z } (Prop. 15) + |N|c2 | {z } (Prop. 8) \u00b7 \u00b7 \u00b7 ) + |N|c2\u03ba\u2032\u22122 \u0001 + |N|c2\u03ba\u2032 + (lines 11 to 14) z }| { 1 2 \u03ba X k=2\u03ba\u2032+2 nk |{z} (Prop. 8) \u0013 = O \u0012 (h3 e)\u03ba\u2032hx + (h3 e)\u03ba\u2032\u22121|N|c2 + \u00b7 \u00b7 \u00b7 + (h3 e)1|N|c2\u03ba\u2032\u22122 + |N|c2\u03ba\u2032 | {z } Polynomial of order \u03ba\u2032\u22121 + 1 2 \u03ba X k=2\u03ba\u2032+2 nk \u0013 \u2286O (h3 e)\u03ba\u2032hx + (h3 e)\u03ba\u2032\u22121 max k\u2032\u2208[2\u03ba\u2032] |N|ck\u2032 + 1 2 \u03ba X k=2\u03ba\u2032+2 nk ! \u2286O h3\u03ba\u2032 e \u0012 hx + max k\u2208[2\u03ba\u2032] |N|c2k\u2032 \u0013 + 1 2 \u03ba X k=2\u03ba\u2032+2 nk ! = e Hy. Next, we simplify the term by bounding the number of output neurons with their maximum: 15 \fLadner, Eichelbeck, and Althoff e Hy \u2286O \u0012 h3\u03ba\u2032 e \u0012 hx + |N|cmax \u0013 + 1 2 \u03ba X k=2\u03ba\u2032+2 nmax \u0013 \u2286O \u0010 h3\u03ba\u2032 e (hx + |N|cmax) + (\u03ba \u22122\u03ba\u2032)nmax \u0011 , which shows that hy \u2208e Hy \u2286O \u0010 h3\u03ba\u2032 e (hx + |N|cmax) + (\u03ba \u22122\u03ba\u2032)nmax \u0011 . Please note that all involved operations on polynomial zonotopes to compute the output set Y (affine map, Minkowski sum, and quadratic map) have polynomial time complexity (Kochdumper, 2022, Tab. 3.2), and that the time complexity is dominated by the number of generators resulting from the applied quadratic map operations. Thus, it follows directly from Thm. 16 that Alg. 1 has polynomial time complexity in the number of uncertain input features hx and uncertain edges he compared to an exponential complexity when all 2he possible graphs need to be verified individually. While our approach is exponential in the number of message-passing steps \u03ba\u2032, we want to stress that \u03ba\u2032 is usually small to avoid over-smoothing (Chen et al., 2020). To further improve the scalability of our approach, the number of generators can be limited using order reduction methods (Ladner and Althoff, 2024; Kochdumper, 2022, Prop. 3.1.39) at the cost of additional outer approximations. Additionally, we want to stress that many involved operations can be parallelized and efficiently be computed on a GPU, in particular the matrix multiplication on matrix polynomial zonotopes (Lemma 10). Let us demonstrate our approach for verifying graph neural networks by a small example: Example 2 Let \u03a6 be a neural network with input X, graph G, and output Y computed by two layers: H1 = LGC 1 (X, G), Y = LGC 2 (H1, G), with W1 = W2 = I2. The input graph G = (N, E) is chosen as N = n 1 , 2 , 3 o , E = n 1 \u22122 , 1 \u22123 , 2 \u22123 o , and the input features for each node are X(1,\u00b7) = \u0014[0.9, 1.1] [0.9, 1.1] \u0015\u22a4 , X(2,\u00b7) = X(3,\u00b7) = \u00141 1 \u0015\u22a4 . Thus, X = \uf8ee \uf8f0 X(1,\u00b7) X(2,\u00b7) X(3,\u00b7) \uf8f9 \uf8fb. Let us now consider the presence of the edge 1 \u22123 as unknown during the evaluation of Y\u2217= \u03a6(X, G). Thus, the uncertainty of the features of node 1 is passed to node 3 after one message passing step if the edge 1 \u22123 is present (in H\u2217 1 = LGC 1 (X, G)), and after two steps otherwise (in Y\u2217= LGC 2 (H1, G) via 2 ). 16 \fGraph Convolutional Network Verification 1 2 3 Graph G 0.35 0.4 0 0.2 0.4 0.6 P(1,2) P(1,3) Message passing P 0.9 0.95 1 1.05 0.9 0.95 1 1.05 H1(3,1) H1(3,2) Hidden H1 of 3 0.9 0.95 1 1.05 0.9 0.95 1 1.05 Y(3,1) Y(3,2) Output Y of 3 Exact with 1 \u22123 Exact without 1 \u22123 Enclosure uncertain 1 \u22123 Subset with 1 \u22123 Subset without 1 \u22123 Enclosure interval arithmetic Figure 5: Visualization of Example 2. Our approach allows a tight enclosure of the output with uncertain input graph G. Example 2 is visualized in Fig. 5: The input set X given as an interval is converted to a (matrix) polynomial zonotope (Kochdumper, 2022, Prop. 3.1.10). We can obtain the exact output set for either case by propagating the respective graph through the network (purple and green) as well as their enclosure using our approach (Thm. 16, blue). Please note that we explicitly preserve the dependencies between the considered sets via the identifier vector of a matrix polynomial zonotope (Def. 9). We can visualize the preserved dependencies in the enclosure of the uncertain edge: By plugging \u22121 and 1 into the dependent factor \u03b1k corresponding to the uncertain edge, we obtain the subset (Kochdumper, 2022, Prop. 3.1.43) corresponding to the respective case (orange and yellow). This demonstrates the tightness of our approach. Additionally, we show the respective message passing P from node 1 to the nodes 2 and 3 for each case (purple and green) as well as their enclosure (blue), where we use a polynomial of order 2 to enclose b D \u22121 2 diag in (10). While the message passing from node 1 to 3 trivially becomes 0 if we remove that edge, the message passing from node 1 to 2 also changes due to the normalization during the computation of P through the degree matrix. Moreover, we want to point out that the enclosure P is a non-convex, slightly bent stripe. Please note that the enclosure of the output Y can also be non-convex in general. For comparison, we include an enclosure of the uncertain message passing P\u2217 using interval arithmetic (Jaulin et al., 2001) in Fig. 5. We omit the enclosure of H\u2217 1 and Y\u2217using interval arithmetic as the obtained intervals are so large that the results using our approach described above would be barely visible, even for this small example. This large outer approximation comes from the lost dependencies between all involved variables. 4.3 Subgraph Verification For a graph neural network with node-level output, we are not always required to propagate the entire graph through all layers of the network. Given a node of interest and a network with \u03ba\u2032 message passing steps, we are only required to verify the subgraph within the (\u03ba\u2032 + 1)-hop neighborhood as all other nodes do not influence the considered node (Z\u00a8 ugner 17 \fLadner, Eichelbeck, and Althoff and G\u00a8 unnemann, 2019). We require (\u03ba\u2032 + 1) hops due to the normalization through the degree matrix in the message passing (Def. 4). The (\u03ba\u2032 + 1)-hop neighborhood can easily be found using a breadth-first search on the given graph with the considered node as the root node. The graph and the respective feature matrix can be reduced as follows: Corollary 17 (Subgraph Selection) Given an input Hk\u22121 \u2208R|N|\u00d7ck\u22121 to a layer k, the message passing P = \u02dc D\u22121 2 \u02dc A \u02dc D\u22121 2 \u2208R|N|\u00d7|N| of a graph G, and the node indices K of a subgraph G\u2032, we can construct a projection matrix M = I|N|(K,\u00b7) such that H\u2032 k\u22121 = MHk\u22121, P \u2032 = MPM\u22a4, contain the input and the message passing corresponding to the subgraph. Proof The statement follows directly from the construction of the projection matrix M, where nodes that are not in G\u2032 are removed. After each graph convolutional layer (Def. 4), we can further reduce the graph as the number of remaining message-passing steps decreases. This can be achieved by implicitly adding projection layers computing Cor. 17 after each graph convolutional layer. After the last graph convolutional layer, we can remove all nodes except for the considered node, as no information is exchanged between nodes from that point onward. The selection of the subgraph only requires left and right matrix multiplications, thus, Cor. 17 can also be computed if the input Hk\u22121 \u2282R|N|\u00d7ck\u22121 or the message passing P \u2282R|N|\u00d7|N| are uncertain and represented by a matrix polynomial zonotope using (6). 5 Experimental Results Our approach is implemented in the MATLAB toolbox CORA (Althoff, 2015), where we extend the existing approach of verifying neural networks using polynomial zonotopes (Kochdumper et al., 2023; Ladner and Althoff, 2023). Our implementation will be made publicly available with the next release of CORA. All computations were performed on an Intel Core Gen. 11 i7-11800H CPU @2.30GHz with 64GB memory. We demonstrate our approach on three benchmark graph datasets: The first two, Enzymes and Proteins, represent protein structures tailored for the task of protein function classification (Borgwardt et al., 2005; Schomburg et al., 2004). The third dataset, Cora2, represents a citation network with several classes of publications (Yang et al., 2016; McCallum et al., 2000). The main properties of each dataset are summarized in Tab. 1. All graph neural networks considered here are as described in Alg. 1, where we have three message-passing steps (\u03ba\u2032 = 3) and tanh activation unless stated otherwise. The number of input and output neurons depends on the number of node features and classes of the dataset (Tab. 1), respectively, and the networks have 64 neurons per node in hidden layers. To evaluate our approach on the datasets, we perturb the node features and graph structure as follows: We normalize all node features and perturb them using the same 2. The identical names of the toolbox CORA and the dataset Cora are coincidental, with no relation between the two. 18 \fGraph Convolutional Network Verification Table 1: Properties of the benchmark datasets. Name Classification #Graphs #Nodes #Edges #Node features #Classes min/max min/max c0 Enzymes graph-level 600 11/66 34/186 21 6 Proteins graph-level 1,113 4/238 10/869 4 2 Cora node-level 1 2,708 10,556 1,433 7 0 2 4 6 8 0 20 40 60 Number of uncertain edges e E Verificatiom time [s] / |N| Enzymes 0 2 4 6 8 0 20 40 60 Number of uncertain edges e E Proteins Graph enumeration Our approach Figure 6: Time comparison of our approach with computing all possible graphs individually, where we normalized the verification time by the number of nodes |N| of the verified graphs. perturbation radius \u03b4 \u2208R+ on all features. Given a flattened input \u20d7 X \u2208R|N|\u00b7c0, our input set then becomes \u20d7 X = D \u20d7 X, \u03b4I|N|\u00b7c0, [ ], I|N|\u00b7c0 E PZ \u2282R|N|\u00b7c0, (13) which we can reshape to a matrix polynomial zonotope X \u2282R|N|\u00d7c0. For the perturbation of the graph structure, please recall that the uncertain graph G = (N, E) has nodes N \u2282N and edges E = E\u2217\u222ae E \u2286N \u00d7 N consisting of fixed edges E\u2217and uncertain edges e E. The uncertain edges e E can be seen as a budget an attacker has to perturb the graph structure for the graph neural network to misclassify the input (G\u00a8 unnemann, 2022), and we verify that no possible configuration results in a misclassification (Sec. 2.5) using our approach (Thm. 16). The partitioning of the edges depends on the experiment: To preserve the structure of the input graphs, the set of fixed edges E\u2217always contains a spanning tree of the graph, and we make the presence of some remaining edges unknown and, thus, part of the uncertain edges e E depending on the experiment. The spanning tree is constructed using a breadth-first search, with the root node being the one with the highest degree (e.g., 1 in Fig. 1). We repeat each experiment 50 times with different graphs sampled from the respective dataset. In our first experiment, we evaluate the polynomial time complexity (Thm. 16) on graphs with uncertain node features and uncertain graph structure. For this experiment, we iteratively increase the number of uncertain edges e E, and compare it to enumerating all 19 \fLadner, Eichelbeck, and Althoff 0 200 400 600 800 1,000 1,200 0 0.2 0.4 0.6 0.8 1 Cumulative verification time [s] Verified instances [%] Enzymes 0 500 1,000 1,500 2,000 2,500 0 0.2 0.4 0.6 0.8 1 Cumulative verification time [s] Proteins |e E| = 0.0% |e E| = 0.1% |e E| = 0.5% |e E| = 1.0% |e E| = 5.0% Figure 7: Verified instances of the Enzymes dataset and the Proteins dataset, where the number of uncertain edges |e E| is relative to the total number of edges |E| in the graph. 0 200 400 600 0 0.2 0.4 0.6 0.8 1 Cumulative verification time [s] Verified instances [%] Cora (\u03ba\u2032 = 2) 0 500 1,000 1,500 0 0.2 0.4 0.6 0.8 1 Cumulative verification time [s] Cora (\u03ba\u2032 = 3) |e E| = 0.0% |e E| = 0.1% |e E| = 0.5% |e E| = 1.0% |e E| = 5.0% Figure 8: Verified instances of the Cora dataset with different numbers of message-passing steps, where the number of uncertain edges |e E| is relative to the total number of edges |E| in the graph. possible graphs based on the uncertain edges and verifying them individually. As illustrated in Fig. 6, the verification time using enumeration quickly explodes due to its exponential time complexity, whereas the verification time of our approach remains low. We repeated this experiment only 20 times due to this reason. In our second experiment, we examine the number of graphs verified by our approach (Fig. 7). The graphs are sorted by their size in ascending order, and we state the number of uncertain edges e E relative to the total number of edges of a graph for better comparability across differently sized graphs. We use a rather small perturbation radius \u03b4 = 0.001 on the 20 \fGraph Convolutional Network Verification Enzymes and Proteins dataset as we have found that the graph neural networks are not robust for larger radii, and counterexamples can easily be found. While we were able to verify almost all instances taken from the Proteins dataset, the verification rate drops on the Enzymes dataset. We think this is due to the smaller graphs in the Enzymes dataset, which appear to be less robust to graph structure perturbations using our networks, and smaller graphs have nodes with smaller degrees, which can result in a larger approximation error during the enclosure of the inverse square root function (Lemma 13) using linear polynomials (Fig. 4). In our third experiment, we demonstrate the scalability of our approach by applying it on the Cora dataset. For this dataset, we do not use a perturbation radius (\u03b4 = 0) as the input data is binary, and thus perturbations do not have an intuitive justification. As this dataset has a node-level output, we can also dynamically remove nodes that do not influence a considered node throughout the verification process (Sec. 4.3). However, we want to stress that, on average, about half of the nodes have to be considered initially, as the graph is highly connected. The verification results for two graph neural networks with different numbers of message-passing steps (\u03ba\u2032 = 2 and \u03ba\u2032 = 3) are shown in Fig. 8. We obtain high verification rates despite the large size of the graph of the Cora dataset (Tab. 1). Please note that for a fixed number of perturbed edges, the verification time varies significantly despite always verifying a node on the same graph. This is primarily due to the dynamic subgraph extraction being able to remove many nodes and, thus, significantly speeding up computation time. 6"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.15070v2.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.15070v2",
|
| 3 |
+
"title": "BotDGT: Dynamicity-aware Social Bot Detection with Dynamic Graph Transformers",
|
| 4 |
+
"abstract": "Detecting social bots has evolved into a pivotal yet intricate task, aimed at\ncombating the dissemination of misinformation and preserving the authenticity\nof online interactions. While earlier graph-based approaches, which leverage\ntopological structure of social networks, yielded notable outcomes, they\noverlooked the inherent dynamicity of social networks -- In reality, they\nlargely depicted the social network as a static graph and solely relied on its\nmost recent state. Due to the absence of dynamicity modeling, such approaches\nare vulnerable to evasion, particularly when advanced social bots interact with\nother users to camouflage identities and escape detection. To tackle these\nchallenges, we propose BotDGT, a novel framework that not only considers the\ntopological structure, but also effectively incorporates dynamic nature of\nsocial network. Specifically, we characterize a social network as a dynamic\ngraph. A structural module is employed to acquire topological information from\neach historical snapshot. Additionally, a temporal module is proposed to\nintegrate historical context and model the evolving behavior patterns exhibited\nby social bots and legitimate users. Experimental results demonstrate the\nsuperiority of BotDGT against the leading methods that neglected the dynamic\nnature of social networks in terms of accuracy, recall, and F1-score.",
|
| 5 |
+
"authors": "Buyun He, Yingguang Yang, Qi Wu, Hao Liu, Renyu Yang, Hao Peng, Xiang Wang, Yong Liao, Pengyuan Zhou",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-24",
|
| 8 |
+
"primary_cat": "cs.SI",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.SI",
|
| 11 |
+
"cs.AI"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "Temporal AND Graph",
|
| 15 |
+
"gt": "Detecting social bots has evolved into a pivotal yet intricate task, aimed at\ncombating the dissemination of misinformation and preserving the authenticity\nof online interactions. While earlier graph-based approaches, which leverage\ntopological structure of social networks, yielded notable outcomes, they\noverlooked the inherent dynamicity of social networks -- In reality, they\nlargely depicted the social network as a static graph and solely relied on its\nmost recent state. Due to the absence of dynamicity modeling, such approaches\nare vulnerable to evasion, particularly when advanced social bots interact with\nother users to camouflage identities and escape detection. To tackle these\nchallenges, we propose BotDGT, a novel framework that not only considers the\ntopological structure, but also effectively incorporates dynamic nature of\nsocial network. Specifically, we characterize a social network as a dynamic\ngraph. A structural module is employed to acquire topological information from\neach historical snapshot. Additionally, a temporal module is proposed to\nintegrate historical context and model the evolving behavior patterns exhibited\nby social bots and legitimate users. Experimental results demonstrate the\nsuperiority of BotDGT against the leading methods that neglected the dynamic\nnature of social networks in terms of accuracy, recall, and F1-score.",
|
| 16 |
+
"main_content": "Introduction As social networks become integrated into people\u2019s daily routines, there is a prevalent occurrence of program-controlled bots masquerading as legitimate users for malicious purposes [Subrahmanian et al., 2016]. Social bots engage in detrimental activities such as propagating misinformation [Varol et al., 2017; Gao et al., 2023], manipulating public opinion [Cui et al., 2020], interfering in elections [Rossi et al., 2020] and promoting extremist ideologies [Ferrara et al., 2016]. It is therefore imperative to effectively detect social *The authors contributed equally to this work. \u2020Corresponding authors. Historical Snapshots Current Snapshot Low Medium High Interaction patterns of social bots Similarity of network structure Following Interaction patterns of humans Bot Human Following back T\u0bd4 T\u0bd5 T\u0bd6 \u00b7\u00b7\u00b7 \u00b7\u00b7\u00b7 \u00b7\u00b7\u00b7 \u00b7\u00b7\u00b7 Figure 1: Dynamic nature of social network bots to mitigate the detrimental societal and economic impact and to preserve the integrity of social network information. Traditional techniques for bot detection are largely based on features, requiring extraction of either numerical feature from user information [Yang et al., 2013] or semantic features from textual information [Wei and Nguyen, 2019; Duki\u00b4 c et al., 2020]. However, bot operators can often bypass bot detection through advanced countermeasures, which is commonly referred to as bot evolution [Cresci, 2020]. In fact, the detectability of the feature-based methods is vulnerable to imitation and evasion, as bot operators can effortlessly steal user information from legitimate users or intersperse a few malicious messages with many neutral ones [Feng et al., 2022b]. As a result, such methods are inaccurate in spotting disguised social bots. With the advancements in graph neural networks, some researchers employed graph-based methods [Wu et al., 2023; Feng et al., 2022a; Yang et al., 2023a] to identify the disguised social bots. They typically assume that the network structure of social bots generally differs from that of legitimate users. For instance, social bots tend to have sparser connections and randomly select users to interact with, whereas human beings prefer to connect with others who share similar characteristics [Yang et al., 2013]. These graph-based methods are among top performers by leveraging the topological structure of social networks for bot detection. However, most of the existing graph-based detection methods interpret the social network as a static graph and fail to acquire the dynamic nature of social networks. As arXiv:2404.15070v2 [cs.SI] 24 Apr 2024 \fshown in Figure 1, there still remain two intractable issues: Deficiency in utilizing historical interaction graph context. Similar to the case of evading detection from featurebased methods by forging numerical or semantic features, the ever-evolving social bots are meticulously engineered to interact with legitimate users and mimic their network structures [Cresci, 2020] to escape graph-based detection. However, despite the structure of social network has changed, the discrepancies in the previous interaction graph between social bots and benign users could reveal the deception of social bots and uncover their true identity. Unfortunately, conventional approaches upon static graphs solely rely on the last state of the social network and overlook the valuable historical interaction graph context. Consequently, if the social bots have already completed their disguise, it is challenging for static graph based methods to distinguish benign users from the evolved social bots. Limitation of modeling evolving behavior patterns. Social bots evolve over time, evading detection by dynamically adapting their actions, strategies, or interaction patterns to mimic legitimate users. In contrast, genuine users do not require such adaptations and exhibit different evolution of behavior patterns compared to social bots. Discovering the evolving behavior patterns may enhance the effectiveness of social network modeling [Liu et al., 2020]. Nevertheless, static graph based methods fall short of modeling the distinct evolving behavior patterns of social bots and legitimate users, leading to erroneous results when conducting bot detection tasks. To overcome the limitations above, we propose a new framework called BotDGT (Bot detection with Dynamic Graph Transformers). The key insight is to introduce the dynamicity modeling of social network for bot detection. To this end, BotDGT depicts a social network as a dynamic graph for modeling historical interaction graph contexts and discerning the evolving behavior patterns. Specifically, we interpret users and interactions as nodes and edges, respectively, to generate a batch of snapshots at a fixed time interval for a given social network. A structural module that employs message-passing mechanism is proposed to model the topological structure of each historical snapshot. Additionally, a temporal module based on self-attention mechanism is further employed to incorporate historical contexts and exploit the distinct behavior patterns evolution exhibited by social bots and legitimate users. Overall, our contributions are summarized as follows: \u2022 To the best of our knowledge, we are the first to characterize a social network as a dynamic graph and effectively identify the ever-evolving social bots that disguise themselves through adapting their behavior patterns. \u2022 We introduce a novel bot detection framework to consider both topological structure and the dynamic nature of social networks to enhance the performance of bot detection. \u2022 We conduct comprehensive experiments on two benchmarks for bot detection, which demonstrates the superior performance of BotDGT compared to the leading methods in terms of accuracy, recall and F1-score. Further experiments substantiate the effectiveness of incorporating the dynamic nature of social networks for bot detection. 2 Preliminaries 2.1 Related Work Social Bot Detection Early methods for social bot detection are predominantly feature-based. Researchers extracted numerical features from user information and fed them into machine learning models for classification [Lee et al., 2011; Mazza et al., 2019; Yang et al., 2020] or anomaly detection [Miller et al., 2014]. Some studies employed natural language processing techniques to encode textual information, capturing semantic features to enhance the feature-based methods [Hayawi et al., 2022; Duki\u00b4 c et al., 2020; Yang et al., 2023b]. However, newer generations of social bots may forge numerical features or semantic features, either by stealing legitimate users\u2019 information or interspersing malicious messages among benign ones, to evade feature-based detection. With the advancements in graph neural networks, some graph-based methods leveraged the topological structure of social networks for bot detection [Pham et al., 2022; Shi et al., 2023; Peng et al., 2024; Zeng et al., 2024]. The study [Ali Alhosseini et al., 2019] takes the first attempt to introduce graph convolutional networks to aggregate user information from neighboring nodes for bot detection. Subsequent investigations modeled the heterogeneity of social networks and yielded leading performance [Feng et al., 2021b; Feng et al., 2022a]. However, these methods interpreted the social networks as static graphs and neglected the intrinsic dynamicity of real-world social networks, thereby falling short of detecting evolving social bots that adapt strategies to mimic legitimate users\u2019 network structure [Cresci, 2020]. To this end, we build upon previous research and present a dynamicity-aware bot detection framework. It incorporates historical context and exploits the evolution of user behavioral patterns, aiming at enhancing the performance of bot detection. Dynamic Graph Neural Network Dynamic graphs capture temporal information through timebased dimensions [Skarding et al., 2021; Peng et al., 2021]. Previous research in graph representation learning has predominantly concentrated on static scenarios, presuming fixed topological structures. However, real-world graphs, including social networks [Alvarez-Rodriguez et al., 2021; Wang et al., 2021], exhibit continual evolution and dynamic characteristics over time. Dynamic graph neural networks are designed to capture this dynamic nature and are widely adopted in various tasks, including link prediction [Xie et al., 2021; Chen et al., 2022; Sankar et al., 2020; Zhang et al., 2023], anomaly detection [Cai et al., 2021; Guo et al., 2022], and node classification [Kim et al., 2022; Pareja et al., 2020; Xu et al., 2020]. Drawing upon the previous works that employed recurrent neural networks [Chen et al., 2022; Zhou et al., 2020] and attention mechanisms [Sankar et al., 2020; Xu et al., 2020] to model dynamic graphs, we propose a novel approach that utilizes a self-attention mechanism to leverage the dynamic nature of social network, thereby enhancing the effectiveness of bot detection. \fReal world Social Network Graph Construction \u2026 \u2026 1 t k t N t Dynamic Social Network \uff1f Structural Module 1,{ 1} t l h \uf02b ,{ 1} k t l h \uf02b ,{ 1} N t l h \uf02b { 1} 1 l h \uf02b { } 1 l h Message Passing Message Passing Message Passing 12 \uf061 14 \uf061 15 \uf061 16 \uf061 13 \uf061 C Interaction \u2026 \u2026 Stack Temporal Module Position Embedding D 1,{ 1} t l h \uf02b ,{ 1} k t l h \uf02b ,{ 1} N t l h \uf02b Linear Linear Linear Matmul Scal e Mas k Softma x Matmul Linear Linear Linear Matmul Sca le Ma sk Softma x Matmul Linear Linear Linear Matmul Scale Mask Softmax Matmul Temporal Attention Query Key Value FFN Classification Loss Bot Human Figure 2: Overview of our proposed BotDGT framework. 2.2 Problem Definition In this paper, we depict the social network as a dynamic graph that changes over time and capture the dynamic nature of the social network to improve the performance of the bot detection model. In this part, we first define the dynamic social network and then formulate the problem. Definition (Dynamic Social Network). A dynamic social network is depicted as a graph G = {Gt1, Gt2, ..., GtN } with a series of network snapshots over time. Gtk = (V tk, Etk) represents the snapshot of a given social network graph at the timestamp tk, where V tk, Etk are users and interactions respectively observed at timestamp tk. To align with the previous studies, we treat bot detection as a binary classification problem, i.e., users are classified into human (y = 0) or bot (y = 1). We formulate the problem of bot detection in dynamic social networks as follows: Problem (Bot Detection in Dynamic Social Network). Given a dynamic social network G = {Gt1, Gt2, ..., GtN }, the problem is to find an encoding function f : v \u2192\u02c6 y for each node v \u2208V tk at the timestamp tk \u2208{t1, t2, ..., tN}, such that \u02c6 y approximates the ground truth y to maximize prediction accuracy. 3 Methodology As shown in Figure 2, BotDGT comprises two modules to primarily capture the topological structure and dynamicity of social networks. Specifically, we produce snapshots of the social network at a certain time interval. For each snapshot, the structural module aggregates the features of neighboring nodes and generates temporary node representations containing the snapshot\u2019s topology information. Additionally, the temporal module integrates historical context and exploits changes in behavior patterns over time. The resultant node representations are subsequently utilized to differentiate social bots from genuine users. 3.1 Constructing a Dynamic Graph We first construct a dynamic social network G = {Gt1, Gt2, ..., GtN } at a specific time interval \u2206t. We then acquire the node representation using the information encoding procedure established in the state-of-the-art techniques from recent study [Feng et al., 2022a]. A fully-connected layer is used to transform xtk i , the feature of user i at timestamp tk, into the initial user vector htk,{0} i : htk,{0} i = \u03c3(WIxtk i + bI), (1) where WI, bI are trainable parameters and \u03c3(\u00b7) is a nonlinear activation function. 3.2 Modeling Topological Structure Upon generating a dynamic social network and initial user vectors, we propose a structural module that leverages a message-passing mechanism [Gilmer et al., 2017] to effectively model the topological structure of each snapshot. This structural module takes a snapshot Gtk = (V tk, Etk) and a set of initial user vector \b htk i , \u2200vi \u2208V tk\t at timestamp tk as input. The output includes a new set of temporary node representations \b stk i , \u2200vi \u2208V tk\t , which captures the structural information of the snapshot at tk. Graph attention networks [Veli\u02c7 ckovi\u00b4 c et al., 2017] have shown superior performance when tackling graph data, by specifying different weights to different nodes within a neighborhood. Inspired by the Transformer architecture [Vaswani et al., 2017], we adopt a scaled dot-product attention mechanism for provisioning each node with the ability to learn the importance of its neighbors within a particular snapshot. Specifically, for a given a node pair (vi, vj) in snapshot Gtk, the attention weight can be calculated as such: qtk,{l} i = W {l} q \u00b7 htk,{l} i + b{l} q , ktk,{l} j = W {l} k \u00b7 htk,{l} j + b{l} k , \u03b1tk,{l} ij = D qtk,{l} i , ktk,{l} j E P u\u2208N tk (i) D qtk,{l} i , ktk,{l} u E, (2) where {l} denotes the l-th layer of structural module and N tk (i) denotes the neighborhood of node vi at the timestamp tk. The \finitial user vector htk,{l} i and htk,{l} j are transformed into a query vector qtk,{l} i and a key vector ktk,{l} j . The attention weight \u03b1tk,{l} ij , which indicates the contribution of node vj to node vi at the snapshot Gtk, is calculated by the exponential scale dot product function \u27e8q, k\u27e9= exp \u0010 qkT \u221a d \u0011 , where d is the input embedding dimension. After obtaining the attention weight, we transform the initial user vector into a value vector and aggregate information from the neighboring nodes of vi. A multi-head attention mechanism is employed to capture diverse patterns and dependencies in the topological structure of the social network: vtk,{l} j = W {l} v \u00b7 htk,{l} j + b{l} v , htk,{l+1} i = C \u2225 c=1 \u03c3 \u0012P j\u2208N tk (i) \u0010 \u03b1tk,{l} c,ij .vtk,{l} c,j \u0011\u0013 , (3) where \u2225represents the concatenation operation, \u03b1tk,{l} c,ij denotes the attention weight computed by the c-th attention head, and vtk,{l} c,j denotes the corresponding value vector. It is worth noting that we stack L layers to allow nodes to capture more distant and global dependencies in the topological structure. The output of the last layer in the structural module is denoted as s. 3.3 Acquiring Temporal Dynamicity While BotDGT\u2019s structural module can capture topological information from static snapshots, it insufficiently leverages historical context and fails to discover evolving behavior patterns of social bots. Inspired by [Sankar et al., 2020; Ying et al., 2021], we devise a self-attention based temporal module to further make use of the temporal characteristics of social networks for bot detection. The temporal module takes as inputs a sequence of temporary representations of node vi at each timestamp, denoted as \b st1 i , st2 i , ..., stN i \t . The module outputs a new sequence of user representations \b \u02c6 zt1 i , \u02c6 zt2 i , ..., \u02c6 ztN i \t , where \u02c6 ztk i denotes the final representation that contains both topological and temporal feature of node vi at tk. Position Embedding Layer Since the self-attention mechanism is unaware of the nodes\u2019 ordering information, we introduce a position embedding layer to accommodate temporal information in the sequence that can effectively reflect the dynamic nature of social networks. We consider two categories of position embedding \u2013 absolute temporal position embedding and evolving temporal position embedding. First, we embed the absolute temporal position [Gehring et al., 2017] of each snapshot as a basis to capture ordering information as follows: ptk,AT = EAT (tk), (4) where ptk,AT denotes the Absolute Temporal position embedding for the timestamp tk and EAT denotes the trainable absolute temporal position embedding parameter. Note that the absolute temporal position embedding only relies on the order of the snapshot, indicating that the nodes in the same snapshot have the same absolute temporal position embedding, i.e., the absolute temporal position embedding is independent of the nodes\u2019 features. Second, we embed two crucial temporal signals: the local clustering coefficient and bidirectional links ratio. These signals have demonstrated their utility in countering the disguised social bots [Yang et al., 2013] and could reveal the evolving behavior patterns over time. \u2022 Local Clustering Coefficient (LCC): it measures the degree to which a node\u2019s neighbors are interconnected. Genuine users typically engage with acquaintances (e.g., friends, family members, and colleagues) who have similar connections and thus form closely-knit communities. By contrast, social bots are usually associated with randomly selected neighbors who lack close connectivity, which results in reduced clustering coefficients when compared with legitimate users. The position embedding of the local clustering coefficient is calculated as follows: LCC(vtk i ) = 2 \u2217|etk vi| ktk vi \u2217(ktk vi \u22121), ptk,LCC i = ELCC(LCC(vtk i )), (5) where |etk vi| is the number of edges between neighbors of node vi at the timestamp tk, ktk vi is the sum of the indegree and outdegree of node vi at tk. \u2022 Bidirectional Links Ratio (BLR): it is a metric in social network analysis to assess the reciprocity between an account and its followings [Yang et al., 2013]. A bidirectional link appears when two accounts mutually follow each other. This metric proves particularly useful in distinguishing between genuine users, who often own higher bidirectional link counts due to reciprocal following acquaintances with mutual follow-backs, and social bots, who exhibit lower bidirectional link counts due to their indiscriminate following behavior and lack of reciprocal connections. The position embedding of the bidirectional links ratio is calculated as follows: BLR(vtk i ) = Nblinks(vtk i ) Nfing(vtk i ) , ptk,BLR i = EBLR(BLR(vtk i )), (6) where Nblinks(vtk i ) and Nfing(vtk i ) denote the numbers of bidirectional links and following interactions. In summary, the integration of these two categories of position embeddings enables the temporal module to capture essential temporal insights from ordering information and the evolving behavior patterns of social bots. Temporal Attention Layer The temporal attention layer starts from gathering the outputs of the structural module and the position embedding layer: \u02c6 stk i = stk i + ptk,AT i + ptk,LCC i + ptk,BLR i . (7) Then we pack the representations of node vi together across the timestamps, which is denoted as \u02c6 Si \u2208RT \u00d7F . Finally we perform multi-head temporal attention as follows: Qi, Ki, Vi = \u02c6 SiWq, \u02c6 SiWk, \u02c6 SiWv, \u02c6 Zi = D \u2225 d=1 softmax( Qd,iKT d,i \u221a F + Mask) \u00b7 Vd,i, (8) \fwhere \u2225represents the concatenation operation, Q, K, V are the queries, keys, and values transformed by trainable parameters W\u2217\u2208RF \u00d7F respectively. Mask \u2208RT \u00d7T is a sequence mask matrix that makes sure the node at timestamp tk only attends over its historical node representation. The Mask is defined as follows: Maskab = \u001a0 if a \u2265b \u2212\u221e otherwise (9) 3.4 Learning and Optimization The goal of BotDGT is to capture both the topological structure and the dynamic nature of social networks to classify the accounts into legitimate user and social bots. We pass the output of the temporal module into a linear layer and softmax layer for bot detection: \u02c6 yi = softmax(W2 \u00b7 (\u03c3(W1 \u00b7 \u02c6 zi + b1)) + b2), (10) where \u02c6 yi is the predicted output of node vi and \u02c6 zi is the representation of node vi obtained by temporal module. Finally, we define the objective function that utilizes a binary crossentropy function to classify node v into legitimate users and social bots at each snapshot: Loss = N X k=1 X vi\u2208V tk [yilog(\u02c6 yi) + (1 \u2212yi)log(1 \u2212\u02c6 yi)] , (11) where N is the number of the snapshots, yi is the ground truth label of node vi. 4 Experiments In this section, we conduct extensive experiments on two benchmark datasets to answer the following questions: \u2022 RQ1: How does our framework perform in bot detection compared to baseline methods? \u2022 RQ2: What is the impact of removing individual architectural components on the framework\u2019s performance? \u2022 RQ3: What is the significance of capturing the dynamic nature of social networks for social bot detection? 4.1 Experimental Setup Dataset We conduct experiments on two comprehensive social bot detection benchmark datasets (i.e., TwiBot-20 [Feng et al., 2021a] and TwiBot-22 [Feng et al., 2022b]) collected from Twitter. The datasets provide a wide range of entities and relationships, spanning the period from the inception of Twitter to the time of dataset creation, which supports our bot detection framework to model the topological structure and dynamic nature of social networks. It\u2019s worth noting that Twibot-22 suffers from a class imbalance issue, where the number of humans is significantly larger than that of social bots. Baselines We compare BotDGT with comprehensive social bot detection methods categorized into two groups: feature-based methods and graph-based methods. Our code is publicly available on GitHub1. Feature-based methods generally extract the numerical features from user metadata or semantic features from textual information to identify social bots, including: \u2022 EvolveBot [Yang et al., 2013] designs robust features that are expensive for bots to evade and utilizes machine learning classifiers to combat the evasion tactics of spammers. \u2022 Varol et al. [Varol et al., 2017] extracts groups of features from Twitter users and leverages random forest classifier to identify Twitter bot. \u2022 BotBuster [Ng and Carley, 2023] employs a mixture-ofexperts approach to process user metadata and textual information, thereby improving cross-platform bot detection. \u2022 DeeProBot [Hayawi et al., 2022] extracts features from the user account and leverages natural language processing techniques to encode textual information to learn user representations for bot detection. \u2022 SGBot [Yang et al., 2020] is proposed to tackle the scalability and generalization issues in social bot detection by strategically selecting a subset of training data. Graph-based methods generally interpret social networks as graphs and leverage geometric deep learning for social bot detection, including: \u2022 GCN [Kipf and Welling, 2016] equally aggregates features from neighbors and learns user representations, which are then passed to a linear layer for classification. \u2022 GAT [Veli\u02c7 ckovi\u00b4 c et al., 2017] leverages an attention mechanism to assign diverse weights to different neighboring nodes, improving the learning of node representations. \u2022 BotRGCN [Feng et al., 2021b] is designed to construct a heterogeneous social network graph and employ relational graph convolutional networks for bot detection. \u2022 RGT [Feng et al., 2022a] utilizes graph transformers and semantic attention to effectively model the heterogeneity of social networks for bot detection. 4.2 Framework Performance (RQ1) We evaluate our proposed social bot detection framework along with several representative baselines on the two benchmarks and present the results in Table 1. It is demonstrated that graph-based methods, which treat the social network as graphs, generally outperform feature-based methods. This could be attributed to the feature-based methods are easily circumvented by forging numerical or semantic features. The results underscore the importance of capturing topological structure of social networks for effective bot detection. Our proposed BotDGT outperforms other static graphbased baseline models, including the state-of-the-art static graph model, in terms of accuracy, recall, and F1-score on 1https://github.com/Peien429/BotDGT \fTable 1: Performance of different social bot detection methods on TwiBot-20 and TwiBot-22. We run each method five times and report the average value as well as the standard deviation. The best and second-best results are highlighted with bold and underline. Methods Dataset TwiBot-20 TwiBot-22 Metrics Accuracy F1-score Precision Recall Accuracy F1-score Precision Recall feature-based EvolveBot 65.83\u00b10.63 69.75\u00b10.50 66.93\u00b10.60 72.81\u00b10.41 71.09\u00b10.03 14.09\u00b10.08 56.38\u00b10.04 8.04\u00b10.05 Varol et al. 78.74\u00b10.55 81.08\u00b10.48 78.04\u00b10.61 84.37\u00b10.67 73.92\u00b10.02 27.54\u00b10.26 75.74\u00b10.31 16.83\u00b10.21 BotBuster 78.55\u00b10.44 82.12\u00b10.61 79.85\u00b10.74 84.00\u00b10.53 74.33\u00b10.17 52.26\u00b11.82 63.32\u00b11.47 45.64\u00b11.70 DeeProBot 73.14\u00b10.01 77.05\u00b10.02 71.61\u00b10.01 83.50\u00b10.04 76.50\u00b10.07 24.74\u00b10.08 80.00\u00b10.27 14.99\u00b10.05 SGBot 79.50\u00b10.72 84.15\u00b10.53 75.64\u00b10.70 93.54\u00b10.36 75.53\u00b10.25 37.45\u00b10.24 74.31\u00b10.16 25.42\u00b10.07 graph-based GCN 83.51\u00b10.56 84.81\u00b10.42 84.60\u00b11.26 85.05\u00b10.94 77.83\u00b10.96 52.16\u00b13.46 71.83\u00b11.12 45.77\u00b12.25 GAT 85.04\u00b10.38 86.65\u00b10.61 83.69\u00b11.23 89.94\u00b11.65 78.65\u00b10.19 55.86\u00b11.38 71.24\u00b10.80 46.04\u00b12.17 BotRGCN 85.83\u00b10.38 87.44\u00b10.42 83.98\u00b10.34 91.20\u00b11.03 78.95\u00b10.26 56.47\u00b11.21 72.38\u00b11.42 46.33\u00b11.74 RGT 86.53\u00b10.47 87.74\u00b10.62 90.37\u00b10.64 77.47\u00b10.43 77.01\u00b10.21 47.25\u00b10.83 72.80\u00b10.76 34.99\u00b10.90 ours BotDGT 87.25\u00b10.51 88.87\u00b10.55 84.44\u00b10.39 94.24\u00b10.37 79.33\u00b10.22 58.15\u00b10.74 72.42\u00b10.70 48.46\u00b10.92 Table 2: Results of ablation study. SM and TM denote the structural module and temporal module, respectively. Ablation Settings TwiBot-20 TwiBot-22 Accuracy F1-score Accuracy F1-score BotDGT 87.25\u00b10.51 88.87\u00b10.55 79.33\u00b10.22 58.15\u00b10.74 replace SM w/ GCN 86.28\u00b10.35 87.87\u00b10.33 79.28\u00b10.05 57.14\u00b11.11 replace SM w/ GAT 86.48\u00b10.39 87.99\u00b10.42 79.14\u00b10.13 57.23\u00b11.42 replace SM w/ RGCN 86.33\u00b10.55 87.92\u00b10.73 79.17\u00b10.15 57.70\u00b11.76 replace SM w/ RGT 86.22\u00b10.20 87.64\u00b10.24 79.28\u00b10.05 57.24\u00b11.30 w/o TM 85.72\u00b10.21 86.99\u00b10.39 78.64\u00b10.12 55.23 \u00b11.17 w/o pAT in TM 86.42\u00b10.40 88.13\u00b10.54 79.23\u00b10.12 56.51\u00b10.54 w/o pLCC in TM 86.25\u00b10.51 87.92\u00b10.53 79.25\u00b10.21 56.77\u00b10.93 w/o pBLR in TM 86.56\u00b10.22 88.08\u00b10.24 79.29\u00b10.15 56.84\u00b10.98 both TwiBot-20 and Twibot-22 datasets. In comparison with the architecture of previous static graph-based methods, BotDGT not only leverages the topological structure of the social network but also incorporates a temporal module that captures the dynamic nature of the social network. The superior performance of BotDGT could be attributed to its ability to capture the historical context of social networks and model the behavior patterns of automated bots that may evolve over time to evade detection, enabling better discrimination of social bots disguised as legitimate users by interacting with other users. Further detailed analysis of the dynamicity modeling is provided in Section 4.4. 4.3 Ablation Study (RQ2) BotDGT comprises a structural module and a temporal module, to generate node representations for social bot detection. In this section, we conduct an ablation study on BotDGT by removing or replacing one specific component at a time to assess its significance. The components validated in this section are the message-passing mechanism in the structural module, the temporal module and the temporal position embeddings within it. Experimental results of these ablation models on TwiBot-20 and TwiBot-22 are shown in Table 2. Effect of Structural Attention. In the structural module, we propose a scaled dot-product attention mechanism that assigns diverse weights to different neighboring nodes for propagating node messages and capturing topological structure in each static snapshot. We replace the structural attention with other static graph-based methods proposed to detect social bots, including GCN, GAT, BotRGCN, and RGT. The observed performance degradation indicates that the scaled dot-product structural attention better captures the underlying topological structure for dynamicity modeling of social network. Effect of Temporal Module. The temporal module assumes a pivotal role in modeling the dynamicity of social networks and the evolving behavior patterns of social bots. We first assess the overall impact of the temporal module and then evaluate the effect of position embeddings within the temporal module. The variant w/o TM removes the temporal module of BotDGT, characterizing the social network as a static graph. As shown in Table 2, the variant\u2019s performance experiences significant degradation when compared to the original BotDGT architecture, which indicates the importance of incorporating temporal information for effective bot detection. The temporal position embeddings are proposed to capture the temporal information in the sequence. The variant w/o pAT in TM confirms the effectiveness of capturing the ordering information of the time sequence. The variants w/o pAT in TM and w/o pLCC in TM demonstrate the importance of considering evolving behavior patterns. Overall, these results confirm the crucial role of positional embeddings in effectively modeling the dynamicity of social networks. 4.4 The significance of dynamicity modeling (RQ3) To investigate the impact of exploiting the inherent dynamicity of social networks for bot detection, we enhance several static graph-based baselines with the proposed temporal module and compare their performance before and after this enhancement. The experimental results outlined in Table 3 reveal that the majority of the graph-based baselines with the temporal module integrated exhibit noticeable performance improvement compared with their non-enhanced counterparts. Similar to BotDGT\u2019s result, all of the enhanced graphbased methods can achieve higher recall rates, indicating the significance of capturing the dynamic nature of social networks in detecting disguised social bots. Notably, the graphbased methods with the temporal module integrated experience a slight reduction in precision. We speculate that the increased sensitivity to social bots derived from the tempo\fTable 3: Performance comparison between the original static graph-based baselines and the enhanced models with the proposed temporal module. Bold indicates the improved model performance. Dataset Metric Accuracy F1-score Precision Recall Method Original Enhanced Original Enhanced Original Enhanced Original Enhanced TwiBot-20 GCN 83.51\u00b10.56 86.28\u00b10.35 84.81\u00b10.42 87.87\u00b10.33 84.60\u00b11.26 84.20\u00b10.24 85.05\u00b10.94 91.88\u00b10.56 GAT 85.04\u00b10.38 86.48\u00b10.39 86.65\u00b10.61 87.99\u00b10.42 83.69\u00b11.23 84.65\u00b10.56 89.94\u00b11.65 91.61\u00b11.25 BotRGCN 85.83\u00b10.38 86.33\u00b10.55 87.44\u00b10.42 87.92\u00b10.73 83.98\u00b10.34 83.95\u00b10.74 91.20\u00b11.03 91.77\u00b11.02 RGT 86.53\u00b10.47 86.22\u00b10.20 87.74\u00b10.62 87.64\u00b10.24 90.37\u00b10.64 84.00\u00b10.26 77.47\u00b10.43 91.61\u00b10.79 TwiBot-22 GCN 77.83\u00b10.96 79.28\u00b10.05 52.16\u00b13.46 57.14\u00b11.11 71.83\u00b11.12 71.10\u00b11.44 45.77\u00b12.25 47.82\u00b12.16 GAT 78.65\u00b10.19 79.14\u00b10.13 55.86\u00b11.38 57.23\u00b11.42 71.24\u00b10.80 71.45\u00b12.00 46.04\u00b12.17 48.77\u00b12.87 BotRGCN 78.95\u00b10.26 79.17\u00b10.15 56.47\u00b11.21 57.70\u00b11.76 72.38\u00b11.42 73.37\u00b11.65 46.33\u00b11.74 48.07\u00b13.02 RGT 77.01\u00b10.21 79.28\u00b10.05 47.25\u00b10.83 57.24\u00b11.30 72.80\u00b10.76 72.99\u00b11.90 34.99\u00b10.90 47.17\u00b12.60 Figure 3: Framework performance at various time intervals Figure 4: Distribution of temporal attention weights ral module might lead to a slight increase in false positives. This observation also gives rise to a decrease in RGT\u2019s F1score on the Twibot-20 dataset, which initially had the highest precision and the lowest recall rate. Nevertheless, there is a notable improvement in F1-score for most graph-based methods, which can reaffirm the importance of incorporating the dynamic nature of social networks in bot detection. 5 Discussion 5.1 Granularity for Dynamicity Modeling Different from the static graph-based approaches that rely on the most recent snapshot, BotDGT integrates historical context from multiple snapshots. During the process of graph construction in BotDGT, we construct a series of snapshots to depict the social network at a time interval \u2206t, which determines the granularity of the dynamic social network. To explore how granularity affects dynamicity modeling, we evaluate BotDGT with various time intervals on TwiBot-20. The result, illustrated in Figure 3, shows that the model performance initially improves as the granularity becomes finer due to richer temporal information. However, a decline in the model performance is observed when the granularity becomes finer than 12 months. We speculate that while setting the granularity finer than 12 months provides more historical context and detailed evolving patterns, it also introduces more noise and short-term fluctuations of the social network, making it more challenging for the temporal module to learn consistent patterns. Furthermore, the study [Cresci, 2020] has found that the evolution of social bots is not very frequent, indicating that social bots mostly don\u2019t change their actions or strategies within a short period of time. Therefore, excessively fine granularity may not provide meaningful insights into the evolving behavior patterns exhibited by social bots. 5.2 Temporal Attention for Dynamicity Modeling To further explore how temporal attention affects the performance of bot detection, we visualize the distribution of temporal attention weights averaged over test nodes on TwiBot20 at the time interval of 12 months. In Figure 4, each row represents the attention weight distribution of the snapshot at tk over its historical snapshots at t1, \u00b7 \u00b7 \u00b7 , tk\u22121. As shown in Figure 4, BotDGT doesn\u2019t assign uniform weight to historical snapshots, indicating the different contributions of each snapshot for social bot detection. When predicting the most recent snapshot of the dynamic social network, BotDGT assigns more weight to the historical snapshots before 2015, rather than focusing on the more recent ones. We speculate that the reason is that advanced social bots evolved to change their behavior patterns and interact with legitimate users around 2015, which is consistent with the rise of a third wave of bots from 2016 onwards as described in the study [Cresci, 2020]. Thus, BotDGT is capable of adapting attention weight distributions to effectively incorporate historical context. 5.3 Limitations and Future Work A primary limitation lies in the fact that, while BotDGT demonstrates significant improvements, we acknowledge the increased computational cost associated with dynamicity modeling. However, we believe that this trade-off is acceptable, given the potential adverse impact that social bots could cause. Another limitation is that our evaluation is limited to the Twitter platform due to the lack of datasets from other platforms and the generalizability of BotDGT to other platforms remains uncertain. We leave optimizing the computational efficiency of BotDGT and assessing its performance across diverse social media ecosystems as future work. 6"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.15081v1.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.15081v1",
|
| 3 |
+
"title": "Perturbing Attention Gives You More Bang for the Buck: Subtle Imaging Perturbations That Efficiently Fool Customized Diffusion Models",
|
| 4 |
+
"abstract": "Diffusion models (DMs) embark a new era of generative modeling and offer more\nopportunities for efficient generating high-quality and realistic data samples.\nHowever, their widespread use has also brought forth new challenges in model\nsecurity, which motivates the creation of more effective adversarial attackers\non DMs to understand its vulnerability. We propose CAAT, a simple but generic\nand efficient approach that does not require costly training to effectively\nfool latent diffusion models (LDMs). The approach is based on the observation\nthat cross-attention layers exhibits higher sensitivity to gradient change,\nallowing for leveraging subtle perturbations on published images to\nsignificantly corrupt the generated images. We show that a subtle perturbation\non an image can significantly impact the cross-attention layers, thus changing\nthe mapping between text and image during the fine-tuning of customized\ndiffusion models. Extensive experiments demonstrate that CAAT is compatible\nwith diverse diffusion models and outperforms baseline attack methods in a more\neffective (more noise) and efficient (twice as fast as Anti-DreamBooth and\nMist) manner.",
|
| 5 |
+
"authors": "Jingyao Xu, Yuetong Lu, Yandong Li, Siyang Lu, Dongdong Wang, Xiang Wei",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.CV",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CV",
|
| 11 |
+
"cs.CR",
|
| 12 |
+
"cs.LG"
|
| 13 |
+
],
|
| 14 |
+
"label": "Original Paper",
|
| 15 |
+
"paper_cat": "Diffusion AND Model",
|
| 16 |
+
"gt": "Diffusion models (DMs) embark a new era of generative modeling and offer more\nopportunities for efficient generating high-quality and realistic data samples.\nHowever, their widespread use has also brought forth new challenges in model\nsecurity, which motivates the creation of more effective adversarial attackers\non DMs to understand its vulnerability. We propose CAAT, a simple but generic\nand efficient approach that does not require costly training to effectively\nfool latent diffusion models (LDMs). The approach is based on the observation\nthat cross-attention layers exhibits higher sensitivity to gradient change,\nallowing for leveraging subtle perturbations on published images to\nsignificantly corrupt the generated images. We show that a subtle perturbation\non an image can significantly impact the cross-attention layers, thus changing\nthe mapping between text and image during the fine-tuning of customized\ndiffusion models. Extensive experiments demonstrate that CAAT is compatible\nwith diverse diffusion models and outperforms baseline attack methods in a more\neffective (more noise) and efficient (twice as fast as Anti-DreamBooth and\nMist) manner.",
|
| 17 |
+
"main_content": "Introduction Diffusion Models (DMs) [11] represent a cutting-edge advancement in the field of generative models, particularly within the realm of Text-to-Image (T2I) generation. This strategic breakthrough in generative modeling has gained recognition for its remarkable efficacy and potency in capturing intricate patterns and nuances. The technique can effortlessly transform textual descriptions into rich and visually compelling images. In the effort to make generative modeling with DM more efficient, the development has led to the creation of multiple variants of DM models, including Textual Inversion [6], DreamBooth [27], Custom Diffusion [16], and SVDiff [9], etc. These variants provide users with more customized arXiv:2404.15081v1 [cs.CV] 23 Apr 2024 \fand enhanced experiences, allowing them to obtain precise images of a specified subject by using prompts and only a small set (4-5) of relevant images. This level of customization not only empowers users to create unique and personalized content but also cultivates a widely embraced and individualized creative experience. Despite the power of these models, users should be careful to avoid any harmful or unintended consequences that may arise from their applications. For example, malicious attackers can exploit photos available on the internet and use customized LDMs to generate deceptive and harmful fake images. Of even greater concern is the ability of attackers to fabricate false news images for their personal gain. Our research is dedicated to protecting users from malicious T2I attacks. Through effective strategies, we attempt to contribute valuable insights to enhance understanding and bolster security in the T2I domain. Currently, there exist adversarial attack methods, such as Anti-DreamBooth [32] and Mist [18], which have been developed to tackle the aforementioned issues. Anti-DreamBooth has exhibited remarkable proficiency in countering adversarial face attacks specifically targeted at DreamBooth, while Mist has proven its effectiveness in preserving artists\u2019 copyrights from the transformative effects of AI-for-art. However, it is crucial to acknowledge that current solutions have limitations, particularly in terms of their ability to generalize and their efficiency in terms of time. Our research aims to overcome these limitations by focusing on the generalization of adversarial attack methods and their strong adaptability to a broader range of scenarios and systems. Moreover, the reduction of execution time is pivotal for streamlining processes, ensuring more practical and efficient applications in the real world. To tackle these challenges, we focus on attacking LDMs as a whole. A direct method involves executing a Projected Gradient Descent (PGD) [21] attack on LDMs, targeting all parameters, similar to the approach employed by Anti-DreamBooth on DreamBooth. However, the substantial number of parameters in LDMs results in considerable time and space overhead. We propose adversarial optimization on only crossattention layers for an efficient PGD attack. Inspired by Custom Diffusion, we have found that attention layers, specifically the cross-attention layers, play a significant role in the training process of LDMs. The cross-attention layers, integral components of LDMs, undergo substantial parameter change over the training despite having a relatively small number of parameters. We intend to leverage this observation to improve adversarial attacks on DMs. In order to investigate the effectiveness of the PGD attack on cross-attention layers of LDMs, we conduct experiments on Stable Diffusion (SD) v2.1, performing PGD attacks on both the original model and the one fine-tuned with crossFigure 2. Illustration of the vulnerability of cross-attention layers by PGD. The comparison of adversarial attack between cross-attention and other layers reveal the vulnerability of crossattention layers in PGD attack. We added noise to the clean images through PGD attack to generate adversarial examples. Subsequently, we employed DreamBooth [27] for customized finetuning on the adversarial examples, resulting in generated images from attacked diffusion model. attention to produce adversarial examples. Then, we train DreamBooth on these adversarial examples to observe the attack effects. The results justify that even with minor updates to the cross-attention layers, there is a discernible improvement in the effectiveness of the attack, as illustrated in Fig. 2. According to our preliminary observations, we introduce an adversarial attack method, Cross-Attention Attack (CAAT), that can be applied to all customized fine-tuned models based on LDMs. While adding perturbations to generate adversarial examples, we update the parameters of the cross-attention layers, a pivotal component of LDMs. The obtained perturbations will affect the cross-attention layers during fine-tuning, disrupting the mapping from text to images. Our experiments show that disrupting this key element yields significant results. Figure 1 demonstrates the outstanding attack effectiveness of CAAT. Additionally, because the parameters of cross-attention layers are relatively small, our attack is lightweight and faster in training. Through extensive testing, our attack method has proven to be effective against existing LDM-based customized finetuning, with minimal time overhead. The overview of CAAT is presented in Fig. 3. In summary, our contributions are as follows: 1. We identify and leverage the effectiveness of crossattention layers in LDMs to efficient adversarial attacks on DMs. 2. We developed CAAT, a simple yet effective attacker that exhibits excellent generalization and efficient training, providing users with robust protection against portrait rights infringements. 3. We justify CAAT\u2019s effectiveness, efficiency, and generality through extensive experiments across various stateof-the-art adversarial attack methods on different cus\ftomized LDM models. 4. We perform ablation study to analyze the effectiveness of influential factors for CAAT and provide suggestions for its application. 2. Related Work 2.1. T2I models The advent of foundation models, as proposed by Bommasani et al. [2], has triggered a noticeable shift in the landscape of deep learning. This transition is characterized by a growing emphasis on large-scale models, housing billions of parameters, and trained on extensive datasets. This evolution has, in turn, propelled advancements in T2I generation models. In the domain of image generation, Generative Adversarial Networks (GANs)[7], once emblematic and canonical, are witnessing a gradual displacement by diffusion models[11]. This shift is attributed to the disruptive influence of diffusion models on the traditional structure of GANs, leading to a notable improvement in the quality of generated content [5]. The remarkable success of diffusion models in the realm of image generation [1, 22, 24, 28] has redirected research interests, with an increasing focus on their potential applications in T2I generation. As an exemplar T2I model, Stable Diffusion (SD)[25] adopts the Contrastive Language-Image Pre-training (CLIP)[23] Text Encoder for encoding textual information. SD generates a Gaussian noise matrix, employing a random function as a \u201csubstitute\u201d for the Latent Feature. This matrix is then fed into the \u201cimage optimization module\u201d of the SD model, featuring a U-Net [26] network. The U-Net network is tasked with predicting noise while simultaneously integrating semantic information from the textual input. The Scheduler refines the noise predicted by the U-Net at each iteration. Finally, this refined information undergoes processing in the Variational AutoEncoder (VAE) [15] Decoder, culminating in the generation of the final image. This paradigmatic shift in image generation models underscores the dynamic nature of the field, spurred by the adoption of foundation models and the continuous pursuit of enhanced capabilities. Dreambooth [27] is realized through SD fine-tuning, employing a minimal input of several images (typically three or four images) to generate corresponding images under various prompts. Diverging from the SD fine-tuning approach, Textual Inversion [6] operates with a reduced set of images, generating and training images with a similar style by specifying new keywords. SVDiff [9] presents a lighter-weight diffused fine-tuning model designed to mitigate the risks of overfitting and language drift simultaneously. In contrast, Custom Diffusion [16] optimizes solely the parameters in the cross-attention layers of the T2I diffusion model. This targeted optimization facilitates the efficient learning of new concepts, surpassing DreamBooth and Textual Inversion models in terms of image generation performance. Notably, Custom Diffusion achieves this while minimizing memory overhead and enhancing inference efficiency. 2.2. Adversarial attack The emergence of the Fast Gradient Sign Method (FGSM) [8] has led researchers in the field of machine learning to focus a significant portion of their attention on adversarial attacks. Its idea is to add the computed loss value to the input image, causing an increase in the loss value of the network\u2019s output and ultimately leading to incorrect model predictions. This has also spurred the development of other similar methods [13, 17, 21, 30, 34, 36]. BIM [17], through multiple iterations, introduces small perturbations along the direction of increasing gradients, resulting in more accurate perturbations compared to FGSM. Among them, Projected Gradient Descent (PGD) [21] deserves special attention. Unlike the fast attack method of FGSM that operates with a single iteration, PGD is an iterative attack method. It generates stronger adversarial samples by performing multiple iterations, allowing it to bypass certain defense mechanisms. 2.3. User safeguarding through image cloaking Image cloaking is a widely researched field due to its importance in maintaining privacy and preventing misuse of images. Pixelization and blurring are commonly used techniques for hiding personal information such as faces and license plates. With the continuous development of the T2I model, people are paying attention to its remarkable image generation capabilities while also being wary of the potential risks of its misuse. Therefore, when faced with malicious attacks on images, we should take measures to prevent their success. For T2I, our goal is to introduce imperceptible perturbations into pre-existing images before their release. Once these images are reused, the model will generate images with negative effects. [4, 20, 29, 31, 35] attempt to prevent images from being edited or exploited. Similar to our objective, Anti-DreamBooth [32] and Mist [18] aim to disrupt the generative modeling quality by adding subtle perturbations to images. Our work differs from their method of adding perturbations to images while keeping the parameters unchanged. In our approach, we train and update the parameters of the cross-attention layers of the model. By updating these parameters, we introduce perturbations to the image. 3. Method Figure 3 illustrates an overview of our CAAT approach that leverages PGD training on cross-attention layer to effectively attack LDMs. We introduce the principles of diffusion models and adversarial attacks in Sec. 3.1 and \fFigure 3. Schematic of CAAT attacking a T2I diffusion model. During attacker training, first, WK and WV of the cross-attention layer are optimized. Then, the perturbation \u03b4 is optimized based on the gradient of x, yielding perturbed image x + \u03b4. Sec. 3.2. Furthermore, CAAT is proposed in detail in Sec. 3.3. 3.1. Diffusion models In the current field of Text-to-Image (T2I), diffusion models have established themselves as the reigning champions, capable of generating diverse and realistic images. Diffusion models include two processes: a forward process and a backward process. The forward process gradually introduces noise into the input image until the data distribution becomes pure Gaussian noise, while the backward process learns in reverse, extracting the desired data from random noise. Given the input image x0 \u223cq(x), forward process injects noise into x0 over T steps, resulting in a Markov chain x1, x2, x3, ..., xT , each xt satisfies: x _{t}= \\ s q r t {\\alpha _t}x_{0}+\\sqrt {1-\\alpha _t}\\epsilon , \\label {eq:eq_DM_forward} (1) where \u03f5 \u223cN(0, I) and \u03b1t is obtained by a noise scheduler. Given noise image xt in time t, backward process learn to denoise the noise image to obtain xt\u22121. The training objective of diffusion models can be expressed succinctly as follows: \\mat hca l {L}_{DM} ( \\theta ,x_{0})=\\mathbb {E}_{x_{0},t,\\epsilon }\\|\\epsilon -\\epsilon _{\\theta }(x_{t},t)\\| , \\label {eq:eq_DM} (2) where \u03f5\u03b8 is a parametric neural network. The prompt-based diffusion models, such as LDMs, have an additional prompt c to generate images that better match the text description. After undergoing encoding processing, the prompt c is mapped to the intermediate layers in the U-Net of LDMs through the introduction of cross-attention layers, achieving the mapping from text to images: \\math cal {L}_{LDM}(\\ t heta , x_ {0})=\\mathbb {E}_{x_{0},t,\\epsilon ,c}\\|\\epsilon -\\epsilon _{\\theta }(x_{t},t,c)\\| . \\label {eq:eq_CDM} (3) 3.2. Adversarial attack Adversarial attack, now prevalent in various domains, represents a sophisticated and pervasive class of attack methods in the contemporary digital landscape. It were initially introduced for targeting classification models whose attacks leverage carefully crafted inputs with the aim of deceiving, misleading, or undermining classification models, thereby compromising their performance or inducing misclassifications. In short, it finds an alternative input x\u2032 for a given input x and its label that causes it not to be classified as its true label which can be formulated by \\b egi n { al igned}x ^{\\p rim e }&: = \\arg \\max _{x^{\\prime }}\\mathcal {L}_\\theta (x^{\\prime }) ,\\\\s.t.&\\quad ||x-x^{\\prime }||\\le \\eta ,\\end {aligned} \\label {eq:adv} (4) where L\u03b8 is a classification network and \u03b7 is a small positive constant, ensuring that x\u2032 does not deviate too far from x. 3.3. CAAT It is critical to analyze the vulnerability of DMs from the perspectives of both effectiveness and efficiency. CAAT is proposed based on this goal and developed upon PGD attack. To prevent the misuse of customized diffusion models, we aim to obtain adversarial examples that, when used as inputs for customized LDMs models, result in the fine-tuned model losing the ability to generate images corresponding to specific themes, thereby disrupting the quality of the T2I generate images. To achieve this, we introduce a perturbation \u03b4 into the input image x, which is visually imperceptible controlled by \u03b7, making it impossible for the model to learn useful information during training. The overall objective of CAAT can be formulated by \\ beg in { aligned } \\ del ta &: =\\a r g \\max _\\delta \\mathcal {L}_{LDM}(\\theta ,x+\\delta ),\\\\&\\quad \\text {where}~\\|\\delta \\|\\leq \\eta .\\end {aligned} \\label {eq:adv_DM} (5) A classic and practical adversarial attack method is the PGD attack, which is applied to Anti-DreamBooth and Mist. PGD is applied to a trained model, obtaining gradients during the attack process without updating model parameters. Different from this convention, we optimize LDMs during the CAAT training. By this means, LDMs is trained on adversarial examples x + \u03b4 to enhance its robustness. Simultaneously, adversarial examples are applied to a more robust LDMs, leading to the generation of adversarial examples with improved attack effectiveness. The LDMs training process of CAAT can be formulated by \\ beg in { aligned } \\ the ta &: =\\a r g \\min _\\theta \\mathcal {L}_{LDM}(\\theta ,x+\\delta ),\\\\&\\quad \\text {where}~\\|\\delta \\|\\leq \\eta .\\end {aligned} \\label {eq:adv_DM} (6) We leverage the observations and best practices in Custom Diffusion [16] to analyze and select the layers for efficient attack. During the fine-tuning of diffusion models, cross-attention layers have the fewest parameters but undergo the most changes. This observation indicates crossattention layer plays a significant role in model optimization \fTable 1. Effectiveness assessment with four evaluation metrics by comparing different attackers on different T2I diffusion models. Bold is the best score and underlining is the second-best score. CAAT achieved 12 best and 3 second-best out of 16 metrics, demonstrating its superior attack effectiveness. The abbreviation for \u201cAnti-dreambooth\u201d is denoted as \u201cAnti\u201d. T2I diffusion models attack Custom Diffusion DreamBooth SVDiff Textual Inversion FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 clean 1.00 0.52 0.47 195 0.98 0.52 0.53 179 0.99 0.57 0.68 218 1.00 0.47 0.27 242 Anti 1.00 0.48 0.21 207 0.81 0.40 0.16 307 0.94 0.38 0.46 308 0.50 0.15 -0.92 378 Mist 1.00 0.39 0.03 233 0.99 0.32 0.13 275 0.88 0.21 -0.12 317 0.63 0.14 -0.85 348 CAAT 1.00 0.42 -0.36 250 0.64 0.32 -0.14 371 0.85 0.34 0.29 355 0.43 0.14 -1.30 396 Table 2. Effectiveness analysis across varying noise budgets for CAAT on selected T2I diffusion models, where \u201c*\u201d denotes the default budget setting. T2I diffusion models \u03b7 Custom Diffusion DreamBooth SVDiff Textual Inversion FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 0.05 1.0 0.45 -0.27 225 0.95 0.44 0.44 251 0.98 0.44 0.51 307 0.83 0.34 -0.17 302 *0.10 1.0 0.42 -0.36 250 0.64 0.32 -0.14 371 0.85 0.34 0.29 355 0.51 0.14 -1.30 396 0.15 0.95 0.38 -0.24 284 0.34 0.28 -0.58 401 0.76 0.29 0.15 390 0.50 0.09 -0.90 405 during the training process. Conventional attention between images and texts can be formulated as follows: \\mathrm {A tt e n t ion}(Q, K,V) = \\ m a thrm {softmax}\\left (\\frac {QK^T}{\\sqrt {d}}\\right )\\cdot V, \\label {eq:coss-atten} (7) where Q = WQf, K = WKc, V = WV c. Here, f \u2208 R(h\u00d7w)\u00d7l is image features, c \u2208Rs\u00d7d is features of prompt and WQ, WK, and WV are learnable matrices that respectively map the input to query, key and value. WQ processes the image input features, while WK and WV handle the text input features. Disrupting the learning of WK and WV can undermine the mapping between text and images in customized fine-tuned diffusion models. After this undermining, the model is capable of recognizing or acknowledging the content or subject of the image, but it lacks the ability to categorize or classify it into specific groups or types. Therefore, we update the parameters WK and WV of crossattention layers. In summary, during the CAAT process, we freeze the model parameters other than WK and WV and only update them to facilitate the learning of the mapping between text input and image input by the model. Simultaneously, we search for a perturbation \u03b4 in images x that causes the model to lose the aforementioned capabilities. (The reasons for choosing to simultaneously update parameters and add noise are discussed in detail in Supplementary Material D). The search process is implemented by calculating the gradients for x and performing gradient ascent. The algorithm is introduced in Algorithm 1. Algorithm 1 CAAT Input: Images x, K layers parameter WK, V layers parameter WV , step length \u03b1, limitation \u03b7, steps number N, LDMs learning rate l Output: Perturbed images x\u2032 1: Initialize \u03b4 2: for i = 1 \u2192N do 3: \u2207K, \u2207V , \u2207x \u2190LLDM((WK, WV ), x + \u03b4) 4: WK \u2190WK \u2212l\u2207K 5: WV \u2190WV \u2212l\u2207V 6: \u03b4 \u2190\u03b4 + \u03b1sgn\u2207x \\triangleright \u2207x is from the input images. 7: if ||\u03b4|| > \u03b7 then 8: \u03b4 \u2190clip(\u03b4, \u2212\u03b7, \u03b7) \\triangleright limit ||\u03b4|| within [0, \u03b7] 9: end if 10: end for 11: x\u2032 \u2190x + \u03b4 12: return x\u2032 4. Experiments In this section, we valuate the effectiveness of CAAT on customized LDMs through experiments. Specifically, we compare CAAT with other attack methods across various DMs to evaluate the effectiveness, generalization, and efficiency of CAAT. 4.1. Experimental setup Datasets. To justify our proposed CAAT attacker, the testing datasets should comply the following criteria: 1) an ample supply of face images, 2) categorized based on individuals, and 3) high-quality images with high resolution. In accordance with these criteria and taking inspiration \fTable 3. Effectiveness evaluation across different LDMs versions on different T2I diffusion models. CAAT is trained on SD v2.1. version attack T2I diffusion models Custom Diffusion DreamBooth SVDiff Textual Inversion FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 v1.4 clean 0.97 0.53 0.21 224 0.96 0.47 0.50 197 0.93 0.50 0.23 248 0.97 0.41 0.17 248 CAAT 0.79 0.45 -0.24 313 0.65 0.27 -0.34 350 0.16 0.25 -1.57 447 0.15 0.07 -1.94 501 v1.5 clean 0.96 0.54 0.27 217 0.97 0.46 0.41 199 0.97 0.52 0.26 233 0.90 0.41 -0.07 259 CAAT 0.88 0.46 -0.03 284 0.49 0.31 -0.50 364 0.12 0.24 -1.41 425 0.31 0.09 -1.48 441 Table 4. Effectiveness assessment by varying the number of perturbed images. The results demonstrate the proportion of perturbed images obtained by CAAT that affect the image quality of the T2I diffusion models, considering four input images. Clean Perturbed T2I diffusion models Custom Diffusion DreamBooth SVDiff Textual Inversion FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 FR \u2193 FS \u2193 IR \u2193 FID \u2191 4 0 1.00 0.52 0.47 195 0.98 0.52 0.53 179 0.99 0.57 0.68 218 1.00 0.47 0.27 242 3 1 1.00 0.50 0.16 202 0.97 0.50 0.53 197 0.98 0.53 0.61 234 1.00 0.44 0.24 252 2 2 1.00 0.47 0.09 207 0.91 0.50 0.26 249 0.94 0.47 0.60 247 0.88 0.37 -0.06 281 1 3 1.00 0.45 -0.15 228 0.76 0.44 0.10 301 0.93 0.39 0.48 294 0.71 0.24 -0.44 314 0 4 1.00 0.42 -0.36 250 0.64 0.32 -0.14 371 0.85 0.34 0.29 355 0.43 0.14 -1.30 396 from Anti-DreamBooth, we select the face datasets CelebAHQ [14]. CelebA-HQ is the high-resolution version of CelebA [19], which includes 10,177 unique celebrity identities and 202,599 face images. CelebA-HQ, on the other hand, contains over 30,000 high-resolution (1024 \u00d7 1024) face images from more than 1,000 different celebrities. For our evaluation, we utilize a subset [3] of CelebA-HQ with 307 subjects that have been properly categorized. Data Preprocessing. Due to the extensive comparative content, we opt to use 10 subjects from this subset as our experimental subjects, ensuring diversity in terms of gender, ethnicity, and age. For each subject, four photos are selected and processed into 512 \u00d7 512 resolution. Comparative attackers. We compare CAAT with other attackers that are also applied in DMs, including AntiDreamBooth (aspl) and Mist, which aims to protect users\u2019 portrait rights. In particular, to ensure fairness, the same four images are used as both the training and attacked images for Anti-DreamBooth (aspl). CAAT is compared with these two existing methods to evaluate their strengths and weaknesses. Attacked model selection. For customized fine-tuned models based on LDMs, four practical and popular ones, including Text Inversion, DreamBooth, Custom Diffusion, and SVDiff, are selected as the target models to achieve the adversarial examples through the attackers. This selection exhibits diversity and state-of-the-art performance. Successfully performing attacking on them can demonstrate that our CAAT can be effective on all LDMs-based finetuned models. Additionally, we compare the effectiveness of the attack on the variants of stable diffusion. Evaluation metrics. The quality of the generated face images is evaluated using the face detection and recognition model provided by InsightFace [12]. All the generated images are subjected to face detection to obtain the success rate of face detection called Face Detection Success Rate (FR). For the generated images with detected faces, the average face similarity with four clean images is calculated, which is called Face Similarity (FS). FS takes values in the range of [0, 1], indicating the quality of generated images. Higher FS values signify lower face similarity and better attack effect. Moreover, ImageReward (IR) [33] is employed to compute the T2I generated image quality. It requires prompts corresponding to generated images, and evaluates the quality of images generated based on the prompts. Lower IR values signify lower image quality and better attack effect. Finally, we use Fr\u00b4 echet Inception Distance (FID) [10] to measure the similarity between generated images and clean images. Higher FID indicates that the generated images are farther from clean images, signifying better attack effect. Training setup. We exclusively train CAAT on the WK and WV of cross-attention layers, using a batch size of 1 and a learning rate of 1 \u00d7 10\u22125 for 250 training steps. Mixed precision with bf16 is employed. The attack prompt provided is \u201ca photo of a person\u201d. By default, we use the latest Stable Diffusion (v2.1) as the pretrained generator and set \u03b1 to 5 \u00d7 10\u22123 for CAAT, along with \u03b7 = 0.1. Training CAAT with 500 steps on an NVIDIA RTX3090 takes approximately 2 minutes. We also summarize the hyperparameters for other attackers in Tab. A1 and DMs in Tab. A2, all of which are set to default values. 4.2. T2I generation First, the clean images are input into CAAT, AntiDreamBooth, and Mist to obtain perturbed images (adver\fFigure 4. Comparison in the images generated by different T2I diffusion models with different attackers. The first column illustrates the four input images. For attackers by row, the observation of the perturbation pattern can refer to Fig. 5. For diffusion models by column, four models are selected and compared to evaluate the performance of attackers. sarial examples). Next, both the perturbed images and clean images undergo customized fine-tuning with Custom Diffusion, DreamBooth, SVDiff, and Textual Inversion. After the fine-tuning process, we generate 16 images with the prompt \u201ca photo of a person\u201d using Stable Diffusion (v2.1). The experimental results are presented in Tab. 1, while visual representations of some results are shown in Fig. 4. As observed, CAAT successfully attacks all the models, yielding the best results for DreamBooth, Textual Inversion, and Custom Diffusion, and the second-best result for SVDiff. Although CAAT may not achieve optimal results across all evaluation metrics, the obtained values are already very low and visually imperceptible. Furthermore, both AntiDreamBooth and Mist exhibit poor attack results on Custom Diffusion, underscoring CAAT\u2019s superior generalization capability. Additionally, while Mist achieves decent results, its added perturbation is more visually discernible, as evident in Fig. 5. Moreover, we conducted additional experiments in Supplementary Material B with different prompts and subjects. 4.3. Computational overhead We conducted analysis on computational overhead. The experiments were carried out by comparing CAAT, Mist, and Anti-DreamBooth under the same training setting. Figure 6 demonstrates our outstanding performance in terms of time efficiency. Training time of our method CAAT is about 2 minutes and 30 seconds on an NVIDIA RTX3090, compared to about 5 minutes and 30 seconds for AntiDreamBooth and about 5 minutes for Mist on same GPU. \fFigure 5. Adversarial examples of different attacker after adding noise. The parameter configurations of Anti-DreamBooth and Mist follow the default settings in Tab. A1. Figure 6. The training time of the attackers under the default settings of CAAT, Mist, and Anti-DreamBooth (Anti). CAAT is approximately twice faster than the other two. More importantly, CAAT does not require prior class images, but Anti-DreamBooth requires 200 images by default, which indicates that CAAT saves more cost. 4.4. Ablation study We conduct ablation study to analyze the effect of CAAT. The experiments are carried by varying perturbation budgets, T2I diffusion models, and the quantity of perturbed images. Perturbation budgets. We study the impact of different perturbation strengths when applying CAAT on the quality of T2I images. In our previous experiments, we set \u03b7 = 0.10, and now explore the effects of \u03b7 = 0.05 and \u03b7 = 0.15. The results are presented in Tab. 2. It can be observed that a larger \u03b7 leads to poorer T2I image quality, but excessively high \u03b7 settings introduce visually perceptible noise in the adversarial samples. Fig. 5 visually presents perturbed images generated by different attack methods. When using the default settings \u03b7 = 0.10, CAAT demonstrates superior attack effectiveness (as Tab. 1), with a level of noise similar to Anti-DreamBooth and less noise compared to Mist. However, when \u03b7 = 0.15, the perturbed images exhibit excessive noise. T2I diffusion model variants. It is essential to conduct the performance of the adversarial examples generated by CAAT on different versions of T2I diffusion models. In previous experiments, we apply CAAT on Stable Diffusion v2.1 for both the attack and T2I image generation. Additionally, we conducted experiments to assess the performance of CAAT\u2019s samples on Stable Diffusion v1.4 and v1.5, as shown in Tab. 3. CAAT demonstrates robust performance across different versions of Stable Diffusion, highlighting its strong generalization capabilities. Quantity of perturbed images. To simulate real-world scenarios where malicious attackers may obtain some clean images, we examine the impact of different proportions of perturbed images in the case of four input images. As indicated in Tab. 4, the results demonstrate that more disturbed images lead to a more effective attack. CAAT consistently exhibits a robust attack effect, particularly with two or more perturbed images, whereas the impact is less pronounced with one or fewer perturbed images. 4.5. Robustness of CAAT In real-world usage scenarios, images are easy to distortion, such as lossy compression or deformation. To verify if CAAT can handle complex real-world situations, we applied a variety of image perturbation methods in Supplementary Material C to demonstrate the robustness of CAAT. 5."
|
| 18 |
+
}
|
abs_9K/validation_abstract_short_2404.15104v2.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.15104v2",
|
| 3 |
+
"title": "Identifying Fairness Issues in Automatically Generated Testing Content",
|
| 4 |
+
"abstract": "Natural language generation tools are powerful and effective for generating\ncontent. However, language models are known to display bias and fairness\nissues, making them impractical to deploy for many use cases. We here focus on\nhow fairness issues impact automatically generated test content, which can have\nstringent requirements to ensure the test measures only what it was intended to\nmeasure. Specifically, we review test content generated for a large-scale\nstandardized English proficiency test with the goal of identifying content that\nonly pertains to a certain subset of the test population as well as content\nthat has the potential to be upsetting or distracting to some test takers.\nIssues like these could inadvertently impact a test taker's score and thus\nshould be avoided. This kind of content does not reflect the more\ncommonly-acknowledged biases, making it challenging even for modern models that\ncontain safeguards. We build a dataset of 601 generated texts annotated for\nfairness and explore a variety of methods for classification: fine-tuning,\ntopic-based classification, and prompting, including few-shot and\nself-correcting prompts. We find that combining prompt self-correction and\nfew-shot learning performs best, yielding an F1 score of 0.79 on our held-out\ntest set, while much smaller BERT- and topic-based models have competitive\nperformance on out-of-domain data.",
|
| 5 |
+
"authors": "Kevin Stowe, Benny Longwill, Alyssa Francis, Tatsuya Aoyama, Debanjan Ghosh, Swapna Somasundaran",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-05-01",
|
| 8 |
+
"primary_cat": "cs.CL",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.CL",
|
| 11 |
+
"I.2.7"
|
| 12 |
+
],
|
| 13 |
+
"label": "Original Paper",
|
| 14 |
+
"paper_cat": "LLM Fairness",
|
| 15 |
+
"gt": "Natural language generation tools are powerful and effective for generating\ncontent. However, language models are known to display bias and fairness\nissues, making them impractical to deploy for many use cases. We here focus on\nhow fairness issues impact automatically generated test content, which can have\nstringent requirements to ensure the test measures only what it was intended to\nmeasure. Specifically, we review test content generated for a large-scale\nstandardized English proficiency test with the goal of identifying content that\nonly pertains to a certain subset of the test population as well as content\nthat has the potential to be upsetting or distracting to some test takers.\nIssues like these could inadvertently impact a test taker's score and thus\nshould be avoided. This kind of content does not reflect the more\ncommonly-acknowledged biases, making it challenging even for modern models that\ncontain safeguards. We build a dataset of 601 generated texts annotated for\nfairness and explore a variety of methods for classification: fine-tuning,\ntopic-based classification, and prompting, including few-shot and\nself-correcting prompts. We find that combining prompt self-correction and\nfew-shot learning performs best, yielding an F1 score of 0.79 on our held-out\ntest set, while much smaller BERT- and topic-based models have competitive\nperformance on out-of-domain data.",
|
| 16 |
+
"main_content": "Introduction Large language models (LLMs) have become ubiquitous in the space of natural language generation (NLG) due to recent advances in model capability (Minaee et al., 2024). However, these improvements come with the potential for various negative societal impacts. These negative impacts include \u2217 * Work done while at ETS 1Code and dataset available at https:// github.com/EducationalTestingService/ fairness-detection. Q: You went to one of The Eras Tour shows, didn\u2019t you? Is \u201cYes\u2014I love Taylor Swift!\u201d the right answer? Who is that? (A) (B) Q: You went to the music concert, didn\u2019t you? Ah, I see the correct answer: \u201cYes\u2014it was a great performance!\u201d Figure 1: In (A), the generated question requires knowledge of what The Eras Tour is to identify the correct answer. Even native English speakers would likely not be able to identify the correct response if they were not familiar with Taylor Swift. In (B), the generated question does not require specific background knowledge, so test takers would not need to use specialized knowledge to identify the correct answer. Our goal is to identify and filter content like (A) to help ensure fair testing. the generation of misinformation/propaganda, allocation harms of systems providing benefits only to certain groups of people, and representational harms revolving around bias and stereotyping. Natural language processing (NLP) models\u2013including LLMs\u2013are known to reflect and repeat harmful biases and stereotypes (Hosseini et al., 2023; Bender et al., 2021; Hovy and Prabhumoye, 2021; Nadeem et al., 2021), and research into how the community addresses the societal harms engendered by NLP technology is critical (Wang et al., 2024; Dev et al., 2022; Blodgett et al., 2020). Many of these types of bias in language generation are well-studied. Biases based on gender (Nemani et al., 2024; Devinney et al., 2022; Strengers et al., 2020; Wan et al., 2023), race (Das and Balke, 2022; Field et al., 2021), nationality (Venkit et al., 2023), and disability (Venkit et al., 2022) have been identified in language models, and many modern LLMs incorporate deliberate safeguarding measures in an attempt to alleviate these arXiv:2404.15104v2 [cs.CL] 1 May 2024 \fissues (OpenAI et al., 2023; Anil et al., 2023). In the area of language assessment, there exists a tangential set of issues regarding fairness to test takers and score users (Educational Testing Service, 2022). These issues are particularly dangerous when applied to language learning and assessment; tests with inherent biases have the potential to compromise the validity of the test. Therefore, content that is irrelevant to the skills and abilities the test is intended to measure should be avoided (Figure 1). This includes content that could disadvantage anyone based on their culture, location, or experiences (e.g., focusing on barbeques on the 4th of July could disadvantage test-takers who are unfamiliar with U.S. culture); their emotions (e.g., health hazards and diseases can evoke negative emotional responses among some people); their worldviews (e.g., luxury cruises or designer clothing may make some people feel excluded); and other factors. We refer to these types of issues as fairness issues. Knowing how to better understand, detect, and mitigate bias related to fairness in NLG not only raises awareness of the issue but also enables researchers and developers to create more fair and inclusive NLP systems, evaluation metrics, and datasets in the language assessment space. Our goal is to build a system for identifying fairness-violating content in automatically generated texts. It is of course still necessary to have human review and revision of the content, but by adding a filtering process after generation and before manual review, we can significantly reduce the time taken for reviewing and the chance that fairness-related content is mistakenly allowed. To accomplish this goal, we explore four different approaches: fine-tuning, topic-based classification, few-shot prompting, and prompt-self correction. Our methods need to adapt to new contexts: our definition of fairness is operationally defined by the particular testing context, and may not apply to others, so the guidelines, prompts, and models may not apply generally to new contexts. For this reason, we assess our methods on two held-out test sets and analyze how our methods could be applied to new contexts. We release our resulting dataset, consisting of 620 samples, of which 19.4% contain fairness issues2, to facilitate improvements in the fairness-detection community. 2Each sample we used was rejected for deployment in actual tests. Using rejected samples for our experiments allows us to release the dataset: accepted stimuli cannot be made public. Our contribution consists of the following: 1. We define a new fairness problem around issues faced in developing fair testing content. 2. We release a dataset of 601 samples for use in evaluating fairness detection methods. 3. We analyze the relative effectiveness of a variety of well-known classification techniques. 4. We provide a new mechanism for prompting self-correction, which yields significant improvements over other prompting strategies. We start with data collection and analysis. We collect 620 samples over seven different types of content generated using LLM prompting. We annotate each sample and assess whether it contains a fairness issue, and if it does, whether that fairness issue pertains to knowledge, skill, or expertise or emotion (more on these categories and how they relate to fairness in Section 3). We then use this dataset to experiment with a series of models for classifying fairness issues. We show that fine-tuning and filtering by topic can be cheap and effective options, although prompting strategies with GPT4 tend to be more effective. Few-shot prompting along with selfcorrecting prompt strategies yield strong performance with relatively little data, and combining both yields the best results on our in-domain test set, with an F1 score of .773. Interestingly, using a shorter, more generic prompt combined with our self-correction method yields the best result on our out-of-domain test set, with an F1 score of .462. 2 Related Work Bias, fairness, and responsible AI has been at the forefront of education technology, with contemporary research focusing on automated scoring, writing assistance, and other nuances of applying NLP technology to this sensitive domain (Mayfield et al., 2019; Loukina et al., 2019). Baffour et al. (2023) find that assisted writing tools may exhibit moderate bias depending on the task, while Wambsganss et al. (2023) found no significant gender bias difference in writing done with and without automated assistance. Wambsganss et al. (2022) explore bias in educational tools for German peer review, and Kwako et al. (2023, 2022) propose novel methods for detecting bias in automated scoring algorithms. We are specifically interested in applications to language generation, and there is also substantial \fwork in using LLMs and other NLP technology to generate content for educational assessments (Laverghetta Jr. and Licato, 2023; Gonzalez et al., 2023; Heck and Meurers, 2023; Uto et al., 2023; Tack et al., 2023; Stowe et al., 2022). However, this work largely fails to address bias and fairness issues in content generation. Our work is specifically focused on fairness issues in automatically generated language testing content. In the context of language models, fairness and bias have emerged as critical concerns. Existing detection and mitigation tools generally diverge from our work: some are overly domain-specific like the focus on news articles in Raza et al. (2024), while others are focused on assessing issues within the language models and datasets (Bellamy et al., 2018), rather than the outputs. Other works rely on retrospective metrics that assess a model\u2019s fairness through aggregated predictions and subgroup analysis, and/or focus on classification rather than generation problems (Weerts et al., 2023; Wi\u00b4 sniewski and Biecek, 2022; Saleiro et al., 2019). Although these tools enhance transparency and accountability for evaluating language model issues, they fundamentally differ from our bias detection approach tailored for evaluating generated text in real-time for a production environment. 3 Problem Motivation In the language testing context, we face a unique set of fairness challenges in generating content. Specifically, fair testing requires content that does not contain irrelevant factors that negatively impact the assessment of a test taker. A primary concern is to ensure that the test content measures only what it is intended to measure. For English-language proficiency tests, this means that the test must measure only the skills and abilities needed to communicate effectively in English, and not other constructs such as background knowledge of specific jobs, events, or cultures. Consider the following question and an example of a response to that question: \u2022 Question: You went to one of The Eras Tour shows, didn\u2019t you? \u2022 Response: Yes\u2013I love Taylor Swift! If the task were to identify whether the response is an appropriate response to the question, even some native English speakers would likely get it wrong. This is because, in addition to needing to know features of English proficiency (in this case, the ability to infer gist, purpose, and basic context based on information stated in short spoken texts), one would also need to know about Taylor Swift and her concert tour. Thus, those familiar with Taylor Swift would have an unfair advantage in identifying the correct answer. Eliminating the fairness issue for this type of question would result in the following revision: \u2022 Question: You went to the music concert, didn\u2019t you? \u2022 Response: Yes\u2013it was a great performance! In addition to avoiding testing outside knowledge, it is also important that language proficiency tests do not include content that is offensive or disturbing. For example, the following question and response refer to serious health issues, which have the potential to evoke deep negative emotions. \u2022 Question: Did you hear that Luis has been hospitalized? \u2022 Response: No, but I knew he had a bad case of Covid-19. Content like this that could prompt strong feelings of anger, sadness, or anxiety should be avoided because it could derail a test taker\u2019s concentration, resulting in lower performance on the test. How a test taker interacts with this test content may tell more about their ability to concentrate under emotional strain than about their ability to identify a response\u2019s linguistic appropriateness. Eliminating this construct-irrelevant content helps to ensure that the test measures only the skills and abilities it is intended to measure. 4 Methods Our goal is to detect whether a generated stimulus contains an issue as a binary classification task. We build a dataset of texts labeled for potential fairness issues and explore potential detection methods. 4.1 Dataset Our goal is to identify and mitigate these fairness issues in testing content. We build a dataset spanning seven different item or task types from standardized English language proficiency tests all generated using GPT4 (OpenAI et al., 2023). Item and task types can contain up to four components: the stimulus (main text the question is based on), stem \fItem/Task Type Total Fairness KSA Emotion Read a Text Aloud 304 55 24 39 Talks 91 12 6 6 Text completion 84 26 11 19 Respond to Questions Using Information Provided 56 10 5 5 *Conversations 41 8 5 4 *Respond to a Written Request 25 7 6 1 Total 601 118 57 74 Table 1: Item/task types and annotations for fairness issues. Each has a binary annotation (fairness issue/no fairness issue) and is tagged as containing a KSA issue or an Emotion issue. Types marked with \u2019*\u2019 are held out for testing as an \"out-of-domain\" dataset, and not used for any training/evaluation. (question asked about the stimulus), key (the correct answer to the stem), and distractors (a set of alternative answers that are incorrect). Fairness issues are possible in all components, but we focus on only the stimuli, which are typically the longest, most feature-rich components of the test content, and thus are most likely to reflect fairness and bias issues. Issues in the stimuli can leak through to other components, making the stimulus the source of the majority of fairness issues. Annotation For each stimulus, we aim to identify whether or not the stimulus contains fairness/bias issues, and if so, what type of issue is present. We start with a dataset of automatically generated stimuli. These stimuli were generated using prompting and different versions of GPT: the prompts were iteratively improved with the goal of improving the overall quality of the stimuli. During this process, each stimulus was evaluated by the test\u2019s content development experts. For this work, the stimuli used were rejected by the reviewers, allowing us to provide them publicly and explore their use for fairness detection. These rejected stimuli typically have the relevant language and structure, so our goal is to identify which of those stimuli were rejected (at least in part) for fairness reasons. We employ content development experts to annotate these samples, yielding a binary classification between non-fairness and fairness-related rejections. However, there are different ways for bias and fairness considerations to impact individual stimuli. To better understand and mitigate these issues, we separated them into two main categories: \u2022 Knowledge, Skill, and Ability (KSA): content that contains construct-irrelevant information that may be unavailable to test takers in different environments or with different experiences and abilities. These include content with reference to specific skills, regionalisms, or unfamiliar contexts. \u2022 Emotion: content in which language, scenarios, or images are likely to cause strong emotions that may interfere with the ability of some groups of test takers to respond. These include offensive, controversial, upsetting, or overly negative content. Each sample that is flagged for fairness is annotated for one or both of these categories. This allows further analysis to address these specific fairness categories and to better understand the impact of specific fairness issues. Our dataset is comprised of stimuli from seven different item and task types: a summary of the collected data is shown in Table 1, with examples for each type in Appendix A. These stimuli represent various structures, depending on the item/task type: Read a Text Aloud, Talks, and Text Completion stimuli are short text paragraphs, while Conversation stimuli involve turns between two or more speakers. Respond to Questions Using Information Provided and Respond to a Written Request task stimuli are structured content: the generation process creates text that is filled into a structured template; we use only the raw text. Overall we collect 601 samples, of which 19.6% exhibit evidence of fairness issues, with 9.5% reflecting KSA issues and 12.3% Emotion issues. We build a validation set of 48 samples reflecting a balance of the item and task types from the training types (Read a Text Aloud, Talks, Text Completion, and Respond to Questions Using Information Provided), and an equal-sized \"in-domain\" dataset from these stimuli is held separately for testing. These datasets contain an even number of positive and negative classes for fairness evaluations. As our goal is to be able to identify positive cases where fairness issues exist, we intend for our validation and test sets to have a substantial number of this class. We use the two remaining types (Conversations, Respond to a Written Request) as a separate \"out-of-domain\" test set to evaluate performance on unseen content. \f4.2 Experiments We experiment with standard transformer-based classification baselines, topic detection, and a variety of GPT4-based prompting, including methods for automatic prompt-self correction. We describe each method below: each is tuned on the validation set, and we report the best model performance on that set. We then evaluate model performance on two separate test sets in Section 5. Classification with Fine-Tuning We fine-tune standard pre-trained transformer models for sequence classification. We experiment with bert-base-cased, bert-large-cased (Devlin et al., 2019), roberta-base, (Liu et al., 2019) and deberta-base (He et al., 2021) models. We perform a hyperparameter search on our validation set for each model, finding that a learning rate of 2e-5 over 2-4 epochs generally performs best, and report results using the model with the best performance. Topic-Based Filtering We observe that many samples are flagged for fairness due to the topic of the material: many topics contain content that violates our fairness guidelines directly, while others are simply more likely to include unacceptable content. Motivated by this, we explore topic detection as a method for identifying fairness issues. We first identify topics found within the data. We use the topic modeling framework BERTopic (Grootendorst, 2022) to extract topic representations from two sources of training data: (1) all samples from the training partition of our dataset and (2) our fairness guidelines. In this method, SentBERT (Reimers and Gurevych, 2019) converts each training document into a dense vector representation which are then grouped by semantic similarity, creating clusters that represent different topics. For each of the two training sets, topic descriptions made up of the most important words in a cluster are generated for the clusters containing at least five supporting documents. We manually assess each topic description for themes that should be avoided based on their relation to known fairness issues and which topics are acceptable. Finally, for each unseen sample in test and validation datasets, we make predictions based on the single nearest topic cluster. If a sample falls within the boundaries of restricted topics, it is classified as a violation. Results for these methods are shown in Table 2. The fine-tuned bert-based models perform fairly Fine-tuning Model Prec Rec F1 bert-base-cased 1.00 0.29 0.45 bert-large-cased 0.92 0.50 0.65 roberta-base 0.92 0.50 0.65 deberta-base 1.00 0.63 0.77 Topic-based Filtering Model Prec Rec F1 Topic-data 0.79 0.46 0.58 Topic-guidelines 1.00 0.04 0.10 Table 2: Results for fine-tuning (above) and topic detection (below) on the validation set. well, with F1 scores for bert-large-cased and roberta-base both around 0.65, and deberta-base showing exceptional performance with an F1 score of 0.77. The Topic-Based Filtering models are worse, with the data-based system yielding an F1 score of 0.58. In all cases, precision is much higher than recall; these models are conservative with predictions. 4.3 Prompting We initially experiment with five different \u201cbase\u201d prompts. We pair these with stimuli and use GPT4 to return \u201cTrue\u201d if the stimulus contains a fairness issue and \u201cFalse\u201d otherwise. These prompts represent different strategies3: \u2022 GENERIC (SHORT) 53 tokens: Drawing from general knowledge of fairness and bias in LLMs, we write a generic prompt designed to combat attested LLM biases. This prompt is designed as a weak baseline. Our goal is to determine if a short, simple prompt can capture relevant issues, and whether or not it can be easily improved via self-correction or few-shot learning (Sections 4.3 and 4.3) \u2022 GENERIC (LONG) 191 tokens: This is a longer, more detailed version of the above, containing nearly 200 tokens. \u2022 GUIDELINE (SHORT) 197 tokens: We craft a prompt based on guidelines for writing fair assessments. Using documentation that defines what constitutes fair assessment items and how to write them, we build a prompt capturing the important components of a fair question. The goal of this prompt is to determine whether human-written guidelines based on theoretical issues will accurately capture these issues in real data. 3Prompts in Appendix B. \f\u2022 GUIDELINE (LONG) 1081 tokens: We construct a \u201clong\u201d version of the previous guidelines by summarizing the entire fairness guidelines with the help of GPT4, asking for concise versions of relevant sections and combining them into a document that fully captures all the relevant aspects of the guidelines. This prompt is our longest, but still fully based on documentation. The goal of this prompt is to determine the efficacy of a longer, more comprehensive prompt. \u2022 DATA-DRIVEN 142 tokens: We craft a prompt based on annotations in our data. We identify which topics and language cause fairness issues and build the prompt to reflect how they might generalize to unseen item/task types and topics. This method is hypothesized to be the most effective, as it will address known issues in the data but may not extend to unseen data, as it is built specifically around the given training samples. These prompts are run through GPT4 via the Azure interface (OpenAI et al., 2023). Each prompt was updated manually to correct obvious potential issues. Our goal here is not to overoptimize prompt writing, which could lead to overfitting the validation set, but rather to develop a generic prompt likely to be effective for both known fairness issues and novel issues possible in generated content. Initial experiments on the validation set revealed two insights: the GENERIC (LONG) prompt performs similarly to the GENERIC (SHORT) in all cases, and the GUIDELINE (LONG) prompt is ineffective. We therefore focus our efforts on the three other prompts: GENERIC (SHORT) GUIDELINE (SHORT) and DATA-DRIVEN. A primary issue in identifying the fairness issues we are concerned with is that they are only applicable in the context of certain testing environments. The guidelines and data we use are specific to a certain test; for other tests, other environments, and other contexts, different definitions of fairness and different alignments will be applicable. For this reason, the ability to adapt to new environments is critical in applying fairness constraints. We aim to build a system that can learn to adapt to new guidelines with minimal information. We explore several methods to improve the robustness of prompting: few-shot prompting and self-correcting prompting techniques. Few-Shot Prompting We follow few-shot prompting strategies that have been successful for LLM classification tasks (Logan IV et al., 2022; Brown et al., 2020). For each of our base prompts, we provide a set number n of additional samples for both the positive and negative classes. Each of the samples contains the text of the stimulus along with a brief description of why it does or does not violate our fairness guidelines. Prompt Self-Correction We leverage our annotated data using a prompt self-correction strategy (Figure 2). We start with a base prompt and iterate through a batch of samples from our training data. For each sample, we insert text into the prompt, perform a pass through GPT4, and evaluate the resulting output. If it is correct, we continue. If not, we instruct the LLM to make adjustments to the prompt, either to disallow the sample (when the error is a false negative) or to allow it (when the error is a false positive), using the following prompts: \u2022 Positive sample incorrectly classified as negative: The previous text was classified as not having any fairness issues, returning False. However, it did have an issue. Think about what topics or issues in the text might be unfair. Improve the original fairness instructions by adding or modifying restrictions so to account for this text. \u2022 Negative sample incorrectly classified as positive: The previous text was classified as having a fairness issue, returning True. However, this item has no issue. Think about why this text was classified as unfair. Improve the original fairness instruction to allow this item by removing or revising restrictions. This process is run up to e epochs, or stopped early if accuracy reaches 1 or the predictions are stable. We run over b batches of n samples randomly drawn from the training data, using the best-scoring prompt from the final batch for evaluation.4 Combining Few-Shot and Self-Correction Few-shot and self-correction are inherently complimentary, as the self-correction method returns an optimized prompt and few-shot learning reinforces it by providing in-domain examples. We combine them by concatenating additional few-shot learning samples to the self-correcting prompts. 4For an example of the process, see Appendix C. \fPrompt Training Sample LLM (GPT4) Prediction Incorrect Correct Rewrite prompt Training Data Evaluate Run epoch Return final prompt Finished New prompt Resample Figure 2: Self-correcting prompt strategy. Data is run through the prompt. If the result is correct, we continue; otherwise, we instruct the LLM to correct the prompt. Figure 3: F1 scores on the validation set for each prompting method. Note that for GENERIC (SHORT) the F1 score was 0. Full results in Appendix D. For each of these improvements to prompting, we perform a hyperparameter search over the number of total training/few-shot samples and batch size. We experiment with the GENERIC (SHORT) GUIDELINE (SHORT) and DATA-DRIVEN prompts.5 We hypothesize the GENERIC (SHORT) and GUIDELINE (SHORT) prompts should be able to benefit quickly from adaptive methods, while the DATA-DRIVEN prompt should be nearly optimized, as it is already based on observations from the data. We use the validation set to tune the prompts and parameters to optimize the F1 score for each method. Note that for all prompting strategies, the temperature is set to zero; the prompts should only return True or False. Figure 3 shows the best results on the validation set. We explore each model\u2019s effectiveness on unseen data in Section 5. 5Experiments with the longer guideline-based prompt were unsuccessful: the LLM invariably returns either a commentary on a single testing procedure or rewrites the prompt entirely to handle a single sample. The base generic prompt fails, as the traditional bias and stereotyping issues are less likely to occur in our generated content, and the fairness issues we are concerned with are unlikely to be deemed as problematic out of context. Using a simplified version of our guidelines yields a 0.36 F1 score for identifying fairness issues. The DATA-DRIVEN based on observations in the training data yields much better results (0.70 F1). However, this may not extend well to novel cases, as the prompt is driven purely by our validation data. Few-shot learning displays some interesting properties: we see significant improvements across all three prompts, using three samples. (This yielded the best results across all validation runs). Even the minimal GENERIC (SHORT) prompt rises to over 0.60 F1 with minimal few-shot prompting. We see small improvements over the baseline using prompt self-correction for all three prompts. For the DATA-DRIVEN prompt, results using selfcorrection equal those using few-shot learning. This aligns with previous work showing that language models themselves tend to write better prompts (Fernando et al., 2023): after only a few iterations of self-correction, the DATA-DRIVEN prompt surpasses the performance of a humanwritten prompt, even in cases where the human describes the dataset explicitly. Combining self-correction and few-shot learning yields improvements over base prompts and fewshot prompting alone. This approach yields the best results for all three prompts, with the bestperforming model being the DATA-DRIVEN prompt with self-correction and few-shot learning. This may be due to overfitting, however: the prompt is written to reflect the data. To explore the efficacy of these methods on unseen data, we evaluate them on our two held-out test sets. 5 Test Results The previous experiments describe our attempts to identify the best-performing model for fairness classification on our validation set. Our goal is to develop a system that generalizes. For this, we evaluate the best-performing of the above model types on two held-out test sets: 1. In-domain: The 48 held-out samples drawn from the item/task types used for training. 2. Out-of-domain: All samples (66) from the two held-out types: Conversations, Respond to a Written Request. \fFigure 4: F1 scores on two test sets for each proposed method. Note that for bert-large-cased and GENERIC (SHORT), the scores were 0.00 on the unknown test set. Full results in Appendix E. Figure 4 shows the results on the test set. We evaluate the best-performing models of each type: fine-tuned transformer models, topic-based classification, base prompts, few-shot learning, self-correction, and combining few-shot and selfcorrection. We here note some key facts about model performance on our test set. Best Performance Combining the DATADRIVEN prompt with self-correction and few-shot learning performs the best on the in-domain test. This shows this is the best approach if there is available data and expertise to support hand-crafting a DATA-DRIVEN prompt and running self-correction. On the out-of-domain data, the smaller initial prompts, GENERIC (SHORT) and GUIDELINE (SHORT) both outperform the DATA-DRIVEN prompt, perhaps due to their more generic nature: the DATA-DRIVEN prompt is too specific to this dataset, and understandably doesn\u2019t generalize well. The self-correct+few-shot methodology performs the best in both cases: few-shot learning alone is better than self-correction alone, but the combination is typically the best. Strong Results from Small Models Traditional transformer-based classification performs remarkably well, especially in generalizing to the out-ofdomain data. On the in-domain data, the best performing model deberta-base performs on par with the best base prompting model (0.58 compared to 0.60 F1 score), although this is a significant drop from the validation performance of 0.77, and performs quite poorly on out-of-domain data (0.20), indicating the model may overfit during training. On the out-of-domain data, roberta-base performs nearly as well as the best-performing overall model, just 0.04 behind the GENERIC (SHORT) prompt with self-correction and few-shot learning. If the goal is to quickly and cheaply build a system that is applicable to a wide variety of domains, there appears to be significant value in relying on these relatively small transformer-based classification models. The Topic (data) approach is also competitive on out-of-domain data, and does not even require model training; it lags only slightly behind the roberta-base model. Self-Correction We found significant success in our proposed self-correction mechanism. While it typically does not outperform few-shot learning in isolation, the methods are naturally complementary, and the combination often yields the best-performing model. In examining the models\u2019 self-corrections, we find that when asked to become more restrictive, the model tends to add sentences with new constraints, which nicely reflect the issue that was missed. When asked to become less restrictive, the model tends to add hedges to currently existing constraints. In our experiments, we noted some issues. First, when run using too many samples or batches, the prompts tend to degrade: once the LLM makes an error and returns a prompt that doesn\u2019t match the specifications, the run needs to be aborted. Even when the LLM sticks to the instructions, after many iterations the prompts become unwieldy and selfcontradictory, and performance rapidly declines. We suggest using somewhere between six and 20 total samples for prompt self-correction; it is best to avoid making corrections indefinitely. \fModel Type KSA Emotion Fine-tuned bert-base-cased 0.07 0.57 bert-large-cased 0.00 0.00 roberta-base 0.06 0.56 deberta-base 0.08 0.75 Topic-based Data 0.26 0.59 Guideline-based 0.20 0.06 Base Prompting GENERIC (SHORT) 0.00 0.00 GUIDELINE (SHORT) 0.29 0.09 DATA-DRIVEN 0.47 0.50 Self-correction GENERIC (SHORT) 0.35 0.30 GUIDELINE (SHORT) 0.35 0.27 DATA-DRIVEN 0.47 0.41 Few-shot GENERIC (SHORT) 0.18 0.24 GUIDELINE (SHORT) 0.30 0.24 DATA-DRIVEN 0.36 0.56 Few-shot + Self-correction GENERIC (SHORT) 0.18 0.21 GUIDELINE (SHORT) 0.23 0.21 DATA-DRIVEN 0.24 0.59 Table 3: Recall scores for KSA and Emotion-labeled data across both test sets. Use-Cases and Metrics We here report F1 score as a balance between precision and recall. (For full scores, see Appendix E.) Depending on the end use case, other metrics may be more appropriate. In our case, we advocate for always including humans in the evaluation process to ensure that only fair content is accepted. We then value both precision (as we do not want to excessively flag content for fairness issues, which could reduce diversity) and recall (as we do not want to let fairness issues through). Optimizing for recall seems reasonable, as it is likely more important to prevent fairness issues from being released, but it is critical to note that no system is perfect: even optimizing for recall, these fairness issues are likely to persist, and the models should not be used as failproof safeguards. KSA and Emotion We evaluate performance on the test set for the two subcategories: Knowledge, Skill, and Ability (KSA) and Emotion (Table 3). The deberta-base model performs exceptionally well on the KSA subcategory, capturing 75% of the fairness-flagged samples. Data-based methods (the DATA-DRIVEN prompts (0.59) and Topics from Data (0.59)) also perform well, likely due to the inclusion of negative emotional issues in the text. They perform much worse on KSA classification, although the DATA-DRIVEN prompts still yield the best performance (0.47): KSA-related issues are especially difficult as they generally involve only specific knowledge, and would not normally be considered fairness issues in other contexts. 6"
|
| 17 |
+
}
|
abs_9K/validation_abstract_short_2404.15132v1.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"url": "http://arxiv.org/abs/2404.15132v1",
|
| 3 |
+
"title": "Black Hole Search by a Set of Scattered Agents in Dynamic Rings",
|
| 4 |
+
"abstract": "In this paper we investigate the problem of searching for a black hole in a\ndynamic graph by a set of scattered agents (i.e., the agents start from\narbitrary locations of the graph). The black hole is a node that silently\ndestroys any agent visiting it. This kind of malicious node nicely models\nnetwork failures such as a crashed host or a virus that erases the visiting\nagents. The black hole search problem is solved when at least one agent\nsurvives, and it has the entire map of the graph with the location of the black\nhole. We consider the case in which the underlining graph is a dynamic\n1-interval connected ring: a ring graph in which at each round at most one edge\ncan be missing. We first show that the problem cannot be solved if the agents\ncan only communicate by using a face-to-face mechanism: this holds for any set\nof agents of constant size, with respect to the size $n$ of the ring.\n To circumvent this impossibility we consider agents equipped with movable\npebbles that can be left on nodes as a form of communication with other agents.\nWhen pebbles are available, three agents can localize the black hole in\n$O(n^2)$ moves. We show that such a number of agents is optimal.\n We also show that the complexity is tight, that is $\\Omega(n^2)$ moves are\nrequired for any algorithm solving the problem with three agents, even with\nstronger communication mechanisms (e.g., a whiteboard on each node on which\nagents can write messages of unlimited size). To the best of our knowledge this\nis the first paper examining the problem of searching a black hole in a dynamic\nenvironment with scattered agents.",
|
| 5 |
+
"authors": "Giuseppe Antonio Di Luna, Paola Flocchini, Giuseppe Prencipe, Nicola Santoro",
|
| 6 |
+
"published": "2024-04-23",
|
| 7 |
+
"updated": "2024-04-23",
|
| 8 |
+
"primary_cat": "cs.DC",
|
| 9 |
+
"cats": [
|
| 10 |
+
"cs.DC"
|
| 11 |
+
],
|
| 12 |
+
"label": "Original Paper",
|
| 13 |
+
"paper_cat": "Knowledge AND Graph",
|
| 14 |
+
"gt": "In this paper we investigate the problem of searching for a black hole in a\ndynamic graph by a set of scattered agents (i.e., the agents start from\narbitrary locations of the graph). The black hole is a node that silently\ndestroys any agent visiting it. This kind of malicious node nicely models\nnetwork failures such as a crashed host or a virus that erases the visiting\nagents. The black hole search problem is solved when at least one agent\nsurvives, and it has the entire map of the graph with the location of the black\nhole. We consider the case in which the underlining graph is a dynamic\n1-interval connected ring: a ring graph in which at each round at most one edge\ncan be missing. We first show that the problem cannot be solved if the agents\ncan only communicate by using a face-to-face mechanism: this holds for any set\nof agents of constant size, with respect to the size $n$ of the ring.\n To circumvent this impossibility we consider agents equipped with movable\npebbles that can be left on nodes as a form of communication with other agents.\nWhen pebbles are available, three agents can localize the black hole in\n$O(n^2)$ moves. We show that such a number of agents is optimal.\n We also show that the complexity is tight, that is $\\Omega(n^2)$ moves are\nrequired for any algorithm solving the problem with three agents, even with\nstronger communication mechanisms (e.g., a whiteboard on each node on which\nagents can write messages of unlimited size). To the best of our knowledge this\nis the first paper examining the problem of searching a black hole in a dynamic\nenvironment with scattered agents.",
|
| 15 |
+
"main_content": "Introduction 1.1 Exploration of Dynamic Networks In the distributed computing community a large set of works (see [20]) studies the computational paradigm of mobile agents. A mobile agent is a software component that is able to move on a network visiting nodes. When a node is visited, the agent executes some computation interacting with the local environment, the memory and resources of the visited computational node, and then it moves on a next computational node by transmitting itself on the network. That is the agent can be seen as an intelligent message with computational capabilities and that is able to decide its next destination. In the mobile agent paradigm a plethora of problems have been studied. The most famous are: exploration, the agents have to collectively visit the entire network; gathering, the agents have to reach the same node; patrolling, the agents have to periodically patrol the network minimising the time between two visits of the same node. One problem that has been thoroughly investigated is the Black Hole Search (Bhs) [25]. In this problem there exists a dangerous stationary node, called black hole (Bh), that silently erases from the network all the agents that visit it. A Bh node could model several kind of common failures: for instance, consider a crashed host, and any agent trying to visit it will be lost and removed from the network; or a node infected by a virus that cancels the incoming agents. The many works that investigated Bh have given to us a complete knowledge of the computational properties of the problem under several assumptions (examples are communication mechanisms employed by the agents, level of synchronicity, topology of the network, and agents\u2019 knowledge and capabilities). However, almost all of them examine the case in which the network is static: the set of computational nodes and the links connecting them are static and never change. Recently, research within distributed computing has started to focus on mobile-agents in highly dynamic graphs, i.e., graphs where the topological changes are not limited to sporadic and disruptive events (such as process failures, links congestion, etc). Highly dynamic graphs model a wide range of modern networked systems whose dynamic nature is the natural product of innovations in communication technology (e.g., wireless networks), in software layer (e.g., a controller in a software defined network), and in society (e.g., the pervasive nature of smart mobile devices) (e.g., see [5]). We consider evolving graphs, that are dynamic graphs that can be seen as an infinite sequence of static graphs. In this case the model of computation is by definition synchronous, and at each round corresponds a static graph of the aforementioned sequence. A popular assumption in this model is the 1-interval connectivity: this assumption dictates that at each round the dynamic graph is connected (e.g., [1,10,21\u201323,26]). We focus on the case of 1-interval connected rings, where the topology is a ring graph in which at each round at most one edge is missing. In the last years the body of works studying agents on highly dynamic graphs 2 \fhas been growing with a sustained velocity (for a recent survey see [9]). In particular, a large number of papers is focussing on 1-interval connected rings: the gathering problem has been investigated in [12], the exploration problem in [3, 4, 11] and the Bhs for colocated1 agents in the recent [13]. Despite this large interest, a lot of questions are open. One of them is answered in this paper: how does the computational landscape of finding a Bh change when agents are scattered? In the scattered case agents start from arbitrary nodes of the graph. We will show that this setting has many differences with respect to the case of colocated agents (studied in [13]) in terms of both solvability (solving Bhs in some settings becomes impossible) and complexity. 1.2 Related Works The Black Hole Search (Bhs) problem has ben introduced in [15]. The problem has been studied in graph of restricted topologies (e.g., trees [8], rings and tori [6,17,24]) and in arbitrary and possibly unknown topology (e.g., [7,14,15]). For a recent survey see [25]. The most relevant papers are the ones investigating Bhs in static ring networks. In the asynchronous setting, it is possible to solve the problem with two colocated agents and \u0398(n log n) moves, in the whiteboard model [16], and in the pebble model [18]. It has been shown that O(n log n) moves also suffices for the scattered case and oriented rings [6]. Others [2] investigated time-optimal algorithms when considering unitary delay. In spite of all the differences in settings and assumptions, all these investigations share a common trait: the agents operate on a static network. The only works studying Bhs in dynamic graph are [13] and [19]. [19] is on the black hole search in carrier graphs, a particular class of periodic temporal graphs defined by circular intersecting routes of public carriers, where the stops are the nodes of the graph and the agents can board and disembark from a carrier at any stop. [13] studies the Bhs in the same setting studied in this paper: 1-interval connected ring with a single Bh. [13] shows that three agents are necessary to find the Bh (in the static case two agents are enough to explore arbitrary known graphs [7]), and it presents optimal algorithms to find the Bh with three agents. Moreover, if agents can communicate only when they are on the same node, the authors show that Bhs can be solved in \u0398(n2) moves and rounds. Finally, if agents can use pebbles, they show an improved algorithm that finds the Bh in \u0398(n1.5) moves and rounds. In both studies, the agents are assumed to be initially colocated, i.e. to start from the same safe node. To the best of our knowledge, no study considers the case of scattered agents. 1.3 Contributions We study the problem of finding a Bh in an oriented dynamic ring by a set of scattered agents with visible identities under different communication ca1Agents are colocated when they all start from the same node. 3 \fpabilities. We study two main families of communication mechanisms. The endogenous family, where the agents can communicate without using any external facilities. In this case, they can either see each other only when on the same node (Vision model), or they can also talk with each other (Face2Face model). In contrast, in the exogenous family, the agents communicate using external tools. In this case, we have the Pebbles model, in which each agent carries a pebble that can leave on a node to mark it for other agents, or that it can remove from a node in case this marking is not needed anymore; or the Whiteboard model, in which each node has a public whiteboard on which agents can write messages of unlimited size. Our first result (Obs. 2) is that in the endogenous family the Bhs is unsolvable using three agents. This is in contrast with the colocated case where Bhs is solvable in the same setting by using three agents (see [13]). To circumvent such impossibility we then rely on exogenous communication. We focus on algorithms that use an optimal number of agents. In particular, in [13], it has been shown that Bhs in dynamic rings is unsolvable if only two agents are available. This results clearly extends also to the scattered case. Therefore, we will consider algorithms for set of three agents (size optimal algorithms). In Th. 4, we show that any optimal size algorithm solving Bhs requires \u2126(n2) moves and \u2126(n2) rounds in the whiteboard model. We note that on a static and synchronous rings two agents can find the blackhole in O(n) moves and rounds. This observation is interesting as it shows that dynamicity does not only increase the number of required agents but it also increases, significatively, the time and moves required. This also highlights the price to pay for having scattered agents: in fact, for dynamic rings, O(n1.5) moves and rounds are sufficient in the colocated case [13]. Finally, our lower bound is tight: we provide an algorithm that solves Bhs in the pebble model in O(n2) rounds and moves using three agents (Th. 6). 2 Model and Preliminaries 2.1 The Model and the Problem The system is a temporal graph where a set of nodes V is connected by a set of edges E. The system is synchronous, and the dynamic networks is an evolving graph G. The time is divided in fictional unites called rounds. The evolving graph can be seen as a sequence of static graphs: G = G0, G1, . . . , Gr, . . ., where Gr = (Vr, Er) is the graph of the edges present at round r. The footprint of the dynamic graph is a static graph containing all the edges that will be present in the system, alternatively, is the union of all the graphs in the aforementioned sequence. An evolving graph where connectivity is guaranteed at every round is called 1-interval connected (i.e., \u2200Gi \u2208G, Gi is connected). In this paper we focus on dynamic rings: 1-interval connected graphs whose footprint is a ring. Let R = (v0, v1, . . . vn\u22121) be a dynamic oriented ring, i.e., where each node vi has two ports, consistently labelled left and right connecting it to vi\u22121 and vi+1 4 \f(operations on indices are modulo n). Nodes are anonymous, that is they do not have IDs. A set A = {a0, a1, . . . , ak\u22121} of mobile agents inhabits R. The agents start from distinct arbitrary locations: they are scattered. Agents have distinct visible identifiers in {0, . . . , k \u22121} and they know the total size of the ring n. The agents can move from node to neighbouring node and they have bounded storage (O(log n) bits of internal memory suffice for our algorithms). In each round all agents are activated. Upon activation, an agent on node v at round r takes a local snapshot of v that contains the set Er(v) of edges incident on v at this round, and the set of agents present in v. The agent communicates with the others (the communication mechanism employed will be discussed later). On the basis of the snapshot, the communication, and the content of its local memory, an agent then decides what action to take. The action consists of a communication step (defined below) and a move step. In the move step the agent may decide to stay still or to move on an edge e = (v, v\u2032) \u2208Er(v). In the latter case, if the edge is present, the agent will reach v\u2032 in round r + 1. We consider two classes of communication mechanisms (endogenous and exogenous) which give rise to four models. Endogenous Mechanisms rely only on the robots\u2019 capabilities without requiring any external object. In the FaceToFace (F2F) model the agent can explicitly communicate among themselves only when they reside on the same node. In the Vision model an agents can see all the other agents that reside on the same node (hence count their number); however, they cannot communicate. Exogenous Mechanisms do require external objects for the robots to exchange information. Among those we distinguish: Pebble: each agent is endowed with a single pebble that can be placed on or taken from a node. On each node, the concurrent actions of placing or taking pebbles are done in fair mutual exclusion. -Whiteboard: each node contains a local shared memory, called whiteboard, of size O(log n) where agents can write on and read from. Access to the whiteboard is done in adversarial but fair mutual exclusion. The temporal graph G contains a black hole (Bh), a node that destroys any visiting agent without leaving any detectable trace of that destruction. We say that an agent knows the footprint of R when it knows its left and right distance from the blackhole, that is the agent is able to build in its memory a graph isomorphic to the footprint of R and it knows its relative position with respect to the blackhole. Definition 1. (Bhs) [13] Given a dynamic ring R, and an algorithm A for a set of agents we say that A solves the Bhs if at least one agent survives and terminates knowing the footprint of R. Each agent that terminates has to know the footprint of R. Since n is known it is enough that the agent knows its right (or left) distance from the blackhole in order to know the footprint, this means that is not necessary for the agent to visit all nodes of R. We call size the number of agents used by the protocol. Other measures of complexity are the total number of moves performed by the agents, which we 5 \fshall call cost, and time it takes to complete the task. Figure 1 shows (a) four rounds of an execution in a dangerous dynamic ring, and (b) the space diagram representation that we will use in this paper. The agent is represented as the black quadrilateral and it is moving clockwise; the Bh is the black node. At round r = 2 and r = 3 the agent is blocked by the missing edge. In the diagram, the movement of the agent is represented as a solid line. r = 1 <latexit sha1_base64=\"/D+zVlJ8UzSm fo9a7IMUGdWOAc=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRS0Y1QcOyon1AG8pk eluHTh7M3Cgl5BPc6gf4Ne7EnfgzTmIWtnpWh3Pu5RyOF0mh0bY/rdLK6tr6RnmzsrW9s 7tXre13dRgrDh0eylD1PaZBigA6KFBCP1LAfE9Cz5tdZX7vAZQWYXCH8whcn0DMRGcoZ Fu1aUzqtbthp2D/iVOQeqkQHtUs8rDchjHwLkmk9cOwI3YQpFxCWhnGiLGZ2wKA0M D5oN2k7xrSo9jzTCkESgqJM1F+P2RMF/rue+ZS5/hvV72MvE/bxDj5MJNRBDFCAHPglB IyIM0V8KMAHQsFCyrDlQEVDOFEMEJSj3IixWUh0I8lChU+pouqCfe8UKZmO2d5qb+k e9pwmo2zm2a91SxWLJNDckROiEPOSYtckzbpE6m5Ik8kxfr1Xqz3q2Pn9OSVfwckAVYX 9O5KOw</latexit> r = 0 <latexit sha1_base64=\"ySeTdHpafQT8C uD8u8B104dcNo=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRS0Y1QcOyon1AG8pk eluHTh7M3Cgl5BPc6gf4Ne7EnfgzTmIWtnpWh3Pu5RyOF0mh0bY/rdLK6tr6RnmzsrW9s 7tXre13dRgrDh0eylD1PaZBigA6KFBCP1LAfE9Cz5tdZX7vAZQWYXCH8whcn0DMRGcoZ Fu1aU9qtbthp2D/iVOQeqkQHtUs8rDchjHwLkmk9cOwI3YQpFxCWhnGiLGZ2wKA0M D5oN2k7xrSo9jzTCkESgqJM1F+P2RMF/rue+ZS5/hvV72MvE/bxDj5MJNRBDFCAHPglB IyIM0V8KMAHQsFCyrDlQEVDOFEMEJSj3IixWUh0I8lChU+pouqCfe8UKZmO2d5qb+k e9pwmo2zm2a91SxWLJNDckROiEPOSYtckzbpE6m5Ik8kxfr1Xqz3q2Pn9OSVfwckAVYX 9NKaOv</latexit> r = 2 <latexit sha1_base64=\"aWzON6H9QVIuw socySfPuvB7QI=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiSlohuh4MZlRfuANpTJ 9LYOnUnCzI1Sj7BrX6AX+NO3Ik/YxKzsK1ndTjnXs7heKEUBm37yqsrW9sbhW3Szu7e /sH5cphxwSR5tDmgQx0z2MGpPChjQIl9EINTHkSut70OvW7j6CNCPx7nIXgKjbxVhwho l0p6/qw3LVrtkZ6CpxclIlOVrDilUcjAIeKfCRS2ZM37FDdOdMo+AS4tIgMhAyPmUT6Cf UZwqMO8+6xvQ0MgwDGoKmQtJMhL8fc6aMmSkvuVQMH8yl4r/ef0Ix5fuXPhODzNAi FhCzIcC2SEYCOhAZEljYHKnzKmWaIoAVlnCdilKyEKgiUIHT/GimoR7XiDjZDtnealV 0qnXnEbt/LZRbTbyFYvkmJyQM+KQC9IkN6RF2oSTCXkmL+TVerPerQ/r8/e0YOU/R2QB1 vcPUJ+jsQ=</latexit> G0 <latexit sha1_base64=\"P9Ba+S6mgRzUi q+VEdTDcyj8FOY=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRS0WXBhS4r2ge0oUym t3Xo5MHMjVJCPsGtfoBf407ciT/jJGZhq2d1OdezuF4kRQabfvTKq2srq1vlDcrW9s7u 3vV2n5Xh7Hi0OGhDFXfYxqkCKCDAiX0IwXM9yT0vNl5vceQGkRBnc4j8D12TQE8EZGu n2amSPqnW7Yegf4lTkDop0B7VrPJwHPLYhwC5ZFoPHDtCN2EKBZeQVoaxhojxGZvCwNC A+aDdJO+a0uNYMwxpBIoKSXMRfn8kzNd67nvm0md4r5e9TPzPG8Q4uXATEUQxQsCzIBQ S8iDNlTAjAB0LBYgsaw5UBJQzxRBCco4N2JsVlkI9GOJQoWP6aJqwj0vlKnZzle6i/p njacZuPsplvNYsVy+SQHJET4pBz0iLXpE06hJMpeSLP5MV6td6sd+vj57RkFT8HZAHW1 zc9YqOm</latexit> G1 <latexit sha1_base64=\"uIkXCSlgVrnpR wIuqGZDqLuLG4=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRS0WXBhS4r2ge0oUym t3Xo5MHMjVJCPsGtfoBf407ciT/jJGZhq2d1OdezuF4kRQabfvTKq2srq1vlDcrW9s7u 3vV2n5Xh7Hi0OGhDFXfYxqkCKCDAiX0IwXM9yT0vNl5vceQGkRBnc4j8D12TQE8EZGu n2auSMqnW7Yegf4lTkDop0B7VrPJwHPLYhwC5ZFoPHDtCN2EKBZeQVoaxhojxGZvCwNC A+aDdJO+a0uNYMwxpBIoKSXMRfn8kzNd67nvm0md4r5e9TPzPG8Q4uXATEUQxQsCzIBQ S8iDNlTAjAB0LBYgsaw5UBJQzxRBCco4N2JsVlkI9GOJQoWP6aJqwj0vlKnZzle6i/p njacZuPsplvNYsVy+SQHJET4pBz0iLXpE06hJMpeSLP5MV6td6sd+vj57RkFT8HZAHW1 zc/HaOn</latexit> G2 <latexit sha1_base64=\"gXwpcbVnsGys KJDWOKJtbjUsc=\">ACIXicbVDJTgJBFOzGDXEDPXrpSEw8kRmC0SOJBz1ilCWBCelp HtihZ0n3Gw2ZzCd41Q/wa7wZb8afcRjnIGCdKlXvpSrlhkoatKwvWlhb39jcKm6Xdnb39 g/KlcOCSItoC0CFeieyw0o6UMbJSrohRq45yroutOrud9BG1k4N/jLATH4xNfjqXgmE p318P6sFy1alYGtkrsnFRJjtawQouDUSAiD3wUihvTt60QnZhrlEJBUhpEBkIupnwC/ZT 63APjxFnXhJ1GhmPAQtBMKpaJ8Pcj5p4xM89NLz2OD2bZm4v/ef0Ix5dOLP0wQvDFPAi lgizIC3TEYCNpAZEPm8OTPpMcM0RQUvGhUjFKF1lIdCLFEodPCWLahruoFK0u3s5aVW Sadesxu189tGtdnIVySY3JCzohNLkiT3JAWaRNBJuSZvJBX+kbf6Qf9/D0t0PzniCyAf v8AQNijqA=</latexit> G3 <latexit sha1_base64=\"ik0+it21WRL/YBOUWD79i+PSX+8=\">ACIXicbVDLTsJAF J3iC/EFunQzkZi4Iq1idEniQpcY5ZFAQ6bDBSfMtM3MrY0fIJb/QC/xp1xZ/wZ29qFgGd1cs69OSfHC6UwaNtfVmFldW19o7hZ2tre2d0rV/bJog0hxYPZKC7HjMghQ8tFCihG2p gypPQ8SZXqd95BG1E4N/jNARXsbEvRoIzTKS768HZoFy1a3YGukycnFRJjuagYhX7w4BHCnzkhnTc+wQ3ZhpFzCrNSPDISMT9gYegn1mQLjxlnXGT2ODMOAhqCpkDQT4e9HzJQxU +Ul4rhg1n0UvE/rxfh6NKNhR9GCD5Pg1BIyIM1yIZAehQaEBkaXOgwqecaYIWlDGeSJGySpzgSqSKHTwNJtXk3DPC+Qs2c5ZXGqZtE9rTr12fluvNur5ikVySI7ICXHIBWmQG9I kLcLJmDyTF/JqvVnv1of1+XtasPKfAzIH6/sHQpOjqQ=</latexit> r = 3 <latexit sha1_base64=\"/t24mKOsRoCcbyw13o/IpE4OtUs=\">ACIXicbVDLSsNAF J3UV62vVpduBovgqiRa0Y1QcOyon1AG8pkeluHTjJh5kYpoZ/gVj/Ar3En7sSfMYlZ2NazOpxzL+dwvFAKg7b9ZRVWVtfWN4qbpa3tnd29cmW/bVSkObS4kp3PWZAigBaKFBCN9T AfE9Cx5tcp37nEbQRKrjHaQiuz8aBGAnOMJHu9NXZoFy1a3YGukycnFRJjuagYhX7Q8UjHwLkhnTc+wQ3ZhpFzCrNSPDISMT9gYegkNmA/GjbOuM3ocGYaKhqCpkDQT4e9HzHxjp r6XPoMH8yil4r/eb0IR5duLIwQgh4GoRCQhZkuBbJCECHQgMiS5sDFQHlTDNE0IyzhMxSlaZC/QjiUKrp9m8moR7npKzZDtncal0j6tOfXa+W292qjnKxbJITkiJ8QhF6RBbki TtAgnY/JMXsir9Wa9Wx/W5+9pwcp/DsgcrO8fUlqjsg=</latexit> v0 <latexit sha1_base64=\"gWEMhrwv/9O5 ZE73r1FVf8Fon0=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRSUHcFNy4r2ge0oUym t3Xo5MHMnUoJ+QS3+gF+jTtxJ/6MSczCVs/qcM69nMPxIik02vanVpb39jcKm9Xdnb39 g+qtcOuDo3i0OGhDFXfYxqkCKCDAiX0IwXM9yT0vNl15vfmoLQIg3tcROD6bBqIieAMU+ luPrJH1brdsHPQv8QpSJ0UaI9qVnk4DrnxIUAumdYDx47QjZlCwSUklaHREDE+Y1MYpDR gPmg3zrsm9NRohiGNQFEhaS7C74+Y+VovfC+9Bk+6FUvE/zBgYnl24sgsgBDwLQiE hD9JciXQEoGOhAJFlzYGKgHKmGCIoQRnqWjSVZYCfSNRqPAxWVbTcM8LZJu56wu9Zd0 zxtOs3F126y37GLFMjkmJ+SMOSCtMgNaZMO4WRKnsgzebFerTfr3fr4OS1Zxc8RWYL19 Q2PKaPV</latexit> v1 <latexit sha1_base64=\"PI0eEyqalFtw Ogk1C6MkM4NT0w=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRSUHcFNy4r2ge0oUym t3Xo5MHMnUoJ+QS3+gF+jTtxJ/6MSczCVs/qcM69nMPxIik02vanVpb39jcKm9Xdnb39 g+qtcOuDo3i0OGhDFXfYxqkCKCDAiX0IwXM9yT0vNl15vfmoLQIg3tcROD6bBqIieAMU+ luPnJG1brdsHPQv8QpSJ0UaI9qVnk4DrnxIUAumdYDx47QjZlCwSUklaHREDE+Y1MYpDR gPmg3zrsm9NRohiGNQFEhaS7C74+Y+VovfC+9Bk+6FUvE/zBgYnl24sgsgBDwLQiE hD9JciXQEoGOhAJFlzYGKgHKmGCIoQRnqWjSVZYCfSNRqPAxWVbTcM8LZJu56wu9Zd0 zxtOs3F126y37GLFMjkmJ+SMOSCtMgNaZMO4WRKnsgzebFerTfr3fr4OS1Zxc8RWYL19 Q2Q5KPW</latexit> v2 <latexit sha1_base64=\"ptW+2sw4r9Fdb b/OhHbZPq07Da8=\">ACIXicbVDLTsJAFJ3iC/EFunQzkZi4Ii0hUXckblxilEcCDZkO F5w7TQztxjS8Alu9QP8GnfGnfFnbGsXAp7VyTn35pwcL5TCoG1/WYWNza3tneJuaW/4 PCoXDnuGBVpDm2upNI9jxmQIoA2CpTQCzUw35PQ9aY3qd+dgTZCBQ84D8H12SQY8EZJt L9bFgflqt2zc5A14mTkyrJ0RpWrOJgpHjkQ4BcMmP6jh2iGzONgktYlAaRgZDxKZtAP6E B8G4cdZ1Qc8jw1DREDQVkmYi/P2ImW/M3PeS5/ho1n1UvE/rx/h+MqNRBGCAFPg1B IyIM1yIZAehIaEBkaXOgIqCcaYIWlDGeSJGySpLgX4kUWj1tFhWk3DPU3KRbOesLrVO OvWa06hd3zWqTtfsUhOyRm5IA65JE1yS1qkTiZkGfyQl6tN+vd+rA+f08LVv5zQpZgf f8Akp+j1w=</latexit> Bh <latexit sha1_base64=\"jI+Lg/BuaBiUH mDeU6Ft3xoeOwg=\">ACJnicbVDLSsNAFJ34rPXV6tLNYBFclaQI6q7oxmUF+4A2lMn0 th06k4SZG6WE/IRb/QC/xp2IOz/FJGZhW8/qcM69nMPxQikM2vaXtba+sbm1Xdop7+7tH xWqkcdE0SaQ5sHMtA9jxmQwoc2CpTQCzUw5UnoerPbzO8+gjYi8B9wHoKr2MQXY8EZpl IvHhOb6bJsFKz63YOukqcgtRIgdawapUGo4BHCnzkhnTd+wQ3ZhpFxCUh5EBkLGZ2w C/ZT6TIFx47xwQs8iwzCgIWgqJM1F+PsRM2XMXHnpWI4NcteJv7n9SMcX7mx8MIwed ZEAoJeZDhWqRLAB0JDYgsaw5U+JQzRBC8o4T8UonWYhUEUShQ6ekU1Dfe8QGbOctL rZJOo+5c1K/vG7WmXaxYIifklJwTh1ySJrkjLdImnEjyTF7Iq/VmvVsf1ufv6ZpV/ByTB VjfP6papfQ=</latexit> Ring Removed edge <latexit sha1_base64=\"KlepczXIferH73axTG+ZU7AVo5w=\">ACKnicbVBLTgJBFOzBH+IPdOmIzFxRWYIRp ckblyikU8CE9LTPLBD9/Sk+w2GEK7hVg/gadwRtx7EGZyFgLWqVL2XqlQSWHRdRdObmt7Z3cv184ODw6PimWTltWx4ZDk2upTSdgFqQIoYkCJXQiA0wFEtrB+C712xMwVujwCacR+IqNQjEUnGEi9R5B6QkMKAxG0C+W3Yq7BN0kXkbK JEOjX3LyvYHmsYIQuWTWdj03Qn/GDAouYV7oxRYixsdsBN2EhkyB9WfL0nN6GVuGmkZgqJB0KcLfjxlT1k5VkFwqhs923UvF/7xujMNbfybCKEYIeRqEQsIyHIjkjWADoQBRJY2BypCyplhiGAEZwnYpzMsxKoYonC6Jf5qpqEB4GW82 Q7b32pTdKqVrxa5fqhWq7XshXz5JxckCvikRtSJ/ekQZqEk4i8kjfy7nw4n87C+fo9zTnZzxlZgfP9Awcmp68=</latexit> Agent movements <latexit sha1_base64=\"kCNMgnOfmBP0uqahlHn3G9q9R8o=\">ACNnicbVC9TgJBGNzF/EPNL Gx2UhMrMgdwWiJsbHERH4SIGRv+cANu7eX3e9QcvIytvoAvoqNnbH1EbxDCgGnmsx8k9kdP5TCou+Oyura+sbm5mt7PbO7t5+Ln9QtzoyHGpcS2aPrMgRQA1FCihGRpgypfQ8IfXqd8YgbFCB3c4DqGj 2CAQfcEZJlI3d9RGeMT4agABUqVHoBJiJ91cwS26U9Bl4s1IgcxQ7eadTLuneZTGuWTWtjw3xE7MDAouYZJtRxZCxodsAK2EBkyB7cTD0zoaWQZahqCoULSqQh/EzFT1o6Vn1wqhvd20UvF/7xWhP3LTiy CMEIeFqEQsK0yHIjkmWA9oQBRJa+HKgIKGeGIYIRlHGeiFEy1VyhiQKox8m82pS7vtapt5i0stk3qp6JWL57elQqU8WzFDjskJOSMeuSAVckOqpEY4eSLP5IW8Om/Oh/PpfP2erjizCGZg/P9AwbxrM M=</latexit> r = 0 <latexit sha1_base64=\"ySeTdHpafQT8CuD8u8B104dcNo=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgq iRS0Y1QcOyon1AG8pkeluHTh7M3Cgl5BPc6gf4Ne7EnfgzTmIWtnpWh3Pu5RyOF0mh0bY/rdLK6tr6RnmzsrW9s7tXre13dRgrDh0eylD1PaZBigA6KFBCP1LAfE9Cz5tdZX7vAZQWYXCH8whcn0DMRGcoZFu1aU9qtbthp2 D/iVOQeqkQHtUs8rDchjHwLkmk9cOwI3YQpFxCWhnGiLGZ2wKA0MD5oN2k7xrSo9jzTCkESgqJM1F+P2RMF/rue+ZS5/hvV72MvE/bxDj5MJNRBDFCAHPglBIyIM0V8KMAHQsFCyrDlQEVDOFEMEJSj3IixWUh0I8l ChU+pouqCfe8UKZmO2d5qb+ke9pwmo2zm2a91SxWLJNDckROiEPOSYtckzbpE6m5Ik8kxfr1Xqz3q2Pn9OSVfwckAVYX9NKaOv</latexit> r = 1 <latexit sha1_base64=\"/D+zVlJ8UzSmfo9a7IMUGdWOAc=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgq iRS0Y1QcOyon1AG8pkeluHTh7M3Cgl5BPc6gf4Ne7EnfgzTmIWtnpWh3Pu5RyOF0mh0bY/rdLK6tr6RnmzsrW9s7tXre13dRgrDh0eylD1PaZBigA6KFBCP1LAfE9Cz5tdZX7vAZQWYXCH8whcn0DMRGcoZFu1aUzqtbthp2 D/iVOQeqkQHtUs8rDchjHwLkmk9cOwI3YQpFxCWhnGiLGZ2wKA0MD5oN2k7xrSo9jzTCkESgqJM1F+P2RMF/rue+ZS5/hvV72MvE/bxDj5MJNRBDFCAHPglBIyIM0V8KMAHQsFCyrDlQEVDOFEMEJSj3IixWUh0I8l ChU+pouqCfe8UKZmO2d5qb+ke9pwmo2zm2a91SxWLJNDckROiEPOSYtckzbpE6m5Ik8kxfr1Xqz3q2Pn9OSVfwckAVYX9O5KOw</latexit> r = 2 <latexit sha1_base64=\"aWzON6H9QVIuwsocySfPuvB7QI=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgq iSlohuh4MZlRfuANpTJ9LYOnUnCzI1Sj7BrX6AX+NO3Ik/YxKzsK1ndTjnXs7heKEUBm37yqsrW9sbhW3Szu7e/sH5cphxwSR5tDmgQx0z2MGpPChjQIl9EINTHkSut70OvW7j6CNCPx7nIXgKjbxVhwhol0p6/qw3LVrtk Z6CpxclIlOVrDilUcjAIeKfCRS2ZM37FDdOdMo+AS4tIgMhAyPmUT6CfUZwqMO8+6xvQ0MgwDGoKmQtJMhL8fc6aMmSkvuVQMH8yl4r/ef0Ix5fuXPhODzNAiFhCzIcC2SEYCOhAZEljYHKnzKmWaIoAVlnCdilKyEKgi iUIHT/GimoR7XiDjZDtnealV0qnXnEbt/LZRbTbyFYvkmJyQM+KQC9IkN6RF2oSTCXkmL+TVerPerQ/r8/e0YOU/R2QB1vcPUJ+jsQ=</latexit> r = 3 <latexit sha1_base64=\"/t24mKOsRoCcbyw13o/IpE4OtUs=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgq iRa0Y1QcOyon1AG8pkeluHTjJh5kYpoZ/gVj/Ar3En7sSfMYlZ2NazOpxzL+dwvFAKg7b9ZRVWVtfWN4qbpa3tnd29cmW/bVSkObS4kp3PWZAigBaKFBCN9TAfE9Cx5tcp37nEbQRKrjHaQiuz8aBGAnOMJHu9NXZoFy1a3Y GukycnFRJjuagYhX7Q8UjHwLkhnTc+wQ3ZhpFzCrNSPDISMT9gYegkNmA/GjbOuM3ocGYaKhqCpkDQT4e9HzHxjpr6XPoMH8yil4r/eb0IR5duLIwQgh4GoRCQhZkuBbJCECHQgMiS5sDFQHlTDNE0IyzhMxSlaZC/Qj iUKrp9m8moR7npKzZDtncal0j6tOfXa+W292qjnKxbJITkiJ8QhF6RBbkiTtAgnY/JMXsir9Wa9Wx/W5+9pwcp/DsgcrO8fUlqjsg=</latexit> v0 <latexit sha1_base64=\"gWEMhrwv/9O5ZE73r1FVf8Fon0=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgq iRSUHcFNy4r2ge0oUymt3Xo5MHMnUoJ+QS3+gF+jTtxJ/6MSczCVs/qcM69nMPxIik02vanVpb39jcKm9Xdnb39g+qtcOuDo3i0OGhDFXfYxqkCKCDAiX0IwXM9yT0vNl15vfmoLQIg3tcROD6bBqIieAMU+luPrJH1brdsHP Qv8QpSJ0UaI9qVnk4DrnxIUAumdYDx47QjZlCwSUklaHREDE+Y1MYpDRgPmg3zrsm9NRohiGNQFEhaS7C74+Y+VovfC+9Bk+6FUvE/zBgYnl24sgsgBDwLQiEhD9JciXQEoGOhAJFlzYGKgHKmGCIoQRnqWjSVZYCfSNR qPAxWVbTcM8LZJu56wu9Zd0zxtOs3F126y37GLFMjkmJ+SMOSCtMgNaZMO4WRKnsgzebFerTfr3fr4OS1Zxc8RWYL19Q2PKaPV</latexit> v1 <latexit sha1_base64=\"PI0eEyqalFtwOgk1C6MkM4NT0w=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgq iRSUHcFNy4r2ge0oUymt3Xo5MHMnUoJ+QS3+gF+jTtxJ/6MSczCVs/qcM69nMPxIik02vanVpb39jcKm9Xdnb39g+qtcOuDo3i0OGhDFXfYxqkCKCDAiX0IwXM9yT0vNl15vfmoLQIg3tcROD6bBqIieAMU+luPnJG1brdsHP Qv8QpSJ0UaI9qVnk4DrnxIUAumdYDx47QjZlCwSUklaHREDE+Y1MYpDRgPmg3zrsm9NRohiGNQFEhaS7C74+Y+VovfC+9Bk+6FUvE/zBgYnl24sgsgBDwLQiEhD9JciXQEoGOhAJFlzYGKgHKmGCIoQRnqWjSVZYCfSNR qPAxWVbTcM8LZJu56wu9Zd0zxtOs3F126y37GLFMjkmJ+SMOSCtMgNaZMO4WRKnsgzebFerTfr3fr4OS1Zxc8RWYL19Q2Q5KPW</latexit> v2 <latexit sha1_base64=\"ptW+2sw4r9Fdb/OhHbZPq07Da8=\">ACIXicbVDLTsJAFJ3iC/EFunQzkZi4I i0hUXckblxilEcCDZkOF5w7TQztxjS8Alu9QP8GnfGnfFnbGsXAp7VyTn35pwcL5TCoG1/WYWNza3tneJuaW/4PCoXDnuGBVpDm2upNI9jxmQIoA2CpTQCzUw35PQ9aY3qd+dgTZCBQ84D8H12SQY8EZJtL9bFgflqt2zc5 A14mTkyrJ0RpWrOJgpHjkQ4BcMmP6jh2iGzONgktYlAaRgZDxKZtAP6EB8G4cdZ1Qc8jw1DREDQVkmYi/P2ImW/M3PeS5/ho1n1UvE/rx/h+MqNRBGCAFPg1BIyIM1yIZAehIaEBkaXOgIqCcaYIWlDGeSJGySpLgX4k UWj1tFhWk3DPU3KRbOesLrVOvWa06hd3zWqTtfsUhOyRm5IA65JE1yS1qkTiZkGfyQl6tN+vd+rA+f08LVv5zQpZgf8Akp+j1w=</latexit> Bh <latexit sha1_base64=\"jI+Lg/BuaBiUHmDeU6Ft3xoeOwg=\">ACJnicbVDLSsNAFJ34rPXV6tLNYBFcl aQI6q7oxmUF+4A2lMn0th06k4SZG6WE/IRb/QC/xp2IOz/FJGZhW8/qcM69nMPxQikM2vaXtba+sbm1Xdop7+7tHxWqkcdE0SaQ5sHMtA9jxmQwoc2CpTQCzUw5UnoerPbzO8+gjYi8B9wHoKr2MQXY8EZplIvHhOb6bJsFK z63YOukqcgtRIgdawapUGo4BHCnzkhnTd+wQ3ZhpFxCUh5EBkLGZ2wC/ZT6TIFx47xwQs8iwzCgIWgqJM1F+PsRM2XMXHnpWI4NcteJv7n9SMcX7mx8MIwedZEAoJeZDhWqRLAB0JDYgsaw5U+JQzRBC8o4T8UonWYh UEUShQ6ekU1Dfe8QGbOctLrZJOo+5c1K/vG7WmXaxYIifklJwTh1ySJrkjLdImnEjyTF7Iq/VmvVsf1ufv6ZpV/ByTBVjfP6papfQ=</latexit> Figure 1: (a) Execution in a dangerous dynamic ring, and (b) its space diagram representation. 3 Preliminaries Before presenting and analyzing our solution protocols, we report some known impossibility results and a technical lemma that we will use in our paper. Then we briefly describe a well known idea employed for Bhs in static graphs that will be adapted in our algorithms, as well as the conventions and symbols used in our protocols. 3.1 Known Impossibilities In this section we report known impossibility results. Theorem 1. [13] In a dynamic ring of size n > 3, two colocated agents cannot solve the Bhs. The impossibility holds even if the agents have unique IDs, and are equipped with the strongest (Whiteboard) communication model. Theorem 2. [13] There exists no algorithm that solves the Bhs in a dynamic ring R whose size is unknown to the agents. The result holds even if the nodes have whiteboards, the agents have IDs, and irrespectively of the number of agents. Observation 1. [13] Given a dynamic ring R, and a cut U (with |U| > 1) of its footprint connected by edges ec and ecc to nodes in V \\U, agents in U explore a node outside the cut at the end of round r if and only if, in round r, there are two agents in U, one that tries to traverse ec and one trying to traverse ecc, respectively. 6 \f3.2 Cautious Walk Cautious Walk is a mechanism introduced in [15] for agents to move on dangerous graphs in such a way that two (or more) agents never enter the black hole from the same edge. The general idea of cautious walk in static graphs is that when an agent a moves from u to v through an unexplored (thus dangerous) edge (u, v), a must leave the information that the edge is under exploration at u. The information can be provided through some form of mark in case of exogenous communication mechanisms, or implicit in case of endogenous mechanisms (e.g., by employing a second agent as a \u201cwitness\u201d). In our algorithms we will make use of variants of the general idea of cautious walk, adapting it to the dynamic scenario. 3.3 Pseudocode Convention and Communication We use the pseudocode convention introduced in [11]. In particular, our algorithms use as a building block procedure Explore (dir | p1 : s1; p2 : s2; . . . ; pk : sk), where dir \u2208{left, right, nil}, pi is a predicate, and si is a state. In Procedure Explore, the agent takes a snapshot, then evaluates predicates p1, . . . , pk in order; as soon as a predicate is satisfied, say pi, the procedure exits, and the agent transitions to the state si specified by pi. If no predicate is satisfied, the agent tries to move in the specified direction dir (or it stays still if dir = nil), and the procedure is executed again in the next round. The following are the main predicates used in our Algorithms: \u2022 meeting[ID/Role]: the agent sees another agent with identifier ID (or role Role) arriving at the node where it resides, or the agent arrives in a node, and it sees another agent with identifier ID (or role Role). Furthermore, the following variables are maintained by the algorithms: \u2022 Ttime, Tnodes: the total number of rounds and distinct visited nodes2, respectively, since the beginning of the execution. \u2022 Etime, Enodes: the total number of rounds and distinct visited nodes, respectively, since the last call of procedure Explore. \u2022 EMtime [C/ (CC)]: the number of rounds during which the clockwise/ (resp. counter-clockwise) edge is missing since the last call of procedure Explore. \u2022 #Meets[ID]: the number of times the agent has met with agent ID. \u2022 RLastMet[ID] records the number of rounds elapsed since the agent has seen (or meet) an agent with id ID 2An agent is able to identify if the node where it resides has been previously visited or not by counting the number of steps it has performed in certain direction. 7 \fObserve that, in a fully synchronous system, when predicate meeting[y] holds for an agent a with id x, then predicate meeting[x] holds for the agent with id y. In the pebble model we will also use the CautiousExplore procedure: it is analogous to Explore, with the main difference that the agent uses the pebble to perform a cautious walk. That is, the agent leaves a pebble on the current node, it moves to the node in the moving direction, then it goes back to remove the left pebble, and finally it returns to the recently explored node. Communication and pebble removal. As for the ability of agents to interact, we observe that, even in the simpler pebble model, any communication between agents located at the same node is easy to achieve (e.g., two agents may exchange messages of any size using a communication protocol in which they send one bit every constant number of rounds). Therefore, we can assume that, in the exogenous models, agents are able to communicate. Specifically, the communication of constant size messages is assumed to be instantaneous, since it can implemented trivially by a multiplexing mechanism (the logical rounds are divided in a constant number of physical round, the first of which is used to execute the actual algorithm and the others to communicate). During a cautious walk using CautiousExplore procedure, agent x might return to a node to retrieve its pebble, even while another agent is present on the same node. In such instances, the two agents meet, but any state transitions initiated by this meeting will only take effect after agent x has successfully reclaimed its pebble. 3.4 CautiousPendulum: An algorithm for colocated agents In this section we describe the Bhs algorithm CautiousPendulum presented in [13]. The algorithm solves the Bhs when three agents with visible IDs start from the same node. We will use CautiousPendulum as subprocedure in our algorithm for the scattered case (Section 6). The CautiousPendulum algorithm uses three agents: the Avanguard, the Retroguard, and the Leader. The three agents start on the home-base node v0. Agents Avanguard and Leader move clockwise simulating a cautious walk. In particular, If the edge e in the clockwise direction is not present, both agents wait until it reappears. If edge e is present, Avanguard moves to the unexplored node using edge e. Then, if in a successive round the edge e is still present, Avanguard goes back to Leader, signalling that the visited node is safe; at this point, both Leader and Avanguard move clockwise to the recently explored node. If Avanguard does not return when e is present, then the Leader knows that the node visited by Avanguard is the blackhole. Retroguard moves as follows: it goes counter-clockwise until it visits the first unexplored node; then, it goes back clockwise until it meets again Leader. Once Retroguard meets Leader, it moves again counter-clockwise, iterating the same pattern. In case Retroguard finds a missing edge on its path, it waits until the edge re-appears; then it resumes its movement. If the Leader sees a missing edge e in its clockwise direction and, while waiting for e to appear, does not meet Retroguard after enough time for Retroguard 8 \fto explore a node and go back, then we say that Agent Retroguard fails to report to Leader. In this case, Retroguard entered the black hole, hence the Leader can correctly compute its location. Theorem 3. [13] Consider a dynamic ring R, with three colocated agents with distinct IDs in the Vision model. Algorithm CautiousPendulum solves Bhs with O(n2) moves and in O(n2) rounds. 4 Impossibility with Scattered Agents and Endogenous Communication When the agents are scattered, three of them, even equipped with the stronger endogenous mechanism (i.e., F2F model), cannot solve Bhs on rings of arbitrary size, as shown by the following: Observation 2. Three scattered agents in the F2F model cannot solve Bhs on a static ring of arbitrary size n, even if they have distinct IDs. Proof. Let A be an algorithm that correctly solves the problem. The proof is by contradiction: we will show that there exists an initial configuration C of the 3 agents on a ring of a proper size n > 10 that makes A fail. We will construct the configuration C in such a way that no two agents meet. Let id1, id2, id3 be the IDs of agents. We consider the behaviour of agent idi until round r in a run where it executes the algorithm A, and it does not meet any agent. Let D(ai, n, r) the maximum distance in any direction travelled by an agent until round r. Let rm be the minimum round at which D(ai, n, r) > 0 for some ai. Without loss of generality, let id1 be this agent. We can position the agents so that id1 is adjacent to the blackhole and enters it at round rm. Every other agent can be positioned such that they have not met any other agent by round rm. At this stage, we are left with two agents, and we can invoke Th. 1 to conclude that it is impossible to solve the problem. Note that the premise of Th. 1 is based on co-located agents. However, this scenario is simpler than the dispersed case, so the result is applicable to our context as well. Fortunately, any exogenous mechanism circumvents the impossibility of Obs. 2. In the following we focus on such mechanisms. 5 Exogenous Communications: Lower Bound for Size-optimal Algorithms. We now consider the Exogenous Communications. Interestingly, we can show a quadratic lower bound on the number of moves and rounds of any size-optimal algorithm that solve that BHS-Problem with scattered agents; the bound holds even if agents have IDs and whiteboards are present. 9 \fTheorem 4. In a dynamic ring R with whiteboards, any algorithm A for Bhs with three scattered agents with unique IDs requires \u2126(n2) moves and \u2126(n2) rounds. Proof. The proof is by contradiction. Let A be a sub-quadratic algorithm that solves the BHS-Problem; and let a, b, and c be the three agents. Suppose the agents have unique IDs, and, without loss of generality, let c be the first agent that moves. Let us assume an initial configuration where c is initially placed on node vc, neighbour of the Bh, and where a and b are on two neighbours nodes, va and vb, at distance n/2 from vc. Furthermore, w.l.o.g, let us assume that c is placed in such a way that when it moves, at round r = 0, it immediately enters Bh; also, let vc be the counter-clockwise neighbor of the Bh. Note that, (N1) since c enters the blackhole at round 0 and it can write information on node vc (whiteboard model), agents a and b can compute the position of the Bh only in two cases: either (N1.1) one of them enters Bh or (N1.2) one of them visits node vc. We now prove that case (N1.2) might never happen. Let Ur be the partition of nodes explored by agents a and b at the end of round r. By Observation 1, agents a and b may explore a node outside Ur only if they try to traverse at the same round both the edges crossing the cut Ur and V \\ Ur. Let ec be the clockwise edge incident in Ur, and ecc be the counter-clockwise one. Edge ec might always be missing, thus preventing the agents from crossing it. Therefore, Bh might only be reached by its clockwise neighbor, and node vc will never be explored. Since the blackhole is at distance n 2 from both va and vb, by (N1.1) there must exists a set of rounds r1, r2, . . . , rn/8 where Urj \u2265n/8 + j. We now prove that if A is sub-quadratic, then in one of these rounds, there must exist an agent, say b, that explores at least two nodes, say v1 at round r1 and v2 at round r2, such that (1) it does not communicate with a between the two explorations and (2) both a and b visit o(n) disjoint nodes between r1 and r2. Assume by contradiction then neither (1) or (2) apply. Then, in each Urj agent b explores only one node and the agents collectively performs at least n/8 moves. Since there are n/8 such rounds we have at least O(n2) moves. Thus having a contradiction. Note that, since the initial configuration is arbitrary and a and b never received any information communicated from c, the positions of v1 and v2 do not depend on the positions of Bh and vc. Therefore, there can exist two initial configurations C1 and C2, such that v1 =Bh in C1 and v2 =Bh in C2. Since b reaches the Bh by round r2, a is the only agent that can disambiguate between the two configurations. However, a might be blocked indefinitely on a set of nodes that was never visited by b after round r1 (see Observation 1 \u2013 at round r2 agent a is trying to traverse edge ec). Consequently, a is not able to distinguish between C1 and C2; thus, A cannot be correct, having a contradiction. Finally, the bound on the number of rounds derives immediately from the bound on moves and from having a constant number of agents. The above theorem shows the cost optimality of the size-optimal algorithm 10 \fGather&Locate described in the following Section 6. 6 An Optimal Exogenous Algorithm: Gather&Locate In this section, we describe an algorithm to solve the problem with k = 3 agents using pebbles. We name the algorithm Gather&Locate. Gather&Locate works in two phases: \u2022 Phase 1: In the first phase agents move clockwise using pebbles to implement a cautious walk. If they meet they synchronise their movements such that at most one of them enters in the black hole. This phase lasts until all three agents meet or 9n rounds have passed. We will show that at the end of this phase we have either: \u2013 (1) three agents are on the same node or on the two endpoint nodes of the same edge. In this case we say that agents gathered; \u2013 (2) the counter-clockwise neighbour of the black hole has been marked, at most one agent is lost, and the two remaining agents are gathered (that is they are on the same node, or on two endpoints of an edge); \u2013 (3) one agent is lost in the black hole and the counter-clockwise neighbour of the black hole has been marked. The remaining two agents either both terminated, locating Bh, or only one terminated, with the other still looking for the Bh. In Phase 2 this last agent will either terminate or it will be blocked forever (in both cases the problem is solved). \u2022 Phase 2: The second phase starts after the previous one, and relies on the properties enforced by the first phase. In particular, if at the beginning of this phase three agents are on the same node, they start algorithm CautiousPendulum. Otherwise, if two agents are on the same node, they act similarly to Retroguard and Leader in CautiousPendulum. If none of the above applies, then two agents are on the two endpoints of a missing edge, or only a single agent is still looking for the Bh. This scenario is detected by a timeout strategy: upon a timeout, an agent starts moving clockwise looking for the node marked during Phase 1. If two agents meet during this process, they act similarly to Retroguard and Leader in CautiousPendulum. Otherwise, in case a single agent is still active, it will either reach the marked node (and terminate correctly) or it will be blocked forever on a missing edge. We remark that in this last case there has been an agent correctly terminating in Phase 1, and thus BHSProblem is still correctly solved. 6.1 Detailed Description. The pseudocode of Phase 1 is reported in Algorithms 1, 3, and 2; and Phase 2 in Algorithms 4 and 5. In the pseudocode, we use the predicate #A = x that is 11 \fverified when on the current node there are x agents. Initially, all agents have role Start. Phase 1: The first phase lasts for at most 9n rounds (refer also to the examples in Figure 2). The agents start in state Init of Algorithm 1 and role Start: each agent walks cautiously clockwise for 9n rounds. If an agent reaches a marked node (predicate marked), then it waits until the next node can be deemed as safe or unsafe (see state Wait). If in the marked node the incident clockwise edge is present and the agent that marked the node does not return, then the next node is the black hole (the agent terminates by triggering predicate NextUnsafe). If two Start agents meet on the same node (predicate meeting[Start]), they synchronise their movements such that they will never cross an edge leading to a possibly unsafe node in the same round. Specifically, the agents enter in the synchronisation state Two, where one agent becomes Follower (Algorithm 3) and the other becomes Explorer (Algorithm 2). The role of Explorer is to visit new nodes, while Follower just follows Explorer when a node is safe (this is similar to Leader and Avanguard in CautiousPendulum). If the remaining Start agent meets with either the Follower or the Explorer, it will assume the behaviour of the Follower (predicate meeting[Follower] in state Init and state Copy). Finally, if the three agents meet on the same node, Phase 1 terminates (see predicate #A = 3 in all states). In all cases, at the end of round 9n, this phase ends. In Section 6.2, we will show that, if in Phase 1 all the alive agents have not localised the Bh, then either: \u2022 three agents gathered: either three agents are on the same node, or two agents are on a node v and the third agent is blocked on the clockwise neighbour v\u2032 of (the marked) node v; or \u2022 the counter-clockwise neighbour of the black hole has been marked, at most one agent is lost, and the two remaining agents are gathered. The two agents are either on the same node, or on two different neighbours node and one of them has marked the node where the other resides. \u2022 the counter-clockwise neighbour of the black hole has been marked, at most one agent is lost, one agent correctly terminated, while the other is still looking for the Bh. Phase 2: The agents start in InitP2 state of Algorithm 4: here, several checks are executed to understand how Phase 1 ended and to orchestrate the behaviour of the agents. In more details: \u2022 Each agent checks if there are other agents on the same node: in case there are two agents, they get the roles of Retroguard and MLeader (their behaviour is similar to Retroguard and Leader in CautiousPendulum). If there are three agents, they start algorithm CautiousPendulum. 12 \fRing n <latexit sha1_base64=\"WmUeyGy+o3Ww9i7I3IRcqTm8m8I=\">ACH3icbVDLTsJAFJ3iC/EF unQzkZi4Iq3B6JLEjUtI5JFAQ6bDBSdMp83MrY0/QK3+gF+jTvjlr+xrV0IeFYn59ybc3K8UAqDtr20SlvbO7t75f3KweHR8Um1dtozQaQ5dHkgAz3wmAEpFHRoIRBqIH5noS+N7/P/P4zaCMC9Y iLEFyfzZSYCs4wlTpqXK3bDTsH3SROQeqkQHtcs8qjScAjHxRyYwZOnaIbsw0Ci4hqYwiAyHjczaDYUoV8G4cd40oZeRYRjQEDQVkuYi/P2ImW/MwvfS5/hk1n3MvE/bxjh9M6NhQojBMWzIBQS8 iDtUgnADoRGhBZ1hyoUJQzRBC8o4T8Uo3WQl0I8kCh28JKtqGu5gUzS7Zz1pTZJ7rhNBs3nWa91SxWLJNzckGuiENuSYs8kDbpEk6AvJI38m59WJ/Wl/X9e1qyip8zsgJr+QM+NqMq</latex it> Marked node <latexit sha1_base64=\"fSY2dA7Dk3P6e1vI ABJVEi7VK0o=\">ACMnicbVDLSgNBEJz1GeMriUcvg0HwFHZF0WPAixchgnlAEkLvpNUhszPLT K8PlvyKV/0Af0Zv4tWPcDfmYIx1Kq6qaLCWElHv/mLSwuLa+sFtaK6xubW9ulcqXlTGIFNoVRx nZCcKikxiZJUtiJLUIUKmyHo7Pcb9+hdLoK3qMsR/BjZbXUgBl0qBU6RE+UHoBdoRDrs0Qx4NS 1a/5E/B5EkxJlU3RGJS9Qm9oRBKhJqHAuW7gx9RPwZIUCsfFXuIwBjGCG+xmVEOErp9Oyo/5fuK ADI/Rcqn4RMTfHylEzj1GYXYZAd26v14u/ud1E7o+7adSxwmhFnkQSYWTICeszFZBPpQWiSBvjl xqLsACEVrJQYhMTLKZgKjRJG05n48q2bhYWhUvl3wd6l50jqsBUe148vDav1oumKB7bI9dsACd sLq7Jw1WJMJ9sCe2DN78V69d+/D+/w5XfCmPztsBt7XNynTqsg=</latexit> Unmarked node <latexit sha1_base64=\"GhaEnOXsPlnEKZq9 /3wKZvxDIa8=\">ACNHicbVDLSgNBEJz1GeMrPm5eBoPgKexKRI+CF48KRoUkhN5JR4fMY5npV eOSf/GqH+C/CN7Eq9/gbszBqHUqrqpouJESU9h+BpMTc/Mzs2XFsqLS8srq5W19QtvUyewIay7 ioGj0oabJAkhVeJQ9Cxwsu4f1z4l7fovLTmnAYJtjVcG9mTAiXOpXNFuE9ZQ2jwfWxy43t4rBT qYa1cAT+l0RjUmVjnHbWglKra0Wq0ZBQ4H0zChNqZ+BICoXDciv1mIDowzU2c2pAo29no/pDvpN 6IMsTdFwqPhLx50cG2vuBjvNLDXTjf3uF+J/XTKl32M6kSVJCI4ogkgpHQV4me+CvCsdEkHRHL k0XIADInSgxC5mOZDTQTqVJF09m4qebhcWxVsV30e6m/5GKvFtVr+2d71aP6eMUS2LbJdF7 IAdsRN2yhpMsAf2yJ7Yc/ASvAXvwcf36VQw/tlgEwg+vwANjau/</latexit> Anon <latexit sha1_base64=\"MsKJeZ7y/1Bn7nji oa7I4K0obGw=\">ACKHicbVBLTgJBFOzBH+IPdOmIzFxRWYIRpcYNy4xkU8EQnqaB3bo6Z50v 9GQydzCrR7A07gzbD2JM8hCwFpVqt5LVcoPpbDoujMnt7G5tb2T3y3s7R8cHhVLxy2rI8OhybXUp uMzC1IoaKJACZ3QAt8CW1/cpv57WcwVmj1gNMQ+gEbKzESnGEqPcY9y+mN0ioZFMtuxZ2DrhNv Qcpkgcag5OR7Q82jABRyaztem6I/ZgZFxCUuhFkLGJ2wM3ZQqFoDtx/PKCT2PLENQzBUSDo X4e9HzAJrp4GfXgYMn+yql4n/ed0IR9f9WKgwQlA8C0IhYR5kuRHpFkCHwgAiy5oDFYpyZhgiGE EZ56kYpeMsBQaRGH0S7KspuG+r2W2nbe61DpVSterXJ5Xy3Xa4sV8+SUnJEL4pErUid3pEGah BNFXskbeXc+nE/ny5n9nuacxc8JWYLz/QOCFqbq</latexit> Bh <latexit sha1_base64=\"jI+Lg/BuaBiUHmDeU6Ft3xoeOwg=\">ACJnicbVDLSsNAFJ34rPXV 6tLNYBFclaQI6q7oxmUF+4A2lMn0th06k4SZG6WE/IRb/QC/xp2IOz/FJGZhW8/qcM69nMPxQikM2vaXtba+sbm1Xdop7+7tHxWqkcdE0SaQ5sHMtA9jxmQwoc2CpTQCzUw5UnoerPbzO8+gjYi8B 9wHoKr2MQXY8EZplIvHhOb6bJsFKz63YOukqcgtRIgdawapUGo4BHCnzkhnTd+wQ3ZhpFxCUh5EBkLGZ2wC/ZT6TIFx47xwQs8iwzCgIWgqJM1F+PsRM2XMXHnpWI4NcteJv7n9SMcX7mx8MIw edZEAoJeZDhWqRLAB0JDYgsaw5U+JQzRBC8o4T8UonWYhUEUShQ6ekU1Dfe8QGbOctLrZJOo+5c1K/vG7WmXaxYIifklJwTh1ySJrkjLdImnEjyTF7Iq/VmvVsf1ufv6ZpV/ByTBVjfP6papfQ =</latexit> (a) Phase 1: run where BHS-Problem is solved. Ring n <latexit sha1_base64=\"WmUeyGy+o3Ww9i7I3IRcqTm8m8I=\">ACH3icbVDLTsJAFJ3iC/EFun QzkZi4Iq3B6JLEjUtI5JFAQ6bDBSdMp83MrY0/QK3+gF+jTvjlr+xrV0IeFYn59ybc3K8UAqDtr20SlvbO7t75f3KweHR8Um1dtozQaQ5dHkgAz3wmAEpFHRoIRBqIH5noS+N7/P/P4zaCMC9YiLEFyfzZ SYCs4wlTpqXK3bDTsH3SROQeqkQHtcs8qjScAjHxRyYwZOnaIbsw0Ci4hqYwiAyHjczaDYUoV8G4cd40oZeRYRjQEDQVkuYi/P2ImW/MwvfS5/hk1n3MvE/bxjh9M6NhQojBMWzIBQS8iDtUgnADoRGh BZ1hyoUJQzRBC8o4T8Uo3WQl0I8kCh28JKtqGu5gUzS7Zz1pTZJ7rhNBs3nWa91SxWLJNzckGuiENuSYs8kDbpEk6AvJI38m59WJ/Wl/X9e1qyip8zsgJr+QM+NqMq</latexit> Marked node <latexit sha1_base64=\"fSY2dA7Dk3P6e1vIABJVEi7VK0o=\">ACMnicbVDLSgNBEJz1GeMriU cvg0HwFHZF0WPAixchgnlAEkLvpNUhszPLTK8PlvyKV/0Af0Zv4tWPcDfmYIx1Kq6qaLCWElHv/mLSwuLa+sFtaK6xubW9ulcqXlTGIFNoVRxnZCcKikxiZJUtiJLUIUKmyHo7Pcb9+hdLoK3qMsR/BjZ bXUgBl0qBU6RE+UHoBdoRDrs0Qx4NS1a/5E/B5EkxJlU3RGJS9Qm9oRBKhJqHAuW7gx9RPwZIUCsfFXuIwBjGCG+xmVEOErp9Oyo/5fuKADI/Rcqn4RMTfHylEzj1GYXYZAd26v14u/ud1E7o+7adSxwmhFn kQSYWTICeszFZBPpQWiSBvjlxqLsACEVrJQYhMTLKZgKjRJG05n48q2bhYWhUvl3wd6l50jqsBUe148vDav1oumKB7bI9dsACdsLq7Jw1WJMJ9sCe2DN78V69d+/D+/w5XfCmPztsBt7XNynTqsg=</late xit> Unmarked node <latexit sha1_base64=\"GhaEnOXsPlnEKZq9/3wKZvxDIa8=\">ACNHicbVDLSgNBEJz1GeMrPm 5eBoPgKexKRI+CF48KRoUkhN5JR4fMY5npVeOSf/GqH+C/CN7Eq9/gbszBqHUqrqpouJESU9h+BpMTc/Mzs2XFsqLS8srq5W19QtvUyewIay7ioGj0oabJAkhVeJQ9Cxwsu4f1z4l7fovLTmnAYJtjVcG9 mTAiXOpXNFuE9ZQ2jwfWxy43t4rBTqYa1cAT+l0RjUmVjnHbWglKra0Wq0ZBQ4H0zChNqZ+BICoXDciv1mIDowzU2c2pAo29no/pDvpN6IMsTdFwqPhLx50cG2vuBjvNLDXTjf3uF+J/XTKl32M6kSVJCI4 ogkgpHQV4me+CvCsdEkHRHLk0XIADInSgxC5mOZDTQTqVJF09m4qebhcWxVsV30e6m/5GKvFtVr+2d71aP6eMUS2LbJdF7IAdsRN2yhpMsAf2yJ7Yc/ASvAXvwcf36VQw/tlgEwg+vwANjau/</late xit> Anon <latexit sha1_base64=\"MsKJeZ7y/1Bn7njioa7I4K0obGw=\">ACKHicbVBLTgJBFOzBH+IPdO mIzFxRWYIRpcYNy4xkU8EQnqaB3bo6Z50v9GQydzCrR7A07gzbD2JM8hCwFpVqt5LVcoPpbDoujMnt7G5tb2T3y3s7R8cHhVLxy2rI8OhybXUpuMzC1IoaKJACZ3QAt8CW1/cpv57WcwVmj1gNMQ+gEbKz ESnGEqPcY9y+mN0ioZFMtuxZ2DrhNvQcpkgcag5OR7Q82jABRyaztem6I/ZgZFxCUuhFkLGJ2wM3ZQqFoDtx/PKCT2PLENQzBUSDoX4e9HzAJrp4GfXgYMn+yql4n/ed0IR9f9WKgwQlA8C0IhYR5kuR HpFkCHwgAiy5oDFYpyZhgiGEZ56kYpeMsBQaRGH0S7KspuG+r2W2nbe61DpVSterXJ5Xy3Xa4sV8+SUnJEL4pErUid3pEGahBNFXskbeXc+nE/ny5n9nuacxc8JWYLz/QOCFqbq</latexit> r0 <latexit sha1_base64=\"ZsngdPOKgvXZiLQgDyhtTWNbOi8=\">ACIXicbVDLSsNAFJ3UV62vVp duBovgqiRS0WXBjcuK9gFtKJPpbR06mYSZG6WEfIJb/QC/xp24E3/GJGZhW8/qcM69nMPxQikM2vaXVpb39jcKm9Xdnb39g+qtcOuCSLNocMDGei+xwxIoaCDAiX0Qw3M9yT0vNl15vceQRsRqHuch+D6bK rERHCGqXSnR/aoWrcbdg6SpyC1EmB9qhmlYfjgEc+KOSGTNw7BDdmGkUXEJSGUYGQsZnbAqDlCrmg3HjvGtCTyPDMKAhaCokzUX4+xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdBKCTkQYZrkY4AdC w0ILKsOVChKGeaIYIWlHGeilG6ykKgH0kUOnhKFtU03PMCmaTbOctLrZLuecNpNi5um/VWs1ixTI7JCTkjDrkLXJD2qRDOJmSZ/JCXq036936sD5/T0tW8XNEFmB9/wCIaPR</latexit> r1 <latexit sha1_base64=\"S2VJmvgfyjzKfeJvPortlM7v24=\">ACIXicbVDLSsNAFJ3UV62vVp duBovgqiRS0WXBjcuK9gFtKJPpbR06mYSZG6WEfIJb/QC/xp24E3/GJGZhW8/qcM69nMPxQikM2vaXVpb39jcKm9Xdnb39g+qtcOuCSLNocMDGei+xwxIoaCDAiX0Qw3M9yT0vNl15vceQRsRqHuch+D6bK rERHCGqXSnR86oWrcbdg6SpyC1EmB9qhmlYfjgEc+KOSGTNw7BDdmGkUXEJSGUYGQsZnbAqDlCrmg3HjvGtCTyPDMKAhaCokzUX4+xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdBKCTkQYZrkY4AdC w0ILKsOVChKGeaIYIWlHGeilG6ykKgH0kUOnhKFtU03PMCmaTbOctLrZLuecNpNi5um/VWs1ixTI7JCTkjDrkLXJD2qRDOJmSZ/JCXq036936sD5/T0tW8XNEFmB9/wCJ3KPS</latexit> r2 <latexit sha1_base64=\"ZPRW8LkRiNV2v6SretHL8oJ4As=\">ACIXicbVDLSsNAFJ34rPXV6t LNYBFclaRUdFlw47KifUAbymR6W4dOJmHmRikhn+BWP8CvcSfuxJ8xiVnY1rM6nHMv53C8UAqDtv1lra1vbG5tl3bKu3v7B4eV6lHXBJHm0OGBDHTfYwakUNBgRL6oQbmexJ63uw683uPoI0I1D3OQ3B9Nl ViIjDVLrTo8aoUrPrdg6SpyC1EiB9qhqlYbjgEc+KOSGTNw7BDdmGkUXEJSHkYGQsZnbAqDlCrmg3HjvGtCzyLDMKAhaCokzUX4+xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdBKCTkQYZrkY4AdC w0ILKsOVChKGeaIYIWlHGeilG6ykKgH0kUOnhKFtU03PMCmaTbOctLrZJuo+406xe3zVqrWaxYIifklJwTh1ySFrkhbdIhnEzJM3khr9ab9W59WJ+/p2tW8XNMFmB9/wCLl6PT</latexit> Bh <latexit sha1_base64=\"jI+Lg/BuaBiUHmDeU6Ft3xoeOwg=\">ACJnicbVDLSsNAFJ34rPXV6t LNYBFclaQI6q7oxmUF+4A2lMn0th06k4SZG6WE/IRb/QC/xp2IOz/FJGZhW8/qcM69nMPxQikM2vaXtba+sbm1Xdop7+7tHxWqkcdE0SaQ5sHMtA9jxmQwoc2CpTQCzUw5UnoerPbzO8+gjYi8B9wHoKr2M QXY8EZplIvHhOb6bJsFKz63YOukqcgtRIgdawapUGo4BHCnzkhnTd+wQ3ZhpFxCUh5EBkLGZ2wC/ZT6TIFx47xwQs8iwzCgIWgqJM1F+PsRM2XMXHnpWI4NcteJv7n9SMcX7mx8MIwedZEAoJeZDhWq RLAB0JDYgsaw5U+JQzRBC8o4T8UonWYhUEUShQ6ekU1Dfe8QGbOctLrZJOo+5c1K/vG7WmXaxYIifklJwTh1ySJrkjLdImnEjyTF7Iq/VmvVsf1ufv6ZpV/ByTBVjfP6papfQ=</latexit> (b) Phase 1: run where two agents gather. At round r0 the rightmost agent enters in the black hole, while the middle agent is blocked. At round r1 the two remaining agents gathers. Ring n <latexit sha1_base64=\"WmUeyGy+o3Ww9i7I3IRcqTm8m8I=\">ACH3icbVDLTsJAFJ3iC/E FunQzkZi4Iq3B6JLEjUtI5JFAQ6bDBSdMp83MrY0/QK3+gF+jTvjlr+xrV0IeFYn59ybc3K8UAqDtr20SlvbO7t75f3KweHR8Um1dtozQaQ5dHkgAz3wmAEpFHRoIRBqIH5noS+N7/P/P4zaCMC9 YiLEFyfzZSYCs4wlTpqXK3bDTsH3SROQeqkQHtcs8qjScAjHxRyYwZOnaIbsw0Ci4hqYwiAyHjczaDYUoV8G4cd40oZeRYRjQEDQVkuYi/P2ImW/MwvfS5/hk1n3MvE/bxjh9M6NhQojBMWzIBQ S8iDtUgnADoRGhBZ1hyoUJQzRBC8o4T8Uo3WQl0I8kCh28JKtqGu5gUzS7Zz1pTZJ7rhNBs3nWa91SxWLJNzckGuiENuSYs8kDbpEk6AvJI38m59WJ/Wl/X9e1qyip8zsgJr+QM+NqMq</lat exit> Marked node <latexit sha1_base64=\"fSY2dA7Dk3P6e1vI ABJVEi7VK0o=\">ACMnicbVDLSgNBEJz1GeMriUcvg0HwFHZF0WPAixchgnlAEkLvpNUhszPLT K8PlvyKV/0Af0Zv4tWPcDfmYIx1Kq6qaLCWElHv/mLSwuLa+sFtaK6xubW9ulcqXlTGIFNoVR xnZCcKikxiZJUtiJLUIUKmyHo7Pcb9+hdLoK3qMsR/BjZbXUgBl0qBU6RE+UHoBdoRDrs0Qx4N S1a/5E/B5EkxJlU3RGJS9Qm9oRBKhJqHAuW7gx9RPwZIUCsfFXuIwBjGCG+xmVEOErp9Oyo/5f uKADI/Rcqn4RMTfHylEzj1GYXYZAd26v14u/ud1E7o+7adSxwmhFnkQSYWTICeszFZBPpQWiSBv jlxqLsACEVrJQYhMTLKZgKjRJG05n48q2bhYWhUvl3wd6l50jqsBUe148vDav1oumKB7bI9dsA CdsLq7Jw1WJMJ9sCe2DN78V69d+/D+/w5XfCmPztsBt7XNynTqsg=</latexit> Unmarked node <latexit sha1_base64=\"GhaEnOXsPlnEKZq9 /3wKZvxDIa8=\">ACNHicbVDLSgNBEJz1GeMrPm5eBoPgKexKRI+CF48KRoUkhN5JR4fMY5npV eOSf/GqH+C/CN7Eq9/gbszBqHUqrqpouJESU9h+BpMTc/Mzs2XFsqLS8srq5W19QtvUyewIay 7ioGj0oabJAkhVeJQ9Cxwsu4f1z4l7fovLTmnAYJtjVcG9mTAiXOpXNFuE9ZQ2jwfWxy43t4rB TqYa1cAT+l0RjUmVjnHbWglKra0Wq0ZBQ4H0zChNqZ+BICoXDciv1mIDowzU2c2pAo29no/pDv pN6IMsTdFwqPhLx50cG2vuBjvNLDXTjf3uF+J/XTKl32M6kSVJCI4ogkgpHQV4me+CvCsdEkHR HLk0XIADInSgxC5mOZDTQTqVJF09m4qebhcWxVsV30e6m/5GKvFtVr+2d71aP6eMUS2LbJd F7IAdsRN2yhpMsAf2yJ7Yc/ASvAXvwcf36VQw/tlgEwg+vwANjau/</latexit> Anon <latexit sha1_base64=\"MsKJeZ7y/1Bn7nji oa7I4K0obGw=\">ACKHicbVBLTgJBFOzBH+IPdOmIzFxRWYIRpcYNy4xkU8EQnqaB3bo6Z50v 9GQydzCrR7A07gzbD2JM8hCwFpVqt5LVcoPpbDoujMnt7G5tb2T3y3s7R8cHhVLxy2rI8OhybXU puMzC1IoaKJACZ3QAt8CW1/cpv57WcwVmj1gNMQ+gEbKzESnGEqPcY9y+mN0ioZFMtuxZ2DrhN vQcpkgcag5OR7Q82jABRyaztem6I/ZgZFxCUuhFkLGJ2wM3ZQqFoDtx/PKCT2PLENQzBUS DoX4e9HzAJrp4GfXgYMn+yql4n/ed0IR9f9WKgwQlA8C0IhYR5kuRHpFkCHwgAiy5oDFYpyZhgi GEZ56kYpeMsBQaRGH0S7KspuG+r2W2nbe61DpVSterXJ5Xy3Xa4sV8+SUnJEL4pErUid3pEG ahBNFXskbeXc+nE/ny5n9nuacxc8JWYLz/QOCFqbq</latexit> Follower <latexit sha1_base64=\"qe+/iWEY2CEkjoQi J43kZDRucqQ=\">ACLHicbVDLSsNAFJ34rPXV6tLNYBFclaRUdFkQxGUF+4A2lsn0tg6dZMLMj aWE/odb/QC/xo2IW7/DJGZhW8/qcM69nMPxQikM2vaHtba+sbm1Xdgp7u7tHxyWykdtoyLNocWV VLrMQNSBNBCgRK6oQbmexI63uQ69TtPoI1QwT3OQnB9Ng7ESHCGifQ9w2nN0pKNQU9H5QqdtX OQFeJk5MKydEclK1Cf6h45EOAXDJjeo4dohszjYJLmBf7kYGQ8QkbQy+hAfPBuHFWe07PIsNQ0 RA0FZJmIvz9iJlvzMz3kuf4aNZ9lLxP68X4ejKjUQRgBT4NQSMiCDNci2QPoUGhAZGlzoCKg nGmGCFpQxnkiRslAC4F+JFoNZ0vqkm45ymZbucsL7VK2rWqU69e3NUqjXq+YoGckFNyThxySRr kljRJi3CiyTN5Ia/Wm/VufVpfv6drVv5zTBZgf8ALCo0A=</latexit> Explorer <latexit sha1_base64=\"CKYuK9yYXQ/t25uA dLHZd14G6sM=\">ACLHicbVDJSgNBFOxjXFL9OilMQiewkyI6DEgscIZoFkD2dl9ikZ6H7j RqG/IdX/QC/xouIV7/DnEOJrFORVU96lFeJIVG2/6wVlbX1jc2C1vF7Z3dvf1S+aCtw1hxaPFQ hqrMQ1SBNBCgRK6kQLmexI63uQy9TsPoLQIg1ucRuD6bByIkeAMjXSX9DWnV0+RiYGaDUoVu2p noMvEyUmF5GgOylahPwx57EOAXDKte4doZswhYJLmBX7sYaI8QkbQ8/QgPmg3SR7e0ZPYs0wp BEoKiTNRPh7kTBf6nvmaTP8F4veqn4n9eLcXThJiKIYoSAp0UoJGRFmith9gA6FAoQWfo5UBFQ zhRDBCUo49yIsRlortCPJQoVPs7mVPueaFMt3MWl1om7VrVqVfPbmqVRj1fsUCOyDE5JQ45Jw1 yTZqkRThR5Jm8kFfrzXq3Pq2v3+iKld8ckjlY3z85DajX</latexit> r0 <latexit sha1_base64=\"ZsngdPOKgvXZiLQg DyhtTWNbOi8=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRS0WXBjcuK9gFtKJPpbR06mYSZG 6WEfIJb/QC/xp24E3/GJGZhW8/qcM69nMPxQikM2vaXVpb39jcKm9Xdnb39g+qtcOuCSLNocMD Gei+xwxIoaCDAiX0Qw3M9yT0vNl15vceQRsRqHuch+D6bKrERHCGqXSnR/aoWrcbdg6SpyC1Em B9qhmlYfjgEc+KOSGTNw7BDdmGkUXEJSGUYGQsZnbAqDlCrmg3HjvGtCTyPDMKAhaCokzUX4+ xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdBKCTkQYZrkY4AdCw0ILKsOVChKGeaIYIWlHGe ilG6ykKgH0kUOnhKFtU03PMCmaTbOctLrZLuecNpNi5um/VWs1ixTI7JCTkjDrkLXJD2qRDOJm SZ/JCXq036936sD5/T0tW8XNEFmB9/wCIaPR</latexit> r1 <latexit sha1_base64=\"S2VJmvgfyjzKfeJ vPortlM7v24=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRS0WXBjcuK9gFtKJPpbR06mYSZG 6WEfIJb/QC/xp24E3/GJGZhW8/qcM69nMPxQikM2vaXVpb39jcKm9Xdnb39g+qtcOuCSLNocMD Gei+xwxIoaCDAiX0Qw3M9yT0vNl15vceQRsRqHuch+D6bKrERHCGqXSnR86oWrcbdg6SpyC1Em B9qhmlYfjgEc+KOSGTNw7BDdmGkUXEJSGUYGQsZnbAqDlCrmg3HjvGtCTyPDMKAhaCokzUX4+ xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdBKCTkQYZrkY4AdCw0ILKsOVChKGeaIYIWlHGe ilG6ykKgH0kUOnhKFtU03PMCmaTbOctLrZLuecNpNi5um/VWs1ixTI7JCTkjDrkLXJD2qRDOJm SZ/JCXq036936sD5/T0tW8XNEFmB9/wCJ3KPS</latexit> r2 <latexit sha1_base64=\"ZPRW8LkRiNV2v6S retHL8oJ4As=\">ACIXicbVDLSsNAFJ34rPXV6tLNYBFclaRUdFlw47KifUAbymR6W4dOJmHmR ikhn+BWP8CvcSfuxJ8xiVnY1rM6nHMv53C8UAqDtv1lra1vbG5tl3bKu3v7B4eV6lHXBJHm0OGB DHTfYwakUNBgRL6oQbmexJ63uw683uPoI0I1D3OQ3B9NlViIjDVLrTo8aoUrPrdg6SpyC1Ei B9qhqlYbjgEc+KOSGTNw7BDdmGkUXEJSHkYGQsZnbAqDlCrmg3HjvGtCzyLDMKAhaCokzUX4+ xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdBKCTkQYZrkY4AdCw0ILKsOVChKGeaIYIWlHGe ilG6ykKgH0kUOnhKFtU03PMCmaTbOctLrZJuo+406xe3zVqrWaxYIifklJwTh1ySFrkhbdIhnEz JM3khr9ab9W59WJ+/p2tW8XNMFmB9/wCLl6PT</latexit> r3 <latexit sha1_base64=\"plfkRtnywIkqCd3 9pftApfaXZY=\">ACIXicbVDLSsNAFJ34rPXV6tLNYBFclUQruiy4cVnRPqANZTK9rUMnmTBzo 5SQT3CrH+DXuBN34s+YxCxs61kdzrmXczheKIVB2/6yVlbX1jc2S1vl7Z3dvf1K9aBjVKQ5tLmS Svc8ZkCKANoUEIv1MB8T0LXm15nfvcRtBEquMdZCK7PJoEYC84wle708HxYqdl1OwdJk5BaqR Aa1i1SoOR4pEPAXLJjOk7dohuzDQKLiEpDyIDIeNTNoF+SgPmg3HjvGtCTyLDUNEQNBWS5iL8/ YiZb8zM9JLn+GDWfQy8T+vH+H4yo1FEYIAc+CUEjIgwzXIh0B6EhoQGRZc6AioJxphghaUMZ5 KkbpKnOBfiRaPWUzKtpuOcpmaTbOYtLZPOWd1p1C9uG7Vmo1ixRI7IMTklDrkTXJDWqRNOJm QZ/JCXq036936sD5/T1es4ueQzMH6/gGNUqPU</latexit> Bh <latexit sha1_base64=\"jI+Lg/BuaBiUHmDeU6Ft3xoeOwg=\">ACJnicbVDLSsNAFJ34rPX V6tLNYBFclaQI6q7oxmUF+4A2lMn0th06k4SZG6WE/IRb/QC/xp2IOz/FJGZhW8/qcM69nMPxQikM2vaXtba+sbm1Xdop7+7tHxWqkcdE0SaQ5sHMtA9jxmQwoc2CpTQCzUw5UnoerPbzO8+gjYi8 B9wHoKr2MQXY8EZplIvHhOb6bJsFKz63YOukqcgtRIgdawapUGo4BHCnzkhnTd+wQ3ZhpFxCUh5EBkLGZ2wC/ZT6TIFx47xwQs8iwzCgIWgqJM1F+PsRM2XMXHnpWI4NcteJv7n9SMcX7mx8M IwedZEAoJeZDhWqRLAB0JDYgsaw5U+JQzRBC8o4T8UonWYhUEUShQ6ekU1Dfe8QGbOctLrZJOo+5c1K/vG7WmXaxYIifklJwTh1ySJrkjLdImnEjyTF7Iq/VmvVsf1ufv6ZpV/ByTBVjfP6pap fQ=</latexit> (c) Phase 1: run where three agents gather. At round r0 the rightmost agent is blocked. At round r1 two agents meet creating a pair Explorer-Follower. At round r2 the pair is blocked and the leftmost agent is able to catch up. At round r3 the tree agents gathered. Note that the meeting predicate of the Start with the Follower triggers at round r3 and r3 \u22122: when an agent is cautious exploring it cannot meet other agents if it has to unmark a node. Figure 2: Example of runs for Phase 1 of Gather&Locate. 13 \fRing n <latexit sha1_base64=\"WmUeyGy+o3Ww9i7I3IRcqTm8m8I=\">ACH3icbVDLTsJAFJ3iC/EFunQzkZi4 Iq3B6JLEjUtI5JFAQ6bDBSdMp83MrY0/QK3+gF+jTvjlr+xrV0IeFYn59ybc3K8UAqDtr20SlvbO7t75f3KweHR8Um1dtozQaQ5dHkgAz3wmAEpFHRoIRBqIH5noS+N7/P/P4zaCMC9YiLEFyfzZSYCs4wlTpqXK3bDTs H3SROQeqkQHtcs8qjScAjHxRyYwZOnaIbsw0Ci4hqYwiAyHjczaDYUoV8G4cd40oZeRYRjQEDQVkuYi/P2ImW/MwvfS5/hk1n3MvE/bxjh9M6NhQojBMWzIBQS8iDtUgnADoRGhBZ1hyoUJQzRBC8o4T8Uo3WQl0 I8kCh28JKtqGu5gUzS7Zz1pTZJ7rhNBs3nWa91SxWLJNzckGuiENuSYs8kDbpEk6AvJI38m59WJ/Wl/X9e1qyip8zsgJr+QM+NqMq</latexit> Marked node <latexit sha1_base64=\"fSY2dA7Dk3P6e1vIABJV Ei7VK0o=\">ACMnicbVDLSgNBEJz1GeMriUcvg0HwFHZF0WPAixchgnlAEkLvpNUhszPLTK8PlvyKV/0Af0 Zv4tWPcDfmYIx1Kq6qaLCWElHv/mLSwuLa+sFtaK6xubW9ulcqXlTGIFNoVRxnZCcKikxiZJUtiJLUIUK myHo7Pcb9+hdLoK3qMsR/BjZbXUgBl0qBU6RE+UHoBdoRDrs0Qx4NS1a/5E/B5EkxJlU3RGJS9Qm9oRBKh JqHAuW7gx9RPwZIUCsfFXuIwBjGCG+xmVEOErp9Oyo/5fuKADI/Rcqn4RMTfHylEzj1GYXYZAd26v14u/ud1 E7o+7adSxwmhFnkQSYWTICeszFZBPpQWiSBvjlxqLsACEVrJQYhMTLKZgKjRJG05n48q2bhYWhUvl3wd6l 50jqsBUe148vDav1oumKB7bI9dsACdsLq7Jw1WJMJ9sCe2DN78V69d+/D+/w5XfCmPztsBt7XNynTqsg=</ latexit> Anon <latexit sha1_base64=\"MsKJeZ7y/1Bn7njioa7I 4K0obGw=\">ACKHicbVBLTgJBFOzBH+IPdOmIzFxRWYIRpcYNy4xkU8EQnqaB3bo6Z50v9GQydzCrR7A07 gzbD2JM8hCwFpVqt5LVcoPpbDoujMnt7G5tb2T3y3s7R8cHhVLxy2rI8OhybXUpuMzC1IoaKJACZ3QAt8C W1/cpv57WcwVmj1gNMQ+gEbKzESnGEqPcY9y+mN0ioZFMtuxZ2DrhNvQcpkgcag5OR7Q82jABRyaztem6I /ZgZFxCUuhFkLGJ2wM3ZQqFoDtx/PKCT2PLENQzBUSDoX4e9HzAJrp4GfXgYMn+yql4n/ed0IR9f9WKgw QlA8C0IhYR5kuRHpFkCHwgAiy5oDFYpyZhgiGEZ56kYpeMsBQaRGH0S7KspuG+r2W2nbe61DpVSterXJ 5Xy3Xa4sV8+SUnJEL4pErUid3pEGahBNFXskbeXc+nE/ny5n9nuacxc8JWYLz/QOCFqbq</latexit> r1 <latexit sha1_base64=\"S2VJmvgfyjzKfeJvPor tlM7v24=\">ACIXicbVDLSsNAFJ3UV62vVpduBovgqiRS0WXBjcuK9gFtKJPpbR06mYSZG6WEfIJb/QC/xp 24E3/GJGZhW8/qcM69nMPxQikM2vaXVpb39jcKm9Xdnb39g+qtcOuCSLNocMDGei+xwxIoaCDAiX0Qw3M9 yT0vNl15vceQRsRqHuch+D6bKrERHCGqXSnR86oWrcbdg6SpyC1EmB9qhmlYfjgEc+KOSGTNw7BDdmGkU XEJSGUYGQsZnbAqDlCrmg3HjvGtCTyPDMKAhaCokzUX4+xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdB KCTkQYZrkY4AdCw0ILKsOVChKGeaIYIWlHGeilG6ykKgH0kUOnhKFtU03PMCmaTbOctLrZLuecNpNi5um/V Ws1ixTI7JCTkjDrkLXJD2qRDOJmSZ/JCXq036936sD5/T0tW8XNEFmB9/wCJ3KPS</latexit> r2 <latexit sha1_base64=\"ZPRW8LkRiNV2v6SretH L8oJ4As=\">ACIXicbVDLSsNAFJ34rPXV6tLNYBFclaRUdFlw47KifUAbymR6W4dOJmHmRikhn+BWP8CvcS fuxJ8xiVnY1rM6nHMv53C8UAqDtv1lra1vbG5tl3bKu3v7B4eV6lHXBJHm0OGBDHTfYwakUNBgRL6oQbme xJ63uw683uPoI0I1D3OQ3B9NlViIjDVLrTo8aoUrPrdg6SpyC1EiB9qhqlYbjgEc+KOSGTNw7BDdmGkU XEJSHkYGQsZnbAqDlCrmg3HjvGtCzyLDMKAhaCokzUX4+xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdB KCTkQYZrkY4AdCw0ILKsOVChKGeaIYIWlHGeilG6ykKgH0kUOnhKFtU03PMCmaTbOctLrZJuo+406xe3zVq rWaxYIifklJwTh1ySFrkhbdIhnEzJM3khr9ab9W59WJ+/p2tW8XNMFmB9/wCLl6PT</latexit> a <latexit sha1_base64=\"ZOC8MUE7yAhrFfu3xB9 BvN3XU=\">ACH3icbVDLTgJBEJzF+IL9OhlIjHxRHYNRo8kXjxCIo8ENqR3aHDC7CMzvRpC+AKv+gF+jT fjlb9xd92DgHWqVHWnKuVFShqy7aV2Nre2d0r7pcODo+OT8qV04JYy2wLUIV6p4HBpUMsE2SFPYijeB7C rve9D71u8+ojQyDR5pF6PowCeRYCqBEasGwXLVrdga+SZycVFmO5rBiFQejUMQ+BiQUGN37IjcOWiSQuGi NIgNRiCmMF+QgPw0bjzrOmCX8YGKOQRai4Vz0T8+zEH35iZ7yWXPtCTWfdS8T+vH9P4zp3LIoJA5EGkVSY BRmhZTIB8pHUSARpc+Qy4AI0EKGWHIRIxDjZCXQjxVJHb4sVtUk3PNCtUi2c9aX2iSd65pTr9206tVGPV+ xyM7ZBbtiDrtlDfbAmqzNBEP2yt7Yu/VhfVpf1vfvacHKf87YCqzlDye3ox0=</latexit> Unmarked node <latexit sha1_base64=\"GhaEnOXsPlnEKZq9/3wK ZvxDIa8=\">ACNHicbVDLSgNBEJz1GeMrPm5eBoPgKexKRI+CF48KRoUkhN5JR4fMY5npVeOSf/GqH+C/CN 7Eq9/gbszBqHUqrqpouJESU9h+BpMTc/Mzs2XFsqLS8srq5W19QtvUyewIay7ioGj0oabJAkhVeJQ9Cxw su4f1z4l7fovLTmnAYJtjVcG9mTAiXOpXNFuE9ZQ2jwfWxy43t4rBTqYa1cAT+l0RjUmVjnHbWglKra0Wq 0ZBQ4H0zChNqZ+BICoXDciv1mIDowzU2c2pAo29no/pDvpN6IMsTdFwqPhLx50cG2vuBjvNLDXTjf3uF+J/X TKl32M6kSVJCI4ogkgpHQV4me+CvCsdEkHRHLk0XIADInSgxC5mOZDTQTqVJF09m4qebhcWxVsV30e6m /5GKvFtVr+2d71aP6eMUS2LbJdF7IAdsRN2yhpMsAf2yJ7Yc/ASvAXvwcf36VQw/tlgEwg+vwANjau/</ latexit> Bh <latexit sha1_base64=\"jI+Lg/BuaBiUHmDeU6Ft 3xoeOwg=\">ACJnicbVDLSsNAFJ34rPXV6tLNYBFclaQI6q7oxmUF+4A2lMn0th06k4SZG6WE/IRb/QC/xp 2IOz/FJGZhW8/qcM69nMPxQikM2vaXtba+sbm1Xdop7+7tHxWqkcdE0SaQ5sHMtA9jxmQwoc2CpTQCzUw5 UnoerPbzO8+gjYi8B9wHoKr2MQXY8EZplIvHhOb6bJsFKz63YOukqcgtRIgdawapUGo4BHCnzkhnTd+wQ 3ZhpFxCUh5EBkLGZ2wC/ZT6TIFx47xwQs8iwzCgIWgqJM1F+PsRM2XMXHnpWI4NcteJv7n9SMcX7mx8MI wedZEAoJeZDhWqRLAB0JDYgsaw5U+JQzRBC8o4T8UonWYhUEUShQ6ekU1Dfe8QGbOctLrZJOo+5c1K/ vG7WmXaxYIifklJwTh1ySJrkjLdImnEjyTF7Iq/VmvVsf1ufv6ZpV/ByTBVjfP6papfQ=</latexit> (a) Phase 2: case of two agents gathered on the same edge. At round r1 agent a triggers the timeout and goes in state Forward starting moving clockwise. At round r2 it finds the marked node and terminates. Note that the other agent is either unblocked and thus reach the marked node and correctly terminate or it waits forever on a missing edge. Ring n <latexit sha1_base64=\"WmUeyGy+o3Ww9i7I3IRcqTm8m8I=\">ACH3icbVDLTsJAFJ3iC/EFunQzkZi4 Iq3B6JLEjUtI5JFAQ6bDBSdMp83MrY0/QK3+gF+jTvjlr+xrV0IeFYn59ybc3K8UAqDtr20SlvbO7t75f3KweHR8Um1dtozQaQ5dHkgAz3wmAEpFHRoIRBqIH5noS+N7/P/P4zaCMC9YiLEFyfzZSYCs4wlTpqXK3bDTs H3SROQeqkQHtcs8qjScAjHxRyYwZOnaIbsw0Ci4hqYwiAyHjczaDYUoV8G4cd40oZeRYRjQEDQVkuYi/P2ImW/MwvfS5/hk1n3MvE/bxjh9M6NhQojBMWzIBQS8iDtUgnADoRGhBZ1hyoUJQzRBC8o4T8Uo3WQl0 I8kCh28JKtqGu5gUzS7Zz1pTZJ7rhNBs3nWa91SxWLJNzckGuiENuSYs8kDbpEk6AvJI38m59WJ/Wl/X9e1qyip8zsgJr+QM+NqMq</latexit> Marked node <latexit sha1_base64=\"fSY2dA7Dk3P6e1vIABJVEi7VK0o=\">ACMnicbVDLSgNBEJz1GeMriUcvg0Hw FHZF0WPAixchgnlAEkLvpNUhszPLTK8PlvyKV/0Af0Zv4tWPcDfmYIx1Kq6qaLCWElHv/mLSwuLa+sFtaK6xubW9ulcqXlTGIFNoVRxnZCcKikxiZJUtiJLUIUKmyHo7Pcb9+hdLoK3qMsR/BjZbXUgBl0qBU6RE+UHo BdoRDrs0Qx4NS1a/5E/B5EkxJlU3RGJS9Qm9oRBKhJqHAuW7gx9RPwZIUCsfFXuIwBjGCG+xmVEOErp9Oyo/5fuKADI/Rcqn4RMTfHylEzj1GYXYZAd26v14u/ud1E7o+7adSxwmhFnkQSYWTICeszFZBPpQWiSBvjlxqL sACEVrJQYhMTLKZgKjRJG05n48q2bhYWhUvl3wd6l50jqsBUe148vDav1oumKB7bI9dsACdsLq7Jw1WJMJ9sCe2DN78V69d+/D+/w5XfCmPztsBt7XNynTqsg=</latexit> Anon <latexit sha1_base64=\"MsKJeZ7y/1Bn7njioa7I4K0obGw=\">ACKHicbVBLTgJBFOzBH+IPdOmIzFx RWYIRpcYNy4xkU8EQnqaB3bo6Z50v9GQydzCrR7A07gzbD2JM8hCwFpVqt5LVcoPpbDoujMnt7G5tb2T3y3s7R8cHhVLxy2rI8OhybXUpuMzC1IoaKJACZ3QAt8CW1/cpv57WcwVmj1gNMQ+gEbKzESnGEqPcY9y+mN0io ZFMtuxZ2DrhNvQcpkgcag5OR7Q82jABRyaztem6I/ZgZFxCUuhFkLGJ2wM3ZQqFoDtx/PKCT2PLENQzBUSDoX4e9HzAJrp4GfXgYMn+yql4n/ed0IR9f9WKgwQlA8C0IhYR5kuRHpFkCHwgAiy5oDFYpyZhgiGEZ5 6kYpeMsBQaRGH0S7KspuG+r2W2nbe61DpVSterXJ5Xy3Xa4sV8+SUnJEL4pErUid3pEGahBNFXskbeXc+nE/ny5n9nuacxc8JWYLz/QOCFqbq</latexit> r1 <latexit sha1_base64=\"S2VJmvgfyjzKfeJvPortlM7v24=\">ACIXicbVDLSsNAFJ3UV62vVpduBovg qiRS0WXBjcuK9gFtKJPpbR06mYSZG6WEfIJb/QC/xp24E3/GJGZhW8/qcM69nMPxQikM2vaXVpb39jcKm9Xdnb39g+qtcOuCSLNocMDGei+xwxIoaCDAiX0Qw3M9yT0vNl15vceQRsRqHuch+D6bKrERHCGqXSnR86oWrc bdg6SpyC1EmB9qhmlYfjgEc+KOSGTNw7BDdmGkUXEJSGUYGQsZnbAqDlCrmg3HjvGtCTyPDMKAhaCokzUX4+xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdBKCTkQYZrkY4AdCw0ILKsOVChKGeaIYIWlHGeilG6y kKgH0kUOnhKFtU03PMCmaTbOctLrZLuecNpNi5um/VWs1ixTI7JCTkjDrkLXJD2qRDOJmSZ/JCXq036936sD5/T0tW8XNEFmB9/wCJ3KPS</latexit> r2 <latexit sha1_base64=\"ZPRW8LkRiNV2v6SretHL8oJ4As=\">ACIXicbVDLSsNAFJ34rPXV6tLNYBFc laRUdFlw47KifUAbymR6W4dOJmHmRikhn+BWP8CvcSfuxJ8xiVnY1rM6nHMv53C8UAqDtv1lra1vbG5tl3bKu3v7B4eV6lHXBJHm0OGBDHTfYwakUNBgRL6oQbmexJ63uw683uPoI0I1D3OQ3B9NlViIjDVLrTo8aoUrP rdg6SpyC1EiB9qhqlYbjgEc+KOSGTNw7BDdmGkUXEJSHkYGQsZnbAqDlCrmg3HjvGtCzyLDMKAhaCokzUX4+xEz35i576WXPsMHs+xl4n/eIMLJlRsLFUYIimdBKCTkQYZrkY4AdCw0ILKsOVChKGeaIYIWlHGeilG6y kKgH0kUOnhKFtU03PMCmaTbOctLrZJuo+406xe3zVqrWaxYIifklJwTh1ySFrkhbdIhnEzJM3khr9ab9W59WJ+/p2tW8XNMFmB9/wCLl6PT</latexit> Retroguard <latexit sha1_base64=\"dFD4dx58n3gH38dflmRGgfTILJI=\">ACMHicbVDLSgNBEJz1Gd+JHr0MBsFT 2A2KHgNePEYxD0hC6J20cjszjLTEwlL/sSrfoBfoyfx6le4G3Mwap2Kqm6qDBR0pLv3lLyura+uFjc2t7Z3dvWJpv2m1MwIbQit2iFYVDLGBklS2E4MQhQqbIWjy9xvjdFYqeNbmiTYi2AYyzspgDKpXymXSv4DZL RQwdmMO0Xy37Fn4H/JcGclNkc9X7JK3QHWrgIYxIKrO0EfkK9FAxJoXC62XUWExAjGInozFEaHvprPqUHzsLpHmChkvFZyL+/EghsnYShdlBHRvf3u5+J/XcXR30UtlnDjCWORBJBXOgqwMtsE+UAaJIK8OXIZcwEGi NBIDkJkostGWgiMnCJp9MN0Uc3Cw1CrfLvg91J/SbNaCU4rZ9fVcu10vmKBHbIjdsICds5q7IrVWYMJNmaP7Ik9ey/eq/fufXyfLnznwO2AO/zC3IJqeo=</latexit> MLeader <latexit sha1_base64=\"GT/GN6xa+vtcoWKTu0iZfPBHWho=\">ACK3icbVDLTgJBEJz1ifgCPXqZSEw8 kV2C0SOJFw+aYCKPBDakd2hwuzDmV4N2fAdXvUD/BpPGq/+h7vIQcA6Vaq6U5XyIiUN2faHtbK6tr6xmdvKb+/s7u0XigdNE8ZaYEOEKtRtDwqGWCDJClsRxrB9xS2vNFl5rceURsZBnc0jtD1YRjIgRAqeQmXSP4zTV CH/WkVyjZXsKvkycGSmxGeq9opXr9kMR+xiQUGBMx7EjchPQJIXCSb4bG4xAjGCInZQG4KNxk2nrCT+JDVDI9RcKj4V8e9HAr4xY9L32ge7PoZeJ/XiemwYWbyCKCQORBZFUOA0yQst0DuR9qZEIsubIZcAFaCBCL TkIkYpxus9coB8rkjp8msyrabjnhSrbzlcapk0K2WnWj67rZRq1dmKOXbEjtkpc9g5q7ErVmcNJtgDe2Yv7NV6s96tT+vr93TFmv0csjlY3z/QkKgW</latexit> a <latexit sha1_base64=\"ZOC8MUE7yAhrFfu3xB9BvN3XU=\">ACH3icbVDLTgJBEJzF+IL9OhlIjHx RHYNRo8kXjxCIo8ENqR3aHDC7CMzvRpC+AKv+gF+jTfjlb9xd92DgHWqVHWnKuVFShqy7aV2Nre2d0r7pcODo+OT8qV04JYy2wLUIV6p4HBpUMsE2SFPYijeB7Crve9D71u8+ojQyDR5pF6PowCeRYCqBEasGwXLVrdga +SZycVFmO5rBiFQejUMQ+BiQUGN37IjcOWiSQuGiNIgNRiCmMF+QgPw0bjzrOmCX8YGKOQRai4Vz0T8+zEH35iZ7yWXPtCTWfdS8T+vH9P4zp3LIoJA5EGkVSYBRmhZTIB8pHUSARpc+Qy4AI0EKGWHIRIxDjZCXQj xVJHb4sVtUk3PNCtUi2c9aX2iSd65pTr9206tVGPV+xyM7ZBbtiDrtlDfbAmqzNBEP2yt7Yu/VhfVpf1vfvacHKf87YCqzlDye3ox0=</latexit> Bh <latexit sha1_base64=\"jI+Lg/BuaBiUHmDeU6Ft3xoeOwg=\">ACJnicbVDLSsNAFJ34rPXV6tLNYBFc laQI6q7oxmUF+4A2lMn0th06k4SZG6WE/IRb/QC/xp2IOz/FJGZhW8/qcM69nMPxQikM2vaXtba+sbm1Xdop7+7tHxWqkcdE0SaQ5sHMtA9jxmQwoc2CpTQCzUw5UnoerPbzO8+gjYi8B9wHoKr2MQXY8EZplIvHhOb6b JsFKz63YOukqcgtRIgdawapUGo4BHCnzkhnTd+wQ3ZhpFxCUh5EBkLGZ2wC/ZT6TIFx47xwQs8iwzCgIWgqJM1F+PsRM2XMXHnpWI4NcteJv7n9SMcX7mx8MIwedZEAoJeZDhWqRLAB0JDYgsaw5U+JQzRBC8o4T 8UonWYhUEUShQ6ekU1Dfe8QGbOctLrZJOo+5c1K/vG7WmXaxYIifklJwTh1ySJrkjLdImnEjyTF7Iq/VmvVsf1ufv6ZpV/ByTBVjfP6papfQ=</latexit> (b) Phase 2: case of three agents gathered, two on the same node the other on the neighbour. At round r1 the Retroguard enters in the black hole. At round r2 the MLeader detects that Retroguard failed to report an terminates. Note that this happens before a timeouts. Figure 3: Example of runs for Phase 2 of Gather&Locate. 1: Predicates Shorthands: NextUnsafe = Etime > EMtime[C] 2: NextSafe = the agent that marked the node returned. 3: States: {Init, Wait, EndPhase1, Terminate, Copy}. 4: In state Init: 5: CautiousExplore(right | T time = 9n\u2228#A = 3: EndPhase1; marked: Wait; meeting[Start]: Two; meeting[Follower] \u2228meeting[Explorer]: Copy) 6: In state Wait: 7: Explore(nil | T time = 9n \u2228#A = 3: EndPhase1; NextUnsafe: Terminate; NextSafe : Init) 8: In state Two: 9: Use IDs to assign to yourself a role in {Follower, Explorer} in a mutual exclusive fashion. 10: Execute the corresponding Algorithm, that is Alg. 3 in state WaitFollower, or Alg. 2 in state Explorer. 11: In state Copy: 12: set your role to Follower. 13: In state EndPhase1: 14: take the role of Start 15: starts Phase 2 by entering state InitP2 of Alg. 4. 16: In state Terminate: 17: terminate, Bh is the next node in clockwise direction. 18: Algorithm 1: Gather&Locate; Phase 1 Algorithm for scattered agents Start 14 \f1: States: {Explorer, Back, MoveForward, EndPhase1, Terminate}. \u25b7Terminate and EndPhase1 as in Algorithm 1 2: In state Explorer: 3: if current node is not marked then 4: mark current node 5: Explore(right | T time = 9n \u2228#A = 3: EndPhase1; Enodes > 0 : Back) 6: else 7: Explore(nil | T time = 9n \u2228#A = 3: EndPhase1; NextUnsafe: Terminate) \u25b7If the node is marked we have to wait to see if it is safe to move 8: In state Back: 9: Explore(left | T time = 9n \u2228#A = 3: EndPhase1; Enodes > 0 : MoveForward) 10: In state MoveForward: 11: unmark current node 12: Explore(right | T time = 9n \u2228#A = 3: EndPhase1; Enodes > 0 : Explorer) 13: Algorithm 2: Gather&Locate; Phase 1 Algorithm for Explorer 1: States: {WaitFollower, Follow, EndPhase1}. \u25b7EndPhase1 as in Algorithm 1 2: In state WaitFollower: 3: Explore(nil | T time = 9n \u2228#A = 3: EndPhase1, Meeting[Back]: Follow ) 4: In state Follow: 5: Explore(right | T time = 9n \u2228#A = 3: EndPhase1, Enodes > 0: WaitFollower ) 6: Algorithm 3: Gather&Locate; Phase 1 Algorithm for Follower \u2022 If the agent is missing the pebble, then it was blocked while trying to recover its pebble at the end of Phase 1. The agent tries to recover the pebble by moving counter-clockwise on one step for 4\u00b7n2 rounds. If during this period it succeeds then it goes to state Forward. If 4 \u00b7 n2 rounds have passed without succeeding, then the agent goes in the Forward state. This move has the following goal: if there are two agents on its counterclockwise node, then they have role Retroguard and MLeader, and in 4 \u00b7 n2 rounds can locate black hole. Otherwise, if there is just one agent on the clockwise node or if there is no one, this timeout avoids that the agent is blocked forever on a missing edge trying to recover a pebble. \u2022 If the agent is on a marked node, then it waits there until either it meets the agent that marked the node, or 4 \u00b7 n2 rounds have passed. If they meet, they get the roles of Retroguard and MLeader; otherwise, if the timeout triggers, the agent goes in state Forward. \u2022 If none of the above applies, the agent goes in state Forward. We now detail the behaviour of the agents: \u2022 Agent MLeader and agent Retroguard. The MLeader moves clockwise, while Retroguard acts as in Algorithm CautiousPendulum. If Retroguard fails to report, MLeader identifies the black hole and terminates. Finally, if MLeader and an agent that is not Retroguard meet, then this new agent takes the role of Avanguard and MLeader the role of Leader, and they behave exactly as in Algorithm CautiousPendulum (predicate meeting[Leader] and state BeAvanguard for the agent with role Start; 15 \fand predicate meeting[Start] and state GoToCP for the Leader). The only caveat in this case, is that MLeader keeps the value of variable #Meets[Retroguard] when switching to Leader. \u2022 Agent in state Forward. In state Forward an agent moves in the clockwise direction. If it reaches a marked node, then it discovered the black hole and the agent terminates. If two agents in state Forward meet, they use their IDs to get the roles of MLeader and Retroguard. 1: Predicates Shorthands: NextUnsafe = Etime > EMtime[C] 2: States: {InitP2, BeAvanguard, Terminate, AssignRoles}. 3: In state InitP2: 4: if #A > 1 then 5: go to state AssignRoles 6: else if my pebble is missing then 7: Explore(left |meeting[Start]: AssignRoles; meeting[MLeader]: BeAvanguard; Enodes > 0: Forward ; T time > 4n2: Forward) 8: else if the current node is marked then 9: take the pebble if yours 10: Explore(nil |meeting[Start]: AssignRoles; T time > 4n2: Forward) 11: else 12: go to state Forward 13: In state Forward: 14: Explore(right | marked \u2227Enodes > 0: Terminate; meeting[Start]: AssignRoles; meeting[MLeader]: BeAvanguard) 15: In state AssignRoles: 16: if your pebble is on the node take it. 17: if #A=2 then 18: Use ID to take a role in { Retroguard, MLeader } in a mutual exclusive fashion. 19: execute the CautiousPendulum if Retroguard or Alg. 5 in state Go if MLeader. 20: else 21: Use ID to take a role in { Retroguard, Leader, Avanguard } in a mutual exclusive fashion. 22: start algorithm CautiousPendulum. 23: In state BeAvanguard: 24: if your pebble is on the node take it. 25: take the role of Avanguard. 26: start algorithm CautiousPendulum. 27: In state Terminate: 28: Terminate Bh is the next node in clockwise direction. 29: Algorithm 4: Gather&Locate; Phase 2 Algorithm for scattered agents Start 6.2 Correctness of Gather&Locate. Definition 2. (Gathered configuration) We say that a group of k agents gathered if either: \u2022 There are k agents on the same node; or, \u2022 There are k\u22121 agents on node vi, and one agent a on node vi+1. Moreover, agent a marked node vi with a pebble and has to still unmark it. Let us first start with a technical lemma, derived from [12], and adapted to our specific case. 16 \f1: Predicates Shorthands: NextUnsafe = Etime > EMtime[C]. 2: F ailedReport[Retroguard] = EMtime[C] > 2((#Meets[Retroguard] + 1) + T nodes). 3: States: {Go, Cautious, StartCP, Terminate, TerminateR}. 4: In state Go: 5: Explore(right | marked: Cautious; meeting[Start]=StartCP; F ailedReport[Retroguard]: TerminateR; ) 6: In state Cautious: 7: Explore(nil | meeting[Start]: StartCP; NextUnsafe : Terminate; F ailedReport[Retroguard]: TerminateR ) 8: In state StartCP: 9: start algorithm CautiousPendulum with the role of Leader keeping the value of variable #Meets[Retroguard]. 10: In state Terminate: 11: Terminate, Bh is in the next node in clockwise direction. 12: In state TerminateR: 13: Terminate, Bh is in the node that is at distance #Meets[Retroguard] + 1 from counterclockwise direction from the reference node. 14: Algorithm 5: Gather&Locate; Phase 2 Algorithm for MLeader Lemma 1. If k agents perform a cautious walk in the same direction for an interval I of 9n rounds and one of the alive agents does not explore n nodes and no agent terminates, then the agents gathered. Proof. Let A be the set of agents performing a cautious walk, say in clockwise direction, and let a\u2217be the agent that does not explore n nodes. Agent a\u2217can be blocked in progressing its cautious walk in two possible ways: (i) when it is trying to explore a new node using a missing edge in its clockwise direction (we say that a\u2217is forward blocked); (ii) when it is returning to a previously explored node to unmark it (it is blocked by an edge missing in its counter-clockwise direction, and we say that a\u2217is backward blocked). Thus, If in a round r an agent is forward blocked and another one is backward blocked, then they are on two endpoints of the same missing edge. If a\u2217is not blocked for 3(n \u22121) rounds then it has explored n nodes. Therefore, a\u2217has been blocked for at least 6n \u22123 rounds or more rounds over an interval of 9n rounds. If there is a round r\u2032 when a\u2217is blocked, then every a \u2208A that at round r\u2032 is not blocked does move (note that all blocked agents are either backward or forward blocked on the same edge of a\u2217). Thus, all agents in A that are not blocked move towards a\u2217of at least 6n\u22123 3 = 2n \u22121 steps. On the other hand, every time a\u2217moves, the other agents might be blocked; however, by hypothesis, this can occur less than 3n times. Since the initial distance between a\u2217and an agent in A is at most n \u22121, it follows that such a distance increases less than n \u22121 (due to a\u2217movements); however, it decreases by 2n \u22121 (due to a\u2217being blocked). In conclusion, by the end of I, all agents are either at the same node or at the two endpoints of a missing edge and the lemma follows. Lemma 2. Given three agents executing Phase 1, at most one of them enters the black hole. In this case, the counter-clockwise neighbour node of the black hole is marked by a pebble. 17 \fProof. If agents have not already met, then each agent performs a cautious walk, all in the same direction, marking a node and avoiding that other agents visit a possibly unsafe node (see state Init in Algorithm 1): when the agent sees a marked node, it goes in state Waits. In this state, the agent waits until it is sure that the next node is safe (that is, until the agent that marked the node returns to remove the pebble). When two agents meet, they become Follower and Explorer. By construction, Follower never reaches Bh: in fact, Follower moves a step clockwise only when it sees Explorer returning (see state Wait and predicate meeting[Explorer]); this implies that the node where it moves is safe. Also note that Explorer never visits a possibly unsafe node if there is another agent on it: in fact, in state Explore, there is a check on whether the current node is marked or not; if marked, Explorer waits (thus, also blocking Follower) until the next node can be deemed as safe. If the third agent reaches Follower, it will also become Follower and it will never visit an unsafe node. Moreover, the Explorer agent always marks a node before visiting its unexplored neighbour (see state Explore of Algorithm 2). In conclusion, we have that at most one agent enters Bh, and the counterclockwise neighbour node of Bh will be marked by a pebble, and the lemma follows. Observation 3. If an agent terminates while executing Phase 1, then it correctly terminates. Proof. The claim follows immediately by observing that the state Terminate is always reached when an agent visits a marked node, the clockwise edge is not missing, and the agent that marked the node does not return. Lemma 3. Let us consider three agents executing Phase 1. If not all agents terminated locating the Bh, then Phase 1 ends by round 9n and, when it ends, one of the following scenarios holds: \u2022 (1) all agents gathered; \u2022 (2) at most one agent disappeared in the black hole, the counter-clockwise neighbour of the black hole is marked, and the remaining agents gathered; \u2022 (3) one agent terminated, the counter-clockwise neighbour of the black hole is marked, and the remaining agent has to still locate the Bh. Proof. By construction, in all states the agents check predicate Ttime = 9n; thus, Phase 1 ends after at most 9n rounds. By Lemma 2 we have that at most one agent enters the Bh, leaving its counter-clockwise neighbour marked. There are three possible cases: \u2022 One agent terminates, and by Observation 3 it terminates correctly solving the BHS-Problem. The other agent has to still locate the Bh 18 \f\u2022 One agent enters in the Bh and no one terminates. If no alive agent terminates, then no one of them has explored n nodes. Therefore, at the end of Phase 1 Ttime = 9n and by Lemma 1 the agents gathered, and the lemma follows. \u2022 No agent enters the Bh and no agent terminates. In this case we have that three agents gather by the end of Phase 1. If agents end Phase 1 because predicate #A = 3, then the statement immediately follows. Otherwise, Ttime = 9n, by Lemma 1 the agents gathered, and the lemma follows. The next lemma shows that, if Bh has been marked in Phase 1, then two agents executing Algorithm 4 solve BHS-Problem in at most O(n2) rounds. Lemma 4. Let us assume that the counter-clockwise neighbour v of Bh has been marked by a pebble. If two agents execute Algorithm 4, at least one of them terminates correctly locating the Bh in O(n2) rounds; the other agent either terminates correctly locating the Bh or it never terminates. Proof. By Lemma 3, at the first round of Phase 2 we have two possible cases: \u2022 The two agents are at the same node. In this case, they immediately enter in state AssignRoles. Let a be the agent that takes the role of MLeader and b be the one that becomes Retroguard. Their movements are similar to the ones of Leader and Retroguard in CautiousPendulum, with the only difference that MLeader moves until it reaches a marked node. By Lemma 3, this marked node is the counter-clockwise neighbour of Bh; thus, if MLeader reaches it, MLeader correctly terminates. If MLeader does not visit the marked node because of a missing edge, Retroguard is able to move. By using a similar argument to the one used in the proof of Theorem 3, the black hole is located in at most O(n2) rounds, and the lemma follows. Also note that the only agent that can go in a termination state is MLeader, therefore Retroguard cannot terminate incorrectly. \u2022 The two agents occupy two neighbouring nodes, and the most clockwise agent does not have the pebble. More precisely, agent a is at node v, agent b at node v\u2032; also, agent b is missing its pebble, and node v is marked by a pebble. In this case, agent a executes lines 9-10 of Algorithm 4: it removes the pebble from v, and waits for 4 \u00b7 n2 rounds. Agent b executes line 7 of Algorithm 4: it moves towards node v for 4 \u00b7 n2 rounds. If edge e = (v, v\u2032) appears before the timeout, then a and b meet, and previous case applies. Otherwise, both agents go in state Forward. In this state they both move clockwise. If one of them reaches the marked node, it correctly terminates. Otherwise the path towards Bh is blocked by a missing edge and the agents would meet in at most O(n) rounds. When they meet, they both go in state AssignRoles, and previous case applies 19 \fagain. Note that this implies that at most one of the agents in state Forward can be blocked forever by a missing edge. Lemma 5. Let us assume that three agents are gathered after Phase 1. Then, if three agents executes Algorithm 4, at least one of them terminates correctly locating the Bh in O(n2) rounds; the other agents either terminate correctly locating the Bh or never terminate. Proof. If three agents are on the same node, then they start CautiousPendulum algorithm and the correctness follows from Theorem 3. Otherwise, we have two agents on a node v, with v marked with a pebble, and the other agent b on v\u2032, with v\u2032 the clockwise neighbour of v. Upon the start of Phase 2, the two agents will become Retroguard and MLeader, respectively; MLeader waits on the marked node, while b tries to go back to v. If edge e = (v, v\u2032) is missing for 4n2 rounds, then Retroguard has enough time to reach the black hole, and MLeader to terminate because of the fail to report of Retroguard, hence the lemma follows. Note that after the termination of MLeader, the agent b goes in state Forward, it moves clockwise and either it enters the Bh or is blocked forever by a missing edge; in all cases it cannot terminate. Finally, the last case to analyse is when Retroguard is blocked by a missing edge in the first 4n2 rounds. In this case, MLeader and b meet, and algorithm CautiousPendulum starts. The lemma follows by Theorem 3. Lemma 6. Let us assume that a single agent a starts Phase 2. This agent, by executing Algorithm 4, either terminates correctly or it waits forever on a missing edge. Proof. By algorithm construction after at most 4n2 rounds from the beginning of Phase 2 the agent a goes in state Forward and it starts moving in clockwise direction. Being the only agent still active, it will never change behaviour until it reaches the marked node or another agent. By Lemma 3 the counter-clockwise neighbour of Bh is marked, and the terminated agent is located at that node. If no edge is removed forever, a will reach the marked node, and it will terminate. Otherwise, a will be forever blocked on a missing edge. Theorem 5. Given a dynamic ring R, three agents with visible IDs and pebbles running Gather&Locate, solve Bhs in O(n2) moves and O(n2) rounds. Proof. By Lemma 3, Phase 1 terminates in at most O(n) rounds. At this time, either: (1) BHS-Problem is solved and all agents terminated, or (2) the agents gathered, or (3) the counter-clockwise neigbhour of Bh is marked and the remaining agents are gathered, or (4) there is still an agent active while an agent correctly terminated. In case (2), the proof follows by Lemma 5. In case (3), the proof follows by Lemma 4. In case (4), the proof follows by Lemma 6. 20 \fBy Th. 4 and Th. 5 we have: Theorem 6. Algorithm Gather&Locate is size-optimal with optimal cost and time. 7"
|
| 16 |
+
}
|