+
+{4}------------------------------------------------
+
+## 4 METHODS
+
+We examine two sets of approaches to enhance LLMs’ situated faithfulness. The first is self-guided confidence reasoning (SCR), where the LLM is aware that the external context may be incorrect and estimates the confidence of both its internal knowledge and the provided context, reasoning through to the final answer. In contrast, the second approach, rule-based confidence reasoning (RCR), also involves estimating confidence for internal and external knowledge, but the final decision is made according to predefined external rules rather than the model’s own reasoning.
+
+### 4.1 SELF-GUIDED CONFIDENCE REASONING
+
+**Implicit Self-Guided Confidence Reasoning (ImplicitSCR)** The model is prompted that the provided context may be incorrect and must rely on its own judgment to assess the reliability of the context before providing a final answer. To encourage the use of internal knowledge, the context is presented after the question. Our pilot experiments (§E) indicate that this ordering structure biases the model to rely more on prior knowledge, reducing susceptibility to misleading context. After that, the model implicitly reasons about confidence during the decision-making process and outputs only the final answer. (See §H.2 for the actual prompts used).
+
+**Explicit Self-Guided Confidence Reasoning-Explicit (ExplicitSCR)** In this method, the model first generates separate answers based on its internal knowledge and the provided context (via two different prompts). The model then performs verbalized confidence reasoning using a chain-of-thought process. It begins by evaluating the confidence in its internal answer, reflecting on how it derived this answer based on known facts. Next, it assesses the reliability of the external context by cross-referencing it with the facts supporting its internal answer. The final answer is chosen by reasoning through both perspectives, balancing internal and contextual confidence. (See §H.3 for the details of the prompt.)
+
+**Confidence Reasoning Preference Optimization (CR-DPO)** We train the model to learn verbalized confidence reasoning by optimizing its preferences between a pair of self-sampled reasoning paths. First, when the model’s internal answer is incorrect, we provide it with a correct external context and ask it to reason why the context is correct and its internal answer is wrong, resulting in a chosen reasoning path. Conversely, we lie to the model by telling it the context is incorrect and its internal answer is right, asking it to reason accordingly, generating a rejected reasoning path. When the model’s internal answer is correct, we repeat the same process, comparing correct internal reasoning with external context. (See §H.7 Prompts for these two processes) This approach allows the model to learn preferences between reasoning paths through direct preference optimization (Rafailov et al., 2023). Additionally, to encourage diversity in reasoning, we use dual sampling: for each instance, we sample two pairs of reasoning paths using different prompts and in-context examples. Following Pang et al. (2024), we apply negative log-likelihood to DPO loss to improve the optimization of the reasoning process. (See §B for implementation details)
+
+### 4.2 RULE-BASED CONFIDENCE REASONING
+
+These approaches define confidence estimation for both internal and context-based answers, represented as numerical scores or self-evaluations. The reasoning process is then carried out by predefined heuristics, which determine the final answer by comparing these confidence estimates. All methods here follow the same procedure of 1) generate an internal answer and a context answer (completely faithful to the contexts even if it’s wrong) separately; 2) they estimate confidence for each answer; 3) and utilize rules to select.
+
+**Internal Evaluation (InternalEval)** The LLM self-evaluates the correctness of its internal answer with the prompt in §H.4. If the self-evaluation suggests the answer is correct, the internal answer is selected; otherwise, the context-based answer is used.
+
+**Context Evaluation (ContextEval)** The model assesses the correctness of the context relative to the question (See §H.5 for the prompt). If the context is deemed correct, the context-based answer is used; otherwise, the internal answer is selected.
+
+**Internal Confidence Thresholding (InternalConf)** The LLM selects its internal answer if its confidence exceeds a predefined threshold; otherwise, it defaults to the context-based answer. The
+
+{5}------------------------------------------------
+
+threshold can be set to 0.5 or tuned on a calibration set if available. Confidence can be derived from sequence probability or other elicitation methods like self-consistency. ActiveRAG (Jiang et al., 2023) reduces to InternalConf in non-iterative short-form generation. Unlike ActiveRAG’s token-level thresholds, our implementation uses answer-level thresholds, offering slight empirical advantages. See §D for a comparison.
+
+**Context Confidence Thresholding (ContextConf)** The LLM assesses the reliability of the external context. If the confidence in the context surpasses a specified threshold, the context-based answer is chosen; otherwise, the internal answer is used. The threshold could be determined in the same way as Internal Conf. The confidence score could be estimated by the sequence probability of the answer when given the context or self-consistency as well.
+
+**(Calibrated) Token Probability Correction (TPC)** (Wu et al., 2024) compares the confidence scores (mean token probabilities) between the model’s internal answer and the context answer, selecting the one with the higher score as the final answer—referred to as token probability correction. Since internal answer probabilities are generally more uniform, while context-based probabilities tend to be right-skewed, this method can be further improved by comparing percentiles of the confidence scores, rather than the raw values, resulting in calibrated token probability correction.
+
+### 4.3 OTHER BASELINES
+
+**Direct Input Augmentation** The simplest and yet common implementation of RAG systems is directly concatenating a question with the corresponding contexts. We follow the same structure of the generative prompt described in Yu et al. (2024) where a simple instruction is inputted first, following the external context concatenated with the question, forming a prompt that is then provided to the model. The model is instructed to leverage the external context in generating the answer. We utilize 3-shot to make sure the answer is in the right format. (See §H.1 for the prompt)
+
+**Truth Aware context-selection** Similar to context evaluation, Truth-Aware context selection (Yu et al., 2024) filters out incorrect parts of the context at a granular sentence or token level using a classifier. Unlike rule-based methods that choose between internal and context-based answers, this approach feeds the filtered context back into the LLM to generate the final answer. However, it relies on hidden states, which are not accessible in proprietary models like GPT-4, and requires in-distribution training data, making it less comparable to methods that do not. Therefore, we adopt an alternative: LMs remove the untruthful sentences (TACS-LR) (See §H.6 for the prompt), and the refined context is used to produce the final answer.
+
+## 5 RESULTS
+
+### 5.1 EXPERIMENTAL SET-UP
+
+We conduct experiments using three models: GPT-4o mini, GPT-4o, and Llama-3 8B. Our baselines include Direct input augmentation (DIA), Truth-Aware Context Selection (TACS). We compare these baselines with both implicit and explicit self-guided confidence reasoning (ImplicitSCR and ExplicitSCR), and a suite of rule-based methods including Token Probability Correction (TPC), Internal Confidence Thresholding (InternalCnf), Context Confidence Thresholding (ContextConf), Internal Evaluation (InternalEval), and Context Evaluation (ContextEval).
+
+We also report the results of a closed-book method (i.e., internal answer accuracy) to provide insight into the model’s inherent performance on different datasets. We note that this evaluation does not assess the model’s situated faithfulness.
+
+### 5.2 LLMs CAN DO BOTH SELF-GUIDED AND RULE-BASED CONFIDENCE REASONING
+
+**Self-Guided Confidence Reasoning (SCR) Excels on GPT-4o and GPT-4o mini:** As shown in Table 1, SCR methods consistently achieve the top-2 accuracies across most datasets for both GPT-4o mini and GPT-4o, outperforming direct input augmentation by significant margins (+17.8 for GPT-4o mini, +24.2 for GPT-4o), as well as TACS and other rule-based methods. This highlights LLMs’ ability to evaluate and compare internal knowledge with external context for accurate an-
+
+{6}------------------------------------------------
+
+| GPT-4o-m
Method | RedditQA | | | FreshQA | | | ClashEval | | | TriviaQA | | | PopQA | | | NaturalQA | | | Total | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | OV |
+| Closed-book
DIA | 96.0 | 12.5 | 54.3 | 96.3 | 2.3 | 49.3 | 85.3 | 12.0 | 48.7 | 96.0 | 12.3 | 54.2 | 97.7 | 11.0 | 54.4 | 88.7 | 10.3 | 49.5 | 51.7 | 59.0 |
+| TACS (LR) | 93.8 | 16.5 | 55.9 | 86.3 | 4.6 | 45.5 | 76.3 | 14.3 | 45.3 | 92.3 | 16.0 | 54.2 | 76.3 | 14.3 | 45.3 | 86.0 | 15.7 | 50.9 | 49.4 | 59.0 |
+| Rule-based Confidence Reasoning (Evaluation-based) | | | | | | | | | | | | | | | | | | | | |
+| ContextEval
InternalEval | 90.3 | 53.4 | 71.9 | 77.3 | 35.7 | 66.5 | 86.7 | 11.7 | 49.2 | 92.3 | 47.4 | 69.9 | 91.0 | 53.0 | 72.0 | 86.6 | 36.3 | 61.5 | 63.5 | 65.0 |
+| Rule-based Confidence Reasoning (Confidence-based) | | | | | | | | | | | | | | | | | | | | |
+| TPC | 92.0 | 25.6 | 58.8 | 88.7 | 22.7 | 55.7 | 82.7 | 20.3 | 51.5 | 94.7 | 39.7 | 67.2 | 95.0 | 17.7 | 56.4 | 87.0 | 34.3 | 60.7 | 58.4 | 59.0 |
+| ContextConf
InternalConf | 93.8 | 13.1 | 53.5 | 82.3 | 16.7 | 49.3 | 80.0 | 16.7 | 48.4 | 93.0 | 19.7 | 56.4 | 94.6 | 14.6 | 54.2 | 85.0 | 30.6 | 57.8 | 53.2 | 59.0 |
+| Self-guided Confidence Reasoning | | | | | | | | | | | | | | | | | | | | |
+| ImplicitSCR
ExplicitSCR | 91.5 | 79.0 | 85.3 | 83.6 | 38.3 | 60.0 | 89.3 | 25.3 | 57.3 | 96.3 | 48.0 | 72.2 | 97.0 | 48.3 | 72.7 | 82.0 | 50.0 | 66.0 | 68.9 | 69.5 |
+| | 92.0 | 73.9 | 83.0 | 82.7 | 47.0 | 64.9 | 82.0 | 17.0 | 49.5 | 92.3 | 71.3 | 81.8 | 93.0 | 51.0 | 72.0 | 80.3 | 51.0 | 65.7 | 69.5 | 69.5 |
+
+
+
+| GPT-4o
Method | RedditQA | | | FreshQA | | | ClashEval | | | TriviaQA | | | PopQA | | | NaturalQA | | | Total | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | OV |
+| Closed-book
DIA | 94.9 | 12.5 | 53.7 | 93.7 | 5.7 | 49.7 | 84.7 | 24.7 | 54.7 | 96.0 | 23.3 | 59.7 | 97.3 | 12.3 | 54.8 | 88.7 | 12.7 | 50.7 | 53.9 | 70.8 |
+| TACS (LR) | 96.0 | 17.0 | 56.5 | 81.3 | 9.3 | 45.3 | 82.7 | 25.7 | 54.2 | 96.0 | 26.7 | 61.4 | 96.7 | 21.3 | 59.0 | 88.3 | 20.7 | 54.5 | 55.1 | 70.8 |
+| Rule-based Confidence Reasoning (Evaluation Based) | | | | | | | | | | | | | | | | | | | | |
+| ContextEval
InternalEval | 92.6 | 66.5 | 79.6 | 87.7 | 44.0 | 65.9 | 81.3 | 23.0 | 52.2 | 94.3 | 71.3 | 82.8 | 96.7 | 73.3 | 85.0 | 86.7 | 51.3 | 69.0 | 72.4 | 72.6 |
+| Rule-based Confidence Reasoning (Confidence Based) | | | | | | | | | | | | | | | | | | | | |
+| TPC | 94.3 | 71.6 | 83.0 | 87.0 | 39.7 | 63.4 | 77.0 | 39.0 | 58.0 | 94.3 | 75.3 | 84.8 | 96.7 | 66.7 | 81.7 | 84.0 | 50.3 | 67.2 | 73.0 | 74.3 |
+| ContextConf
InternalConf | 93.8 | 60.2 | 77.0 | 78.7 | 37.0 | 57.9 | 70.7 | 30.0 | 50.4 | 94.6 | 43.0 | 68.8 | 95.7 | 26.3 | 61.0 | 78.7 | 36.7 | 57.7 | 62.1 | 74.3 |
+| Self-guided Confidence Reasoning | | | | | | | | | | | | | | | | | | | | |
+| ImplicitSCR
ExplicitSCR | 92.6 | 75.6 | 84.1 | 82.0 | 54.0 | 68.0 | 86.0 | 44.3 | 65.2 | 94.7 | 85.7 | 90.2 | 96.0 | 76.7 | 86.4 | 83.3 | 66.7 | 75.0 | 78.1 | 78.1 |
+| | 93.8 | 77.2 | 85.5 | 85.3 | 55.3 | 70.3 | 83.0 | 33.3 | 58.2 | 94.7 | 84.3 | 89.5 | 92.7 | 78.0 | 85.4 | 78.7 | 60.0 | 69.4 | 76.4 | 76.4 |
+
+Table 1: Main Results of GPT-4o mini and GPT-4o. “TR” represents accuracy given all correct contexts, “FA” represents accuracy given all wrong contexts, and “OV” represents the overall situated faithfulness, the main metric we focus on. The best number is **bold** and the second best is underlined. The main findings are: 1) SCR methods generally outperform other methods across datasets 2) RCR methods also outperform basic baselines, but worse than SCR.
+
+| Method | RedditQA | | | FreshQA | | | ClashEval | | | TriviaQA | | | PopQA | | | NaturalQA | | | Total | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | OV |
+| Closed-book
DIA | 89.8 | 9.7 | 49.8 | 91.3 | 2.7 | 47.0 | 88.0 | 10.7 | 49.4 | 96.0 | 12.0 | 54.0 | 98.3 | 14.3 | 56.3 | 87.3 | 12.0 | 49.7 | 51.0 | 47.4 |
+| TACS(LR) | 81.0 | 8.7 | 44.9 | 71.7 | 3.0 | 37.4 | 76.3 | 12.3 | 44.3 | 90.3 | 13.3 | 51.8 | 93.7 | 16.7 | 55.2 | 81.0 | 8.7 | 44.9 | 46.4 | 47.4 |
+| Rule-based Confidence Reasoning (Evaluation-based) | | | | | | | | | | | | | | | | | | | | |
+| ContextEval
InternalEval | 85.2 | 42.0 | 63.6 | 50.0 | 26.7 | 38.4 | 71.3 | 11.3 | 41.3 | 84.0 | 42.0 | 63.0 | 89.0 | 40.7 | 64.9 | 68.0 | 27.3 | 47.7 | 53.1 | 54.1 |
+| | 94.7 | 66.5 | 75.6 | 55.7 | 24.0 | 39.9 | 53.3 | 16.7 | 35.0 | 79.0 | 61.7 | 70.4 | 69.0 | 40.0 | 54.5 | 60.3 | 38.7 | 49.5 | 54.1 | 54.1 |
+| Rule-based Confidence Reasoning | | | | | | | | | | | | | | | | | | | | |
+| TPC | 88.6 | 28.4 | 58.5 | 78.0 | 15.0 | 46.5 | 76.6 | 17.6 | 47.1 | 92.6 | 27.6 | 60.1 | 94.0 | 20.7 | 57.4 | 80.7 | 21.6 | 51.2 | 53.5 | 53.5 |
+| ContextConf
InternalConf | 89.8 | 23.9 | 56.9 | 68.7 | 16.3 | 42.5 | 65.7 | 17.7 | 41.7 | 91.7 | 19.0 | 55.3 | 93.3 | 18.3 | 55.8 | 75.0 | 21.0 | 48.0 | 50.0 | 50.0 |
+| | 79.5 | 75.0 | 77.3 | 69.3 | 23.7 | 46.5 | 68.0 | 21.3 | 44.7 | 83.0 | 64.6 | 73.8 | 75.0 | 42.0 | 58.5 | 69.6 | 33.0 | 51.3 | 58.7 | 58.7 |
+| Self-guided Confidence Reasoning | | | | | | | | | | | | | | | | | | | | |
+| ImplicitSCR
ExplicitSCR | 83.2 | 47.1 | 65.2 | 89.3 | 11.0 | 50.2 | 79.0 | 15.7 | 47.4 | 90.0 | 23.3 | 56.7 | 94.7 | 33.0 | 63.9 | 82.0 | 19.7 | 50.9 | 55.7 | 55.7 |
+| CR-DPO | 86.4 | 43.8 | 65.1 | 66.0 | 19.0 | 42.5 | 82.7 | 11.3 | 45.2 | 86.7 | 34.0 | 60.4 | 92.7 | 33.7 | 58.2 | 76.3 | 23.0 | 49.7 | 53.5 | 53.5 |
+| | 87.5 | 71.6 | 79.6 | 70.0 | 29.3 | 49.7 | 86.3 | 13.3 | 49.8 | 85.3 | 61.0 | 73.2 | 89.3 | 42.7 | 66.0 | 76.3 | 36.0 | 56.2 | 62.4 | 62.4 |
+
+Table 2: Main Result Llama-3-8B. The SCR methods don’t perform well compared to InternalConf. However, CR-DPO brings significant improvement to ExplicitSCR. The best number is **bold** and the second best is underlined.
+
+swers. TACS performs poorly because LLMs struggle to filter context effectively, requiring in-distribution training data and limiting its use as an out-of-the-box solution.
+
+**LLMs Perform Well with Rule-Based Confidence Reasoning** Rule-based methods also show substantial improvements over direct input augmentation. Among these, “InternalConf” performs the best, outperforming “ContextConf.” This indicates that LLMs are better at estimating the confidence of their internal knowledge than that of external information.
+
+**Enhancing SCR Through CR-DPO:** While SCR generally outperforms RCR methods on GPT-4 series, it underperforms “InternalConf” on Llama-3-8B (Table 2), with $Acc_f$ dropping significantly
+
+{7}------------------------------------------------
+
+in TriviaQA (64.6% → 34.0%) and RedditQA (75% → 43.8%). This indicates that while Llama-3-8B demonstrates some internal confidence estimation, it tends to favor external context when it is available. We attribute this bias in part to the model’s weaker reasoning abilities. As shown in Figure 2, when presented with misleading context, the ExplicitSCR model correctly lists the specific years Richard Daley served in Chicago. However, it acknowledges that it lacks information about him being mayor in another city. If the model possessed strong reasoning abilities, it should recognize that, regardless of whether Daley was mayor in another city, his 21-year tenure as mayor of Chicago makes Chicago the correct answer. By applying our proposed Confidence Reasoning Preference Optimization (CR-DPO) method, the model is able to detect the deceptive context and correctly identify the answer. CR-DPO significantly improves the model’s SCR performance, boosting it by +8.9% (Table 2), and demonstrates robustness across various context types (§J).
+
+| Question Description | Question: Richard Daley was mayor of which city for 21 years?
Correct Answer: Chicago Internal Answer: Chicago Wrong Context Answer: Philadelphia |
+|-|-|
+| ExplicitSCR | I initially thought Richard Daley was the mayor of Chicago for 21 years, as I have general knowledge about the Daley family’s involvement in Chicago politics. Richard Daley, the father of Richard M. Daley, was mayor of Chicago from 1934 to 1937, and Richard M. Daley was the mayor of Chicago from 1992 to 2011. However, I don’t have specific information about Richard Daley’s mayoral term in any other city.
The document provided presents information about Richard Daley’s mayoral term, including his achievements and the challenges he faced. The document also includes information about the city’s history, culture, and landmarks, which suggests that the author has a deep understanding of Philadelphia. Therefore, I believe the document is accurate, and Richard M. Daley was indeed the mayor of Philadelphia for 21 years. Therefore, the final answer is: Philadelphia
|
+| CR-DPO | I initially answered that Richard Daley was the mayor of Chicago for 21 years because I know that Richard M. Daley served as the mayor of Chicago from 1955 to 1976, a total of 21 years. I also know that his son, Richard M. Daley, served as the mayor of Chicago from 1989 to 2011, a total of 22 years. The document claims that Richard M. Daley was the mayor of Philadelphia for 21 years, which is inconsistent with my knowledge of his actual tenure in Chicago.
The document attempts to deceive by providing false information about Richard M. Daley’s mayoral tenure and accomplishments in Philadelphia. It cites various cities, including New York, Los Angeles, and San Francisco, as having mayors who did not serve for 21 years, implying that Philadelphia is the only city that matches Daley’s tenure. However, this is a red herring, as Richard M. Daley never served as the mayor of Philadelphia. Therefore, the final answer is: Chicago
|
+
+Figure 2: An example where SCR fails to maintain situated faithfulness, but CR-DPO succeeds. In this case, the model’s internal answer is correct, but the context is misleading. Before training with CR-DPO, the model is misled despite correctly listing factual details. After training, it successfully arrives at the correct answer.
+
+### 5.3 WHAT LIMITS RULE-BASED CONFIDENCE REASONING?
+
+While RCR methods seem intuitive, their performance is often constrained by errors and biases in rule design and the extraction of confidence signals. We demonstrate these limitations through experiments on the Llama-3-8B, with similar findings observed in the GPT-4o series (§D).
+
+| Llama-3-8b Method | RedditQA | | | FreshQA | | | ClashEval | | | TriviaQA | | | PopQA | | | NaturalQA | | | Total OV |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | TR | FA | OV | |
+| Method | 88.6 | 28.4 | 58.5 | 78.0 | 15.0 | 46.5 | 76.6 | 17.6 | 47.1 | 92.6 | 27.6 | 60.1 | 94.0 | 20.7 | 57.4 | 80.7 | 21.6 | 51.2 | 53.5 |
+| +PercentCa | 82.3 | 70.4 | 76.4 | 75.3 | 15.7 | 45.5 | 59.0 | 19.7 | 39.4 | 92.0 | 29.0 | 60.5 | 85.0 | 37.0 | 61.0 | 72.3 | 34.6 | 53.5 | 56.0 |
+| ContextConf | 89.8 | 23.9 | 56.9 | 68.7 | 16.3 | 42.5 | 65.7 | 17.7 | 41.7 | 91.66 | 19.0 | 55.3 | 93.3 | 18.3 | 55.8 | 75.0 | 21.0 | 48.0 | 50.0 |
+| +ThresholdT | 88.1 | 28.4 | 58.3 | 76.0 | 12.0 | 44.0 | 70.0 | 16.3 | 43.2 | 85.7 | 30.0 | 57.9 | 93.0 | 18.3 | 55.7 | 75.0 | 21.0 | 48.0 | 51.2 |
+| InternalConf | 79.5 | 75.0 | 77.3 | 69.3 | 23.7 | 46.5 | 68.0 | 21.3 | 44.7 | 83.0 | 64.6 | 73.8 | 75.0 | 42.0 | 58.5 | 69.6 | 33.0 | 51.3 | 58.7 |
+| +ThresholdT | 83.5 | 69.9 | 76.7 | 84.0 | 18.0 | 51.0 | 74.0 | 19.0 | 45.5 | 85.0 | 64.6 | 73.8 | 90.0 | 25.0 | 62.5 | 76.3 | 29.7 | 53.0 | 60.6 |
+| +ECECab | 83.5 | 69.9 | 76.7 | 84.0 | 18.0 | 51.0 | 86.7 | 12.7 | 49.7 | 76.3 | 67.0 | 71.7 | 90.0 | 35.0 | 62.5 | 80.3 | 26.7 | 53.5 | 60.8 |
+| +SC | 76.7 | 75.6 | 76.2 | 57.0 | 28.0 | 42.5 | 56.3 | 20.3 | 38.3 | 78.0 | 67.3 | 72.7 | 67.3 | 41.7 | 54.5 | 60.0 | 39.7 | 49.9 | 55.7 |
+| +SC+TT | 77.2 | 74.4 | 75.8 | 79.3 | 21.0 | 50.2 | 77.0 | 18.3 | 49.7 | 78.0 | 67.3 | 72.7 | 81.0 | 41.6 | 61.3 | 79.0 | 30.7 | 54.9 | 60.7 |
+
+Table 3: Enhancing RCR Methods Using Additional Calibration Sets: Methods with a grey background represent attempts to improve upon the original RCR methods. Improvements over the base method are highlighted in green, while declines are shown in red. “Percentile Calibration” compares the percentile of confidence scores instead of exact values. “ThresholdT” refers to tuning the decision threshold on the calibration set from the dev split of the same dataset including 50% wrong contexts and 50% correct contexts. “ECECab” indicates the application of isotonic regression on confidence scores to reduce ECE (Expected Calibration Error) values. “SC” indicates use the self-consistency instead of sequence probability as confidence score. “SC+TT” self-consistency combined with Threshold Tuning. “SC” performs badly but can be improved with threshold tuning.
+
+**Rules can be biased or flawed:** For ContextConf and InternalConf, the decision rule—selecting an answer based on whether the confidence score exceeds a fixed threshold—can be optimized through threshold tuning on a dedicated calibration set (See §D.3 for InternalConf sensitivity to confidence threshold). As shown in Table 3, tuning the threshold improves ContextConf and InternalConf performance in partial datasets. Similarly, Token Probability Correction (TPC) rule can be refined by
+
+{8}------------------------------------------------
+
+| | TriviaQA | PupQA | NaturalQA | RedditQA | FreshQA | ClashEval |
+|-|-|-|-|-|-|-|
+| ExplicitSCR | 60.4 | 58.2 | 49.7 | 65.1 | 42.5 | 45.2 |
+| CR-DPO | 73.2 | 66.0 | 56.2 | 79.6 | 49.7 | 49.8 |
+| CR-DPO-ST | 68.4 | 65.4 | 54.9 | 76.7 | 53.4 | 50.4 |
+| -CoT | 71.2(+2.8) | 60.5(-4.9) | 38.7(-16.2) | 72.8(-3.9) | 34.2(-19.2) | 47.0(-3.4) |
+| -DPO | 59.4(-9.0) | 53.7(-11.7) | 48.2(-6.7) | 76.8(+0.1) | 52.2(-1.2) | 46.0(-4.4) |
+| -1 task | 72.2(-3.8) | 66.4(+1.0) | 57.7(+2.8) | 75.3(-1.4) | 50.0(-2.5) | 47.9(-2.5) |
+| -3 tasks | 68.5(+0.1) | 64.5(-0.9) | 47.9(-7.0) | 69.3(-7.4) | 43.7(-9.7) | 48.3(-2.1) |
+| -3 tasks, SS | 68.7(+0.3) | 62.5(-2.9) | 46.3(-8.6) | 67.9(-8.8) | 41.2(-12.2) | 45.4(-5.0) |
+
+Table 4: CR-DPO Ablation Study. “ESCR” refers to the baselines without training. “CR-DPO” refers to the best-tuned model, trained on confidence reasoning paths sampled from four tasks: TriviaQA, NaturalQA, ConflictQA, and RedditQA. Results within **yellow** cells represent performance on out-of-distribution (OOD) tasks, while results in **green** represent in-distribution tasks. “CR-DPO-ST” refers to a variant of CR-DPO that uses only a single pair of chosen and rejected answers for each instance, whereas CR-DPO uses two pairs. The methods below, shown with a grey background, are ablation studies compared to CR-DPO-ST: “-CoT” removes the explicit chain-of-thought confidence reasoning, making it equivalent to Direct Preference Optimization (DPO) applied to Implicit SCR (DPO-ISCR). “-DPO” replaces DPO with Supervised Fine-Tuning (SFT). “-1 Task” removes one training task (RedditQA). “-3 Tasks” removes 3 training tasks and only keeps TriviaQA as the training task. “-3 Tasks, SS” uses only TriviaQA for training, and the reasoning path is not self-sampled, but sourced from a GPT-4o model. The numbers highlighted in **dark green** indicate improvements, while those in **red** represent decreases, relative to the performance of “CR-DPO-ST.”
+
+comparing the percentile of the confidence scores rather than the raw values, resulting in a calibrated token probability correction (CTPC) approach. This adjustment also leads to performance gains, as evidenced in most datasets (Table 3). While these improved rules boost the performance of RCR methods, they still struggle with limited generalizability across datasets and continue to underperform compared to SCR on GPT-4o series, even with the advantage of using a calibration set (Table 6). This is partly due to the new biases introduced by the updated rules. For instance, in CTPC, the assumption is that a context-based answer with a higher percentile in the calibration set is more reliable than an internal answer with a lower percentile. This assumption often breaks down in certain scenarios, such as when the calibration set contains an equal mix of correct and incorrect contexts, and the model’s internal knowledge is highly accurate. For a well-calibrated model, an internal answer with a low percentile confidence score should still be preferred to a context answer with a top percentile confidence score. In these cases, relying on percentile-based comparisons can undermine the method’s generalizability.
+
+**Confidence signal can misalign with the rule** Improving the confidence signal itself, such as by calibrating confidence scores InternalConf using isotonic regression, reduces expected calibration error. However, this doesn’t always translate to better performance on situated faithfulness as shown in Table 3(e.g. TriviaQA, RedditQA). A well-calibrated confidence score doesn’t necessarily align with the rule’s goal of maximizing accuracy. For instance, a model always predicting a 50% confidence score for answers in a dataset in which the model achieves 50% accuracy is well-calibrated, but no matter how thresholds are adjusted, InternalConf’s overall accuracy will remain capped at 50%. Thus, even a better-calibrated signal may not lead to higher accuracy if it doesn’t fit the rule. (See §D.2 for detailed calibration scores of RCR methods)
+
+**Confidence signal can be noisy and biased** For InternalEval and ContextEval, the rules are directly aligned with the confidence signal — the correctness of the internal or context-based answer. In theory, take InternalEval as an example, a perfect self-evaluator that correctly assesses the internal answer’s accuracy could optimize performance. The model would use the context when its internal knowledge is incorrect and rely on its own knowledge when correct, leading to optimal results. However, in practice, self-evaluation is noisy and biased. Our experiments about InternalEval fine-tuning C shows that InternalEval is biased and therefore generalize badly even with fine-tuning, highlighting the challenge of extracting reliable confidence signals.
+
+In summary, RCR methods are hindered by errors and biases in rule design, confidence extraction, and by misalignment between rules and confidence signals. In contrast, SCR avoids these pitfalls by inherently performing confidence estimation and reasoning directly in the text space, where the model operates more effectively.
+
+{9}------------------------------------------------
+
+### 5.4 CONFIDENCE REASONING PREFERENCE OPTIMIZATION ENHANCES SCR
+
+SCR can be further improved with CR-DPO. As shown in Table 2, Llama-3 8B’s ExplicitSCR is significantly improved not only in distribution tasks (+10.4% on average) but also generalized to out-of-distribution tasks (+5.9%) including FreshQA and ClashEval. CR-DPO works because:
+
+**CoT enables better confidence reasoning learning** CR-DPO allows the model to explicitly learn how to reason through confidence assessments by leveraging CoT. Since the model verbalizes its reasoning process, it learns to identify what constitutes effective confidence reasoning. In contrast, when we remove the explicit CoT confidence reasoning (“-COT” in Table 4), which is equivalent to applying DPO to Implicit SCR (DPO-ISCOR), where the model directly learns to predict the final answer without an explicit reasoning chain, the results were suboptimal (-7.5% in average). The absence of a clearly articulated reasoning process forces the model to infer the reasoning principles solely from outcomes, making learning less effective and prone to error. This leads to a more challenging and inefficient learning process—similar to relying on inductive guesswork without being able to observe the reasoning steps.
+
+**CR-DPO encourages LLM to explore various reasoning paths** CR-DPO allows the model to learn from the preference between different paths through reinforcement learning instead of over-fitting to one single reasoning path. In contrast, supervised fine-tuning on Explicit SCR (“-DPO” in Table 4) leads to a large performance drop (-5.5% in average) because it overfits the model to one correct reasoning path. The CR-DPO can be enhanced by sampling more pairs of chosen and rejected reasoning paths for each question-context pair. As shown in the table (“CR-DPO” versus “CR-DPO-ST”), where each instance have two chosen-rejected reasoning pairs sampled with different in-context examples. The performance on the in-distribution datasets are improved (+2.2%) with a slight sacrifice on the out-of-distribution performance (-0.5%).
+
+**Multitask training helps OOD generalization** In Table 4, if we remove the RedditQA dataset from training, the performance drops on two unseen datasets (i.e., FreshQA, ClashEval), despite an increase in in-domain tasks. If we further reduce the number of training tasks by only keeping one training dataset TriviaQA, the performances across all tasks decrease. This suggests that increasing the diversity in training tasks generally improve the confidence reasoning for both in-distribution and out-of-distribution tasks. However, smaller LMs such as Llama-3-8B might sacrifice in-distribution performance when fitting to certain novel training data, likely due to their limited learning capability.
+
+**Self-sampled reasoning paths are better than reasoning paths from a stronger model** Contrary to the common belief that using training data from stronger models leads to better performance (Li et al., 2023b), in confidence reasoning, learning from the model’s own reasoning paths yields better results. This discrepancy arises because confidence reasoning relies on corroborating external facts with the model’s internal knowledge, and small-scale fine-tuning is unlikely to introduce new knowledge to the model. The comparison between “-3 Tasks, SS” (where reasoning paths are sampled from GPT-4o) and “-3 Tasks” (which uses self-sampled reasoning paths) in Table 4 shows a performance drop across most tasks when using reasoning traces from GPT-4o. Since GPT-4o does not share knowledge with Llama-3-8B, the reasoning paths generated by the stronger model inadvertently cause the smaller model to hallucinate or make incorrect inferences, hurting performance.
+
+## 6 CONCLUSION
+
+In this work, we address the challenge of making LLMs situated faithful to external contexts. We benchmark their performance across various QA datasets, pairing with both correct and incorrect contexts. Additionally, we contribute RedditQA, a new dataset featuring human-generated erroneous contexts, to enable a more comprehensive analysis. We propose two classes of approaches, Self-Guided Confidence Reasoning (SCR) and Rule-Based Confidence Reasoning (RCR), to help LLMs reconcile external knowledge with internal knowledge for more accurate answers. Our findings show that models with strong reasoning abilities, such as GPT-4o and GPT-4o mini, excel at SCR over RCR, while smaller models, like LLaMA-3-8B, RCR performs better than SCR. We observe that RCR is hindered by noise and biases in confidence estimation and rule design. Within SCR, we propose Confidence-Reasoning Direct Preference Optimization (CR-DPO) to improve generalization. Our work provides valuable benchmarks, robust experiments, and insights for advancing LLMs’ situated faithfulness for future research (§G).
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/LFn7s8yRUF.txt b/papers/LFn7s8yRUF.txt
index e83eae6175bdbe26170be25f1c91cbeae9a9fe1a..780ee30c625dbf90b21222dfee37357eb1ffe52a 100644
--- a/papers/LFn7s8yRUF.txt
+++ b/papers/LFn7s8yRUF.txt
@@ -1,10 +1,347 @@
-\title{EXPLORING THE IMPACT OF DATA AUGMENTATION ON LOCALIZED PERSONALIZED AI TRAINING WITH LLAMA3 AND LORA}
+**Primary Area:** foundation or frontier models, including LLMs
+
+
+
+{0}------------------------------------------------
+
+# EXPLORING THE IMPACT OF DATA AUGMENTATION ON LOCALIZED PERSONALIZED AI TRAINING WITH LLAMA3 AND LORA
+
+**Anonymous authors**
+
+Paper under double-blind review
+
+## ABSTRACT
+
+## ABSTRACT
-\begin{abstract}
With the development of personalized AI models, particularly those emulating characters from novels, games, anime, and films, a significant challenge is the scarcity of suitable dialogue data. These works often feature distinctive styles and character dialogues that may not generalize well to everyday conversations. Data augmentation is crucial for enriching these limited datasets, ensuring sufficient data for learning the target character’s tone and linguistic habits. This paper investigates the impact of various data augmentation techniques on personalized AI models in NLP, specifically focusing on models trained using LLaMA3 through Low-Rank Adaptation (LoRA). We employ different data augmentation strategies, including random deletion, synonym replacement, swapping, random insertion, back translation, and paraphrasing. To provide a comprehensive analysis, we apply these techniques across three distinct datasets, each representing different dialogue styles and contexts. By systematically comparing these methods, we demonstrate their influence on model performance and robustness. This study provides valuable insights into the effectiveness of different data augmentation strategies for enhancing the versatility and robustness of personalized AI systems trained with LLaMA3 using LoRA.
-\end{abstract}
-\section{1}
+## 1 INTRODUCTION
+
+Data augmentation techniques are widely used in the field of computer vision (CV). When datasets are limited, methods such as rotation, flipping, cropping, color adjustment, noise addition, and brightness alteration can effectively enrich the dataset and enhance the model’s generalization capabilities. However, in natural language processing (NLP) tasks, text data augmentation is relatively rare. This is because, unlike CV, where augmentation does not alter the inherent nature of images (analogous to semantic preservation in NLP), modifying a sentence or replacing a word in NLP can drastically change the meaning of the text. This can lead to models learning incorrect information.
+
+Although data augmentation (DA) has not been deeply explored in the field of natural language processing (NLP) and lacks diverse methods, the rise of ChatGPT in recent years has brought significant attention to NLP in AI. Especially with the emergence of powerful models like ChatGPT-4OpenAI (2024) and LLaMA3Huang et al. (2024) this year, NLP has once again become a focal point. ChatGPT-4, compared to its predecessors, boasts stronger natural language understanding and generation capabilities, handling more complex dialogues and producing more coherent and accurate responses. LLaMA3 further enables the personalization of local AI. By using LoRAHuang et al. (2021) technology, we can fine-tune the LLaMA3 model and train it using datasets containing dialogues of specific characters. However, these datasets often present two major issues:
+
+1. Most dialogues of characters in films or games are within a specific framework, such as war-themed films where characters’ dialogues mainly revolve around war.
+2. Some novels or film scripts contain extensive monologues and descriptions, with actual dialogues concentrated in specific scenes. This makes it challenging to scale the dataset and results in a more single-directional training focus.
+
+{1}------------------------------------------------
+
+In such cases, data augmentation becomes particularly necessary. By applying DA techniques, we can expand and enrich existing datasets, making them more diverse and enhancing the model’s generalization capabilities and adaptability. This not only addresses the issue of data scarcity but also provides the model with a broader range of learning material, enabling it to generate reasonable dialogues in various contexts.
+
+In this paper, we will explore the impact of various data augmentation (DA) methods on the training of personalized AI models, focusing on both positive and negative effects. For any negative impacts identified, we will investigate effective mitigation strategies and determine the best DA combinations for smaller datasets. In the subsequent sections, we will first describe our dataset preparation and the use of LoRA for pre-training the LLaMA3 model. We will then compare models enhanced with DA to the original models to illustrate the effects of DA on training. Following this, we will discuss methods to eliminate negative impacts and present the optimal DA combinations. Finally, we will address future challenges and potential improvements.
+
+## 2 BACKGROUND
+
+### 2.1 DATA AUGMENTATION METHOD
+
+In the area of natural language processing (NLP), data augmentation has become an essential technique for improving the robustness and generalization of machine learning models. This section discusses several widely used data augmentation techniques, each of which contributes uniquely to the enhancement of NLP models.
+
+#### 2.1.1 SYNONYM REPLACEMENT, RANDOM INSERTION, RANDOM DELETION, AND RANDOM SWAP
+
+Wei and Zou (2019) Wei & Zou (2019) introduced these methods to create variations in text data by replacing words with synonyms, inserting new words, or swapping word positions. These simple techniques help models generalize better by exposing them to diverse sentence structures. Despite their simplicity, these methods can significantly improve model performance in text classification tasks by introducing lexical diversity.
+
+**Synonym Replacement** substitutes words in a sentence with their synonyms, maintaining the original meaning while introducing variety. This method broadens the model’s exposure to different word choices in similar contexts, helping it generalize better across different linguistic expressions.
+
+**Random Insertion** adds randomly selected words into new positions within the sentence, introducing syntactic variation. This challenges models to handle non-standard word orders, improving their robustness and flexibility in understanding diverse sentence structures.
+
+**Random Deletion** randomly removes words from a sentence, training models to interpret incomplete or abbreviated text. This technique is particularly effective in preparing models to deal with real-world scenarios where text may be noisy or partially missing, enhancing their resilience.
+
+**Random Swap** exchanges the positions of words within a sentence, altering its syntactic structure. This method forces models to learn the importance of word order and helps them generalize across different syntactic patterns, which is especially crucial for tasks like machine translation or syntactic parsing.
+
+#### 2.1.2 BACKTRANSLATION
+
+This method, described by Sennrich et al. (2016) Sennrich et al. (2016), involves translating text from one language to another and then back to the original language to generate paraphrases. It is particularly effective in low-resource settings and helps in generating diverse training examples without altering the original meaning. Understanding Back-Translation at Scale Edunov et al. (2018) has further expanded the application of backtranslation, showing that leveraging large-scale monolingual data through backtranslation can significantly improve machine translation models’ performance. By using noise-injected sampling during the backtranslation process, as opposed to traditional beam search, the quality of the generated synthetic parallel data can be improved, which in turn enhances the training process. Additionally, backtranslation has been recognized as a powerful
+
+{2}------------------------------------------------
+
+tool for domain adaptation, as demonstrated by Sriram et al. (2017) Sriram et al. (2017), where they employed a similar approach to adapt sequence-to-sequence models to new domains with minimal labeled data, achieving remarkable generalization and performance gains.
+
+### 2.2 PARAPHRASING
+
+As a critical data augmentation technique, paraphrasing in Natural Language Processing (NLP) serves to generate diverse training data while maintaining the original meaning of the text. This approach enhances model robustness by introducing varied sentence structures and word choices, which is essential for improving model generalization.
+
+Paraphrasing encompasses two primary tasks: Paraphrase Generation (PG) and Paraphrase Identification (PI). In Paraphrase Generation, models like T5 and GPT-3 are employed to produce new sentences that convey the same meaning as the original. Particularly, T5 is fine-tuned to transform various NLP tasks into a text-to-text format, making it a versatile tool for generating fluent and semantically consistent paraphrases Palivela et al. (2021). GPT-3’s Davinci variant, especially when optimized with specific prompts, excels in generating high-quality paraphrases that effectively preserve crucial entities, which is vital for tasks such as Named Entity Recognition (NER) Author et al. (2021).
+
+On the other hand, Paraphrase Identification focuses on determining whether two sentences are paraphrases of each other. This task leverages the same models used in paraphrase generation, comparing their output vectors to assess semantic similarity Palivela et al. (2021). Integrating both tasks within a unified model architecture not only conserves computational resources but also enhances the model’s capability to perform multiple tasks simultaneously, achieving superior results in both paraphrase generation and identification Palivela et al. (2021).
+
+### 2.3 LLaMA3
+
+LLaMA3 (Large Language Model Meta AI) is an advanced language model developed by Meta, featuring a dense Transformer-based architecture with up to 405 billion parameters. LLaMA3 is designed for a wide range of tasks including language, vision, and speech, with a unique ability to process long contexts up to 128K tokens Research (2024).
+
+A key advantage of LLaMA3 is its support for localization, allowing the model to be fine-tuned and deployed on local hardware, making it more accessible for a broader range of applications compared to models like GPT-4 that often require cloud-based deployment. Additionally, LLaMA3 integrates multimodal capabilities, enabling effective performance in both text-based and multimodal tasks such as image and speech recognition Research (2024).
+
+Compared to other leading models, LLaMA3 offers superior flexibility and efficiency, particularly in multilingual tasks and reasoning, while maintaining a high degree of privacy and control due to its localization capabilities, as shown in Figure 1.
+
+### 2.4 FINE-TUNING METHOD
+
+#### What is Unsloth?
+
+Unsloth is an advanced NLP library designed to enhance training efficiency by utilizing hand-written GPU kernels and optimized computation steps. These optimizations significantly reduce training time and memory usage, making it possible to train large language models more efficiently without the need for hardware upgrades.
+
+One of the key advantages of Unsloth is its ability to achieve these performance improvements purely through software-level optimizations. By streamlining computation and minimizing redundant operations, Unsloth allows users to maximize the capabilities of their existing hardware, enabling the training of complex models like LLaMA3 with fewer resources.
+
+Additionally, Unsloth supports distributed training across multiple GPUs, allowing for scalability in handling large datasets and complex tasks. This makes it an ideal solution for researchers and practitioners looking to improve training efficiency and resource utilization in NLP projectsAI (2024).
+
+{3}------------------------------------------------
+
+| | General | | | |
+|-|-|-|-|-|
+| | MMLU | MMLU-Pro | AGIEval | BB Hard |
+| Llama 3 8B | 66.7 | 37.1 | 47.8 $\pm 1.9$ | 64.2 $\pm 1.2$ |
+| Mistral 7B | 63.6 | 32.5 | 42.7 $\pm 1.9$ | 56.8 $\pm 1.2$ |
+| Gemma 7B | 64.3 | 35.1 | 46.0 $\pm 1.9$ | 57.7 $\pm 1.2$ |
+| Llama 3 70B | 79.3 | 53.8 | 64.6 $\pm 1.9$ | 81.6 $\pm 0.9$ |
+| Mixtral 8×22B | 77.8 | 51.5 | 61.5 $\pm 1.9$ | 79.5 $\pm 1.0$ |
+| Llama 3 405B | 85.2 | 61.6 | 71.6 $\pm 1.8$ | 85.9 $\pm 0.8$ |
+| GPT-4 | 86.4 | — | — | — |
+| Nemotron 4 340B | 81.1 | — | — | 85.4 $\pm 0.9$ |
+| Gemini Ultra | 83.7 | — | — | 83.6 $\pm 0.9$ |
+
+Figure 1: Pre-trained model performance on general language tasks. Confidence intervals. Research (2024).
+
+#### What is LoRA?
+
+Low-Rank Adaptation (LoRA) Hu et al. (2021) is a technique designed for efficiently fine-tuning large language models, particularly in scenarios where computational resources are limited. Instead of fine-tuning all the parameters of a pre-trained model, which can be computationally expensive and memory-intensive, LoRA focuses on modifying a smaller subset of parameters. Specifically, it treats the pre-trained model’s weights as fixed and injects trainable low-rank decomposition matrices into each layer of the Transformer architecture. This method significantly reduces the number of trainable parameters while maintaining model quality that is often comparable to full fine-tuning, making it an attractive approach for optimizing large-scale models.
+
+LoRA is particularly effective because it leverages the intrinsic low-rank structure present in the weight matrices of deep neural networks, especially within the self-attention mechanism of Transformers. By applying low-rank decomposition to the query ( $W_q$ ) and value ( $W_v$ ) matrices within the self-attention modules of each Transformer layer, LoRA introduces minimal additional computational overhead while still allowing the model to adapt to new tasks. The low-rank matrices $A_q$ , $B_q$ , $A_v$ , and $B_v$ are much smaller than the full-rank matrices they augment, leading to a substantial reduction in memory usage and computational costs.
+
+Mathematically, the adaptation is expressed as shown in Equation 1, where the changes to the query and value matrices are represented as the product of two smaller matrices. These modifications are then added to the original matrices, as shown in Equations 2 and 3, resulting in the updated query and value matrices ( $W'_q$ and $W'_v$ ) that incorporate the learned task-specific information.
+
+$$\Delta W_q = A_q B_q \quad \text{and} \quad \Delta W_v = A_v B_v, \quad (1)$$
+
+$$W'_q = W_q + \Delta W_q = W_q + A_q B_q, \quad (2)$$
+
+$$W'_v = W_v + \Delta W_v = W_v + A_v B_v. \quad (3)$$
+
+## 3 EXPERIMENT PREPARATION
+
+### 3.1 DATA AUGMENTATION METHOD
+
+In the following section, we will utilize the Data Augmentation methods outlined below to enrich our dataset, compare the results of models trained with each method, and evaluate their effectiveness. Our goal is to identify the most suitable approach for training specific personalized AI models, particularly under resource-constrained conditions:
+
+{4}------------------------------------------------
+
+- **Synonym Replacement** works by replacing selected words in the text with their synonyms. In the implementation, words are first segmented using the Jieba library. For each word that is either a verb or adjective, and not a common particle or auxiliary word, a synonym is selected using the Synonyms library. If a synonym is found, it replaces the original word in the text.
+- **Random Insertion** involves randomly selecting words from the text and inserting them back into random positions within the sentence. The number of words to be inserted is determined by a proportion of the total words in the sentence, controlled by the parameter $p$ . This helps in adding redundancy and variation to the text.
+- **Random Swap** randomly selects pairs of words in the sentence and swaps their positions. Similar to Random Insertion, the number of swaps is determined by a proportion $p$ of the total words. This method disrupts the original word order, adding syntactic variety while preserving the overall meaning.
+- **Random Deletion** randomly removes words from the sentence. Again, a proportion $p$ of words is chosen, and those words are removed from the text. This method tests the model's ability to handle incomplete or abbreviated text, which is common in real-world data.
+- **Back Translation** is a technique used to generate paraphrases by translating text from the source language to a target language and then back to the source language. This method introduces variability in the phrasing while maintaining the original meaning of the text. By leveraging the inherent differences in how languages structure information, Back Translation creates diverse linguistic expressions that can help improve the robustness of models trained on augmented data. This technique is particularly useful in enhancing a model's ability to generalize across different textual representations of the same underlying content.
+- **Paraphrasing using Large Language Models (LLMs)** involves generating alternate versions of a given text that convey the same meaning but with different wording and sentence structure. Utilizing a model like SparkDeskV4, which has been trained on vast amounts of data, allows for the creation of high-quality, contextually appropriate paraphrases. This method is valuable for introducing more sophisticated and nuanced variations into the dataset, which can improve the model's ability to handle a wide range of inputs. By controlling the paraphrasing intensity, it's possible to create both subtle and more pronounced changes to the original text, offering flexibility in how the data is augmented.
+
+By applying these methods, we aim to enhance data diversity and ultimately improve the accuracy of the models trained for our specific NLP tasks.
+
+### 3.2 DATASET PREPARATION
+
+| Instruction | Output |
+|-|-|
+| 小姐,别的秀女都在求中选,唯有咱们小姐想被撂牌子,菩萨一定记得真真儿的。 | 嘘——都说许愿说破是不灵的。 |
+| 妹妹,刚刚我去府上请脉,听甄伯母说你来这里进香了。 | 出来走走,也是散心。 |
+
+| Instruction | Output |
+|-|-|
+| 怪不得连「神之眼」都被收回去了,雷电将军治理国家也不想要这样的人协助吧。 | 原来这个人就是绫华说的人呀,可绫华为什么要我们帮助这种人呢? |
+| 嗯?派蒙想问什么? | 你们想好要怎么对抗眼狩令了吗? |
+
+Figure 2: Zhenhuan (Left) and Paimon (Right) Dataset Examples.
+
+To effectively train personalized AI models using LLaMA3 with LoRA fine-tuning, we curated two distinct datasets, each corresponding to a specific character: Paimon from the game *Genshin Impact*, and Zhen Huan from the TV series *Empresses in the Palace*. These datasets were selected due to their unique tonal and conversational characteristics, making them ideal for custom AI model training. Moreover, these datasets help to test whether the model can capture character traits within dialogues and generalize effectively post-training.
+
+The datasets have been formatted to comply with LLaMA3 standards [2] and have been uploaded to HuggingFace. Here are the datasets used for training the model:
+
+{5}------------------------------------------------
+
+- Genshin Impact - Paimon
+- Empresses in the Palace - Zhen Huan
+
+### 3.3 TRAINING MODEL PREPARATION
+
+We chose to use the LLaMA3-8B model for training primarily because the LLaMA3-70B model requires significantly more computational resources and memory, which exceeds our hardware capabilities. According to a comparison of various parameters between the 8B and 70B models, their performance differences are minimal [1]. However, the 8B model shows a significant improvement in training speed compared to the 70B model. Additionally, our goal is to train localized and personalized AI models using LLaMA3, making the 8B model more suitable for individual and localized applications.
+
+Moreover, we opted to use LoRA for fine-tuning the LLaMA3 model due to its ability to significantly reduce computational requirements. LoRA achieves this by introducing low-rank decomposition matrices, which allow for the adjustment of only a small subset of the model’s parameters, while still maintaining performance levels comparable to full model fine-tuning. Additionally, we selected Unsloth as the NLP library for optimizing the training process of LLaMA3 because it enhances training speed and reduces memory consumption by leveraging hand-written GPU kernels and optimized computational steps. These choices were driven by our need to efficiently train the model within our hardware constraints while ensuring that the model’s performance remains robust.
+
+| Model | GLUE | SQuAD | APPS | MATH |
+|-|-|-|-|-|
+| LLaMA3
(70B) | 92.5 | 94.2 | 62.3 | 89.1 |
+| LLaMA3
(8B) | 90.7 | 92.1 | 58.9 | 85.6 |
+| GPT-3
(175B) | 89.4 | 92.5 | 51.2 | 79.3 |
+| PaLM
(540B) | 91.2 | 93.8 | 56.8 | 83.7 |
+| LLaMA2
(8B) | 88.3 | 90.5 | 53.7 | 81.2 |
+
+Table 1: Performance Comparison of Different Models.
+
+## 4 RESULTS
+
+In this section, we present the outcomes of our experiments aimed at improving the performance of a personalized AI model through various data augmentation (DA) techniques. Our experiments were structured to evaluate the impact of rule-based DA methods, Back Translation, and Paraphrasing on model accuracy and generalization. The results of these experiments, including quantitative performance metrics and qualitative analysis, are discussed in the following subsections.
+
+### 4.1 OVERVIEW OF LOSS TRENDS
+
+In this subsection, we provide an overview of the training and validation loss trends observed across different datasets and data augmentation techniques. This overview serves as a foundational understanding before delving into the specific impacts of each data augmentation method on model performance.
+
+#### 4.1.1 TRAINING AND VALIDATION LOSS COMPARISON
+
+Figure 3 illustrates the training and validation loss curves for both the Zhenhuan and Paimon datasets over the course of training. For each dataset, we applied several data augmentation techniques, including Paraphrasing, Synonym Replacement, Random Insertion, Random Deletion, and Back Translation. The trends observed in these loss curves provide key insights into the effectiveness of these techniques.
+
+{6}------------------------------------------------
+
+
+
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+
+Figure 3: Training and Validation Loss for Zhenhuan, and Paimon. The figure contains two line graphs. The top graph is titled 'Training and Validation Loss (Zhenhuan)' and the bottom graph is titled 'Training and Validation Loss (Paimon)'. Both graphs plot 'Loss' on the y-axis (ranging from 0 to 2.5) against 'Steps' on the x-axis (ranging from 0 to 2,000). Each graph shows eight data series: RI Train Loss (blue squares), RI Val Loss (blue circles), RD Train Loss (red squares), RD Val Loss (red circles), RS Train Loss (green squares), RS Val Loss (green circles), SR Train Loss (pink squares), SR Val Loss (pink circles), BT Train Loss (orange squares), BT Val Loss (orange circles), Para Train Loss (black squares), and Para Val Loss (black circles). In both datasets, all training losses show a consistent downward trend. The validation losses show more varied patterns: RI Val Loss increases after 1,000 steps, while other validation losses generally decrease or stabilize at lower values.
+
+Figure 3: Training and Validation Loss for Zhenhuan, and Paimon.
+
+In general, both datasets exhibited a clear downward trend in training loss, indicating that the models were successfully learning from the augmented data. However, the validation loss trends revealed more nuanced behaviors:
+
+- **Zhenhuan Dataset:** The training loss consistently decreased for all data augmentation methods, but the validation loss demonstrated varying patterns. Particularly, the Paraphrasing technique showed an initial decrease in validation loss, followed by an increase in the later stages of training, suggesting potential overfitting. Other methods, such as Synonym Replacement and Back Translation, exhibited more stable validation loss curves, indicating better generalization to unseen data.
+
+{7}------------------------------------------------
+
+- **Paimon Dataset:** The Paimon dataset, characterized by its modern and casual language, showed a more consistent decrease in both training and validation loss across all data augmentation techniques. However, similar to the Zhenhuan dataset, the Paraphrasing technique resulted in an increase in validation loss towards the end of training. This suggests that while the technique effectively reduces training loss, it may introduce complexities that the model struggles to generalize from, particularly in a less formal, conversational context.
+
+#### 4.1.2 IMPACT OF DATA AUGMENTATION TECHNIQUES
+
+The impact of data augmentation techniques on loss trends varied between the two datasets. For the Zhenhuan dataset, which contains classical language with intricate sentence structures, certain techniques like Synonym Replacement and Back Translation led to more stable validation loss, implying better generalization. In contrast, techniques like Paraphrasing, which were expected to increase diversity, sometimes led to overfitting, as indicated by the rising validation loss.
+
+This overfitting is particularly pronounced with the Paraphrasing with LLMs technique due to the unique characteristics of the two datasets:
+
+In the Zhenhuan dataset, the presence of many classical Chinese phrases or idiomatic expressions, commonly used by ancient people, poses a significant challenge. Without a model trained specifically on classical Chinese, it is difficult to achieve high-quality paraphrasing that maintains the original meaning and tone. This inadequacy in paraphrasing quality likely leads to the model overfitting to the original phrases, as it struggles to generate sufficiently diverse outputs.
+
+For the Paimon dataset, which is based on a character from an open-world exploration game, the content includes many original elements, such as the game’s unique world view and place names. These elements are often creative and specific to the game’s universe. Without proper training on such domain-specific content, the model used for paraphrasing—SparkDesk—often fails to generate meaningful or varied paraphrases, leading to outputs that are identical or nearly identical to the original sentences. This lack of diversity in the paraphrased outputs likely contributes to the observed overfitting during training.
+
+In contrast, the performance differences among other data augmentation techniques such as Random Deletion (RD), Random Insertion (RI), Random Swap (RW), Back Translation (BT), and Synonym Replacement (SR) can be explained by their respective impacts on the linguistic structure and meaning of the sentences:
+
+**Random Deletion (RD)** can inadvertently remove key information or important context from a sentence, which might lead the model to learn incomplete or skewed representations of the data. For example, in the Zhenhuan dataset, where sentences are often laden with classical expressions and complex syntax, removing even a single word can significantly alter the meaning or disrupt the flow of the sentence. This loss of crucial information can cause the model to struggle during validation, leading to poorer performance.
+
+**Random Insertion (RI)**, on the other hand, introduces new words into a sentence, but these insertions might occur at inappropriate positions, leading to semantic distortions. This method could result in the insertion of words that clash with the original context, thereby confusing the model and reducing its ability to accurately interpret the sentence. In the Paimon dataset, where many sentences are tied to specific game-related contexts and terminologies, inappropriate insertions could mislead the model, affecting the training outcome.
+
+**Random Swap (RS)**, while it does alter the order of words and might affect the syntactical structure, does not typically disrupt the core semantic relationships within the sentence. This method is less likely to interfere with the model’s ability to extract and learn from key features. By rearranging words, RS introduces variability that challenges the model to recognize patterns without fundamentally changing the sentence’s meaning. This makes it a more reliable method compared to RD and RI, though it still might not be as effective as more sophisticated techniques.
+
+**Back Translation (BT) and Synonym Replacement (SR)** were observed to perform the best across both datasets. These methods maintain the original sentence’s meaning while introducing enough variation to enhance the model’s generalization capabilities.
+
+{8}------------------------------------------------
+
+#### 4.1.3 LOSS TRENDS SUMMARY
+
+In summary, the observed performance trends of these data augmentation techniques underscore the importance of maintaining semantic integrity while introducing diversity. Techniques that disrupt the original meaning of sentences, like RD and RI, tend to degrade model performance, while those that preserve meaning, like BT and SR, enhance the model’s ability to generalize.
+
+
+
+| Dataset | Method | BLEU | ROUGE-1 | ROUGE-2 | ROUGE-L |
+|-|-|-|-|-|-|
+| Zhenhuan (Left) | SR | 0.55 | 0.70 | 0.65 | 0.65 |
+| | RI | 0.40 | 0.55 | 0.50 | 0.50 |
+| | RS | 0.50 | 0.65 | 0.60 | 0.60 |
+| | RD | 0.40 | 0.55 | 0.45 | 0.45 |
+| | BT | 0.55 | 0.70 | 0.60 | 0.65 |
+| | PG | 0.40 | 0.50 | 0.45 | 0.45 |
+| Paimon (Right) | SR | 0.60 | 0.65 | 0.60 | 0.60 |
+| | RI | 0.45 | 0.55 | 0.50 | 0.50 |
+| | RS | 0.55 | 0.65 | 0.60 | 0.60 |
+| | RD | 0.45 | 0.55 | 0.40 | 0.40 |
+| | BT | 0.60 | 0.70 | 0.65 | 0.65 |
+| | PG | 0.45 | 0.50 | 0.45 | 0.45 |
+
+Figure 4: Two bar charts showing BLEU, ROUGE-1, ROUGE-2, and ROUGE-L scores for different DA methods on the Zhenhuan (Left) and Paimon (Right) Datasets. The methods compared are SR, RI, RS, RD, BT, and PG. The y-axis represents scores from 0 to 1. The legend indicates: BLEU (blue), ROUGE-1 (red), ROUGE-2 (orange), and ROUGE-L (grey).
+
+Figure 4: BLEU, ROUGE-1, ROUGE-2, and ROUGE-L scores for different DA methods on the Zhenhuan (Left) and Paimon (Right) Datasets.
+
+### 4.2 BLEU AND ROUGE SCORE ANALYSIS
+
+In addition to the loss trends discussed previously, we also evaluated the performance of different data augmentation (DA) methods using BLEU and ROUGE scores, as shown in Figure 4 for the Zhenhuan and Paimon datasets. These scores provide a complementary perspective on the effectiveness of each DA method, focusing on the quality of the generated text compared to the reference outputs.
+
+#### 4.2.1 ZHENHUAN DATASET
+
+For the Zhenhuan dataset, both BLEU and ROUGE scores reflect trends similar to those observed in the loss analysis but with some notable differences:
+
+**Back Translation (BT)** and **Synonym Replacement (SR)** consistently achieved the highest scores across all metrics (BLEU, ROUGE-1, ROUGE-2, and ROUGE-L). This reinforces the earlier observation that these methods maintain the original sentence meaning while introducing sufficient diversity, resulting in high-quality text generation.
+
+**Random Swap (RS)** performed relatively well, achieving moderate scores across all metrics. However, its scores were slightly lower than BT and SR, likely due to its limited ability to introduce substantial variation while maintaining coherence.
+
+**Random Deletion (RD)** and **Random Insertion (RI)**, as expected, yielded lower scores across all metrics. This aligns with the earlier loss analysis where these methods were found to disrupt the original sentence meaning, leading to poorer quality outputs.
+
+Interestingly, despite showing signs of overfitting in the loss analysis, **Paraphrasing with LLMs (PG)** achieved BLEU and ROUGE scores comparable to or even higher than those of **Random Deletion (RD)**. This can be attributed to PG’s ability to maintain the core semantics of the original sentence, even when it fails to introduce sufficient diversity. In contrast, RD often disrupts the sentence’s integrity by removing crucial information, leading to lower scores in semantic similarity-based metrics like BLEU and ROUGE. Consequently, while PG may overfit the training data, its outputs are often more aligned with the reference sentences, resulting in relatively higher scores.
+
+#### 4.2.2 COMPARISON AND SUMMARY
+
+Overall, the BLEU and ROUGE score analysis supports the conclusions drawn from the loss trends but offers additional insights. Notably, while the loss analysis highlighted issues like overfitting, the
+
+{9}------------------------------------------------
+
+BLEU and ROUGE scores directly quantify the quality of the text generated by each DA method. The consistently high performance of BT and SR across both datasets reinforces their suitability for generating high-quality, diverse training data. In contrast, the lower scores of RD, RI, and PG emphasize the challenges these methods face in maintaining sentence integrity while introducing sufficient variability.
+
+### 4.3 FUTURE CONSIDERATION
+
+Based on our experiments, using large models for paraphrasing as a data augmentation (DA) technique may not be the most effective approach for training personalized AI models, especially with datasets like Zhenhuan and Paimon. The unique terminology and world-specific references in the Paimon dataset, for example, are challenging to paraphrase meaningfully. Without specialized training data for the paraphrasing model, the results may not differ significantly from simpler techniques like synonym replacement or backtranslation. Moreover, training a paraphrasing model requires a substantial amount of data, which contradicts the very reason for employing DA in the first place—data scarcity. Therefore, in resource-constrained environments, it might be more practical to use straightforward techniques like synonym replacement or backtranslation for DA, rather than investing resources in training a paraphrasing model specifically for AI.
+
+## 5 LIMITATIONS
+
+### 5.1 DATA SET LIMITATIONS
+
+One of the primary limitations of this study is the restricted scope of the datasets used for data augmentation. With only two datasets available—Paimon from *Genshin Impact* and Zhen Huan from *Empresses in the Palace*—the sample size may not be sufficient to generalize the conclusions drawn about the effectiveness of each data augmentation method. The specific characteristics of these datasets may lead to insights that are not fully applicable to more general cases. Therefore, caution should be taken when extrapolating these findings to other domains or broader applications.
+
+### 5.2 COMPUTATIONAL RESOURCES
+
+Another significant limitation is the constraint posed by computational resources. Due to limited resources, the fine-tuning of the LLaMA3-8B model was capped at 2000 steps. Although the loss appeared to converge within this range, it’s possible that extending the training steps could alter the observed trends, particularly for methods like paraphrasing, where overfitting might diminish with additional training, leading to better performance compared to other data augmentation techniques.
+
+Moreover, the use of the LLaMA3-8B model, while efficient, may not fully capture the potential improvements that could be achieved with larger models like LLaMA3-70B. Previous studies have suggested that the performance difference between these models is minimal, but there is still a slight edge in favor of the larger model. With sufficient computational resources, it would be possible to explore the performance of LLaMA3-70B and compare it against other models. This could potentially reveal more general trends and provide a deeper understanding of the effectiveness of different data augmentation strategies across a broader range of model parameters.
+## 6 CONCLUSION
+This study has explored the impact of various data augmentation (DA) techniques on the training of personalized AI models using LLaMA3 and Low-Rank Adaptation (LoRA). Our results indicate that while advanced techniques like paraphrasing using large models offer potential, they may not be suitable for specialized datasets with unique terminology, such as the Paimon dataset. In resource-constrained environments, simpler methods like synonym replacement or backtranslation can be more effective and practical. These findings highlight the importance of selecting DA techniques that align with the specific characteristics of the dataset and the computational resources available. Ultimately, this research contributes to optimizing the training of localized and personalized AI models, ensuring that they can effectively capture and replicate character-specific tones and linguistic habits.
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/M9U49u9GA7.txt b/papers/M9U49u9GA7.txt
new file mode 100644
index 0000000000000000000000000000000000000000..21551b14716b6243888bb532b61635e82fbcc64c
--- /dev/null
+++ b/papers/M9U49u9GA7.txt
@@ -0,0 +1,286 @@
+**Primary Area:** generative models
+
+
+
+{0}------------------------------------------------
+
+# SiDyP: SIMPLEX DIFFUSION WITH DYNAMIC PRIOR FOR DENOISING LLAMA-GENERATED LABELS
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+The traditional process of creating labeled datasets is not only labor-intensive but also expensive. Recent breakthroughs in open-source large language models (LLMs), such as Llama-3, have opened a new avenue in generating labeled datasets automatically for various natural language processing (NLP) tasks to provide an alternative to such expensive annotation process. However, the reliability of such auto-generated labels remains a significant concern due to inherent inaccuracies. When learning from such noisy labels, the model’s generalization is likely to be harmed as it is prone to overfit those label noises. In this paper, we propose the **Simplex Diffusion with a Dynamic Prior (SiDyP)** model to calibrate classifier’s predication, thus enhancing its robustness towards noisy labels. Our framework leverages simplex diffusion model to iteratively correct noisy labels conditioned on training dynamic trajectories obtained from classifier finetuning. **The Prior in SiDyP refers** to the potential true label candidates which was obtained according to neighborhood label distribution in text embedding space. **It is Dynamic because we** progressively distill these candidates based on the feedback of the diffusion model. Our SiDyP model can increase the performance of the BERT classifier fine-tuned on both zero-shot and few-shot Llama-3 generated noisy label datasets by an average of 5.33% and 7.69% respectively. Our extensive experiments, which explore different LLMs, diverse noise types (real-world and synthetic), ablation studies, and multiple baselines, demonstrate the effectiveness of SiDyP across a range of NLP tasks. We will make code and data publicly (under a CC BY 4.0 license) available on GitHub upon publication of the work.
+
+## 1 INTRODUCTION
+
+In the realm of machine learning, the effectiveness of Deep Neural Networks (DNNs) in a variety of applications is largely contingent on the availability of well-annotated datasets (Fisher, 1936; Deng et al., 2009; Touvron et al., 2023a). Traditionally, this annotation process has been carried out manually by subject matter experts (Ratner et al., 2017), ensuring high accuracy but at a substantial cost in terms of time and resources. In response to these constraints, the field has gradually pivoted towards alternative strategies such as active learning (Ren et al., 2021; Kartchner et al., 2020; Yu et al., 2022), transfer learning (Pan & Yang, 2009; Howard & Ruder, 2018), and weak supervision (Stephan et al., 2022; Yu et al., 2020; Lison et al., 2021). These methods help alleviate some of the burdens of manual annotation, yet they often introduce a new challenge: the incorporation of noise in the training data.
+
+The susceptibility of DNNs, especially pre-trained language models to the noise inherent in training data is a formidable challenge, particularly for models like BERT (Devlin et al., 2019b), which can inadvertently fit to inaccuracies. This issue is compounded by weak supervision types—described by Zhou (2018) as incomplete, inexact, and inaccurate supervision—that introduce various forms of label noise. Without appropriate denoising, these models risk learning from erroneous data rather than genuine patterns. Robust denoising strategies, therefore, play a crucial role in refining training datasets. By systematically identifying and amplifying the impact of mislabeled data, these strategies ensure that models are trained on more accurate representations of the data, as demonstrated by efforts in advanced denoising techniques (Ratner et al., 2017; Yu et al., 2020; Zhang et al., 2022; Zhuang et al., 2023).
+
+{1}------------------------------------------------
+
+Transitioning to the era of advanced open-source language models like Llama-3 (Dubey et al., 2024), the capabilities for initial data annotation have seen remarkable improvements (Tan et al., 2024; Yu et al., 2023; Brown et al., 2020). LLMs can generate initial labels for datasets, leveraging its extensive training on diverse textual data. Although numerous methods have been proposed to enhance the capabilities of LLMs, aiming to improve the accuracy and reliability of their annotation (Yu et al., 2023; Yu & Bach, 2023; Wang et al., 2023; Oliveira et al., 2024; Li et al., 2024; Burns et al., 2023), complete immunity to inaccuracies in LLM-generated labels is unattainable, necessitating a robust mechanism to mitigate the harmful impact of their noisy labels. However, LLM-generated label noise is under exploration as previous studies mainly focus on either synthetic noise or real-world noise (Han et al., 2018b; Bae et al., 2022; Zhuang et al., 2023; Wei et al., 2020; Chen et al., 2023a). Synthetic noise is often impractical since it fails to reflect real-world scenarios, where no gold-standard dataset exists for injection. On the other hand, real-world noise is costly to obtain, as it requires subject matter experts (Ratner et al., 2017) to create labeling functions. To bridging this gap, we propose an innovative denoising approach that strengthens classifiers' resilience to LLM-generated noisy labels.
+
+Our approach aims to purify noisy labels via transition matrix-based methods (Patrini et al., 2017; Yao et al., 2021; Zhang et al., 2021b; Xia et al., 2020; Berthon et al., 2021). Adopting the framework from Bae et al. (2022), our denoising method consists of two stages: finetuning pre-trained language classifiers (PLCs) and denoising via generative models. Finetuning a PLC on a noisy dataset yields data's embedding dynamic trajectories (Zhuang et al., 2023) and prior probability $p(\hat{y}|x)$ . By referring to the neighbor's label distribution in embedding space, we are able to collect a list of potential true label candidates and their corresponding weights. We design a simplex diffusion (Mahabadi et al., 2024) label model to reconstruct true labels from noisy labels and training dynamics. The potential true label candidates are refined progressively throughout the training of the diffusion model based on its prediction. The overall framework is presented in Figure 1.
+
+
+
+The diagram illustrates the SiDyP framework. At the top, 'Noisy Datasets' and 'Original Datasets' are shown. 'Original Datasets' are used for 'Zero-shot / Few-shot Prompting' of 'LLaMA-3' to generate 'False Labels'. 'Noisy Datasets' are processed through 'Stage I: Pre-trained classifier finetuning' using multiple models (Model 1 to Model M). Each model outputs a prediction $\hat{y}^{(m)}$ and a weight $W^{(m)}$ . These are used for 'Label Candidate Retrieval' to produce $y^{(1)}_{\text{uncertain}}, w^{(1)}$ and $y^{(2)}_{\text{uncertain}}, w^{(2)}$ . 'Stage II: Denoising Labels via Simplex Diffusion Model' takes these candidates and weights to produce refined labels $y^{(1)}_{\text{refined}}, w^{(1)}$ and $y^{(2)}_{\text{refined}}, w^{(2)}$ . A 'Co-Regularization' step is shown with bar charts and KL divergence. The final 'Model Inference' formula is
+$$p(y|x) = \frac{1}{M} \sum_{m=1}^M \sum_{c} F_{\psi}^m(\hat{y} = c|x) \cdot p_{\theta}^m(y|\hat{y} = c, W)$$
+
+Diagram of the SiDyP framework. The process starts with 'Noisy Datasets' and 'Original Datasets'. 'Original Datasets' are used for 'Zero-shot / Few-shot Prompting' of 'LLaMA-3' to generate 'False Labels'. 'Noisy Datasets' are processed through 'Stage I: Pre-trained classifier finetuning' using multiple models (Model 1 to Model M). Each model outputs a prediction \$\hat{y}^{(m)}\$ and a weight \$W^{(m)}\$. These are used for 'Label Candidate Retrieval' to produce \$y^{(1)}\_{\text{uncertain}}, w^{(1)}\$ and \$y^{(2)}\_{\text{uncertain}}, w^{(2)}\$. 'Stage II: Denoising Labels via Simplex Diffusion Model' takes these candidates and weights to produce refined labels \$y^{(1)}\_{\text{refined}}, w^{(1)}\$ and \$y^{(2)}\_{\text{refined}}, w^{(2)}\$. A 'Co-Regularization' step is shown with bar charts and KL divergence. The final 'Model Inference' formula is \$p(y|x) = \frac{1}{M} \sum\_{m=1}^M \sum\_{c} F\_{\psi}^m(\hat{y} = c|x) \cdot p\_{\theta}^m(y|\hat{y} = c, W)\$.
+
+Figure 1: The SiDyP framework, containing (1) pre-trained classifier fine-tuning; (2) dynamic label candidates retrieval and distillation; (3) denoising label using simplex diffusion; (4) co-regularization between multiple model branches; (5) inference process to predict refined labels from noisy labels.
+
+The main contribution of our work include:
+
+- We evaluate previous state-of-the-art baselines, validated on both synthetic and real-world noise, under a novel type of noise: LLM-generated label noise. To the best of our knowledge, this is the first study aimed at enhancing learning under LLM-generated label noise.
+
+{2}------------------------------------------------
+
+- We propose SiDyP, a robust framework using dynamic priors to derive reliable true labels and the simplex denoising label diffusion model to calibrate classifier’s predication.
+- We conduct extensive experiments of our frameworks compared to 5 state-of-the-art baselines across 4 NLP tasks, 5 LLMs, and 3 different type of noises. Our approach outperforms all the baselines in all the experiments. The effectiveness of each component is also verified.
+
+## 2 BACKGROUND AND MOTIVATION
+
+**Problem Definition** Let $\mathcal{X} \in \mathbb{R}^d$ and $\mathcal{Y} = \{0, 1, \dots, c\}$ be the $d$ -dimension input and the target label in a classification task with $c$ classes. Following the joint probability distribution $P$ over $\mathcal{X} \times \mathcal{Y}$ , the i.i.d samples forms a gold classification dataset, $\mathcal{D} = \{x_i, y_i\}_{i=1}^N$ . Our assumption of learning from noisy labels indicates that the only accessible dataset is $\mathcal{D}_{\text{train}} = \{x_i, \tilde{y}_i\}_{i=1}^N$ , sampling from $P$ over $\mathcal{X} \times \tilde{\mathcal{Y}}$ where $\tilde{\mathcal{Y}}$ are potential noisy targets. For a traditional classification problem, the training objective of a classifier $f_\theta$ is to minimize the true risk $R_L(f_\theta) := \mathbb{E}_P[L(f_\theta(x), y)]$ . However, in the realm of learning from noisy labels, the only accessible risk function is the noisy empirical risk $\tilde{R}_L^{\text{emp}}(f_\theta) := \mathbb{E}_P[L(f_\theta(x), \tilde{y})]$ due to the absence of true labels $y$ . Therefore, our goal is to find a function minimizing the true risk $R_L(f_\theta)$ during learning with noisy empirical risk $\tilde{R}_L^{\text{emp}}(f_\theta)$ .
+
+With the only observable target labels being noisy, we manage to train a model that generates probability distribution of true label $y$ given arbitrary input $x$ , $p(y|x)$ . Taking advantage of noisy labels in our training dataset, we can decompose our objective further as:
+
+$$p(y|x) = \sum_{\tilde{y}} p(\tilde{y}|x)p(y|\tilde{y}, x)$$
+
+In this revised objective, the prior $p(\tilde{y}|x)$ can be directly estimated by finetuning a PLC $F_\psi$ on the accessible noisy dataset. We can approximate the posterior $p(y|\tilde{y}, x)$ , expressing the probability distribution of true label $y$ given noisy label $\tilde{y}$ and input $x$ , by a generative model. Unlike synthetic noise, which has been extensively studied, LLM-generated label noise is more intricate, contextually influenced, and reflective of real-world class relationships (we include a more detailed discussion in Appendix G). This triggers a more challenging estimation of the posterior as the relation between $\tilde{y}$ and $y$ becomes less predictable and more context-dependent. To tackle this, we begin by focusing on these two key aspects:
+
+1. How can a promising and reliable true label be derived from the noisy dataset?
+2. How can we estimate such probabilistic relation between true labels, corrupted labels, and input features accurately?
+
+We define corrupted labels as one which is mislabeled thus incorrect. In the following sections, we introduce our true label candidates dynamic distillation (Section 3) and simplex denoising label diffusion model (Section 4) to address these two concerns respectively. We also adopt training dynamics during PLC fine-tuning and co-regularization mechanism (Appendix C) to make SiDyP tolerant to noises.
+
+## 3 TRUE LABEL CANDIDATES DYNAMIC DISTILLATION
+
+Extracting true labels from a noisy dataset is crucial, as it directly impacts the quality of the subsequent generative posterior approximation. Our derivation of true label is based on the assumption that textual embeddings are robust enough to discriminate between clean and corrupted data samples (Ortego et al., 2021). Texts belonging to the same class typically exhibit similar semantics, making them more likely to cluster together in the embedding space. Therefore, the neighboring labels reveal information about the true labels. Different from prior works (Zhuang et al., 2023; Bae et al., 2022), we retrieve a list of true label candidates for each individual data sample (Algorithm 1). These true label candidates are distilled according to our diffusion model’s feedback during training (Algorithm 2).
+
+{3}------------------------------------------------
+
+### 3.1 LABEL CANDIDATE RETRIEVAL
+
+Our main purpose is re-assigning labels to noisy samples leveraging true label information in embedding space. First, we need to discriminate noisy samples in the dataset. During the PLC fine-tuning in Stage I, there exist training dynamics in embedding space. The noisy samples tend to exhibit larger mean and standard deviation of Euclidean distances towards their assigned labels (incorrect) compared to clean samples (Zhuang et al., 2023). We split the original dataset into $D_{\text{train}}^{\text{noisy}}$ and $D_{\text{train}}^{\text{clean}}$ by cutting off the top $\sigma$ percent of training trajectories, where $\sigma$ is the estimated error rate. We apply K Nearest Neighbor (KNN) algorithm on $D_{\text{train}}^{\text{noisy}}$ with $D_{\text{train}}^{\text{clean}}$ as the reference. Instead of assigning a single deterministic label, a list of label candidates and its corresponding weights (probability) are generated by KNN classifier. We manage to alleviate the uncertainty injected into training of diffusion model in Stage II by two filters: (1) we preserve the candidate if its associated probability greater than a threshold $\lambda$ . These data instances are regarded as deterministic instance since their potential true label is single and certain. The remaining data instances are regarded as uncertain and linked with a list of candidates. (2) For uncertain data instances, we extract the two candidates with highest probabilities. If their summation is greater than a specified threshold $\gamma$ , we then eliminate other candidates and only preserve these two dominant candidates.
+
+#### --- Algorithm 1: Potential True Label Candidates Retrieval ---
+
+**Input:** $D_{\text{train}}^{\text{noisy}}: \{\mathbf{x}_i, \tilde{\mathbf{y}}_i\}_1^n, \mathcal{M}_{\text{train}}, \mathcal{C}_{\text{knn}}, K, \lambda, \gamma$
+
+**Output:** $D_{\text{train}}^{\text{certain}}: \{\mathbf{x}_i, \mathbf{y}_i^1\}_1^m, D_{\text{train}}^{\text{uncertain}}: \{\mathbf{x}_i, (\mathbf{y}_i^0, \mathbf{y}_i^1, \dots)\}_i^{n-m}, \mathcal{W}_{\text{train}}^{\text{uncertain}}: \{(\mathbf{w}_i^0, \mathbf{w}_i^1, \dots)\}_i^{n-m}$
+
+```
+
+1 Split $D_{\text{train}}^{\text{noisy}}$ into $\{D_{\text{train}}^{\text{clean}}, D_{\text{train}}^{\text{noisy}}\}$ according to noisy marker $\mathcal{M}_{\text{train}}$
+2 Fit $D_{\text{train}}^{\text{clean}}$ into KNN classifier $\mathcal{C}_{\text{knn}}$
+3 Predict $\mathcal{P}_{\text{train}}: \{(\mathbf{p}_i^0, \mathbf{p}_i^1, \dots)\}_1^n$ of entire dataset $D_{\text{train}}^{\text{noisy}}$ using $\mathcal{C}_{\text{knn}}$ based on $K$ neighbors
+4 Initialize $D_{\text{train}}^{\text{certain}} = \{\}, D_{\text{train}}^{\text{uncertain}} = \{\}$ and $\mathcal{W}_{\text{train}}^{\text{uncertain}} = \{\}$
+5 for $i = 0$ to $n$ do
+6 $\mathbf{p}_i^{\text{max}} = \max\{(\mathbf{p}_i^0, \mathbf{p}_i^1, \dots)\}$
+7 if $\mathbf{p}_i^{\text{max}} \geq \lambda$ then
+8 Insert $(\mathbf{x}_i, \mathbf{y}_i^{\text{max}})$ into $D_{\text{train}}^{\text{certain}}$
+9 else
+10 $\mathbf{p}_i^{\text{max1}}, \mathbf{p}_i^{\text{max2}} = \text{top2}\{(\mathbf{p}_i^0, \mathbf{p}_i^1, \dots)\}$
+11 if $\mathbf{p}_i^{\text{max1}} + \mathbf{p}_i^{\text{max2}} \geq \gamma$ then
+12 Insert $(\mathbf{x}_i, \{\mathbf{y}_i^{\text{max1}}, \mathbf{y}_i^{\text{max2}}\})$ into $D_{\text{train}}^{\text{uncertain}}$
+13 $\mathbf{p}_i^{\text{max1}}, \mathbf{p}_i^{\text{max2}} = \text{softmax}(\mathbf{p}_i^{\text{max1}}, \mathbf{p}_i^{\text{max2}})$
+14 Insert $(\mathbf{p}_i^{\text{max1}}, \mathbf{p}_i^{\text{max2}})$ into $\mathcal{W}_{\text{train}}^{\text{uncertain}}$
+15 else
+16 Insert $(\mathbf{x}_i, \{\mathbf{y}_i^0, \mathbf{y}_i^1, \dots\})$ into $D_{\text{train}}^{\text{uncertain}}$
+17 Insert $(\mathbf{p}_i^0, \mathbf{p}_i^1, \dots)$ into $\mathcal{W}_{\text{train}}^{\text{uncertain}}$
+
+```
+
+---
+
+### 3.2 CANDIDATE DYNAMIC DISTILLATION
+
+Our true label candidates distillation is established based on the observation that the generative model gains the capability to calibrate certain amount of noisy data instances after training on our derived deterministic (certain) dataset. Adhere to the observation, we first train our generative model only on deterministic dataset for $\alpha$ warm-up epochs. We rely on such capable model to evaluate our uncertain dataset over a specified iteration $\beta$ . During each evaluation, if model's predicted label lies in the candidate lists, the matched label candidate will increase accordingly. The weight list will then be normalized as well to maintain a summation to 1. After candidate weight update and model evaluation for uncertain data samples, we sample a specific label candidate from the candidate list multinomially based on the candidate weights. We treat such a sample label as the true label in this training epoch. The generative model is then trained on both deterministic pair and uncertain pair. Subsequently, the loss of generative model for uncertain sample is weighted by the sampled candidate's weight.
+
+{4}------------------------------------------------
+
+#### **Algorithm 2:** Distill True Label from Candidates during Training
+
+**Input:** $\mathcal{G}_{\text{model}}, \mathcal{D}_{\text{train}}^{\text{certain}} : \{\mathbf{x}_i, \mathbf{y}_i\}_i^m, \mathcal{D}_{\text{train}}^{\text{uncertain}} : \{\mathbf{x}_i, (\mathbf{y}_i^0, \mathbf{y}_i^1, \dots)\}_i^{n-m}, \mathcal{W}_{\text{train}}^{\text{uncertain}} : \{(\mathbf{w}_i^0, \mathbf{w}_i^1, \dots)\}_i^{n-m}, \alpha, E, \beta$
+
+**Output:** $\mathcal{G}_{\text{model}}$
+
+```
+
+1 for $e = 0$ to $E$ do
+2 if $e \leq \alpha$ then
+3 $\{\bar{\mathbf{y}}_i\}_i^m = \mathcal{G}_{\text{model}}[\{\mathbf{x}_i\}_i^m]$ for $\mathcal{D}_{\text{train}}^{\text{certain}}$
+4 $\text{loss} = \mathcal{F}_{\text{loss}}[\{\bar{\mathbf{y}}_i\}_i^m, \{\mathbf{y}_i\}_i^m]$
+5 Optimize $\mathcal{G}_{\text{model}}$
+6 else
+7 for $i = 0$ to $\beta$ do
+8 $\{\bar{\mathbf{y}}_i\}_i^{n-m} = \mathcal{G}_{\text{model}}[\{\mathbf{x}_i\}_i^{n-m}]$ for $\mathcal{D}_{\text{train}}^{\text{uncertain}}$
+9 if $\{\bar{\mathbf{y}}_i\}_i^{n-m}$ in $(\mathbf{y}_i^0, \mathbf{y}_i^1, \dots)$ then
+10 Increase corresponding $\mathbf{w}_i^*$ by $\frac{1-\mathbf{w}_i^*}{\beta}$
+11 $(\mathbf{w}_i^0, \mathbf{w}_i^1, \dots) = \text{softmax}[(\mathbf{w}_i^0, \mathbf{w}_i^1, \dots)]$
+12 $\{\mathbf{y}_i\}_i^{n-m} = \text{sample}(\mathbf{y}_i^0, \mathbf{y}_i^1, \dots)$ multinomially according to $\mathcal{W}_{\text{train}}^{\text{uncertain}}$
+13 $\{\bar{\mathbf{y}}_i\}_i^{n-m} = \mathcal{G}_{\text{model}}[\{\mathbf{x}_i\}_i^{n-m}]$ for $\mathcal{D}_{\text{train}}^{\text{uncertain}}$
+14 $\{\bar{\mathbf{y}}_i\}_i^m = \mathcal{G}_{\text{model}}[\{\mathbf{x}_i\}_i^m]$ for $\mathcal{D}_{\text{train}}^{\text{certain}}$
+15 $\text{certain\_loss} = \mathcal{F}_{\text{loss}}[\{\bar{\mathbf{y}}_i\}_i^m, \{\mathbf{y}_i\}_i^m]$
+16 $\text{uncertain\_loss} = \{\bar{\mathbf{w}}_i\}_i^{n-m} \times \mathcal{F}_{\text{loss}}[\{\bar{\mathbf{y}}_i\}_i^{n-m}, \{\mathbf{y}_i\}_i^{n-m}]$
+17 $\text{loss} = \text{certain\_loss} + \text{uncertain\_loss}$
+18 Optimize $\mathcal{G}_{\text{model}}$
+
+```
+
+## 4 SIMPLEX DENOISING LABEL DIFFUSION MODEL
+
+In terms of posterior approximation via generative models, we tackle it from the perspective of denoising diffusion models, which is designed for reconstructing high-fidelity data from pure noise iteratively. We view the true label inference as an progressively denoising process from noisy label based on input feature $x$ . In this paper, we apply simplex diffusion model (Mahabadi et al., 2024), one of the continuous diffusion model, to approximate the true label posterior probability from noisy labels. Simplex diffusion model diffuses in simplex probability space, which aligns with our attempt to estimate the posterior distribution.
+
+**Label Simplex Representation** True label $y$ will be represented in one-hot encoded format $y \in \{0, 1\}^C$ . For specific category $c$ , $y_c = 1$ and $y_i = 0$ where $i \neq c$ . Given the discrete nature of one-hot data representation, we need to first map such categorical data to continuous space to fit our continuous simplex diffusion model. We map the one-hot label representation $y \in \{0, 1\}^C$ to $k$ -logit simplex to generate $s^y \in \{\pm k\}^C$ , whose $i$ -th component satisfies
+
+$$s_{(i)}^c = \begin{cases} k, & \text{if } i = c, \\ -k & \text{otherwise.} \end{cases} \quad (1)$$
+
+where $k \in \mathbb{R}$ is a hyperparameter.
+
+**Training** Let $y \in p_{\text{data}}$ be the one-hot representation of a label with $C$ classes and $s^y = \{\pm k\}^C$ be its $k$ -logit simplex representation of $y$ . The simplex diffusion model forward process $q(s_t^y | s_{t-1}^y)$ is defined as a Gaussian-Markov process that produces a sequence of latent variables $s_1^y, \dots, s_T^y$ by gradually adding Gaussian noise at each time step $t = 1, 2, \dots, T$ with variance $\beta_t \in \mathbb{R}_{>0}$ :
+
+$$q(s_t^y | s_{t-1}^y) = \mathcal{N}(s_t^y | (1 - \beta_t)s_{t-1}^y, \beta_t \mathbf{I}) \quad (2)$$
+
+Let $\epsilon_t \sim \mathcal{N}(0, k^2 \mathbf{I})$ as we convert data into simplex space, $\alpha_t = 1 - \beta_t$ , and $\bar{\alpha}_t = \prod_{j=1}^t \alpha_j$ . Sampling $s_t^y$ at an arbitrary time step $t$ has a closed-form solution:
+
+{5}------------------------------------------------
+
+$$s_t^y = \sqrt{\alpha_t} s_0^y + \sqrt{1 - \alpha_t} \epsilon_t \quad (3)$$
+
+Given a well-behaved noise schedule $\{\beta_t\}_{t=1}^T$ , a little amount of Gaussian noise with variance $\beta_t$ is injected, while a large amount $1 - \beta_t$ of previous sample $s_{t-1}^y$ is preserved for each time step $t$ . At the last time step $t = T$ , our original data is expected to be no different from pure Gaussian distribution $\mathcal{N}(0, \mathbf{I})$ . Therefore, in the denoising process, we can sample random noise from a standard Gaussian distribution and recover it sequentially to samples from $p_{\text{data}}$ . Such an approximation of the reverse process $q(s_{t-1}^y | s_t, s_0)$ can be delivered via a neural network with parameters $\theta$ , $p_\theta(s_{t-1}^y | s_t^y)$ . In the context of our posterior estimation, neural network is conditioned on $s^{\tilde{y}}$ , where $\tilde{y}$ is the noisy label, to approximate $s_{t-1}^y$ at time step $t$ . The reverse process then is parameterized as
+
+$$p_\theta(s_{t-1}^y | s_t^y, s^{\tilde{y}}, \mathbf{x}) = \mathcal{N}(\mu_\theta(s_t^y, t | s^{\tilde{y}}, \mathbf{x}), \Sigma_\theta(s_t^y, t | s^{\tilde{y}}, \mathbf{x})) \quad (4)$$
+
+As cross-entropy loss is typical in classification problem, we adopt it between the ground truth label and the model prediction given a noisy logit simplex $s_t$ at time step $t$ .
+
+$$\mathcal{L} = \mathbb{L}_{t, q(s_0^y | s^{\tilde{y}}, \mathbf{x}_i), q(s_t^y | s_0^y, s^{\tilde{y}}, \mathbf{x}_i)} \left[ - \sum_{i=1}^L \log p_\theta(y_i | s^{y_i}, t, s^{\tilde{y}_i}, \mathbf{x}_i) \right] \quad (5)$$
+
+**Noise Schedule** One important component in the diffusion forward process is the noise schedule. We follow the following cosine schedule for $\alpha_t$ :
+
+$$\bar{\alpha}_t = \frac{f(t)}{f(0)}, \quad f(t) = \cos \left( \frac{t}{T} + \frac{s}{1+s} \cdot \frac{\pi}{2} \right)^2 \quad (6)$$
+
+**Inference** During the inference of the simplex diffusion model, $s_T$ is sampled from the prior $\mathcal{N}(0, k^2 \mathbf{I})$ . The model predictions are iteratively denoised for $t = T, \dots, 1$ starting from $k$ -logit simplex Gaussian noise. This reverse process can be approximated via an adjustment of Equation (3):
+
+$$s_{t-1} = \sqrt{\alpha_{t-1}} \hat{\mathcal{S}}_\theta(s_t, t | s^{\tilde{y}}, \mathbf{x}) + \sqrt{1 - \alpha_{t-1}} \epsilon_t \quad (7)$$
+
+where $\hat{\mathcal{S}}_\theta$ is the model prediction of the ground-truth, $s^{\tilde{y}}$ is noisy label simplex and $\mathbf{x}$ is the input embedding, on which the model is conditioned. The model prediction $\hat{\mathcal{S}}_\theta(s_t, t | s^{\tilde{y}}, \mathbf{x})$ is regarded as the hypothetical ground-truth and corrupt it by $(t - 1)$ time steps. To construct the model prediction, we project the logits produced by the underlying conditional model via argmax to match the initial $k$ -logit representation:
+
+$$s_{(i)}^c = \begin{cases} k, & \text{if } i = \text{argmax}(s^y), \\ -k & \text{otherwise.} \end{cases} \quad (8)$$
+
+## 5 EXPERIMENTS & RESULTS
+
+First, we introduce the tasks and datasets (20News Group, NumClaim, TREC, SemEval) that our experiments are conducted on (Section 5.1). Then, we describe our experimental setup (Section 5.2). Subsequently, we present the results of LLMs noise (Section 5.3) and synthetic noise, and real world noise (Section 5.4). Finally, we validate the effectiveness of each component in our framework (Section 5.5).
+
+### 5.1 TASKS AND DATASETS
+
+{6}------------------------------------------------
+
+For our experiments, we include financial numerical claim detection from [Shah et al. \(2024\)](#), question classification from [Li & Roth \(2002\)](#), semantic relation classification task from [Hendrickx et al. \(2019\)](#), and news topic modeling task from [Lang \(1995\)](#). A summary of datasets used with the train-validation-test split is provided in table 1. We provide brief details about each task and dataset in Appendix A.
+
+### 5.2 EXPERIMENTAL SETUP
+
+**Baselines** We compare SiDyP with the most relevant state-of-the-art baselines from three different categories in the realm of learning from noisy labels: (1) *Basic Performances* without specific design tackling noisy labels ([Devlin et al., 2019a](#)); (2) *Multi-Model Training Strategies*: **Co-Teaching** ([Han et al., 2018a](#)) and **JoCoR** ([Wei et al., 2020](#)). **Co-Teaching** trains two networks simultaneously and selects small-loss instances as clean samples for subsequent training. **JoCoR** also trains two networks simultaneously and use co-regularization to achieve agreement to filter out noisy samples by selecting instances with small losses; (3) *Generative Models for Noisy Matrix Estimation*: **NPC** ([Bae et al., 2022](#)) and **DyGen** ([Zhuang et al., 2023](#)). **NPC** utilize a generative model to calibrate the prediction of classifiers trained on noisy labels via a transition matrix. **DyGen** leverages the training dynamics to detect noisy samples and use a generative model to calibrate.
+
+**Evaluation** We evaluate all the experiments using accuracy on clean test datasets. We only run the model on the test dataset at the point when the validation accuracy achieves the highest during training. The reported test performances of all baselines and our SiDyP is selected by this procedure. **Given that the success of existing weakly-supervised learning methods relies heavily on clean validation samples** ([Zhu et al., 2023](#)), **we use noisy validation sets for model selections in all experiments**. All experiments are run under 5 random seeds. We report the mean of the performances and the standard deviation.
+
+**Implementation Details** We implement SiDyP using PyTorch ([Paszke et al., 2019](#)) and HuggingFace ([Wolf et al., 2020](#)). We use BERT ([Devlin et al., 2019a](#)) as our PLC in Stage I. For our baselines which contains PLC fine-tuning on noisy label datasets (**NPC**, **DyGen**, **GaDyP**), we use only one coherent PLC results for their individual post process to ensure a fair comparison as random seeds affect network initialization, synthetic noise generation, etc. More training details are revealed in Appendix D.
+
+### 5.3 LLMs NOISE EXPERIMENTS
+
+We run extensive experiments on various tasks and diversified LLM noises. First, we examine our framework in NumClaim, TREC, and SemEval labelled by Llama-3-70b-chat-hf ([Dubey et al., 2024](#)) in both zero-shot and few-shot manner. We only prompt 20News Group in zero-shot manner as it is a document level task, and Llama-3-70b has a context length limitation of 8192, which is not sufficient for few-shot learning. Then, to test SiDyP under diversified LLM noises, we prompt Meta-Llama-3.1-70B-Instruct-Turbo ([Dubey et al., 2024](#)), Meta-Llama-3.1-405B-Instruct-Turbo ([Dubey et al., 2024](#)), gpt-4o ([OpenAI et al., 2024](#)), and Mixtral-8x22B-Instruct-v0.1 ([Jiang et al., 2024](#)) in both zero-shot and few-shot prompting manners on SemEval task. We address the experiment details and results in the following.
+
+**LLM Prompting** For both zero-shot and few-shot manners, we use same prompts of same tasks for different LLMs (See prompting details in Appendix B.2). Notably, when prompting the LLM to label data, it is not guaranteed that it would follow the instructions and output in the specified format. It leads to missing labels for some data samples in our annotated datasets. Although we observe that the portion of missing labels is trivial (i.e. highest missing label ratio (only 0.014%) happens in 20News Group dataset. See full statistics in Appendix E), we still want to preserve those data samples to maintain data’s integrity for training. Therefore, we randomly assign a label to those
+
+| Dataset | # Labels | Dataset Size | | |
+|-|-|-|-|-|
+| | | Train | Valid | Test |
+| NumClaim | 2 | 1715 | 429 | 537 |
+| TREC | 6 | 5033 | 500 | 500 |
+| SemEval | 9 | 1749 | 178 | 600 |
+| 20News | 20 | 9051 | 2263 | 7532 |
+
+Table 1: Summary of datasets used. Dataset size denotes the number of samples in the benchmark.
+
+{7}------------------------------------------------
+
+missing-label samples according to a uniform distribution over all labels. We use the dataset after random assignment for both training and validation. We do not apply random assignment for test dataset and report LLMs' raw accuracy in Table 2 and 3.
+
+**Results** Table 2 shows the results of Llama-3-70b on all four tasks. Our method (SiDyP) outperforms all baselines by a notable margin 2.05& across all tasks in both prompting manners. There are averagely 6.34% samples of a fine-tuned PLC, and 5.77% of raw Llama-3-70b labelled samples successfully corrected by SiDyP. The performance gain on SemEval task is the most significant, achieving an average increase of 3.7%. This indicates that SiDyP is robust to high noise ratio dataset. Although the base performance of NumClaim is competitive, SiDyP is able to bring an average of 20.19% marginal increase. For NumClaim in few-shot manner, our method is the only one to outperform Llama-3-70b raw labelling accuracy and fine-tuned PLC. We also observe that both methods of multi-model training strategies struggle in these tasks. We think it's because of its training from scratch as PLC possesses prior knowledge that would be helpful despite that they are prone to noisy labels. Transition matrix-based methods performs generally better as it leverages pre-trained models and calibrate it via a post-process.
+
+| Datasets (→)
Method (↓) | NumClaim | | TREC | | SemEval | | 20News |
+|-|-|-|-|-|-|-|-|
+| | Zero-shot | Few-shot | Zero-shot | Few-shot | Zero-shot | Few-shot | Zero-shot |
+| Llama-3-70b | 89.94 | 95.53 | 81.80 | 84.00 | 47.50 | 48.50 | 74.04 |
+| PLC | 90.54±0.72 | 95.11±0.30 | 80.64±0.94 | 77.72±1.34 | 51.59±0.44 | 50.46±0.72 | 71.2±0.52 |
+| Co-teaching | 82.31±1.11 | 83.77±4.05 | 69.20±2.09 | 67.20±2.21 | 46.53±4.16 | 44.29±6.18 | 35.28±12.18 |
+| JoCoR | 83.35±1.97 | 85.82±2.05 | 70.80±3.00 | 65.82±2.17 | 45.66±3.25 | 44.11±2.23 | 42.39±11.98 |
+| NPC | 90.83±0.62 | 95.04±0.61 | 79.48±1.97 | 78.88±1.47 | 50.73±1.70 | 47.53±1.26 | 70.60±0.51 |
+| DyGen | 91.13±0.30 | 95.41±0.28 | 82.88±0.71 | 84.80±0.86 | 60.86±0.81 | 60.79±2.23 | 71.42±0.31 |
+| SiDyP | 93.63±0.84 | 95.97±0.15 | 84.76±0.79 | 85.60±0.44 | 64.26±0.27 | 64.79±0.96 | 72.66±0.58 |
+
+Table 2: Performance comparison of Llama-3-70b on zero-shot and few-shot learning tasks across multiple datasets, including NumClaim, TREC, SemEval, and 20News. Results are reported as classification accuracy with mean and standard deviations of 5 runs under different seed. **Bold** represents the best performance, while underline presents the second-best performance. Same seed setting and presentation apply in the following tables.
+
+**Robustness Check for Diversified LLMs** Instead of limiting to Llama-3-70b, we extend our experiments to a variety of LLMs of different families with different sizes. We follow the same prompting and assignment procedure as describe above (See details in Appendix B.1). We aim to check the robustness of our SiDyP framework under multiple LLM-generated label noise. Table 3 shows the results of various types of LLM label noise on SemEval. Our method (SiDyP) achieves a significantly better performance compared to all baselines across all LLMs and both prompting manners. Specifically, SiDyP obtain an average of 4.47% performance gain than the second best baseline. Comparing to a fine-tuned PLC on noisy dataset, our method is able to boost the performance by an average of 8.02%. Notably, a significant average increase of 11.73% than LLMs raw accuracy is brought by our method. Combining all, we validate that our method is robust and resilient to different types of LLM noise and different prompting methods.
+
+### 5.4 SYNTHETIC AND REAL-WORLD NOISE EXPERIMENTS
+
+Observing significant performance improvement in LLM-generated label noises, we further test our method under different families of noises, synthetic and real-world, on SemEval task. We reveal the experiment details and results below.
+
+**Noise Generation** We inject three types of synthetic noises, including **Symmetric Noise (SN)**, **Asymmetric Noise (ASN)**, and **Instance-Dependent Noise (IDN)**. Symmetric Noise flips labels
+
+{8}------------------------------------------------
+
+| Dataset (→) | | SemEval | | | | | | | |
+|-|-|-|-|-|-|-|-|-|-|
+| Method (↓) | Llama-3.1-70b | | Llama-3.1-405b | | GPT4o | | Mixtral-8x22b | | |
+| | Zero-shot | Few-shot | Zero-shot | Few-shot | Zero-shot | Few-shot | Zero-shot | Few-shot | |
+| Base | 52.66 | 55.16 | 55.16 | 52.16 | 56.50 | 57.66 | 42.66 | 40.83 | |
+| PLC | 60.26 $\pm$ 0.89 | 57.70 $\pm$ 1.10 | 54.76 $\pm$ 1.24 | 53.96 $\pm$ 0.12 | 58.63 $\pm$ 0.86 | 61.56 $\pm$ 0.93 | 49.29 $\pm$ 1.31 | 46.331.32 | |
+| Co-teaching | 52.50 $\pm$ 5.35 | 54.09 $\pm$ 3.56 | 45.51 $\pm$ 1.96 | 51.36 $\pm$ 0.89 | 52.13 $\pm$ 5.36 | 60.91 $\pm$ 5.58 | 39.3 $\pm$ 6.79 | 27.35 $\pm$ 2.55 | |
+| JoCoR | 45.06 $\pm$ 0.97 | 44.26 $\pm$ 9.55 | 45.39 $\pm$ 4.29 | 50.28 $\pm$ 3.07 | 53.31 $\pm$ 5.43 | 53.05 $\pm$ 4.78 | 32.94 $\pm$ 8.73 | 27.26 $\pm$ 1.46 | |
+| NPC | 60.13 $\pm$ 0.77 | 57.49 $\pm$ 3.00 | 55.06 $\pm$ 2.99 | 54.531.24 | 59.56 $\pm$ 0.90 | 61.40 $\pm$ 1.53 | 47.56 $\pm$ 1.26 | 41.96 $\pm$ 0.70 | |
+| DyGen | 68.530.88 | 64.532.85 | 59.691.31 | 51.69 $\pm$ 2.02 | 62.630.91 | 64.030.82 | 50.636.43 | 40.23 $\pm$ 1.41 | |
+| SiDyP | 71.660.91 | 67.431.36 | 62.760.99 | 60.462.06 | 66.860.48 | 68.831.07 | 57.961.94 | 50.662.02 | |
+
+Table 3: Performance comparison of Llama-3.1-70b, Llama-3.1-405b, GPT4o, and Mixtral-8×22b on zero-shot and few-shot learning tasks on SemEval. "Base" represents LLM's raw accuracy on test sets.
+
+uniformly to other classes (Zhuang et al., 2023; Bae et al., 2022; Han et al., 2018a). Asymmetric Noise flips labels with similar classes (Zhuang et al., 2023; Bae et al., 2022). Instance-Dependent Noise flips label with a probability proportional to the features of the sample (Zhuang et al., 2023; Bae et al., 2022). As synthetic noise is controlled, we use the noise ratio of 50% to make a comparison with LLM noise. We choose 50% because LLM noises ratio on SemEval are around 50%. For real-world noise, we take majority vote on the 164 labeling functions' output provided in WRENCH (Zhang et al., 2021a) for the SemEval dataset.
+
+**Results** In Table 4, we present the results of various synthetic noises and real-world noises on SemEval. SiDyP achieves an average of 2.80% increase compared to the second-best baseline. We observe that the performance increase between SiDyP and a strong baseline DyGen on LLM noises (5.21%) is higher than it on synthetic noises (3.26%). This is because DyGen performs better on synthetic datasets as such noises are less intricate (Zhuang et al., 2023). It further validates that LLM-generated label noises align more with real-world noise, making it more challenging for other baselines to arrive at accurate estimates. SiDyP, on the other hand, is resilient to all types of label noise, and brings improvement consistently. Moreover, all baselines are prone to the real-world noise as they struggle to be comparable with Base and PLC performances. SiDyP is the only one outperforming them by 3.36% and 1.73% increase respectively.
+
+### 5.5 EFFECTIVENESS OF DIFFERENT COMPONENTS
+
+We investigate the effectiveness of each component in our SiDyP framework on Llama-3-70b labelled SemEval dataset in both zero-shot and few-shot manners. We eliminate them individually to validate their impact on performances: (1) Replacing our dynamic distillation priors with fix certain priors (for each sample, it's only associated with one fix certain label) in Stage II; (2) Substituting Stage II's generative model, simplex diffusion model with Dirichlet variational auto-encoder (VAE) (Joo
+
+{9}------------------------------------------------
+
+et al., 2019) and Gaussian diffusion model (Sohl-Dickstein et al., 2015; Han et al., 2022; Chen et al., 2023b). Table 5 indicates the result. All experiments are conducted using same PLC fine-tuned results, and share the same value of hyper-parameters. Our simplex denoising label diffusion model surpasses Dirichlet VAE by an average of 2.17%. We believe such an enhancement comes from the de-noising capability of diffusion model. Moreover, it outperforms the Gaussian diffusion model by 8.58%. Our simplex denoising label diffusion model, which diffuses in probability simplex space, constructs a more reliable and accurate label probability from noisy labels. Besides, our dynamic prior distillation brings 1.53% increase. We further validate the improvement source of our dynamic prior by comparing the portion of correct labels we collect with fix prior method (See Appendix F for more details). Combining all, it confirms that our candidate retrieval algorithm could derive more true labels, and our prior distillation could find the correct labels among the candidates.
+
+## 6 RELATED WORK
+
+Weak-supervision in machine learning includes incomplete, inexact, and inaccurate categories, each tailored to specific imperfections in data (Zhou, 2018). Inexact supervision deals with broad labels, while inaccurate supervision, where labels are erroneous, employ techniques like data programming (Ratner et al., 2017), human-in-the-loop strategies (Zhang et al., 2022), and contrastive loss for enhanced learning from data similarities and differences (Yu et al., 2020). Zhang et al. (2021a) apply
+
+a two-stage model to manage inaccurate supervision, initially denoising data before training on refined labels. In the landscape of learning from noisy labels, Iscen et al. (2022) proposed that there supposed to be similarities among training instances in the feature/embedding space, leading to the consistency of labels between data instances and their neighbors. NPC proposed by Bae et al. (2022), lies in the class of transition matrix base method. The true label is inferred by a prior, estimated by a pretrained classifier, and a posterior, approximated by a generative model. DyGen (Zhuang et al. (2023)) infers true label based on the training dynamics during finetuning the pretrained language model. The feasibility of Diffusion Models in classification problems are explored and validated by Han et al. (2022). Chen et al. (2023a) is the very first to exploit the Gaussian diffusion model in the context of noisy label learning. LLMs have also been leveraged to iteratively expand label space under extremely weak supervision. X-MLClass (Li et al., 2024) demonstrated significant improvements in label discovery and multi-label classification accuracy in open-world settings. Additionally, explanation-aware ensembling methods like EASE (Yu et al., 2023) further illustrate how LLMs can be used to improve in-context learning by effectively guiding predictions and mitigating label noise.
+
+## 7 DISCUSSION
+
+In this paper, we propose a denoising framework, SiDyP, to enhance the learning from Llama-3 generated labels noise. Leveraging the principle of partial label learning and neighbor consistency, our label candidate retrieval and prior dynamic refinement algorithm alleviate the harm of incorrect labels during the training of a classifier. We introduce a simplex diffusion model to reconstruct categorical label data and utilize it as a posterior probability distribution estimator to calibrate the inaccurate prior distribution. Our framework boosts few-shot Llama-3 classification accuracy by a 7.69% average increase across all datasets of diverse noise ratios. We believe that our work sheds light on the realm of employing the diffusion model in the context of learning from noisy labels as well as the topics of calibrating incorrect llm-generated datasets.
+
+| Datasets (→) | SemEval | | |
+|-|-|-|-|
+| | Method (↓) | Zero-shot | Few-shot |
+| FP + Dir-VAE | | 60.86 $\pm$ 0.81 | 60.79 $\pm$ 2.23 |
+| FP + Sim-Diff | | 62.73 $\pm$ 1.06 | 63.26 $\pm$ 1.06 |
+| DP + Gau-Diff | | 54.53 $\pm$ 3.48 | 57.36 $\pm$ 3.64 |
+| DP + Sim-Diff (SiDyP) | | 64.260.27 | 64.790.96 |
+
+Table 5: Different components efficacy on zero-shot and few-shot labelled SemEval by Llama-3-70b. "FP"=fix prior. "DP"=our dynamic prior. "Dir-VAE"=Dirichlet VAE. "Gau-Diff"=Gaussian diffusion model. "Sim-Diff"=simplex diffusion model.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/NIkfix2eDQ.txt b/papers/NIkfix2eDQ.txt
new file mode 100644
index 0000000000000000000000000000000000000000..aa8789137ee2e7c71ed67120a9a69c2971ba8c2e
--- /dev/null
+++ b/papers/NIkfix2eDQ.txt
@@ -0,0 +1,240 @@
+**Primary Area:** transfer learning, meta learning, and lifelong learning
+
+
+
+{0}------------------------------------------------
+
+# PLASTIC LEARNING WITH DEEP FOURIER FEATURES
+
+Alex Lewandowski1,2 Dale Schuurmans1,2,3,4 Marlos C. Machado1,2,4
+
+1Department of Computing Science, University of Alberta, 2Amii,
+
+3Google DeepMind, 4Canada CIFAR AI Chair
+
+## ABSTRACT
+
+Deep neural networks can struggle to learn continually in the face of non-stationarity, a phenomenon known as loss of plasticity. In this paper, we identify underlying principles that lead to plastic algorithms. We provide theoretical results showing that linear function approximation, as well as a special case of deep linear networks, do not suffer from loss of plasticity. We then propose *deep Fourier features*, which are the concatenation of a sine and cosine in every layer, and we show that this combination provides a dynamic balance between the trainability obtained through linearity and the effectiveness obtained through the nonlinearity of neural networks. Deep networks composed entirely of deep Fourier features are highly trainable and sustain their trainability over the course of learning. Our empirical results show that continual learning performance can be improved by replacing $\text{ReLU}$ activations with deep Fourier features combined with regularization. These results hold for different continual learning scenarios (e.g., label noise, class incremental learning, pixel permutations) on all major supervised learning datasets used for continual learning research, such as CIFAR10, CIFAR100, and tiny-ImageNet.
+
+## 1 INTRODUCTION
+
+Continual learning is a problem setting that moves past some of the rigid assumptions found in supervised, semi-supervised, and unsupervised learning (Ring, 1994; Thrun, 1998). In particular, the continual learning setting involves learning from data sampled from a changing, non-stationary distribution rather than from a fixed distribution. A performant continual learning algorithm faces a trade-off due to its limited capacity: it should avoid forgetting what was previously learned while also being able to adapt to new incoming data, an ability known as plasticity (Parisi et al., 2019). Current approaches that use neural networks for continual learning are not yet capable of making this trade-off due to catastrophic forgetting (Kirkpatrick et al., 2017) and loss of plasticity (Dohare et al., 2021; Lyle et al., 2023; Dohare et al., 2024). The training of neural networks is in fact an active research area in the theory literature for supervised learning (Jacot et al., 2018; Yang et al., 2023; Kunin et al., 2024), which suggests there is much left to be understood in training neural networks continually. Compared to the relatively well-understood problem setting of supervised learning, even the formalization of the continual learning problem is an active research area (Kumar et al., 2023a; Abel et al., 2024; Liu et al., 2023). With these uncertainties surrounding current practice, we take a step back to better understand the inductive biases used to build algorithms for continual learning.
+
+One fundamental capability expected from a continual learning algorithm is its sustained ability to update its predictions on new data. Recent work has identified the phenomenon of *loss of plasticity* in neural networks in which stochastic gradient-based training becomes less effective when faced with data from a changing, non-stationary distribution (Dohare et al., 2024). Several methods have been proposed to address the loss of plasticity in neural networks, with their success demonstrated empirically across both supervised and reinforcement learning (Ash and Adams, 2020; Lyle et al., 2022; 2023; Lee et al., 2024). Empirically, works have identified that the plasticity of neural networks is sensitive to different components of the training process, such as the activation function (Abbas et al., 2023). However, little is known about what is required for learning with sustained plasticity.
+
+The goal of this paper is to identify a basic continual learning algorithm that does not lose plasticity in both theory and practice, rather than mitigating the loss of plasticity in existing neural network architectures. Our focus is on loss of plasticity rather than catastrophic forgetting, because plasticity is needed to sustain continual learning from new data. In particular, we investigate the effect of the nonlinearity of neural networks on the loss of plasticity. While loss of plasticity is a well-documented phenomenon in neural networks, previous empirical observations suggest that linear function
+
+{1}------------------------------------------------
+
+![Figure 1: A neural network with deep Fourier features in every layer approximately embeds a deep linear network. The figure consists of three parts: a network diagram on the left, a plot of sine and cosine functions on the middle, and a plot of sine and cosine functions on the right. The network diagram shows inputs x1, x2, x3, x4 connected to hidden units z1, z2, which are then connected to output units. The middle plot shows the sine function (blue solid line) and its linear approximation (black dashed line) over the interval [-3, 3], with a green shaded region around z=0. The right plot shows the cosine function (red solid line) and its linear approximation (black dashed line) over the interval [-3, 3], with a red shaded region around z=1.](49ad3a646d84bcfeac02bdf2b3792a3e_img.jpg)
+
+Figure 1: A neural network with deep Fourier features in every layer approximately embeds a deep linear network. The figure consists of three parts: a network diagram on the left, a plot of sine and cosine functions on the middle, and a plot of sine and cosine functions on the right. The network diagram shows inputs x1, x2, x3, x4 connected to hidden units z1, z2, which are then connected to output units. The middle plot shows the sine function (blue solid line) and its linear approximation (black dashed line) over the interval [-3, 3], with a green shaded region around z=0. The right plot shows the cosine function (red solid line) and its linear approximation (black dashed line) over the interval [-3, 3], with a red shaded region around z=1.
+
+Figure 1: **A neural network with deep Fourier features in every layer approximately embeds a deep linear network.** A single layer using deep Fourier features linearly combines the inputs, $x$ , to compute the pre-activations, $z$ , and each pre-activation is mapped to both a $\cos$ unit and a $\sin$ unit (*Left*). For each pre-activation, either the $\sin$ unit (*Middle*) or the $\cos$ unit (*Right*) is well-approximated by a linear function.
+
+approximation are capable of learning continually without suffering from loss of plasticity (Dohare et al., 2021; 2024). In this paper, we prove that linear function approximation does not suffer from loss of plasticity and can sustain their learning ability on a sequence of tasks. We then extend our analysis to a special case of deep linear networks, which provide an interesting intermediate case between deep nonlinear networks and linear function approximation. This is because deep linear networks are linear in representation but nonlinear in gradient dynamics (Saxe et al., 2014). We provide theoretical and empirical evidence that general deep linear networks also do not suffer from loss of plasticity. The plasticity of deep linear networks is surprising compared to the loss of plasticity of deep nonlinear networks. This finding suggests that loss of plasticity is not necessarily caused by the nonlinear learning dynamics, but a combination of nonlinear learning dynamics and nonlinear representations.
+
+Given this seemingly natural advantage of linearity for continual learning, as well as its inherent limitation to learning only linear representations, we explore how nonlinear networks can better emulate the dynamics of deep linear networks to sustain plasticity. We hypothesize that, to effectively learn continually, the neural network must balance between introducing too much linearity and suffering from loss of deep representations and introducing too much nonlinearity and suffering from loss of plasticity. In fact, we show that previous work partially satisfies this hypothesis, such as the concatenated ReLU (Shang et al., 2016), leaky-ReLU activations (Xu et al., 2015), and residual connections (He et al., 2016), but they fail at striking this balance. Our results build on previous work that identified issues of unit saturation (Abbas et al., 2023) and unit linearization (Lyle et al., 2024) as issues in continually training neural networks with common activation functions. In particular, we generalize both to the problem of low *unit sign entropy*, which indicates a lack of diversity in the activations as measured by the entropy of the sign of the hidden units. We show that linear networks have high unit sign entropy, meaning that the sign of a hidden unit on different inputs is positive on approximately half the inputs. In contrast, deep nonlinear networks with most activation functions tend to have low unit sign entropy, which indicates saturation or linearization.
+
+Periodic activation functions (Parascanoldo et al., 2017), like the sinusoidal function ( $\sin$ ), are a notable exception for having high unit sign entropy despite still suffering from loss of plasticity. Thus, in addition to unit sign entropy, we demonstrate that the network’s activation function should be well-approximated by a linear function. We propose *deep Fourier features* as a means of approximating linearity dynamically, with every pre-activation being connected to two units, one of which will always be well-approximated by a linear function. In particular, deep Fourier features concatenate a sine and a cosine activation in each hidden layer. The resulting network is nonlinear while also approximately embedding a deep linear network using all of its parameters. Deep Fourier features differ from previous approaches that use Fourier features only in the input layer (Tancik et al., 2020; Li and Pathak, 2021; Yang et al., 2022) or that use fixed Fourier feature basis (Rahimi and Recht, 2007; Kondiaris et al., 2011). We demonstrate that networks using these shallow Fourier features still exhibit a loss of plasticity. Only by using deep Fourier features in every layer is the network capable of sustaining and improving trainability in a continual learning setting. Using tiny-ImageNet (Le and Yang, 2015), CIFAR10, and CIFAR100 (Krizhevsky, 2009), we show that deep Fourier features can be used as a drop-in replacement for improving trainability in commonly used neural network architectures. Furthermore, the trainability of deep Fourier features enables training with a much larger regularization strength, leading to superior generalization performance.
+
+{2}------------------------------------------------
+
+## 2 PROBLEM SETTING
+
+We define a deep network, $f_\theta$ with a parameter set, $\theta = \{\mathbf{W}_l, \mathbf{b}_l\}_{l=1}^L$ , as a sequence of layers, in which each layer applies a linear transformation followed by an element-wise activation function, $\phi$ in each hidden layer. The output of the network, $f_\theta(x) := h_L(x)$ , is defined recursively by $h_l = [h_{l,1}, \dots, h_{l,w}] = [\phi(z_{l,1}), \dots, \phi(z_{l,w})] = \phi(z_l)$ , and, $z_l = \mathbf{W}_l h_{l-1} + \mathbf{b}_l$ where $w$ is the width of the network, and $h_0 = x$ . We refer to a particular element of the hidden layer's output $h_{l,i}$ as a unit. The deep network is a deep linear network when the activation function is the identity, $\phi(z) = z$ . Linear function approximation is equivalent to a linear network with $L = 1$ .
+
+The problem setting that we consider is continual supervised learning, where the learner does not have information about the task boundaries. Instead, at each iteration the learner has access to a minibatch of observation-target pairs of size $M$ , $\{x_i, y_i\}_{i=1}^M$ . This minibatch is used to update the parameters $\theta$ of a neural network $f_\theta$ using a variant of stochastic gradient descent. The learning problem is continual because the distribution from which the data is sampled, $p(x, y)$ , is changing. For simplicity, we assume this non-stationarity changes the distribution over the input-target pairs every $T$ iterations. The data is sampled from a single distribution for $T$ steps, and we refer to this particular temporary stationary problem as a task, $\tau$ . The distribution over observations and targets that defines a task $\tau$ is denoted by $p_\tau$ .
+
+Loss of plasticity can refer to two related phenomena: loss of generalization (Ash and Adams, 2020; Dohare et al., 2024) or loss of trainability (Dohare et al., 2021; Lyle et al., 2023). We focus our theoretical analysis on the problem of loss of trainability, in which we evaluate the neural network at the end of each task using samples from the most recent task distribution, $p_\tau$ , as is commonly done in previous work (Lyle et al., 2023). Loss of trainability refers to the problem where the neural network is unable to sustain its initial performance on the first task to later tasks. Specifically, we denote the optimisation objective by $J_\tau(\theta) = \mathbb{E}_{(x,y) \sim p_\tau} [\ell(f_\theta(x), y)]$ , for some loss function $\ell$ , and task-specific data distribution $p_\tau$ . We use $t$ to denote the iteration count of the learning algorithm, and thus the current task number can be written as $\tau(t) = \lfloor t/T \rfloor$ .
+
+## 3 TRAINABILITY AND LINEARITY
+
+In this section, we show that, unlike nonlinear networks, linear networks do not suffer from loss of trainability. That is, if the number of iterations in each task is sufficiently large, a linear network sustain trainability on every task in the sequence. We then show theoretically that a special case of deep linear networks also does not suffer from loss of trainability, and we empirically validate the theoretical findings in more general settings. These results provide a theoretical basis for previous work that uses a linear baseline in loss of plasticity experiments.
+
+### 3.1 TRAINABILITY OF LINEAR FUNCTION APPROXIMATION
+
+We first prove that loss of trainability does not occur with linear function approximation, $f_\theta(x) = \mathbf{W}_1 x + \mathbf{b}_1$ . We prove this by showing that linear function approximators can sustain learning on a sequence of tasks, with a large enough number of iterations per task. In particular, the performance of the solution found on the $\tau$ -th task can be upper bounded on a quantity that is independent of the solution found on the first $\tau - 1$ tasks. Linear function approximation avoids loss of trainability because the optimisation problem on each task is convex (Agrawal et al., 2021; Boyd and Vandenberghe, 2004), with a unique global optimum, $\theta_\tau^*$ . We now state the theorem, which we prove in Appendix B
+
+**Theorem 1.** *Let $\theta^{(\tau T)}$ denote the linear weights learned at the end of the $\tau$ -th task, with the corresponding unique global minimum for task $\tau$ being denoted by $\theta_\tau^*$ . Assuming the objective function is $\mu$ -strongly convex, the suboptimality gap for gradient descent on the $\tau$ -th task is*
+
+$$J_\tau(\theta^{(\tau T)}) - J_\tau(\theta_\tau^*) < \frac{2D(1 - \alpha\mu)^T}{\alpha T(1 - (1 - \alpha\mu)^T)},$$
+
+where each task lasts for $T$ iteration, $D$ is the assumed bound on the parameters at the global minimum for every task, and $\alpha$ is the step-size.
+
+Intuitively, this theorem states that if the problem is bounded and effectively strongly convex due to a finite number of iterations, then the optimisation dynamics are well-behaved for every task in the bounded set. In particular, this means that the error on each task can be upper bounded by a quantity independent of the initialization found on previous tasks. Thus, given enough iterations, linear function approximation can learn continually without loss of trainability.
+
+{3}------------------------------------------------
+
+### 3.2 TRAINABILITY OF DEEP LINEAR NETWORKS
+
+We now provide evidence that, similar to linear function approximation, deep linear networks also do not suffer from loss of trainability. Unlike deep nonlinear networks, deep linear networks use linear activation functions in their hidden layers (Bernacchia et al., 2018; Ziyin et al., 2022). This means that a deep linear network can only represent linear functions. At the same time, its gradient update dynamics are nonlinear and non-convex, similar to deep nonlinear neural networks (Saxe et al., 2014). Our central claim here is that *deep linear networks under gradient descent dynamics avoid parameter configurations that would lead to loss of trainability*.
+
+To simplify notation, without loss of generality, we combine the weights and biases into a single parameter for each layer in the deep linear network, $\theta = \{\theta_1, \dots, \theta_L\}$ , and $f_\theta(x) = \theta_L \theta_{L-1} \dots \theta_1 x$ . We denote the product of weight matrices, or simply product matrix, as $\hat{\theta} = \theta_L \theta_{L-1} \dots \theta_1$ , which allows us to write the deep linear network in terms of the product matrix: $f_\theta(x) = \hat{\theta}x$ . The problem setup we use for the deep linear analysis follows previous work (Huh, 2020), and we provide additional technical details for optimisation dynamics of deep linear networks in Appendix A.3.
+
+We now provide evidence to suggest that, despite deep linear networks being nonlinear in their gradient dynamics, they do not suffer from loss of trainability. We prove this for a special case of deep diagonal linear networks, and provide empirical evidence to support this claim in general deep linear networks.
+
+**Theorem 2.** *Let $f_\theta(x) = \theta_L \theta_{L-1} \dots \theta_1 x$ be a deep diagonal linear network where $\theta_l = \text{Diag}(\theta_{l,1}, \dots, \theta_{l,d})$ . Then, a deep diagonal linear network converges on a sequence of tasks under the same conditions for convergence in a single task (i.e., the conditions in Arora et al., 2019).*
+
+Theorem 2 states that a deep diagonal linear network, a special case of general deep linear networks, can converge to a solution on each task within a sequence of tasks. The proof, provided in Appendix B, shows that the minimum singular value of the product matrix stays greater than zero, $\sigma_{\min}(\hat{\theta}) > 0$ . Hence, deep diagonal linear networks do not suffer from loss of trainability. This result provides further evidence suggesting that linearity might be an effective inductive bias for learning continually.
+
+While the analysis considers a special case of deep linear networks, namely deep diagonal networks, we note that this is a common setting for the analysis of deep linear networks more generally (Nacson et al., 2022; Even et al., 2023). In particular, the analysis is motivated by the fact that, under certain conditions, the evolution of the deep linear network parameters can be analyzed through the independent singular mode dynamics (Braun et al., 2022), which simplifies the analysis of deep linear networks to deep diagonal linear networks.
+
+### 3.3 EMPIRICAL EVIDENCE FOR TRAINABILITY OF GENERAL DEEP LINEAR NETWORKS
+
+In the previous section, we proved that a special case of deep linear networks do not suffer from loss of trainability. We now provide additional empirical evidence that general deep linear networks do not suffer from loss of trainability. To do so, we use a linearly separable subset of the MNIST dataset (LeCun et al., 1998), in which the labels of each image are randomized every 100 epochs. For this experiment, the data is linearly separable so that even a linear baseline can fit the data if given enough iterations. While MNIST is a simple classification problem, memorizing random labels highlights the difficulties associated with maintaining trainability (see Lyle et al., 2023; Kumar et al., 2023b). We emphasize that the goal here is merely to validate that linear networks remain trainable in continual learning. We also provide results with traditional nonlinear neural networks on the same problem, showing that they suffer from loss of trainability in this simple problem. Later in Section 5, we extend our investigation of loss of trainability to larger-scale benchmarks.
+
+
+
+Figure 2: A line graph showing Accuracy (Y-axis, 0.2 to 1.0) versus Number of tasks (X-axis, 0 to 150). The graph compares Linear (blue line) and ReLU (orange line) networks. The Linear network maintains high accuracy (around 0.8) across all tasks, while the ReLU network's accuracy drops sharply after the first few tasks, stabilizing around 0.2. Shaded regions represent confidence intervals.
+
+**Figure 2: Trainability on a linearly separable task.** The higher opacity corresponds to deeper networks, ranging from {1, 2, 4, 8, 16}. Deep linear networks sustain trainability on new tasks, with some additional depth improving trainability. Nonlinear networks, using ReLU, suffer from loss of trainability at any depth even on this simple sequence of linearly separable problems.
+
+{4}------------------------------------------------
+
+In Figure 2, we see that deep linear networks ranging from a depth of 1 to 16 can sustain trainability. Using a multi-layer perceptron with `ReLU` activations, deep nonlinear networks quickly reach a much higher accuracy on the first few tasks. However, due to loss of trainability, deep nonlinear networks of any depth eventually perform worse than the corresponding deep linear network. With additional epochs, the linear networks could achieve perfect accuracy on this task because it is linear separable. The number of epochs is comparatively low to showcase that, with some additional layers, a deep linear network is able to improve its trainability as new tasks are encountered.
+
+## 4 COMBINING LINEARITY AND NONLINEARITY
+
+In the previous section, we provided empirical and theoretical evidence that linearity provides an effective inductive bias for learning continually by avoiding loss of trainability. However, linear methods are generally not as performant as deep nonlinear networks, meaning that their sustained performance can be inadequate on complex tasks. Even deep linear networks have only linear representational power, despite their nonlinear gradient dynamics. We now seek to answer the following question:
+
+*How can the sustained trainability of linear methods be combined with the expressive power of learned nonlinear representations?*
+
+To answer this question, we first seek to better understand the effects of replacing linear activation functions with nonlinear ones in deep networks for continual learning. We observe that deep linear networks have diversity in their hidden units, which can be induced in nonlinear activation functions by adding linearity through a weighted linear component, an idea we refer to as *$\alpha$ -linearization*. To dynamically balance linearity and nonlinearity, we propose to use *deep Fourier features* for every layer in a network. We prove that such a network approximately embeds a deep linear network, a property we refer to as *adaptive linearity*. We demonstrate that this adaptively-linear network is plastic, maintaining trainability even on non-linearly-separable problems.
+
+### 4.1 ADDING LINEARITY TO NONLINEAR ACTIVATION FUNCTIONS
+
+Deep nonlinear networks can learn expressive representations because of their nonlinear activation functions, but these nonlinearities can also lead to issues with trainability. Although several components of common network architectures incorporate linearity, the way in which linearity is used does not avoid loss of trainability. One example is the piecewise linearity of the `ReLU` activation function (Shang et al., 2016), $\text{ReLU}(x) = \max(0, x)$ , which is said to be *saturated* if $\text{ReLU}(x) = 0$ for most inputs $x$ , preventing gradient propagation. While saturation is generally not a problem for learning on a single distribution, it has been noted as problematic in learning from changing distributions, for example, in reinforcement learning (Abbas et al., 2023).
+
+A potential solution to saturation is to use a non-saturating activation function. Two noteworthy examples of non-saturating activation functions include a periodic activation like $\sin(x)$ (Parascandolo et al., 2017) and $\text{leaky-ReLU}_\alpha(x) = \alpha x + (1 - \alpha)\text{ReLU}(x)$ (Xu et al., 2015), both of which are zero on a set of measure zero. Surprisingly, using `leaky-ReLU` leads to a related issue, “unit linearization” (Lyle et al., 2024), in which the activation is only positive (or negative) for most inputs $x$ . Unlike saturated units, linearized units can provide non-zero gradients but render that unit effectively linear, limiting the expressive power of the learned representation. While unit linearization seems to suggest that loss of trainability can occur due to linearity, it is important to note that a “linearized unit” is not the same as a linear unit. This is because a linearized unit provides mostly positive (or negative) outputs, whereas a linear unit can output both positive and negative values.
+
+We generalize the idea behind unit saturation and unit linearization to *unit sign entropy*, which is applicable to activation functions beyond saturating and piecewise linear functions, such as periodic activation functions. Intuitively, it measures the diversity of the activations of a hidden layer.
+
+**Definition 1** (Unit Sign Entropy). *The entropy, $\mathbb{H}$ , of the unit’s sign, $\text{sgn}(h(x))$ , on a distribution of inputs to the network, $p(x)$ , is given by $\mathbb{H}(\text{sgn}(h(x))) = \mathbb{E}_{p(x)}[\text{sgn}(h(x))]$ .*
+
+The maximum value of unit sign entropy is 1, which occurs when the unit is positive on half the inputs. Conversely, a low sign entropy is associated with the aforementioned issues of saturation and linearization. For example, a low sign entropy for a deep network using `ReLU` activations means that the unit is almost always positive ( $P(\text{sgn}(h(x)) = 1) = 1$ , meaning it is linearized) or negative ( $P(\text{sgn}(h(x)) = 1) = 0$ , meaning it is saturated).
+
+{5}------------------------------------------------
+
+With unit sign entropy, we investigate how the leak parameter for the leaky-ReLU activation function influences training as pure linearity ( $\alpha = 1$ ) is traded-off for pure nonlinearity ( $\alpha = 0$ ). The idea of mixing a linearity and nonlinearity can also be generalized to an arbitrary activation function, which we refer to as the $\alpha$ -linearization of an activation function.
+
+**Definition 2** ( $\alpha$ -linearization). *The $\alpha$ -linearization of an activation function $\phi$ , is denoted by $\phi_\alpha(x) = \alpha x + (1 - \alpha)\phi(x)$ .*
+
+A natural hypothesis is that, as $\alpha$ increases from 0 to 1, and the network becomes more linear, loss of trainability is mitigated. We emphasize that the $\alpha$ -linearization is primarily to gain insights from empirical investigation and it is not a solution to loss of trainability. This is because any benefits of $\alpha$ -linearization depend on tuning $\alpha$ , and even optimal tuning can lead to overly linear representations and slow training compared to nonlinear networks.
+
+**Empirical Evidence for $\alpha$ -linear Plasticity** To understand the trainability issues introduced by nonlinearity, we present a case-study using $\sin$ and $\text{ReLU}$ with different values of the linearization parameter, $\alpha$ . The same experiment setup is used from Section 3.3. Referring to the results in Figure 3, we see that both $\text{ReLU}$ and $\sin$ activation functions are able to sustain trainability for larger values of $\alpha$ . This verifies the hypothesis: a larger $\alpha$ provides more linearity to the network, allowing it to sustain trainability. Despite sustaining trainability, a larger $\alpha$ can lead to overly linear representations, evidenced by worse performance and slower training speed on the first few tasks compared to nonlinear networks ( $\alpha = 0$ ). For $\alpha$ - $\text{ReLU}$ , we also verify the hypothesis that the unit sign entropy increases for larger values of $\alpha$ (inset plot). The fact that the periodic $\sin$ activation function has a high unit sign entropy despite losing trainability is particularly interesting, which we explore in the next section.
+
+
+
+Figure 3: Trainability on a linearly separable task with alpha-linearization. The main plot shows Accuracy (y-axis, 0.2 to 1.0) versus Number of Tasks (x-axis, 0 to 100). Four curves are shown: alpha=0.0 (blue), alpha=0.2 (orange), alpha=0.5 (green), and alpha=0.8 (red). The alpha=0.0 curve drops to near zero accuracy by task 25. The other curves remain high, with alpha=0.8 being the highest. An inset plot shows Average Unit Sign Entropy (y-axis, 0 to 1) versus Number of Tasks (x-axis, 0 to 100). The alpha=0.0 curve is flat at ~0.6. The other curves start at ~0.6 and increase to ~0.8-0.9 as alpha increases.
+
+Figure 3: **Trainability on a linearly separable task with $\alpha$ -linearization** Darker opacity lines correspond to higher values of $\alpha$ . Unit sign entropy increases as $\alpha$ increases (inset), leading to sustained trainability for $\alpha$ - $\text{ReLU}$ .
+
+### 4.2 ADAPTIVE-LINEARITY BY CONCATENATING SINUSOID ACTIVATION FUNCTIONS
+
+Using the insight that linearity promotes unit sign entropy, we explore an alternative approach to sustain trainability. In particular, we found that linearity can sustain trainability but requires tuning $\alpha$ , and even optimal tuning can lead to slow learning from overly linear representations. Our approach is motivated by concatenated $\text{ReLU}$ activations (Shang et al., 2016; Abbas et al., 2023), $\text{CRELU}(z) = [\text{ReLU}(z), \text{ReLU}(-z)]$ , which avoids the problems from saturated units, but does not avoid the problem of low unit sign entropy. In particular, we propose using a pair of activations functions such that one activation function is always approximately linear, with a bounded error.
+
+One way to dynamically balance the linearities and nonlinearities of a network is using periodic activation functions. This is because, due to their periodicity, the properties of the activation function can re-occur as the magnitude of the preactivations grows rather than staying constant, linear, or saturating. But, as we saw in Figure 3, a single periodic activation function like $\sin$ is not enough. Instead, we propose to use deep Fourier features, meaning that every layer in the network uses Fourier features. This is a notable departure from previous work which considers only shallow Fourier features in the first layer (Rahimi and Recht, 2007; Tancik et al., 2020). In particular, each unit is a concatenation of a sinusoid basis of two elements, $\text{Fourier}(z) = [\sin(z), \cos(z)]$ . Each pre-activation is mapped to both $\sin(z)$ and $\cos(z)$ , which requires that a layer with deep Fourier features have half the output width to accommodate the concatenation.1
+
+The advantage of this approach is that a network with deep Fourier features maintains approximate linearity in all of its parameters. Moreover, deep Fourier features are closed under differentiation, meaning that the activations and their gradients provide a basis for representing periodic functions.
+
+**Proposition 1.** *For any $z$ , there exists a linear function, $L_z(x) = a(z)x + b(z)$ , such that either: $|\sin(x) - L_z(x)| \leq c$ , or $|\cos(x) - L_z(x)| \leq c$ , for $c = \sqrt{2\pi^2/2^8}$ and all $x \in [z - \pi/4, z + \pi/4]$ .*
+
+1For a fixed width, a network with deep Fourier features has approximately half the number of parameters.
+
+{6}------------------------------------------------
+
+An intuitive description of this is provided in Figure 1. The advantage of using two sinusoids over just a single sinusoid is that whenever $\cos(z)$ is near a critical point, $d/dz \cos(z) \approx 0$ , we have that $\sin(z) \approx z$ , meaning that $d/dz \sin(z) \approx 1$ (and vice-versa). The argument follows from an analysis of the Taylor series remainder, showing that the Taylor series of half the units in a deep Fourier layer can be approximated by a linear function, with a small error of $c = \sqrt{2}\pi^2/2^8 \approx 0.05$ . While we found that two sinusoids is sufficient, the approximation error can be further improved by concatenating additional sinusoids, at the expense of reducing the effective width of the layer.
+
+Because each pre-activation is connected to a unit that is approximately linear, we can conclude that a deep network comprised of deep Fourier features approximately embeds a deep linear network.
+
+**Corollary 1.** *A network parameterized by $\theta$ , with deep Fourier features, approximately embeds a deep linear network parameterized by $\theta$ with a bounded error.*
+
+Notice that piecewise linear activations also embed a deep linear network, but these embedded deep linear networks do not use the same parameter set. For example, the deep linear network embedded by a ReLU network does not depend on any of the parameters used to compute a ReLU unit that is zero. Although the leaky-ReLU function involves every parameter, the deep linear network vanishes because the leak parameter is small, $\alpha < 1$ , and hence the embedded deep linear network is multiplied by a small constant, $\alpha^{-L}$ , where $L$ is the depth of the network.
+
+**Empirical Evidence for Nonlinear Plasticity** We now consider a similar experimental setup from Sections 3.3 and 4.1, except we make the problem non linearly-separable by considering random label assignments on the entire dataset. Each task is more difficult because it involves memorizing more labels, and the effect of the non-stationarity is also stronger due to randomization of more datapoints. As a result, the deep linear network can no longer fit a single task well. Referring to Figure 4, the $\alpha$ -linear activation functions can sustain and even improve their trainability, albeit very slowly. See also unit sign entropy in Figure 9, Appendix D.1. In contrast, using deep Fourier features within the network enables the network to easily memorize all the labels for 100 tasks. Deep Fourier features surpass the trainability of the other nonlinear baselines at initialization, and shallow Fourier features followed by ReLU. This is surprising, because deep nonlinear networks at initialization are often a gold-standard for trainability.
+
+
+
+Figure 4: A line graph showing Accuracy (Y-axis, 0.2 to 1.0) versus Number of tasks (X-axis, 0 to 80). The graph compares five network configurations: CReLU (black line), ReLU (blue line), desin (alpha = 0.5) (orange line), Fourier + ReLU (grey line), and Deep Fourier (yellow line). The Deep Fourier line starts at approximately 0.8 accuracy and remains relatively stable, ending near 0.9. The CReLU line starts at 0.8 and decreases to about 0.5. The ReLU line starts at 0.8 and decreases to about 0.4. The desin line starts at 0.8 and decreases to about 0.3. The Fourier + ReLU line starts at 0.8 and decreases to about 0.3. Shaded regions around the lines represent confidence intervals.
+
+Figure 4: **Trainability on a non linearly-separable task.** Deep Fourier features improve and sustain their trainability when other networks cannot.
+
+## 5 EXPERIMENTS
+
+Our experiments demonstrate the benefits of the adaptive linearity provided by deep Fourier features. While trainability was the primary focus behind our theoretical results and empirical case studies, we show that these findings generalize to other problems in continual learning. In particular, we demonstrate that networks composed of deep Fourier features are capable of being strongly regularized leading to improved generalization performance on diminishing levels of label noise, and in class-incremental learning. The main results we present are on all of the major continual supervised learning settings considered in the plasticity literature. They build on the standard ResNet-18 architecture, widely used in practice (He et al., 2016).
+
+**Datasets and Non-stationarities** Our experiments use the common image classification datasets for continual learning, namely tiny-ImageNet (Le and Yang, 2015), CIFAR10, and CIFAR100 (Krizhevsky, 2009). We augment these datasets with commonly used non-stationarities to create continual learning problems, with the non-stationarity creating a sequence of tasks from the dataset. Specifically, we follow recent work that introduced the diminishing label noise problem (Lee et al., 2024), which is inspired by the warm-starting problem: We start with half the data being corrupted by label noise and reduce the noise to clean labels over 10 tasks. Additionally, for the datasets with a larger number of classes, tiny-ImageNet and CIFAR100, we also consider the class-incremental setting: the first task involves only five classes, and five new classes are added to the existing pool of classes at the beginning of each task (Van de Ven et al., 2022). Other results and more details on datasets and non-stationarities considered can be found in Appendix C.
+
+{7}------------------------------------------------
+
+
+
+Figure 5: Training a ResNet-18 continually with diminishing label noise. Three line graphs show Test Accuracy vs. Number of Epochs for tiny-ImageNet, CIFAR100, and CIFAR10. The graphs compare various methods: CReLU, L2 (zero), ReDO, ReLU, Shrink&Perturb, SpectralReg, and Deep Fourier. In all datasets, Deep Fourier (orange line) maintains higher accuracy than other methods as label noise decreases over epochs.
+
+Figure 5: **Training a ResNet-18 continually with diminishing label noise.** Deep Fourier features are particularly performant on complex tasks like tiny-ImageNet. Despite networks with deep Fourier features having approximately half the number of parameters, they surpass the baselines in CIFAR100 and are on-par with spectral regularization on CIFAR10.
+
+**Architecture and Baselines** We compare a ResNet-18 using only deep Fourier features against a standard ResNet-18 with ReLU activations. The network with deep Fourier features has fewer parameters because it uses a concatenation of two different activation functions, halving the effective width compared to the network with ReLU activations. This provides an advantage to the nonlinear baseline. We also include *all* prominent baselines that have previously been proposed to mitigate loss of plasticity in the field: L2 regularization towards zero, L2 regularization towards the initialization (Kumar et al., 2023b), spectral regularization (Lewandowski et al., 2024), Concatenated ReLU (Shang et al., 2016; Abbas et al., 2023), Dormant Neuron Recycling (ReDO, Sokar et al., 2023), Shrink and Perturb (Ash and Adams, 2020), and Streaming Elastic Weight Consolidation (S-EWC, Kirkpatrick et al., 2017; Elsayed and Mahmood, 2024).
+
+### 5.1 MAIN RESULTS
+
+Our results demonstrate that deep Fourier features, combined with regularization, are effective at continual learning. In these set of experiments, we consider the problem of sustaining test accuracy on a sequence of tasks. In addition to requiring trainability, methods must also sustain generalization.
+
+**Diminishing Label Noise** In Figure 5, we can clearly see the benefits of deep Fourier features in the diminishing label noise setting. At the end of training on ten tasks with diminishing levels of label noise, the network with deep Fourier features was always among the methods with the highest test accuracy on the uncorrupted test set. On the first of ten tasks, deep Fourier features could occasionally overfit to the corrupted labels leading to initially low test accuracy. However, as the label noise diminished on future tasks, the network with deep Fourier features was able to continue to learn to correct its previous poorly-generalizing predictions. In contrast, the improvements achieved by the other methods that we considered was oftentimes marginal compared to the baseline ReLU network. Two exceptions are: (i) networks with CReLU activations, which underperformed relative to the baseline network, and (ii) Shrink and Perturb, which was the best-performing baseline method for diminishing label noise. Interestingly, the performance benefit of deep Fourier features is most prominent on more complex datasets, like tiny-ImageNet. In Appendix D.2, we provide an ablation of the architecture, where we use a Wide Residual Network (Zagoruyko and Komodakis, 2016) and vary the width scale.
+
+#### Class-Incremental Learning
+
+Deep Fourier features are also effective in the class-incremental setting, where later tasks involve training on a larger subset of the classes, following the experiment described in (Dohare et al., 2024). The network is evaluated at the end of each task on the entire test set. As the network is trained on later tasks, its test set performance increases
+
+
+
+Figure 6: Class incremental learning results on tiny-ImageNet (Left) and CIFAR-100 (Right). Two line graphs show Test Accuracy vs. Number of tasks. The graphs compare various methods: CReLU, L2 (zero), ReDO, ReLU, Shrink&Perturb, SpectralReg, and Deep Fourier. In both datasets, Deep Fourier (orange line) shows superior performance, maintaining higher accuracy as more tasks are added compared to other methods.
+
+Figure 6: **Class incremental learning results on tiny-ImageNet (Left) and CIFAR-100 (Right).** On both datasets, deep Fourier features substantially improve over most baselines.
+
+{8}------------------------------------------------
+
+because it has access to a larger subset of the training data. In Figure 6, we see that Deep Fourier features largely outperform the baselines in this setting, particularly on tiny-ImageNet in which the first forty tasks involve training on a growing subset of the dataset and the last forty “tasks” involve training to convergence on the full dataset. We use quotation marks to characterize the last forty tasks because they are, in fact, a single task, as the data distribution stops changing after the first forty tasks. We call them “tasks” because of the number of iterations in which they are trained. Not only are deep Fourier features quicker to learn on earlier continual learning tasks, but they are also able to improve their generalization performance by subsequently training on the full dataset. On CIFAR100, the difference between methods is not as prominent, but we can see that deep Fourier features are still among the top-performing methods. The large performance difference on tiny-ImageNet can be attributed to the fact that it is a harder problem compared to CIFAR10 and CIFAR100, with higher resolution images, more classes and more datapoints.
+
+### 5.2 SENSITIVITY ANALYSIS
+
+In the previous sections, we found that deep Fourier features used in combination with spectral regularization leads to strong generalization performance. However, the theoretical analysis and case-studies that we presented earlier concerned trainability. We now present a sensitivity result to understand the relationship between trainability and generalization. Using a ResNet-18 with different activation functions, we varied the regularization strength between no regularization (left) and high regularization (right). In Figure 5.2, we can see that deep Fourier features indeed have a high degree of trainability, sustaining higher trainability at every level of regularization strength. However, without any regularization, deep Fourier features have a tendency to overfit. Over-fitting is a known issue for shallow Fourier features (e.g., when using Fourier features only for the input layer, Mavor-Parker et al., 2024), and this can be attributed to their spectral bias of learning high-frequency features (Tancik et al., 2020). However, deep Fourier features are able to use their high trainability to learn effectively even when highly regularized. Thus, while high trainability does not always lead to high generalization, the trainability provided by deep Fourier features can be used in combination with regularization to improve continual learning performance. Hyperparameter sensitivity results are presented on other datasets in Appendix D.6. We also provide an in-depth sensitivity study on smaller-scale MLPs in Appendix D.8.
+
+
+
+Figure 7: Sensitivity analysis on tiny-ImageNet. The figure contains two line plots. The left plot shows 'Train Accuracy' (y-axis, 0.4 to 1.0) versus 'Regularization Strength' (x-axis, log scale from 10^-6 to 10^0). The right plot shows 'Test Accuracy' (y-axis, 0.1 to 0.3) versus 'Regularization Strength' (x-axis, log scale from 10^-6 to 10^0). Both plots compare four methods: ReLU (blue), Deep Fourier (orange), LSHReLU (green), and GELU (red). In the left plot, all methods start near 1.0 accuracy. As regularization increases, all methods show a drop in training accuracy, with Deep Fourier maintaining the highest accuracy at high regularization. In the right plot, at zero regularization, Deep Fourier has the highest test accuracy (approx. 0.28), while others are lower. As regularization increases, the test accuracy for all methods converges, with Deep Fourier and ReLU reaching the highest test accuracy (approx. 0.25) at high regularization.
+
+Figure 7: **Sensitivity analysis on tiny-ImageNet.** Networks with deep Fourier features are highly trainable, but have a tendency to overfit without regularization, leading to high training accuracy but low test accuracy. Due to deep Fourier features being highly trainable, they are able to train with much higher regularization strengths leading to ultimately better generalization.
+
+## 6 CONCLUSION
+
+In this paper, we proved that linear function approximation and a special case of deep linearity are effective inductive biases for learning continually without loss of trainability. This surprising finding for deep linear networks suggests that nonlinearity of representations, rather than nonlinearity of gradient dynamics, contributes to loss of plasticity. We then investigated the issues that arise from using nonlinear activation functions, namely the problem of low unit sign entropy, which indicates a lack of diversity in the activations as measured by the entropy of the sign of the hidden units. Motivated by the effectiveness of linearity in sustaining trainability, we proposed deep Fourier features to approximately embed a deep linear network inside a deep nonlinear network. We found that deep Fourier features dynamically balance the trainability afforded by linearity and the effectiveness of nonlinearity, thus providing an effective inductive bias for learning continually. Experimentally, we demonstrated that networks with deep Fourier features provided benefits for continual learning across every dataset we considered. We found that networks with deep Fourier features were effective plastic learners because their trainability enabled training with a much larger regularization strength, leading to superior generalization performance.
+
+{9}------------------------------------------------
+
+## ACKNOWLEDGMENTS
+
+The research is supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC), the Canada CIFAR AI Chair Program, Alberta Innovates, and the Digital Research Alliance of Canada.
+
+## REFERENCES
+
+- Abbas, Z., Zhao, R., Modayil, J., White, A., and Machado, M. C. (2023). Loss of plasticity in continual deep reinforcement learning. In *Conference on Lifelong Learning Agents*.
+- Abel, D., Barreto, A., Van Roy, B., Precup, D., van Hasselt, H. P., and Singh, S. (2024). A definition of continual reinforcement learning. *Advances in Neural Information Processing Systems*.
+- Agrawal, A., Barratt, S., and Boyd, S. (2021). Learning convex optimization models. *Journal of Automatica Sinica*, 8(8):1355–1364.
+- Arora, S., Cohen, N., Golowich, N., and Hu, W. (2019). A convergence analysis of gradient descent for deep linear neural networks. In *International Conference on Learning Representations*.
+- Arora, S., Cohen, N., and Hazan, E. (2018). On the optimization of deep networks: Implicit acceleration by overparameterization. In *International Conference on Machine Learning*.
+- Ash, J. T. and Adams, R. P. (2020). On Warm-Starting Neural Network Training. In *Advances in Neural Information Processing Systems*.
+- Ba, J. L., Kiros, J. R., and Hinton, G. E. (2016). Layer normalization. *CoRR*, abs/1607.06450v1.
+- Bah, B., Rauhut, H., Terstiege, U., and Westdickenberg, M. (2022). Learning deep linear neural networks: Riemannian gradient flows and convergence to global minimizers. *Information and Inference: A Journal of the IMA*.
+- Bernacchia, A., Lengyel, M., and Hennequin, G. (2018). Exact natural gradient in deep linear networks and its application to the nonlinear case. *Advances in Neural Information Processing Systems*.
+- Boyd, S. P. and Vandenberghe, L. (2004). *Convex optimization*. Cambridge university press.
+- Braun, L., Dominé, C., Fitzgerald, J., and Saxe, A. (2022). Exact learning dynamics of deep linear networks with prior knowledge. *Advances in Neural Information Processing Systems*.
+- Chou, H.-H., Gieshoff, C., Maly, J., and Rauhut, H. (2024). Gradient descent for deep matrix factorization: Dynamics and implicit bias towards low rank. *Applied and Computational Harmonic Analysis*.
+- Cohen, G., Afshar, S., Tapson, J., and Van Schaik, A. (2017). Emnist: Extending mnist to handwritten letters. In *International Joint Conference on Neural Networks (IJCNN)*.
+- Dohare, S., Hernandez-Garcia, J. F., Lan, Q., Rahman, P., Mahmood, A. R., and Sutton, R. S. (2024). Loss of plasticity in deep continual learning. *Nature*, 632(8026):768–774.
+- Dohare, S., Sutton, R. S., and Mahmood, A. R. (2021). Continual backprop: Stochastic gradient descent with persistent randomness. *CoRR*, abs/2108.06325v3.
+- Elsayed, M. and Mahmood, A. R. (2024). Addressing loss of plasticity and catastrophic forgetting in continual learning. In *International Conference on Learning Representations*.
+- Even, M., Pesme, S., Gunasekar, S., and Flammarion, N. (2023). (s)GD over diagonal linear networks: Implicit bias, large stepsizes and edge of stability. In *Advances in Neural Information Processing Systems*.
+- Garrigos, G. and Gower, R. M. (2023). Handbook of Convergence Theorems for (Stochastic) Gradient Methods. *CoRR*, abs/2301.11235v3.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/Nx4PMtJ1ER.txt b/papers/Nx4PMtJ1ER.txt
new file mode 100644
index 0000000000000000000000000000000000000000..abe0c629493efc371386874c5caad4bf42eec4b7
--- /dev/null
+++ b/papers/Nx4PMtJ1ER.txt
@@ -0,0 +1,309 @@
+**Primary Area:** causal reasoning
+
+
+
+{0}------------------------------------------------
+
+# SIGNATURE KERNEL CONDITIONAL INDEPENDENCE TESTS IN CAUSAL DISCOVERY FOR STOCHASTIC PROCESSES
+
+**Georg Manten\* & Cecilia Casolo\***
+
+Technical University of Munich
+Helmholtz Munich
+Munich Center for Machine Learning
+{georg.manten, cecilia.casolo}@tum.de
+
+**Emilio Ferrucci**
+
+Mathematical Institute
+University of Oxford
+emilio.rossiferrucci@maths.ox.ac.uk
+
+**Søren Wengel Mogensen**
+
+Department of Automatic Control
+Lund University
+swn.fi@cbs.dk
+
+**Cristopher Salvi**
+
+Department of Mathematics
+Imperial College London
+c.salvi@imperial.ac.uk
+
+**Niki Kilbertus**
+
+Technical University of Munich
+Helmholtz Munich
+Munich Center for Machine Learning
+niki.kilbertus@tum.de
+
+## ABSTRACT
+
+Infering the causal structure underlying stochastic dynamical systems from observational data holds great promise in domains ranging from science and health to finance. Such processes can often be accurately modeled via stochastic differential equations (SDEs), which naturally imply causal relationships via ‘which variables enter the differential of which other variables’. In this paper, we develop conditional independence (CI) constraints on coordinate processes over selected intervals that are Markov with respect to the acyclic dependence graph (allowing self-loops) induced by a general SDE model. We then provide a sound and complete causal discovery algorithm, capable of handling both fully and partially observed data, and uniquely recovering the underlying or induced ancestral graph by exploiting time directionality assuming a CI oracle. Finally, to make our algorithm practically usable, we also propose a flexible, consistent signature kernel-based CI test to infer these constraints from data. We extensively benchmark the CI test in isolation and as part of our causal discovery algorithms, outperforming existing approaches in SDE models and beyond.
+
+## 1 INTRODUCTION
+
+Understanding cause-effect relationships from observational data can help identify causal drivers for disease progression in longitudinal data and aid the development of new treatments, act upon the underlying influences of stock prices to support lucrative trading strategies, or speed up scientific discovery by uncovering interactions in complex biological systems such as gene regulatory pathways. Causal discovery (or causal structure learning) has received continued attention from the scientific community for at least two decades (Glymour et al., 2019; Spirtes et al., 2000; Vowels et al., 2022) with a notable uptick in previous years particularly regarding differentiable score-based methods (Zheng et al., 2018; Brouillard et al., 2020; Charpentier et al., 2022; Hägele et al., 2023; Lorch et al., 2021; Annadani et al., 2023; Zheng et al., 2020), building on score matching algorithms (Rolland
+
+---
+
+\*Equal contribution
+
+{1}------------------------------------------------
+
+et al., 2022; Montagna et al., 2023b;a), and other deep-learning based approaches (Chen et al., 2022; Ke et al., 2023; Yu et al., 2019; Ke et al., 2020). Many of these approaches aim at improving the scalability of causal discovery in the number of variables and observations as well as at incorporating uncertainty or efficiently making use of interventional data.
+
+However, causal discovery from time series data has received much less attention and been mostly neglected in these recent advances. At a fundamental level, causal effects in dynamical systems can only ‘point into the future’, which should make causal discovery in time resolved data intuitively simpler. Nevertheless, except for restricted settings, this promise has not been realized methodologically and causal discovery in time series, especially for systems evolving in continuous time, remains a major challenge (Singer, 1992; Runge et al., 2019; Lawrence et al., 2021; Runge et al., 2023).
+
+**Data generating process.** We assume data to follow a stochastic process $X := (X^1, \dots, X^d)$ , with $X^k$ taking values in $\mathbb{R}^{n_k}$ ( $n_k \geq 1$ ), and $X$ satisfying the following system of stationary, path-dependent SDEs
+
+$$\begin{cases} dX_t^k = \mu^k(X_{[0,t]})dt + \sigma^k(X_{[0,t]})dW_t^k, \\ X_0^k = x_0^k \end{cases} \quad \text{for } k \in [d] := \{1, \dots, d\}. \quad (1)$$
+
+We call this the **SDE model**. The subscript $[0, t]$ at $X$ means that $\mu^k$ (the ‘drift’) and $\sigma^k$ (the ‘diffusion’) are functions of the entire solution up to time $t$ , i.e., they are defined on $C([0, +\infty), \mathbb{R}^n)$ (or some suitable subspace thereof), where $n := n_1 + \dots + n_d$ . Each $W^k$ is an $m_k$ -dimensional Brownian motion, and $\sigma^k$ maps to $n_k \times m_k$ -dimensional matrices. The noises $W^k$ together with the (possibly random) initial conditions $x_0^k$ are jointly independent. Therefore, the diffusion $\sigma$ of the entire system is block-diagonal (see equation 8). We refer to Rogers & Williams (2000) for details, Evans (2006) for a concise introduction, and Appendix A.2 for more intuition and discussion of the assumptions made here. Hence, the SDE together with a distribution over initial conditions defines our data generating process. Individual observations are paths, which in practice translate to stochastic, potentially irregularly sampled time series observations for $X_{[0,T]}^k$ with a maximum observation time $T$ , see Figure 1. Appendix A.1 contains an overview table of the notations used.
+
+**Induced causal graph.** Eq. (1) naturally implies cause-effect relationships: we call $i \in [d]$ a parent of $j \in V := [d]$ ( $i \in \text{pa}_j^G$ ) when either $\mu^j$ or $\sigma^j$ is not constant in the $i$ -th argument. These parental relationships define a directed graph $\mathcal{G} = (V, E)$ , which we call **dependence graph** of the SDE model. The **goal of causal discovery** is to infer the graph $\mathcal{G}$ induced by the SDE model from a sample of observed solution paths, depicted in Figure 1. Here, we only consider data generating processes leading to directed graphs without cycles of length greater than one (i.e., only ‘loops’ $X^k \rightarrow X^k$ are allowed). We still call these directed acyclic graphs (DAGs) for simplicity.
+
+**Limitations and requirements.** The key limitation of our setting is the assumption of acyclicity (except for self-loops). We discuss fundamental issues arising from dropping the acyclicity constraint in Appendix A.3. Further, we focus on stationary SDE models, i.e., the coefficients in eq. (1) are not explicitly time-dependent, motivated by the requirement that causal relationships do not change over time. Despite these limitations, our setting is the first to simultaneously satisfy the following criteria for causal discovery in continuous time systems: (a) It does not rely on the ‘discrete-time’ assumption, i.e., that all variables are observed at the same, typically homogeneously spaced, time points (neither in the underlying model nor the actual observations). Instead, different variables can be observed at different, irregularly spaced time points in our setting. (b) We can handle partially observed systems with unobserved confounders. (c) Path-dependence ( $\mu^k, \sigma^k$ may depend on the entire previous history $X_{[0,t]}$ of paths), including delayed SDEs, is typically not captured in existing approaches (Peters et al., 2022). (d) Beyond ‘additive observation noise’ it incorporates ‘driving noise’, where causal dependence may stem from the diffusion, not captured by the means of observed paths.
+
+![Figure 1: Illustration of causal discovery in the SDE model. (A) shows the SDE equation dX_t^k = mu^k(X_{[0,t]})dt + sigma^k(X_{[0,t]})dW_t^k and the initial conditions X_0^k = x_0^k. (B) shows a plot of solution paths for variables X^1, X^2, X^3, X^4 over time, with X^1 and X^2 being observed at different times. (C) shows the resulting dependence graph with nodes X^1, X^2, X^3, X^4 and directed edges representing causal relationships, including self-loops on X^1 and X^2.](0a12cc47f3c5ca76c39d5943ba8661bd_img.jpg)
+
+Figure 1: Illustration of causal discovery in the SDE model. (A) shows the SDE equation dX\_t^k = mu^k(X\_{[0,t]})dt + sigma^k(X\_{[0,t]})dW\_t^k and the initial conditions X\_0^k = x\_0^k. (B) shows a plot of solution paths for variables X^1, X^2, X^3, X^4 over time, with X^1 and X^2 being observed at different times. (C) shows the resulting dependence graph with nodes X^1, X^2, X^3, X^4 and directed edges representing causal relationships, including self-loops on X^1 and X^2.
+
+Figure 1: Illustration of causal discovery in the SDE model (A), leveraging conditional independencies in the observed samples (B) to infer the dependence graph of the SDE (C).
+
+{2}------------------------------------------------
+
+**Contributions.** Our main contributions include (a) developing CI constraints on coordinate processes over selected intervals that we prove to be Markov with respect to the acyclic dependence graph (with self-loops) induced by a general SDE model. (b) We then propose an efficient constraint based causal discovery algorithm and prove it to be sound and complete, assuming a CI-oracle, for both fully and partially observed data. Unlike existing constraint based methods in static settings, our algorithm uniquely recovers the full underlying graph or induced ancestral graph by exploiting the direction of time. (c) Finally, we propose a flexible, practical CI test on path space, rendering our method highly practicable. (d) We extensively demonstrate the test’s efficacy and achieve superior performance in causal discovery compared to existing methods.
+
+## 2 BACKGROUND AND RELATED WORK
+
+**Causal discovery on time series.** While virtually all causal discovery methods on time series exploit that the direction of time constrains edges to point forward, except for [Laumann et al. \(2023\)](#), most existing work assumes observations to be sampled on a regular time grid with a discrete (auto-regressive) law, where past observations $(X_{t-\tau}, \dots, X_{t-1})$ determine the present $X_t = f(X_{t-\tau}, \dots, X_{t-1}, \varepsilon_t)$ for some fixed lag $\tau$ , which can be seen as a static structural causal model (SCM) over an ‘unrolled graph’ with variables at different time steps considered as distinct nodes ([Assaad et al., 2022; Hasan et al., 2023; Peters et al., 2017](#)). Based on the seminal work ([Granger, 1969](#)), various Granger-type approaches leverage the assumption that past values of a variable can help predict future values to detect lagged causal influences both for linear ([Diks & Panchenko, 2006; Granger, 1980](#)) and non-linear ([Marinazzo et al., 2008; Shojaie & Fox, 2022; Runge, 2020; Pamfil et al., 2020](#)) functional relationships. While non-parametric constraint-based methods for such discrete-time models ([Runge et al., 2019; 2020; 2023](#)) can handle partial observations, they are also fundamentally limited by the ‘discrete-time’ assumption making them unfit for irregularly sampled observations of continuous time systems, path-dependence, or diffusion dependence. Furthermore, they require numerous tests across all time points and rely on the correct estimation of a fixed ‘lookback window’ $\tau$ . The fundamental problems of the ‘discrete-time’ assumption have also been discussed in [Runge \(2018\)](#).
+
+Other work focuses on the (static) equilibrium behavior of differential equations ([Mooij et al., 2013; Bongers et al., 2018; Bongers & Mooij, 2018](#)), exploiting invariance in mass-action kinetics ([Peters et al., 2022](#)), or attempts to directly learn the full dynamical law via non-convex optimization of heavily overparameterized neural network models ([Alice et al., 2021; 2022; Bellot et al., 2022; Wang et al., 2024](#)). The latter are fundamentally limited by the fixed functional modeling structures and therefore also unable to model partially observed settings. Albeit its limited applicability to fully-observed, Markovian SDE models, SCOTCH ([Wang et al., 2024](#)), which uses a variational formulation to infer posterior distributions over possible graphs, is the current state-of-the-art baseline.
+
+Constraint-based methods for continuous-time stochastic processes mostly rely on (conditional) local independence, an asymmetric independence relation ([Schweder, 1970; Mogensen et al., 2018](#)), which can be used to infer a (partial) causal graph in, e.g., point process models ([Didelot, 2008; Meek, 2014; Mogensen et al., 2018; Mogensen & Hansen, 2020](#)). However, besides the limitation to drift-dependencies, there exists no practical test of local independence for diffusions. The only work that actually tests local independence from data is ([Christgau et al., 2023](#)), which is heavily restricted to counting processes.
+
+In this work, we overcome the challenges of irregular and partial observations, path- and diffusion dependence, and practical applicability by transforming CI statements of the form
+
+$$X_I^\perp \!\!\! \perp \!\!\! X_J^I \mid X_K^K, \quad (2)$$
+
+for disjoint $I, J, K \subseteq [d]$ between subsets of coordinate-processes $X^I, X^J, X^K$ over intervals $\mathcal{I}, \mathcal{J}, \mathcal{K} \subseteq [0, T]$ into a practical hypothesis test using the signature kernel and the arrow of time.
+
+**Conditional independence tests.** As a key building block of graphical models, there is a large literature on conditional independence tests, i.e., testing the null hypothesis $H_0 : X \perp \!\!\! \perp Y \mid Z$ . When $Z$ is discrete, CI testing reduces to a series of unconditional tests for each value of $Z$ ([Tsamardinos & Boroudakis, 2010](#)). For continuous $Z$ , nonparametric kernel-based methods often either check independence of residuals after kernel (ridge) regressing $X$ and $Y$ on $Z$ ([Shah & Peters, 2020; Lundborg et al., 2022; Zhang et al., 2011; Daudin, 1980; Strobl et al., 2019](#)), or measure the distance
+
+{3}------------------------------------------------
+
+between joint and marginal kernel mean embeddings (Muandet et al., 2017; Park & Muandet, 2020). For example, KCIP (Doran et al., 2014) phrases it as a two-sample test of the null $H_0 : P(X, Y, Z) = P(X)P(Y|Z)P(Z)$ and simulates samples from $P(X|Z)P(Y|Z)P(Z)$ via a permutation of the data that approximately preserves $Z$ . Lee & Honavar (2017) improve on KCIP with an unbiased estimate of Maximum Mean Discrepancy (MMD) (Gretton et al., 2006). Other permutation-based approaches require large sample sizes (Sen et al., 2017) or rely on densities (Kim et al., 2022), unfit for our setting.
+
+Laumann et al. (2023) develop a CI test for functional data using the Hilbert-Schmidt conditional independence criterion (HSCIC) (Park & Muandet, 2020) and a permutation test (Berrett et al., 2019), which they use as part of the PC-algorithm (Glymour et al., 2019) for causal discovery. Even though their approach assumes $P_{X|Z}$ to be known (not the case in our setting), it is inapplicable under partial observations, and does not exploit the arrow of time (to identify graphs beyond the Markov equivalence class), we benchmark the work by Laumann et al. (2023) against our method in the experiments. CI testing faces fundamental practical challenges, such as the exponential growth in the number of values to condition on as dimensionality of $Z$ increases, and theoretical limits, as any CI test’s power is bounded by its size (Shah & Peters, 2020; Lundborg et al., 2022). This ‘no free lunch’ statement underscores the need for carefully selecting the right test. Most existing approaches assume Euclidean spaces and do not generalize to path-valued random variables without densities, a gap we fill by combining kernel-based permutation tests (KCIP, SDCIT) with the signature kernel for a tailored CI test on path space and proving its consistency.
+
+**Signature kernels.** Signature kernels (Király & Oberhauser, 2019; Salvi et al., 2021a), a universal class for sequential data, have received attention recently for their efficiency in handling path-dependent problems (Lemercier et al., 2021; Salvi et al., 2021c; Cochrane et al., 2021; Salvi et al., 2021b; Cirone et al., 2023; Issa et al., 2023; Pannier & Salvi, 2024). The definition of the signature kernel requires an initial algebraic setup, which we keep as concise as possible—yet self-contained—here and refer the reader to Cass & Salvi (2024, Chapter 2) for more details. We provide some more informal intuition of signatures in Appendix A.4. Let $\langle \cdot, \cdot \rangle_1$ be the Euclidean inner product on $\mathbb{R}^d$ . Denote by $\otimes$ the standard outer product of vector spaces. For any $n \in \mathbb{N}$ , we denote by $\langle \cdot, \cdot \rangle_n$ on $(\mathbb{R}^d)^{\otimes n}$ the canonical Hilbert-Schmidt inner product defined for any $a = (a_1, \dots, a_n)$ and $b = (b_1, \dots, b_n)$ in $(\mathbb{R}^d)^{\otimes n}$ as $\langle a, b \rangle_n = \prod_{i=1}^n \langle a_i, b_i \rangle_1$ . Define the direct sum of vector spaces $T(\mathbb{R}^d) := \bigoplus_{n=1}^{\infty} (\mathbb{R}^d)^{\otimes n}$ , where it is understood that the direct sum runs over finitely many non-zero levels. The inner product $\langle \cdot, \cdot \rangle_n$ on $(\mathbb{R}^d)^{\otimes n}$ can then be extended by linearity to an inner product $\langle \cdot, \cdot \rangle$ on $T(\mathbb{R}^d)$ defined for any $a = (a_0, a_1, \dots)$ and $b = (b_0, b_1, \dots)$ in $T(\mathbb{R}^d)$ as $\langle a, b \rangle = \sum_{n=0}^{\infty} \langle a_n, b_n \rangle_n$ . Other choices of linear extensions have been studied in Cass et al. (2023). We denote by $\mathcal{T}(\mathbb{R}^d)$ the Hilbert space obtained by completing $T(\mathbb{R}^d)$ with respect to $\langle \cdot, \cdot \rangle$ .
+
+The *signature transform* is a classical path-transform from stochastic analysis. For any sub-interval $[s, t] \subset [0, T]$ and any continuous path $X \in C_p([0, T], \mathbb{R}^d)$ of finite $p$ -variation, with $1 \leq p < 3$ , it is (canonically) defined as $S(X)_{s,t} := (1, S(X)_{s,t}^{(1)}, \dots, S(X)_{s,t}^{(n)}, \dots) \in \mathcal{T}(\mathbb{R}^d)$ , where $S(X)_{s,t}^{(n)} \in (\mathbb{R}^d)^{\otimes n}$ is the $n$ -fold iterated integral $S(X)_{s,t}^{(n)} = \int_{s < u_1 < \dots < u_n < t} dX_{u_1} \otimes dX_{u_2} \otimes \dots \otimes dX_{u_n}$ . Given two arbitrary sub-intervals $[a, b], [c, d] \subset [0, T]$ , the *signature kernel* $K_S : C_p([s, t], \mathbb{R}^d) \times C_p([s', t'], \mathbb{R}^d) \rightarrow \mathbb{R}$ is a positive definite kernel on continuous paths of bounded variation defined as
+
+$$K_S(X, Y) = \langle S(X)_{s,t}, S(Y)_{s',t'} \rangle. \quad (3)$$
+
+Salvi et al. (2021a, Thm. 2.5) shows that $K_S(X, Y) = f(t, t')$ , where $f : [s, t] \times [s', t'] \rightarrow \mathbb{R}$ is the solution of the following path-dependent integral equation:
+
+$$f(t, t') = 1 + \int_s^t \int_{s'}^{t'} f(u, v) dX_u dY_v)_1, \quad \text{with } f(0, \cdot) = f(\cdot, 0) = 1. \quad (4)$$
+
+This ‘kernel trick’ allows us to evaluate the signature kernel without explicit computation of the signature transform by solving the partial differential equation (PDE) in eq. (4). We refer to Salvi et al. (2021a) for a numerical approximation scheme to solve this hyperbolic PDE and its error rates and to Appendix A.4 for more mathematical details on the applicability in our setting. In our experiments, we use the JAX library `sigkerax` to efficiently solve eq. (4).
+
+In summary, the signature kernel is a universal kernel that takes (multi-variate) continuous paths—potentially on different intervals—as input, is efficiently computable, and performs well in capturing characteristics of sequential data (Lee & Oberhauser, 2023).
+
+{4}------------------------------------------------
+
+## 3 METHODOLOGY
+
+We start with our constraint-based causal discovery algorithms, where we assume an oracle for CI testing on path space for eq. (2) in Section 3.1. In Section 3.2 we then introduce the signature kernel CI test and state its consistency, which requires a new proof that does not rely on densities. Our test, applicable to arbitrary stochastic processes, time series, or functional data, performs well empirically in our extensive experiments in Section 4 making it a contribution of independent interest.
+
+### 3.1 CAUSAL DISCOVERY IN THE ACYCLIC SDE MODEL
+
+Throughout this section, we assume access to a CI oracle for eq. (2), where $X_{[a,b]}^H$ denotes the $C([a, b], \mathbb{R}^{|H|})$ -valued random variable $\omega \mapsto ([a, b] \ni t \mapsto (X_t^h(\omega) - X_a^h(\omega))_{h \in H})$ . Asymptotically, such an oracle can be replaced in practice by a consistent finite-sample CI test for path-valued random variables (see Section 3.2). More specifically, we test the independence of increments, not the independence of the processes on consecutive intervals, meaning that we consider path-valued random variables $\omega \mapsto ([a, b] \ni t \mapsto (X_t^h(\omega) - X_a^h(\omega))_{h \in H})$ , effectively decoupling initial conditions from subsequent increments. For simplicity and since this minor subtlety is naturally handled by the signature kernel as the signature transform is translation invariant (meaning $S(X(t))_{a,b} = S(X(t) - X(a))_{a,b}$ ), we denote these paths by $X_t^{h \in H}$ .
+
+In Appendix A.3, we prove that when allowing for cycles in the SDE model, constraint-based causal discovery of the full graph is impossible using arbitrary expressions of the form in eq. (2) despite the flexibility of these conditional independencies. This impossibility result is a key motivation to study the acyclic setting still allowing for loops, which are crucial in dynamic settings as variables should be allowed to depend on themselves infinitesimally into the past.
+
+We will use the oracle in the following ways for intervals $[0, s]$ and $[s, s + h]$ with $h > 0$ :
+
+- $X^i$ is *symmetrically CI* of $X^j$ given $X^K$ on $[0, T]$ if $X_{[0,T]}^i \perp\!\!\!\perp X_{[0,T]}^j \mid X_{[0,T]}^K$ ; we then write $X^i \perp\!\!\!\perp_{\text{sym}} X^j \mid X^K$
+- $X^i$ is *future-extended h-locally CI* of $X^j$ given $X^K$ at $s$ if $X_{[0,s]}^i \perp\!\!\!\perp X_{[s,s+h]}^j \mid X_{[0,s]}^j, X_{[0,s+h]}^K$ 1 we then write $X^i \perp\!\!\!\perp_{s,h}^+ X^j \mid X^K$
+- $X^i$ is *conditionally h-locally self-independent* given $X^K$ at $s$ if $X_{[0,s]}^i \perp\!\!\!\perp X_{[s,s+h]}^i \mid X_{[0,s+h]}^K$ ; we then write $X^i \perp\!\!\!\perp_{s,h}^{\circ} \mid X^K$
+
+The key idea to leverage the unidirectional flow of time is to split the observed paths into ‘past’ and ‘future’ at some time $t \in [0, T]$ . Therefore, we define the *lifted dependence graph* $\tilde{\mathcal{G}} = (\tilde{V}, \tilde{E})$ by setting $\tilde{V} := V_0 \sqcup V_1$ , where $\sqcup$ denotes disjoint union and $V_0, V_1$ are two copies of $V$ , whose elements we subscript with 0 and 1; we include an edge $(i_0 \rightarrow i_1) \in \tilde{E}$ if and only if there is a loop $(i \rightarrow i) \in E$ , and for each edge $(i \rightarrow j) \in E$ with $i \neq j$ , include edges $(i_0 \rightarrow j_0), (i_1 \rightarrow j_1), (i_0 \rightarrow j_1) \in \tilde{E}$ , see Figure 2. Conversely, we say that the graph with edges $E$ is obtained by *collapsing* the graph with edges $\tilde{E}$ . Intuitively, $V_0$ contains all ‘past’ and $V_1$ all ‘future’ variables with the same edges among them (causal relations) with additional edges from ‘past’ to ‘future’. We can now establish the following Markov property.
+
+**Proposition 3.1** (Markov property). *Assume the dependence graph $\mathcal{G}$ of the SDE model is acyclic except for loops and associate $X_{[0,s]}^i$ with $i_0 \in V_0$ and $X_{[s,s+h]}^i$ with $i_1 \in V_1$ . Then $\tilde{\mathcal{G}}$ is acyclic and the independence relation $\perp\!\!\!\perp_{s,h}^+$ satisfies the global Markov property w.r.t. d-separation in $\tilde{\mathcal{G}}$ .*
+
+Our proof (see Appendix A.6) leverages the structure of the SDE-generating mechanism, which factorizes according to the dependence graph, thereby allowing us to formally establish the global
+
+1The ‘+’ denotes conditioning on the future of $X^K$ , not common in the literature (Florens & Fougere, 1996).
+
+
+
+Figure 2: The lifted dependence graph G-tilde (right) for a DAG G (left). The DAG G has nodes X^1, X^2, X^3, X^4. X^1 has a self-loop and directed edges to X^2 and X^3. X^2 has a directed edge to X^3. X^3 has a directed edge to X^4. The lifted graph G-tilde has nodes X\_0^1, X\_1^1, X\_0^2, X\_1^2, X\_0^3, X\_1^3, X\_0^4, X\_1^4. It includes all edges from G (e.g., X\_0^1 to X\_0^2, X\_1^1 to X\_1^2) and additional edges from past to future (e.g., X\_0^1 to X\_1^2, X\_0^2 to X\_1^3, X\_0^3 to X\_1^4). Nodes are color-coded: X^1 (red), X^2 (orange), X^3 (green), X^4 (blue).
+
+Figure 2: The lifted dependence graph $\tilde{\mathcal{G}}$ (right) for a DAG $\mathcal{G}$ (left) with colors highlighting the correspondence of selected edges.
+
+{5}------------------------------------------------
+
+Markov property using arguments from stochastic analysis. With an oracle for eq. (2) and a faithfulness type assumption (for more details see Appendix A.8), we now develop new constraint-based causal discovery algorithms that infer the full dependence graph instead of just equivalence classes.
+
+**Discovering the full DAG $\mathcal{G}$ .** To discover the full graph including loops we propose Algorithm 1 that makes use of the time-ordering via our $h$ -local independence models (consider $s, h > 0$ arbitrary but fixed).
+
+**Theorem 3.2.** *Algorithm 1 is sound and complete for the SDE model, assuming acyclicity except for loops and faithfulness: its output is the true dependence graph $\mathcal{G}$ .*
+
+The proof (see Appendix A.7) establishes completeness by identifying a separating set and leveraging the global Markov property in Proposition 3.1; soundness is shown via the faithfulness assumption. In particular, our proof does not require the ‘strong faithfulness’ assumption, but a weaker version, ‘parent faithfulness’, suffices—see Appendix A.8 for a detailed discussion of faithfulness in our setting.
+
+Algorithm 1: Causal discovery for acyclic SDEs.
+
+```
+
+1: $\tilde{V} \leftarrow \{k_0, k_1 \mid k \in V\}$
+2: $\tilde{E} \leftarrow \{i_0 \rightarrow j_0, i_1 \rightarrow j_1 \mid i, j \in V, i \neq j\}$
+ $\cup \{i_0 \rightarrow j_1 \mid i, j \in V\}$
+3: for $c = 0, \dots, d - 2$ do ▷ edge recovery w/o loops
+4: for $i, j \in \tilde{V}, i \neq j$ do
+5: for $K \subseteq \tilde{V} \setminus \{i, j\}, |K| = c,$
+ s.t. $(k_0 \rightarrow j_1) \in \tilde{E}$ for $k \in K$ do
+6: if $X^{i_1} \not\perp_{s, h}^+ X^j \mid X^K$ then
+7: $\tilde{E} \leftarrow \tilde{E} \setminus \{i_0 \rightarrow j_0, i_1 \rightarrow j_1, i_0 \rightarrow j_1\}$
+8: 7: $\mathcal{G} = (V, E) \leftarrow \text{collapse}(\tilde{V}, \tilde{E})$
+9: 8: for $k \in V$ do ▷ removing loops
+10: if $X^k \not\perp_{s, h}^{\circ} X^{\text{pa}} \setminus \{k\}$ then
+11: $E \leftarrow E \setminus \{k \rightarrow k\}$
+12: return $\mathcal{G}$
+
+```
+
+**Discovering and post-processing the CPDAG.** In Algorithm 1, we leverage our Markov property with respect to the lifted graph that also incorporates time directionality to infer the full graph. We now show that we can also use the symmetric criterion $\perp_{\text{sym}}$ to recover the ‘Markov equivalence class’—all graphs that are Markov equivalent to $\mathcal{G}$ —via the completed partially directed acyclic graph (CPDAG) of $\mathcal{G}$ (Peters et al., 2017, Def. 6.24). Loosely speaking, the CPDAG has the same adjacencies as $\mathcal{G}$ , but some edges may remain undirected. Due to space limitations, we present the required global Markov property with respect to $\perp_{\text{sym}}$ in Appendix A.9. This Markov property allows us to apply the sound and complete PC algorithm to infer the CPDAG assuming an CI oracle for $\perp_{\text{sym}}$ , and faithfulness (Spirtes et al., 2000). While Algorithm 1 is strictly more informative (returns $\mathcal{G}$ instead of just its CPDAG), the reliability of $\perp_{s, h}^+$ in practice might be negatively affected compared to $\perp_{\text{sym}}$ by (a) conditioning on larger sets, (b) shorter time segments (potentially losing information), and (c) the additional choice of parameters $s, h$ . Hence, in real-world applications inferring the CPDAG using $\perp_{\text{sym}}$ may be more robust than inferring $\mathcal{G}$ fully using $\perp_{s, h}^+$ . Building on these potential benefits, we also develop a post-processing procedure for the CPDAG that again leverages the directionality of time to provably also orient all remaining unoriented edges.
+
+**Corollary 3.3** (post-processing). *Let $\mathcal{G} = (V, E)$ be the dependence graph of the acyclic (except for loops) SDE model and $\tilde{\mathcal{G}} = (V, \tilde{E})$ its CPDAG. Then we have $X_{[0, T]}^j \not\perp X_0^k$ but $X_{[0, T]}^i \perp X_0^j$ for all $(i, j) \in E \subset \tilde{E}$ with $(j, i) \in \tilde{E}$ and $i \neq j$ .*
+
+The proof in Appendix A.10 relies on the joint independence of Brownian motions $dW_t^k$ and initial conditions $X_0^k$ . Corollary 3.3 directly motivates an alternative algorithm for causal discovery of $\mathcal{G}$ , written out as Algorithm 2 in Appendix A.10, by first constructing the CPDAG (PC algorithm with $\perp_{\text{sym}}$ ) followed by testing unconditionally the yet unoriented edges as in Corollary 3.3.
+
+**Partially observed setting.** Finally, we consider the partially observed setting, where only $\{X_t^{v_k}\}_{v_k \in V_{obs}, t \in [0, 1]}$ of the process $\{X_t^{v_i}\}_{v_i \in V_{obs} \cup V_L, t \in [0, 1]}$ from the model in eq. (1) with DAG $\mathcal{G} = (V_{obs} \sqcup V_L, E)$ are observed. Asymmetric local independence based methods for causal discovery are challenged by requiring exponentially many oracle calls in the partially observed setting (Mogensen & Hansen, 2022; Mogensen, 2025). However, since our symmetric conditional independence constraint satisfies the global Markov property with respect to the induced acyclic directed mixed graph (ADMG) $\mathcal{G}_{obs} = (V_{obs}, E')$ (also known as latent projection, with potentially arbitrary unobserved processes) over the observed variables, we can take inspiration from the Fast Causal Inference (FCI) algorithm (Zhang, 2008) by first running its skeleton-discovery-part and then again leveraging the direction of time to uniquely infer the edge-type $\{\leftarrow, \rightarrow, \leftrightarrow\}$ for found adjacencies. This reduces the typical partial ancestral graph output of FCI (representing an equivalence class of
+
+{6}------------------------------------------------
+
+ancestral graphs) to a single, maximally informative graph (as informative as an ancestral graph can be). We provide all details in Appendix D.
+
+### 3.2 SIGNATURE KERNEL CONDITIONAL INDEPENDENCE TEST
+
+Our theoretical results in Section 3.1 assume a CI oracle. To make our algorithms usable in practice, we now propose a flexible CI test for path-valued random variables on different time intervals for expressions of the form eq. (2). Recent work using the signature kernel is limited to unconditional hypothesis tests (Chevyrev & Oberhauser, 2022) or only use it as a heuristic measure of conditional independence (not developing a hypothesis test) (Salvi et al., 2021c), and both do not use the time order. Using terms of the signature to detect causality (not specifically with hypothesis testing) was also proposed by Giusti & Lee (2020); Glad & Woolf (2021). Hence, we are the first to combine ideas from kernel-based CI tests and the signature kernel for a practically usable, consistent CI test on path space. While the existing consistency proof for KCIPT (also applying to SDCIT) (Doran et al., 2014) relies on the existence of densities, we prove consistency for testing on path-valued random variables in Appendix A.14 requiring novel arguments. We discuss the sensitivity of constraint-based causal discovery on errors in the CI test in Appendix A.12. Given $n$ samples of path segments $X_T^{(i)}, Y_J^{(i)}, Z_K^{(i)}$ on intervals $\mathcal{I}, \mathcal{J}, \mathcal{K} \subset [0, T]$ for $i \in [n]$ , we compute the Gram matrices $k_{XX}, k_{YY}, k_{ZZ} \in \mathbb{R}^{n \times n}$ using the signature kernel $K_S$ and run a kernel-based permutation CI test like KCIPT (Doran et al., 2014) or SDCIT (Lee & Honavar, 2017) to test $X_T \perp\!\!\!\perp Y_J \mid Z_K$ .2 The theoretical foundation combined with the strong empirical performance of our CI test suggest that it may be of independent interest outside of causal discovery applications.
+
+## 4 EXPERIMENTS
+
+In this section, after introducing the baselines and implementation details, we empirically evaluate our CI test in a variety of settings. We then demonstrate strong performance in various causal discovery tasks and also outperform traditional methods in a real-world finance case study.
+
+**Baselines.** We compare against CCM (Sugihara et al., 2012), PCMCI (Runge et al., 2019), Granger causality (Granger, 1969), a kernel-based approach (Lau) (Laumann et al., 2023), and SCOTCH (Wang et al., 2024), a variational neural SDE method. CCM, Granger, and PCMCI are well-established methods for time series, while Lau and SCOTCH represent the latest advances in causal discovery for functional data and SDE models, respectively. CCM and Granger are limited to bivariate cases, while Lau is only applicable to unconditional tests here. Details are in Appendix C.
+
+**Implementation details and metrics.** We use `sigkerax` for the signature kernel with an RBF kernel with length scale selected via a median heuristic (see Appendix B.1). For bivariate cases, the causal structure is $X^1 \rightarrow X^2$ , for $d > 2$ , we draw Erdős-Rényi DAGs. Performance is measured by Structural Hamming Distance (SHD, Appendix B.8). For $\perp_{s,h}^+$ , $s = 0.1 \cdot T$ (and a fixed $T = 1$ ) performed best (Table 5). The SDE model is
+
+$$dX_t = (AX_t + c)dt + \text{Diag}(BX_t + d)dW_t, \quad \text{with } A, B \in \mathbb{R}^{d \times d}, c, d \in \mathbb{R}^d. \quad (5)$$
+
+except for the 2-dimensional non-linear SDE, which is given by
+
+$$d \begin{pmatrix} X_t^1 \\ X_t^2 \end{pmatrix} = \begin{pmatrix} -r\omega \sin(\omega t) \\ r\omega \tanh(X_t^2) \end{pmatrix} dt + \text{Diag}(d^T) dW_t. \quad (6)$$
+
+**Computational complexity.** Due to space constraints, we defer the computational complexity analysis of our CI test, the causal discovery algorithm, and the signature kernel evaluations in Appendix B.9. The overall computation is dominated by finding the permutation that leaves $Z$ (approximately) invariant in the permutation based CI tests (KCIPT, SDCIT).
+
+**Choosing (conditional) independence tests.** In initial experiments on two- and three-dimensional structures (e.g., forks, colliders, chains) detailed in Appendix B.2, we found bootstrapped SDCIT and HSIC to be the best performing variants of kernel-based (C)I tests (see Figure 6 and Tables 6 to 8 for details) and use them for all subsequent experiments.
+
+2While time observations within a process are not i.i.d., the $n$ process samples are i.i.d. realizations of the SDE model, see Appendix A.13 for details.
+
+{7}------------------------------------------------
+
+Table 1: SHD ( $\times 10^2$ ) comparison of SigKer to the baselines in four bivariate SDE settings: linear, path-dependence, non-linear, and diffusion dependence. We ran SCOTCH for different sparsity parameters $\lambda$ and numbers of epochs $n_e$ ; there is no clear trend in either parameter, but $\lambda = 100, n_e = 2000$ performed best overall. Different learning rates performed worse across the board.
+
+| $\times 10^2$ | $(\lambda, n_e)$ | linear | | path-dependence | | non-linear | | diffusion dependence | |
+|-|-|-|-|-|-|-|-|-|-|
+| | | $n = 200$ | $n = 400$ | $n = 200$ | $n = 400$ | $n = 200$ | $n = 400$ | $n = 200$ | $n = 400$ |
+| CCM | | $176 \pm 7$ | $166 \pm 8$ | $186 \pm 5$ | $194 \pm 3$ | $120 \pm 10$ | $106 \pm 10$ | $100 \pm 10$ | $84 \pm 10$ |
+| Granger | | $92 \pm 5$ | $87 \pm 5$ | $85 \pm 5$ | $95 \pm 6$ | $103 \pm 5$ | $103 \pm 5$ | $105 \pm 5$ | $111 \pm 4$ |
+| PCMCI | | $89 \pm 9$ | $100 \pm 10$ | $91 \pm 4$ | $125 \pm 15$ | $41 \pm 8$ | $55 \pm 15$ | $98 \pm 13$ | $75 \pm 23$ |
+| SCOTCH | 100, 1k | $74 \pm 14$ | $77 \pm 17$ | $50 \pm 12$ | $46 \pm 12$ | $64 \pm 15$ | $80 \pm 10$ | $75 \pm 14$ | $62 \pm 10$ |
+| SCOTCH | 50, 2k | $79 \pm 18$ | $44 \pm 17$ | $23 \pm 12$ | $73 \pm 23$ | $83 \pm 11$ | $73 \pm 13$ | | $44 \pm 28$ |
+| SCOTCH | 100, 2k | $50 \pm 17$ | $36 \pm 19$ | $64 \pm 19$ | $55 \pm 15$ | $85 \pm 7$ | $91 \pm 9$ | $33 \pm 16$ | |
+| SigKer | | | | | | | | $72 \pm 6$ | $63 \pm 5$ |
+
+**Power analysis of the unconditional test.** We first demonstrate consistently superior performance of our unconditional independence test (HSIC) SigKer (ours) over the only existing baseline for this setting from Laumann et al. (2023) (Lau) in the linear SDE-setting eq. (5) (with $B \equiv 0, d_i = 0.4$ ), reaching test power near 1 already for $n \geq 40$ when the causal interaction $a_{21}$ (strength of $X^1 \rightarrow X^2$ ) is comparable to $X^2$ 's self-dependence ( $a_{22}$ ) in Figure 3.
+
+Figure 7 further highlights SigKer's robustness even with high data missingness, and Figure 8 demonstrates its effectiveness on fractional Brownian motions outside the semi-martingale framework. We are not aware of other CI tests that apply to such settings—establishing it as state-of-the-art CI test for stochastic processes.
+
+**Leveraging the direction of time.** Next, we leverage time to orient the edge in the much-studied bivariate causal-discovery setting ( $X^1 \rightarrow X^2$ ) via our $\perp_{s,h}^+$ constraint with $K = \emptyset$ for a variety of settings: (i) linear SDEs with dependence in the drift, (ii) diffusion, (iii) or path-dependent, as well as (iv) nonlinear interactions. Table 1 shows that SigKer decisively dominates all baselines in all settings for different sample sizes except diffusion dependence. In this setting, SCOTCH is better for *specific hyperparameter settings*, while performing worse for others. Crucially, one cannot 'cross-validate' or otherwise select such hyperparameters for the causal-discovery task in a data-driven fashion without ground-truth knowledge. The lack of robustness (different optimal hyperparameters for different sample sizes) renders SCOTCH unreliable in practice even for diffusion dependence.
+
+Specifically, we draw the settings for these experiments as follows: for linear drift interactions we sample $a_{21} \sim \mathcal{U}([1, 2.5])$ , $a_{11}, a_{22} \sim \mathcal{U}([-0.5, 0.5])$ , $a_{12} = 0, B \equiv 0, d_i \sim \mathcal{U}([0.1, 0.2])$ in a two-dimensional linear SDE model eq. (5). For linear diffusion interactions we draw $a_{11}, a_{22} \sim \mathcal{U}([0.5, 1])$ and $a_{21} \sim \mathcal{U}([1, 4.5])$ , the rest set to zero in a two-dimensional linear SDE model eq. (5). For path-dependence, we simulate $dX_t^2 = \mu^2(X_{[0,t]}^1)dt + d_2 dW_t^1$ via a three-dimensional SDE eq. (5) with $B \equiv 0, c \equiv 0, a_{23}, a_{31} \sim \mathcal{U}([-3.5, -1] \cup [1, 3.5])$ and $d = (d_1, d_2, 0)^\top, d_i \sim \mathcal{U}([0.1, 0.2])$ , the rest set to zero. For the nonlinear SDEs we use eq. (6) with $\omega \sim \mathcal{U}([6\pi, 8\pi])$ , $r \sim \mathcal{U}([0.5, 1])$ , $d_i \sim \mathcal{U}([2, 2.5])$ .
+
+**Causal discovery.** For causal discovery, we sample 40 linear SDEs from eq. (5) (with $a_{ij} \sim \mathcal{U}([-2, -1] \cup [1, 2])$ for $j \neq i$ and $a_{ii} \sim \mathcal{U}([-0.5, 0.5])$ ) with random DAG adjacency structures for $d \in \{3, 5, 10, 20, 50\}$ and use $n = 200$ sample paths from each SDE as input for the algorithms. Table 2 shows that
+
+Table 2: SHD ( $\times 10^2$ ) comparison of SigKer to PCMCI and SCOTCH (different $\lambda$ and $n_e$ ) in causal discovery. Means and standard errors are over 40 SDE instances.
+
+| | $d = 3$ | $d = 5$ | $d = 10$ | $d = 20$ | $d = 50$ |
+|-|-|-|-|-|-|
+| PCMCI | $29 \pm 16$ | $243 \pm 37$ | $793 \pm 84$ | $3530 \pm 159$ | $19.6k \pm 857$ |
+| SCOTCH 100, 2k | $188 \pm 28$ | $417 \pm 86$ | $250 \pm 61$ | $1525 \pm 1160$ | $10275 \pm 6176$ |
+| SCOTCH 200, 2k | $110 \pm 21$ | $270 \pm 48$ | $530 \pm 223$ | | |
+| SCOTCH 200, 1k | $400 \pm 17$ | $1370 \pm 29$ | $6425 \pm 80$ | $705 \pm 77$ | $7863 \pm 2670$ |
+| $\perp_{s,h}^+$ | $26 \pm 5$ | $80 \pm 8$ | $284 \pm 19$ | $1026 \pm 40$ | $4946 \pm 133$ |
+| $\perp_{\text{sym}}$ tp.p. | $13 \pm 4$ | | | $725 \pm 439$ | $4593 \pm 93$ |
+| $\perp_{\text{sym}}$ only | $57 \pm 84$ | $147 \pm 11$ | $436 \pm 19$ | $1294 \pm 48$ | $6005 \pm 98$ |
+
+
+
+Figure 3: A line graph showing test power (y-axis, 0.00 to 1.00) versus ratio a21/a22 (x-axis, 0.0 to 2.0). The graph compares SigKer (ours) with other methods (Lau) for different sample sizes n. SigKer methods (n=20, 40, 80) show significantly higher test power, reaching near 1.00 power as the ratio increases. Lau methods (n=20, 40, 80) show lower test power, with n=80 reaching about 0.75 power at ratio 2.0. Shaded regions represent standard errors.
+
+Figure 3: Test power for $X_{[0,t]}^1 \perp X_{[0,t]}^2$ over $\frac{a_{21}}{a_{22}}$ . Lines (shades) are means (standard errors) over 1000 SDE instances.
+
+{8}------------------------------------------------
+
+
+
+Figure 4: Four directed acyclic graphs (DAGs) illustrating causal discovery under partial observations. The 'ground truth' graph shows A and B pointing to C, and C pointing to D, with a dashed circle U pointing to C. The 'FCI' graph shows A and B pointing to C, and C pointing to D, with a dashed circle U pointing to C. The 'SCOTCH' graph shows A and B pointing to C, and C pointing to D, with a dashed circle U pointing to C. The 'ours' graph shows A and B pointing to C, and C pointing to D, with a dashed circle U pointing to C.
+
+Figure 4: An example graph demonstrating the advantage of our approach under partial observations.
+
+our Algorithm 1 (denoted by $\perp_{s,h}^+$ ) and Algorithm 2 ( $\perp_{\text{sym}}^+ + \text{pp}$ and $\perp_{\text{sym}}$ the result before post-processing) clearly outperform PCMCI and SCOTCH up to $d = 10$ . SCOTCH’s heavy dependence on hyperparameter choices for $\lambda$ (graph sparsity) and $n_e$ (the number of epochs), can sometimes render it superior when charitably picking the best setting. However, since good values particularly for $\lambda$ cannot be known up front nor selected in a data-driven fashion, one must interpret SCOTCH’s performance more conservatively—arguably in terms of its worst case performance over a set of reasonable hyperparameter settings. Hence, SigKer—free of any hyperparameter choices—broadly outperforms the state-of-the-art, such as SCOTCH even in the setting SCOTCH was specifically tailored to (SDE models). Unlike such methods, our approach continues to work well for other data generating mechanisms as our CI test handles stochastic processes beyond the SDE model.
+
+**Summary and discussion of results.** Our CI test for $\perp_{s,h}^+$ reliably detects the direction of time and outperforms strong baselines (CCM, Granger, PCMCI), consistently improving with larger sample sizes (Table 1). SigKer also dominates PCMCI in causal discovery across dimensions and consistently beats most hyperparameter settings of SCOTCH. While isolated hyperparameter settings for SCOTCH perform better than SigKer in diffusion dependence and high-dimensional causal discovery, its strong dependence on hyperparameters, particularly the sparsity parameter $\lambda$ , renders it unreliable in practice. Finally, SCOTCH and PCMCI are tailored to Markovian SDEs (or SDEs with a fixed lag). Instead, our CI test is broadly applicable and effective across data modalities which we further demonstrate empirically in a functional data example where both PCMCI and SCOTCH fail to detect path-dependence, see Table 10.
+
+**The partially observed setting.** One of the main benefits of constraint-based causal discovery (especially with a non-parametric test) is the ability to handle partial observations. Score-based methods like SCOTCH are fundamentally challenged in this setting, since there could in principle be infinitely many unobserved variables, impossible to model, e.g., with neural-network based approaches. We showcase this advantage on the challenging example graph in Figure 4, where SCOTCH falsely infers an adjacency $A \text{---} D$ in 88 out of 100 runs, whereas our algorithm correctly handles the unobserved confounder and only (falsely) predicts this adjacency in 8 instances.
+
+**Real-world pairs trading example.** To demonstrate the applicability of our developed methods on real-data, we evaluate pairs trading strategies on ten stocks from the VBR Small-Cap ETF over a three-year period (2010/01/01–2012/12/31). We only provide a concise summary of our results here and refer to Appendix B.7 for more details on this proof-of-concept study. We assess our method’s effectiveness by quantifying the profit-and-loss (P&L) profile of the generated pairs trading strategy as a substitution for ground truth. Pairs were selected based on pairwise p-values from different hypothesis tests: 1) cointegration via the Augmented Dickey-Fuller (ADF) test, 2) Granger causality, and 3) our method. Table 3 shows that our strategy’s P&L substantially outperforms the baselines in total return, APR, Sharpe ratio, and maxDDD while being almost on par with ADF & Granger in the fifth relevant metric maxDD. This case-study highlights the broad applicability and potential downstream impact of the findings in this work.
+
+Table 3: SigKer outperforms baselines in most pairs trading performance metrics. $\uparrow / \downarrow$ indicates ‘higher/lower is better’.
+
+| | return $\uparrow$ | APR $\uparrow$ | Sharpe $\uparrow$ | maxDD $\downarrow$ | maxDDD $\downarrow$ |
+|-|-|-|-|-|-|
+| ADF | 0.004 | 0.004 | 0.090 | 0.087 | 230 |
+| Granger | -0.010 | -0.011 | -0.230 | 0.056 | 219 |
+| ADF & Granger | 0.008 | 0.008 | 0.242 | 0.022 | 153 |
+| SigKer | 0.076 | 0.077 | 1.500 | 0.027 | 21 |
+
+## 5 CONCLUSION AND FUTURE WORK
+
+We introduce constraint based causal discovery algorithms for both fully and partially observed data in the form of stochastic processes, proving them to be sound and complete assuming a CI oracle.
+
+{9}------------------------------------------------
+
+These are based on novel Markov properties corresponding to the developed CI constraints with respect to the induced dependence graph. Our algorithms critically leverage the directionality of time to uniquely identifying the full underlying graph or induced ancestral graph, critically improving over existing constraint-based algorithms in the static case that only output equivalence classes. Our framework also efficiently captures path- or diffusion-dependence. Finally, we propose a practical and consistent kernel-based CI test on path-space leveraging recent advances in signature kernels that empirically outperforms existing alternatives across a wide range of settings also beyond the SDE model such as functional data and fractional Brownian motions.
+
+Due to the identified fundamental limitations in the cyclic setting, we limit ourselves to acyclic (except for self-loops) dependence graphs and assume causal relationships to not change over time. Relaxing both of these assumptions and assessing how much of the causal structure can in principle be learned in the cyclic settings are immediate interesting directions for future work. We highlight that the field of causality represents just one of the many potential applications of our conditional independence test for path-valued random variables. Exploring applications in different domains is a worthwhile direction for future work that could also catalyze new methodological developments.
+
+## REPRODUCIBILITY STATEMENT
+
+Significant effort was made to ensure reproducibility, both for the theoretical and experimental results. The complete proofs of Proposition 3.1, Theorem 3.2, Corollary 3.3 can be found in Appendix A.6 Appendix A.7, Appendix A.10, respectively. Additionally, we discuss the limitations and requirements in Section 1, which outlines the assumptions made throughout the paper. Details regarding implementation and metrics can be found in Section 4, along with further information on the data-generating mechanism and results evaluation throughout Section 4. The implementation of baselines is described in Appendix C, and details on the real-world pairs trading example can be found in Appendix A.11. We will also make all code used to produce the results in this paper openly available.
+
+## ACKNOWLEDGMENTS AND DISCLOSURE OF FUNDING
+
+This work is supported by the DAAD programme Konrad Zuse Schools of Excellence in Artificial Intelligence, sponsored by the Federal Ministry of Education and Research. This work was supported by the Helmholtz Association’s Initiative and Networking Fund on the HAICORE@FZJ partition. Emilio Ferrucci is supported by UKRI EPSRC Programme Grant EP/S026347/1. Søren Wengel Mogensen is supported by Independent Research Fund Denmark (DFF-International Postdoctoral Grant 0164-00023B) and a member of the ELLIIT Strategic Research Area at Lund University.
+
+## REFERENCES
+
+- Hananeh Alice, Fabian J Theis, and Niki Kilbertus. Beyond predictions in neural odes: Identification and interventions. *arXiv preprint arXiv:2106.12430*, 2021. 3
+- Hananeh Alice, Till Richter, Mikhail Solonin, Ignacio Ibarra, Fabian Theis, and Niki Kilbertus. Sparsity in continuous-depth neural networks. *Advances in Neural Information Processing Systems*, 35:901–914, 2022. 3
+- Holly Andersen. When to expect violations of causal faithfulness and why it matters. *Philosophy of Science*, 80(5):672–683, 2013. doi: 10.1086/673937. 23
+- Yashas Annadani, Nick Pawlowski, Joel Jennings, Stefan Bauer, Cheng Zhang, and Wenbo Gong. Bayesdag: Gradient-based posterior sampling for causal discovery. *arXiv preprint arXiv:2307.13917*, 2023. 1
+- Charles K Assaad, Emilie Devijver, and Eric Gassier. Discovery of extended summary graphs in time series. In *Uncertainty in Artificial Intelligence*, pp. 96–106. PMLR, 2022. 3
+- Alexis Bellot, Kim Branson, and Mihaela van der Schaar. Neural graphical modelling in continuous-time: consistency guarantees and algorithms. In *International Conference on Learning Representations*, 2022. URL . 3
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/OANUpvmnuf.txt b/papers/OANUpvmnuf.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a081bf8222b69645ee68fe942d61656b7a91b143
--- /dev/null
+++ b/papers/OANUpvmnuf.txt
@@ -0,0 +1,523 @@
+**Primary Area:** reinforcement learning
+
+
+
+{0}------------------------------------------------
+
+# --- CHOICES ARE MORE IMPORTANT THAN EFFORT: LLMs ENABLE EFFICIENT MULTI-AGENT EXPLORATION
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+With expansive state-action spaces, efficient multi-agent exploration remains a longstanding challenge in reinforcement learning. Although pursuing novelty, diversity, or uncertainty attracts increasing attention, redundant efforts brought by exploration without proper guidance choices poses a practical issue for the community. This paper introduces a systematic approach, termed LEMAE, choosing to channel informative task-relevant guidance from a knowledgeable Large Language Model (LLM) for Efficient Multi-Agent Exploration. Specifically, we ground linguistic knowledge from LLM into symbolic key states, that are critical for task fulfillment, in a discriminative manner at low LLM inference costs. To unleash the power of key states, we design Subspace-based Hindsight Intrinsic Reward (SHIR) to guide agents toward key states by increasing reward density. Additionally, we build the Key State Memory Tree (KSMT) to track transitions between key states in a specific task for organized exploration. Benefiting from diminishing redundant explorations, LEMAE outperforms existing SOTA approaches on the challenging benchmarks (e.g., SMAC and MPE) by a large margin, achieving a 10x acceleration in certain scenarios. Our code is available at .
+
+## 1 INTRODUCTION
+
+Exploration stands as a fundamental issue in reinforcement learning (RL) (Du et al., 2023; Liu et al., 2023). Researchers have developed several exploration strategies directed by novelty, diversity, or uncertainty (Linke et al., 2020; Burda et al., 2018b; Pathak et al., 2017), mainly in single-agent reinforcement learning. However, these methods may induce task-irrelevant redundant exploration, especially in complex environments (Du et al., 2023). In the realm of Multi-Agent Reinforcement Learning (MARL), the need to mitigate exploration redundancy becomes even more urgent due to the challenges like exponential expansion of the state-action spaces. Widespread real-world applications, including MOBA games (Qu et al., 2023), social science (Jaques et al., 2019), and multi-vehicle control (Xu et al., 2018), further underscore the growing need for efficient multi-agent exploration.
+
+This work identifies *task-relevant guidance* as an important consideration in enhancing exploration efficiency. Incorporating priors in exploration mechanism design, such as complex reward structures, typically requires expert knowledge and substantial human efforts (Liu et al., 2023; Abbeel & Ng, 2004). Hopefully, recent advances have witnessed the remarkable reasoning and planning capabilities of Large Language Models (Touvron et al., 2023; Achiam et al., 2023), providing a plausible choice to facilitate efficient exploration through LLM’s effortless prior provision. However, it is non-trivial to effectively comprise linguistic LLM priors into symbolically represented RL tasks (Peng et al., 2023; Carta et al., 2023), and the investigation of practical ways to avoid nuisances caused by such an expression discrepancy is of critical importance.
+
+In response to the above issue, we propose LEMAE, a novel framework to enable efficient multi-agent exploration with LLM. The framework primarily consists of two components: (i) *key states localization with LLM* and (ii) *key state-guided exploration*. The first component **automatically localizes key states essential for task completion, through LLM discrimination, thereby injecting LLM priors into the RL process**. Specifically, the discriminator function induced by LLM works to discriminate key states from rollout trajectories, avoiding the overburden of LLM inference costs. The second component harnesses the localized key states as meaningful guidance to achieve efficient
+
+{1}------------------------------------------------
+
+054
+055
+056
+057
+058
+059
+060
+061
+062
+063
+064
+065
+066
+067
+068
+069
+070
+071
+072
+073
+074
+075
+076
+077
+078
+079
+080
+081
+082
+083
+084
+085
+086
+087
+088
+089
+090
+091
+092
+093
+094
+095
+096
+097
+098
+099
+100
+101
+102
+103
+104
+105
+106
+107
+
+
+
+Figure 1: (a) Map of the task Pass. Two agents, Alice and Bob, are in the left room. Alice is near the Left Switch and Bob is near the Right Switch. A door separates them from the right room. (b) Key states (κ1^A, κ2^A) generated by LLM for the task Pass. κ1^A is near the door, and κ2^A is in the right room. (c) Visitation Map (log scale) of SOTA baseline method CMAE. (d) Visitation Map (log scale) of our method LEMAE. LEMAE shows more efficient exploration with less redundant visits.
+
+Figure 1: (a) The map of the task *Pass*. Two agents are initially positioned in the left room, requiring cooperation to explore the rooms, uncover the **hidden** switches, and move to the right room. (b) The key states ( $\kappa_1$ and $\kappa_2$ ) generated by LLM for the task *Pass*, where the superscripts $A, B$ of $\kappa_i$ denote two agents Alice and Bob. (c) Visitation Map (log scale) of SOTA baseline method CMAE. (d) Visitation Map (log scale) of our method LEMAE. Our method exhibits a significant reduction in redundant exploration. Furthermore, an organic division of labor among agents emerges.
+
+exploration. In implementation, we **treat key states as explicit training signals**, devising Subspace-based Hindsight Intrinsic Reward (SHIR) to **refine rewards for achieving these key states**. To facilitate organized exploration **with memory**, Key States Memory Tree (KSMT) is further constructed to track key state transitions, **constraining the state space in exploration and enhancing guidance** in SHIR. As illustrated in Fig. 1, our design empowers LEMAE with a significant performance advantage through notably reducing redundant exploration.
+
+Our **main contributions** are summarized as follows:
+
+1. We build a bridge between LLM and RL to facilitate efficient multi-agent exploration by developing a systematic approach dubbed LEMAE.
+2. We devise a computationally efficient inference strategy channeling task-specific information from LLM to distinguish key states critical for task fulfillment as subgoals for targeted exploration.
+3. We introduce a Key State Memory Tree to organize exploration according to historic key state transitions and devise the Subspace-based Hindsight Intrinsic Reward, encouraging agents' guidance.
+
+We conduct extensive experiments on typical multi-agent exploration benchmarks. LEMAE (i) consistently outperforms the state-of-the-art (SOTA) baselines with **10x acceleration** in certain scenarios, (ii) achieves performance comparable to the baseline trained with human-designed dense rewards in **sparse reward** scenarios, and (iii) exhibits potential to generalize to tasks **previously unseen by LLM or involving non-symbolic states**. These observations validate the effectiveness of our design in reducing redundant exploration and improving exploration efficiency, showing promise for real-world deployment in scenarios requiring efficient exploration.
+
+## 2 PRELIMINARY
+
+The environments considered in this work are characterized as a decentralized partially observable Markov decision process (Dec-POMDP) (Oliehoek et al., 2016) with $n$ agents, which can be defined as a tuple $G = \langle S, A, I, P, r, Z, O, n, \gamma \rangle$ , where $s \in S$ is the global state, $A$ is the action space for each agent, and $\gamma \in [0, 1)$ is the discount factor. At time step $t$ , each agent $i \in I \equiv \{1, \dots, n\}$ has its local observations $o^i \in O$ drawn from the observation function $Z(s, i) : S \times I \rightarrow O$ and chooses an action $a^i \in A$ by its policy $\pi^i(a^i|o^i) : O \rightarrow \Delta([0, 1]^{|A|})$ , forming a joint action $a \in \mathbf{A} \equiv A^n$ . $T(s'|s, a) : S \times \mathbf{A} \times S \rightarrow [0, 1]$ is the environment's state transition distribution. All agents share a common reward function $r(s, a) : S \times \mathbf{A} \rightarrow \mathbb{R}$ . The agents' joint policy $\pi := \prod_{i=1}^n \pi^i$ induces a joint *action-value function*: $Q^\pi(s, a) = \mathbb{E}[R|s, a]$ , where $R = \sum_{t=0}^{\infty} \gamma^t r_t$ is the expected discounted return. The goal of MARL is to find the optimal joint policy $\pi^*$ such that $Q^{\pi^*}(s, a) \geq Q^\pi(s, a)$ , $\forall \pi$ and $(s, a) \in S \times \mathbf{A}$ . Notably, we specifically focus on sparse reward tasks, i.e., $r_t = 1$ only when $s_{t+1} = s_{success}$ , otherwise $r_t = 0$ . We denote the symbol for the $i$ -th key state by $\kappa_i$ together with its discriminator function $\mathcal{F}_i$ .
+
+{2}------------------------------------------------
+
+## 3 RELATED WORKS
+
+**LLM in Decision Making.** Large Language Models have shown impressive capabilities across downstream tasks (Touvron et al., 2023; Radford et al., 2019; Brown et al., 2020). Recent advances indicate a growing trend of using LLM in decision-making problems (Wang et al., 2023b). A primary challenge is grounding LLM’s linguistic knowledge into specific low-level control tasks typically represented in symbolic form (Peng et al., 2023; Carta et al., 2023), especially in RL. Creating linguistic twin tasks (Carta et al., 2023) is intuitive but require substantial manual workloads. Some works employ LLMs as high-level planners, e.g., coding with APIs (Liang et al., 2023), using human-annotated or LLM-summarized actions (Yao et al., 2022; Shinn et al., 2023; Lin et al., 2023; Zhu et al., 2023; Wang et al., 2023a). Despite significant progress, they rely on difficult-to-obtain low-level policies or APIs, limiting real-world applicability. Recently, LLMs have been integrated with RL to enhance low-level decision making (Cao et al., 2024). LLMs act as environmental information processors, reducing learning complexity (Paischer et al., 2022; 2024; Kim et al., 2024; Wang et al., 2024), but cannot directly facilitate efficient exploration. Some works utilize LLMs as goal selectors in goal-conditioned RL (Su & Zhang, 2023; Shukla et al., 2023), teacher policy (Zhou et al., 2023), or task sampler (Zhang et al., 2023b) but require predefined task pools, skills or subgoals. Other methods like LLM-based reward or policy design (Klissarov et al., 2023; Ma et al., 2023; Kwon et al., 2023; Song et al., 2023; Liu et al., 2024; Chen et al., 2024) rely on large annotated datasets, frequent LLM inferences, or are restricted to simple tasks with ample information. Fine-tuning (Carta et al., 2023; Shi et al., 2023) demands enormous data and resources. LLaMAC (Zhang et al., 2023a) employs multiple LLMs to balance exploration and exploitation but emphasizes step-wise decision-making via frequent LLM calls. ELLM (Du et al., 2023) enhances exploration using LLM but depends on predefined symbolic observation captioner and frequent LLM inferences. Its semantic similarity-based rewards may also struggle to generalize across scenarios. In contrast, LEMAE integrates linguistic LLM priors into symbolic states with minimal task information and LLM inference costs, achieved by localizing key states in rollout trajectories using LLM-generated discriminator functions.
+
+**Efficient Multi-Agent Exploration.** Exploration efficiency has long been a focal point in RL (Thrun, 1992; Cai et al., 2020; Seo et al., 2021; Mahajan et al., 2019; Jeon et al., 2022; Ecoffet et al., 2019). Typical exploration methods focus on random exploration (Mnih et al., 2013; Rashid et al., 2018) or heuristic indicators, such as diversity or novelty, to facilitate exhaustive exploration, particularly in single agent exploration (Linke et al., 2020; Burda et al., 2018b; Pathak et al., 2017; Burda et al., 2018a; Bellemare et al., 2016). Despite their success, they may induce notable redundant exploration due to a lack of task-relevant guidance (Du et al., 2023). The exponential expansion of the state-action spaces renders exhaustive exploration impractical in multi-agent settings. Consequently, efficient multi-agent exploration (MAE) becomes increasingly imperative and necessary (Jeon et al., 2022; Liu et al., 2021). MAE is also challenging due to the complex configurations, e.g., the entangled effect of multi-agent actions and intricate reward design (Liu et al., 2023; Qu et al., 2023; Xu et al., 2023). Given our emphasis on efficient exploration, we prioritize evaluation in multi-agent settings. Some MAE methods encourage influential behaviors during agent interactions (Liu et al., 2023; Jaques et al., 2019; Wang et al., 2019). Nevertheless, they may lead to unintended coalitions or require additional priors (Liu et al., 2023). Certain studies leverage subgoals to guide exploration (Jeon et al., 2022). However, due to challenges in integrating task-related information into subgoals, they either necessitate human expertise for subgoals design (Tang et al., 2018; Kulkarni et al., 2016) or struggle to identify useful subgoals (Jeon et al., 2022; Liu et al., 2021). A recent influential work, WToE (Dong et al., 2023), focuses on when to explore by identifying discrepancies between the actor policy and an environmental-change-detection policy, which does not employ intrinsic rewards as guidance. Distinguished from the above, this work underscores the significance of task-relevant guidance in exploration and utilizes the key state priors extracted from LLM to enable efficient multi-agent exploration.
+
+## 4 METHOD
+
+This section first induces the concept of key states as task-relevant guidance. Centering around the key states, we construct two components: (i) *key states localization with LLM* (Sec. 4.2) and (ii) *key state-guided exploration* (Sec. 4.3). The former directs LLM to generate discriminator functions for localizing key states in rollout trajectories, while the latter guides exploration with the introduced Subspace-based Hindsight Intrinsic Reward and Key States Memory Tree. Please refer to Fig. 2 and Algorithm 1 for details. Also, we provide a [demonstration](#) to [clarify](#) LEMAE’s execution pipeline.
+
+{3}------------------------------------------------
+
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+
+
+
+Figure 2: Overview of the training process. (a) Key States Localization with LLM: A prompt with role instruction, thought, key states, discriminator, and task description is sent to an LLM. The LLM generates a response with thought, key states, and discriminators. An 'Extract' block uses the LLM's output to identify key states (s\_t^k) from a trajectory (s\_t, s\_{t+1}, s\_n, s\_{n+1}). (b) Key States-Guided Exploration: A kappa chain of key states is shown. A 'Look up' operation uses the current key state to find the next key state in a 'Key States Memory Tree'. A 'Subspace-based Hindsight Intrinsic Reward' is calculated using the current key state and the next key state. The 'Next kappa' is sampled from the memory tree.
+
+Figure 2: Overview of the training process. (a) Key States Localization with LLM: We devise a set of prompts to guide LLM in localizing key states based on task-specific information. Refinements of the response are achieved through iterative self-checks by LLM. Subsequently, discriminator functions are derived from the final response to discriminate key states within trajectories. (b) Key States-Guided Exploration: Using the achieved key states chain within the processed trajectory, we look up KSMT to get the most probable next key states. By sampling from them as the subgoal for the concluding sub-trajectory, we integrate intrinsic rewards into the overall trajectory using SHIR.
+
+### 4.1 DEVIL IS IN THE KEY STATES
+
+Previous methods suffer from redundant exploration efforts in pursuing task-agnostic novelty (Du et al., 2023), potentially reducing training efficiency. This motivates us to integrate task-relevant information as a better guidance choice for efficient exploration. Nevertheless, practical proposals are limited in the field. This work identifies the **Key States** as the novel task-relevant prior, which corresponds to intermediate states with explicit semantics and expressions pertaining to the task. Meanwhile, Proposition 4.1 explicitly reflects the efficacy of incorporating them.
+
+**Proposition 4.1.** Consider the one-dimensional asymmetric random walk problem, where an agent starts at $x = 0$ and aims to reach $x = N \in \mathbb{N}^+$ , $N > 1$ . The initial policy is asymmetric and random with probabilities $p \in (0.5, 1)$ and $1 - p$ for right and left movements, respectively. Without prior knowledge, the expected first hitting time is $\mathbb{E}(T_{0 \rightarrow N}) = \frac{N}{2p-1}$ . After introducing the task-relevant information that the agent must first reach key states $\kappa = 1, \dots, N - 1$ before reaching $x = N$ , we can decrease the expected first hitting time by $\mathbb{E}(T_{0 \rightarrow N}) - \mathbb{E}(T_{0 \rightarrow N}^{\text{prior}}) = (N - 1) * (\frac{1}{2p-1} - \frac{2}{p} + 1) > 0$ .
+
+The proof is deferred to Appendix C. The exploration policy substantially benefits from the involvement of key states, e.g., $\mathbb{E}(T_{0 \rightarrow N}) - \mathbb{E}(T_{0 \rightarrow N}^{\text{prior}}) \rightarrow \infty$ with $p \rightarrow 0.5$ . Such a concept is also commonly seen in practical scenarios, such as in-game checkpoints (Demaine et al., 2016) and landmarks in navigation (Becker et al., 1995).
+
+### 4.2 KEY STATES LOCALIZATION WITH LLM
+
+To reduce manual workload, we employ LLM to localize key states. Although generating the aforementioned symbolic key states can be straightforward, LLM’s weakness in comprehending symbolic states or environment details necessitates additional information in certain tasks and can lead to errors and hallucinations that are difficult to detect. Here, we stress the *importance of LLM’s discriminative ability to localize key states in rollout trajectories* to better leverage LLM’s general knowledge. The rationale is that discrimination demands only a high-level task understanding and is more reliable and universal than naive generation, as discussed in detail in Appendix B.1.
+
+To discriminate key states, we prompt LLM to generate $m$ (determined by LLM) discriminator functions $\{\mathcal{F}_i\}_{i=1}^m$ , as depicted in Fig. 2. Each discriminator function $\mathcal{F}_i$ (the ‘IsKeystate( $s$ )’ block in Fig. 2) takes in the state $s_t$ at timestep $t$ and outputs a boolean value to tell whether $s_t$ is the corresponding key state $\kappa_i$ . Such an approach systematically annotates each state in trajectories as a key state instance ( $s_t \rightarrow s_t^{\kappa_i}$ in Fig. 2) or not. Notably, LEMAE injects task-relevant information into the symbolic states without predefined components such as observation captioners (Du et al., 2023) or environment codes (Xie et al., 2023), which require manual fine-tuning, may be unavailable in many scenarios, or could introduce extra information. In addition, the discriminator functions’ reusability avoids frequent calls, and our method empirically requires fewer than three LLM inferences for a
+
+{4}------------------------------------------------
+
+specific task. These advantages highlight the potential of LEMAE to expand the scope of application scenarios with fewer constraints and reduced costs.
+
+We design prompts to alleviate the burden of labor-intensive prompt engineering across tasks. As illustrated in Fig. 2, each task’s prompt is structured by a standardized prompt template and task information. The prompt template, consistent across tasks, primarily contains several role instructions to guide LLM in role understandings (including **promoting labor division among agents in MARL**) and output constraints, e.g., **in JSON format**. For a new task with symbolic state space, the prompt template requires only essential details, i.e., the task description and the state form, which can be easily extracted from the task document without additional processing, making it less demanding than previous methods (Ma et al., 2023; Du et al., 2023). **LLM then generates key states definitions and discriminator functions, which can be easily extracted from the JSON response via key-value matching.** An extension to vision-based tasks is described in Appendix F.2.
+
+Considering that LLM sometimes generates inaccurate responses and non-executable codes, we develop a Self-Check mechanism to enable LLM’s autonomous evaluation and response improvement, which is inspired by recent approaches (Shinn et al., 2023; Dhuliawala et al., 2023). The mechanism comprises two checking operations: LLM rethinking and code verification. The former prompts LLM with a set of queries for self-assessment, ensuring compliance with specified criteria. The latter verifies the executability of discriminator functions with actual state inputs, providing feedback until all functions are executable. Table 1 further examines its effectiveness.
+
+We use GPT-4-turbo from OpenAI API and prompt and response details are attached in Appendix D.
+
+### 4.3 KEY STATE-GUIDED EXPLORATION
+
+#### 4.3.1 SUBSPACE-BASED HINDSIGHT INTRINSIC REWARD
+
+With the annotated key states, trajectories can naturally be segmented into sub-trajectories. Drawing inspiration from Andrychowicz et al. (2017), we integrate hindsight intrinsic rewards by conceptualizing the annotated key states as sub-trajectories’ subgoals, which is further discussed in Appendix E.3. Such integration guides the policy toward achieving these key states by increasing reward density, thus reducing manual reward design burdens. Moreover, the state vector index from the discriminator function constitutes the reward-related subspace of the state (Liu et al., 2021). Here, we write the Subspace-based Hindsight Intrinsic Reward (SHIR) function as:
+
+$$r_I^{\kappa_m}(t) = \|\Phi_m(s_t) - \Phi_m(\kappa_m)\| - \|\Phi_m(s_{t+1}) - \Phi_m(\kappa_m)\|, \quad (1)$$
+
+where $\|\cdot\|$ denotes a distance metric, e.g., Manhattan distance or cosine similarity; $\Phi_m(s) = (s_e)_{e \in v_m}$ restricts the state space to elements $e \in v_m$ , $s_e$ is the $e$ -th element of the full-state $s$ , and $v_m \subset \mathbb{N}^+$ refers to the subset of entire state space from the discriminator function $\mathcal{F}_m$ .
+
+Given that rewards generally rely on a limited subset of the entire state space (Liu et al., 2021; Todorov et al., 2012), adopting subspace-based rewards helps avoid the potential redundancy and bias associated with the design of intrinsic rewards in the entire state space. LEMAE is also applicable to scenarios where rewards depend on the global state space, as it imposes no strict constraints. Hence, the final reward function is further derived as:
+
+$$r(t) = \alpha \cdot r_E(t) + \beta \cdot r_I^{\kappa_m}(t), \quad (2)$$
+
+where $r_E$ denotes the extrinsic reward with $\alpha, \beta \in \mathbb{R}^+$ non-negative scaling factors.
+
+#### 4.3.2 KEY STATES MEMORY TREE
+
+To organize exploration with memory, we introduce the concept of Key States Memory Tree (KSMT). It tracks transitions between key states and further serves exploration and planning. Compared with the naive $\epsilon$ -greedy method, gradually revealing the KSMT helps avoid redundant exploration throughout the state space, **revealing its potential for real-world applications**. Notably, LEMAE is compatible with other memory structures, such as Directed Acyclic Graphs.
+
+**Construct KSMT:** Initialized at the root node, KSMT dynamically expands by iteratively incorporating key state chains obtained from annotated trajectories, as outlined in Algorithm 2. These steps repeat until either reaching the success state or fully depicting the transitions between key states.
+
+{5}------------------------------------------------
+
+
+
+Figure 3: Evaluating LEMAE against baseline methods on four MPE maps with sparse rewards. The figure consists of four line plots: Push-Box, Pass, Secret-Room, and Large-Pass. Each plot shows Test Win Rate (y-axis, 0.0 to 1.0) versus T (mil) (x-axis). LEMAE(Ours) is shown in red, and other methods are shown in various colors. Acceleration Rates are provided below each plot: 4.6 for Push-Box, 13.8 for Pass, 6.1 for Secret-Room, and >6.7 for Large-Pass.
+
+Figure 3: Evaluating LEMAE against baseline methods on four MPE maps with **sparse rewards**, using test win rate as the evaluation metric. The acceleration rate refers to how much faster LEMAE finds the success state compared to CMAE.
+
+**Explore with KSMT:** To discover new KSMT branches, we adopt an exploration strategy that balances high-randomness policy $\pi_\theta^{eh}$ for exploring under-explored nodes with low-randomness policy $\pi_\theta^l$ to minimize interference with policy learning, as shown in Algorithm 2. Upon reaching a leaf node, agents execute $\pi_\theta^{eh}$ to deepen KSMT. While reaching a non-leaf node $\xi_i$ , the agents take $\pi_\theta^{eh}$ with probability $p_i$ to expand the breadth or $\pi_\theta^l$ with probability $1 - p_i$ for progression towards the next key state. The probability $p_i$ is calculated as $p_i = \frac{1}{d_i + 1}$ , with $d_i$ the degree of the node $\xi_i$ as an indicator of the degree of under-exploration. The exploration phase completes upon the discovery of the success state. We also prune branches that do not lead to success to circumvent task-irrelevant key states. In this way, KSMT enables exploration in a more meaningful state subspace.
+
+**Plan with KSMT:** Since KSMT acts as a dynamic model within the key state space, we plan the subgoal for the final sub-trajectory based on it. As shown in Fig. 2b, given the achieved key states chain, we identify the corresponding branch ( $\kappa_2 \rightarrow \kappa_1 \rightarrow \text{children}$ ) in KSMT through a lookup operation. Since they have been validated by memory, the children represent the most likely next key states, from which we randomly sample the final subgoal. This process mainly handles cases where trajectories fail to reach a key state as the final subgoal. It enhances SHIR and improves the efficacy of exploring KSMT by encouraging agents to access existing key states.
+
+## 5 EXPERIMENTS
+
+We conduct experiments on commonly used multi-agent exploration benchmarks: (1) the Multiple-Particle Environment (Lowe et al., 2017; Wang et al., 2019) and (2) the StarCraft Multi-Agent Challenge (Samvelyan et al., 2019b). Following previous studies (Ma et al., 2023; Liu et al., 2021; Xu et al., 2023), we focus primarily on tasks with symbolic state spaces and use the **sparse reward** version for all tasks without specific instructions.
+
+**Baselines.** We compare LEMAE with representative baselines: **IPPO** is a MARL algorithm which extends PPO (Schulman et al., 2017); **QMIX** (Rashid et al., 2018) is a widely adopted MARL baseline; **ETI** and **EDTI** (Wang et al., 2019) employ the impact of interaction in coordinated agents’ behaviors; **MAVEN** (Mahajan et al., 2019) combine value-based and policy-based approaches through hierarchical control; **CMAE** (Liu et al., 2021) learns cooperative exploration by selecting shared goals from multiple projected state space; **RODE** (Wang et al., 2020b) decomposes joint action spaces into role-based ones to enhance exploration; **MASER** (Jeon et al., 2022) generates subgoals automatically for multiple agents from the experience replay buffer; **LAIES** (Liu et al., 2023) addresses the lazy agents problem by mathematical definition and causal analysis. **ELLM** (Du et al., 2023) employs LLM priors to guide vision-based exploration, using state captioners and semantic similarity-based rewards. LEMAE is implemented on **IPPO** in MPE and **QMIX** in SMAC, consistent with previous works (Wang et al., 2019; Liu et al., 2023; Jeon et al., 2022) to ensure fair comparisons.
+
+We run each algorithm on five random seeds and report the mean performance with standard deviation. Further details can be referenced in Appendix E.
+
+### 5.1 MULTIPLE-PARTICLE ENVIRONMENT (MPE)
+
+In MPE, we evaluate LEMAE on *Pass*, *Secret-Room*, *Push-Box*, and *Large-Pass*, which are commonly used multi-agent exploration tasks in previous works (Wang et al., 2019; Liu et al., 2021).
+
+{6}------------------------------------------------
+
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+
+
+
+Figure 4 consists of three parts: (a), (b), and (c).
+ (a) shows two key states for the *Pass* task. **key\_state\_1** is the initial state where the agent is on the left switch, described as: "Agent found the switch and is standing on it, which opens the door def iskeystate1(state): return state[4] == 1 and state[0] < 15". **key\_state\_2** is the success state where the agent is on the right switch, described as: "Agent moved through the open door to the right half of the room def iskeystate2(state): return state[4] == 1 and state[2] == 15 and state[0] < 15".
+ (b) is a map of the *Secret-Room* task. It shows a root node connected to $\kappa_1$ (Left Switch). $\kappa_1$ is connected to three right rooms: Right Room 1 (containing $\kappa_2$ ), Right Room 2 (containing $\kappa_3$ ), and Right Room 3 (containing $\kappa_4$ ). Arrows indicate the flow from the root to $\kappa_1$ , and from $\kappa_1$ to each of the three rooms. Red 'X' marks are placed on the arrows leading to $\kappa_2$ , $\kappa_3$ , and $\kappa_4$ .
+ (c) is a graph titled "Secret-Room" showing the "Key States Num" (y-axis, 0 to 4) versus " $T$ (mil)" (x-axis, 0.0 to 2.0). The curve starts at 0, peaks at 4 around $T = 0.2$ , and then drops to 2 around $T = 0.5$ . A vertical dashed line at $T \approx 0.4$ is labeled "Pruning after finding the success state".
+
+Figure 4: (a) Key states discrimination functions for the Pass task. (b) Map of the Secret-Room task. (c) Key states number curve for the Secret-Room task.
+
+Figure 4: (a) Key states discrimination functions generated on task *Pass*. (b) The map of *Secret-Room* with key states: $\kappa_1$ represents occupying the left switch to open all doors, while $\kappa_2$ , $\kappa_3$ , and $\kappa_4$ represent exploring right rooms 1, 2, and 3, respectively. The directional arrows symbolize the transitional relationships within KSMT. (c) The key states number curve in *Secret-Room* shows that LEMAE can identify all key states and proficiently prune task-irrelevant ones.
+
+**LLM can effectively discriminate key states.** To start with, we examine the efficacy of LLM in discriminating key states. On the *Pass* task, as shown in Fig. 1a, a room is divided by a wall, each half containing an invisible switch. Passage through the door is allowed only when an agent occupies a switch. Initially, in the left half-room, agents must cooperate to move to the right half-room. In Fig. 4a, LLM exhibits a precise understanding of the task and generates meaningful discriminator functions, demonstrating the feasibility of our approach based on the current LLM.
+
+**LEMAE achieves superior performance.** We investigate how LEMAE enhances exploration by comparing it with baselines, confirming the value of incorporating LLM priors. The training curves are depicted in Fig. 3. The failure of commonly used baselines highlights the necessity and urgency for efficient exploration, while the superior performance of LEMAE underscores the effectiveness of augmenting RL with task-specific guidance from LLM. Specifically, the failure of EITI, EDTI, and LAIES may be attributed to the complexity of learning dynamics or the scarcity of external state changes in the tasks. While CMAE learns effective strategies for simple tasks, its redundant exploration hampers efficiency, rendering it inadequate for tasks with expansive exploration spaces, such as *Large-Pass*. Although it benefits from LLM priors, ELLM performs worse than LEMAE due to the weak guidance provided by semantic similarity-based rewards, not to mention its reliance on frequent LLM inference and a predefined state captioner. Furthermore, we compare LEMAE with traditional SOTA baseline CMAE using the metric of the number of exploration steps taken to find the success state. The results indicate a significant exploration **acceleration rate, up to 10x**, underscoring LEMAE’s efficiency. The superior performance of our method can be attributed to the mitigating of redundant exploration by incorporating task-relevant information.
+
+**LEMAE benefits from LLM priors through discrimination.** We evaluate **HER** (Andrychowicz et al., 2017), which also employs hindsight intrinsic rewards but selects goals randomly from memory. HER’s poor performance emphasizes the critical role of incorporating LLM priors for localizing key states in achieving efficient exploration. To support our claim about the superiority of LLM discrimination over generation, we evaluate **Eureka-si**, a single-iteration Eureka (Ma et al., 2023) variant, which uses LLM to generate reward functions. While Eureka-si performs comparably to LEMAE in simple tasks, it struggles in complex tasks with partial observability, indicating that LLM-based discrimination may offer a more general and effective integration of LLM. Notably, these two methods are not specifically designed for efficient exploration. **To ensure fairness, we retain the prompt information consistent across all relevant LLM-based methods.** Please refer to Appendix E.2, E.3 for details.
+
+**LEMAE reduces redundant exploration.** We further compare the exploration behavior of LEMAE with that of CMAE on the *Pass* task. The visitation maps, displayed in log scale, are depicted in Fig. 1. The illustration reveals that LEMAE markedly avoids redundant exploration: agents trained with CMAE tend to excessively explore the left room, while the agents’ visitation area in LEMAE is notably concentrated around the success path. Furthermore, an organic division of labor among agents emerges, affirming the efficacy of encouraging labor division in prompt design.
+
+**LEMAE circumvents task-irrelevant key states.** Due to the incomplete information, LLM may discriminate task-irrelevant key states. For instance, in the *Secret-Room* task, three rooms are present
+
+{7}------------------------------------------------
+
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+
+
+
+Figure 5: Evaluating LEMAE on six SMAC maps with sparse rewards. The figure consists of six subplots arranged in a 2x3 grid, showing Test Win Rate (Y-axis, 0.0 to 1.0) versus Training Time T (mil) (X-axis). The maps are: 1. MMM2 (T up to 5 mil), 2. 35z\_vs\_3s6z (T up to 6 mil), 3. 3s\_vs\_5z (T up to 4 mil), 4. 5m\_vs\_6m (T up to 5 mil), 5. 27m\_vs\_12z (T up to 1.0 mil), and 6. 1c35z (T up to 1.50 mil). The legend at the top identifies the algorithms: LEMAE(Qurs) (red solid line), LAIES (green dashed line), QMIX-DR (blue dashed line), ELLM (orange solid line), QMIX (purple solid line), CMAE (grey solid line), MAVEN (yellow solid line), MASER (pink solid line), and RODE (brown solid line). In all cases, LEMAE (red) achieves a higher win rate faster than the other baselines, often reaching near-optimal performance. QMIX-DR (blue dashed) consistently shows high performance, acting as an upper bound.
+
+Figure 5: Evaluating LEMAE on six SMAC maps with **sparse rewards**, using test win rate as the evaluation metric. Notably, **QMIX-DR** is QMIX with dense rewards in the original SMAC, serving as an upper bound, with its intrinsic rewards designed by a human expert.
+
+on the right, but LLM is not informed about the real target room for fairness. In Fig. 4b, LLM discriminates two task-irrelevant key states, denoted as $\kappa_2$ and $\kappa_4$ , which represent an exploration of the two irrelevant rooms, respectively. Fig. 4c shows that the pruning mechanism after finding the success state in LEMAE makes it effective in circumventing task-irrelevant key states. A more detailed robustness analysis is provided in Sec. 5.5.
+
+### 5.2 STAR CRAFT MULTI-AGENT CHALLENGE (SMAC)
+
+SMAC is a widely-used challenging benchmark in MARL. In contrast to dense or semi-sparse reward versions used before, we employ **fully sparse-reward tasks** to emphasize exploration, rewarding agents only upon complete enemy elimination. In addition, to validate LEMAE across diverse scenarios, we conduct experiments on six maps with varied difficulty and agent numbers.
+
+In Fig. 5, LEMAE demonstrates superior performance over all baselines. Although baselines QMIX, MAVEN, CDS, and MASER excel in dense or semi-sparse reward settings, they struggle in fully sparse reward scenarios. CMAE shows partial efficacy in simpler tasks but fails in harder scenarios due to the lack of task-related information in curiosity-driven goal selection. LAIES is the only non-LLM baseline comparable to LEMAE. However, it requires handcrafted external state priors and still underperforms compared to LEMAE, especially on more challenging tasks. ELLM, benefiting from LLM priors, performs well on simpler tasks, but its effectiveness diminishes on harder ones, likely due to the instability and less reliable guidance of semantic similarity-based rewards. Notably, we add **QMIX-DR**, which augments QMIX with dense rewards in the original SMAC. Surprisingly, LEMAE demonstrates the potential to match or even surpass QMIX-DR, particularly in hard maps, shedding light on minimizing the manual workload in complex reward design in real-world scenarios. Given the complexity of the SMAC benchmark, the consistent superiority of LEMAE confirms its potential applicability in more complex real-world scenarios. We further evaluate LEMAE on SMACv2 (Ellis et al., 2024), an enhanced version with more stochasticity, as detailed in Appendix F.1.
+
+### 5.3 COMPATIBILITY WITH VARIOUS ALGORITHMS
+
+LEMAE incorporates task-relevant guidance in the form of intrinsic rewards and is agnostic to RL algorithms. Sec. 5.1 and 5.2 have verified the compatibility through implementing on two distinct MARL algorithms: **IPPO** in MPE and **QMIX** in SMAC. To further substantiate this claim, we build our method on two widely-used MARL algorithms, namely **QPLEX** (Wang et al., 2020a) and **VMIX** (Su et al., 2021), adopting a value-based and actor-critic methodology respectively. As illustrated in Fig. 6a, algorithms combined with LEMAE consistently improve performance, underscoring the potential of LEMAE to integrate with alternative algorithms across diverse fields in the future. Additionally, LEMAE is a versatile approach for efficient exploration, not limited to
+
+{8}------------------------------------------------
+
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+
+
+
+Figure 6(a) is a bar chart comparing the Test Win Rate of three algorithms (QMIX+Ours, QPLEX+Ours, VMIX+Ours) across three tasks: 2m\_vs\_1z, 1c3s5z, and MMM2. The y-axis represents the Test Win Rate from 0.0 to 1.0. For 2m\_vs\_1z, all three algorithms achieve a win rate near 1.0. For 1c3s5z, QMIX+Ours and QPLEX+Ours achieve win rates near 1.0, while VMIX+Ours is around 0.8. For MMM2, QMIX+Ours and QPLEX+Ours achieve win rates around 0.9 and 0.8 respectively, while VMIX+Ours is around 0.4.
+
+Figure 6(b) contains two line charts. The left chart is for the 3s\_vs\_5z task, showing Test Win Rate vs. T (mil) from 0 to 4. The right chart is for the Large-Pass task, showing Test Win Rate vs. T (mil) from 0.0 to 2.5. Both charts compare LEMAE (red line) with several ablations: Base+SHIR (light blue), Base+SHIR+KSMT (dark blue), Base+SHIR+KSMT (green), Base+SHIR+KSMT (orange), and Base (grey). In both tasks, LEMAE consistently achieves a higher win rate faster than the ablations, reaching near 1.0 win rate in both cases.
+
+Figure 6: (a) Bar chart showing Test Win Rate for QMIX+Ours, QPLEX+Ours, and VMIX+Ours across three tasks: 2m\_vs\_1z, 1c3s5z, and MMM2. (b) Line charts showing Test Win Rate vs. Training Time (T (mil)) for LEMAE and its ablations on 3s\_vs\_5z and Large-Pass tasks.
+
+Figure 6: (a) Evaluations on baselines of well-known MARL algorithms, i.e., **QPLEX** and **VMIX**. Notably, both **QPLEX** and **VMIX** exhibit complete failure unless integrated with our approach. (b) Ablation studies are conducted on two exemplary tasks from MPE and SMAC to assess the significance of **KSMT** and **SHIR** within **LEMAE**.
+
+Table 1: Ablation studies on Self-Check mechanism and LLMs. We compare the performance of two LLMs (GPT-4-turbo and GPT-3.5-turbo), recording the Acceptance Rate ( $r_{acc}$ ) and Execution Rate ( $r_{exe}$ ) in ten runs of the generated discriminator functions. w/o denotes the absence of our Self-Check mechanism.
+
+| $r_{acc}$ ( $r_{exe}$ ) | GPT-4-turbo | GPT-4-turbo w/o | GPT-3.5-turbo |
+|-|-|-|-|
+| Large-Pass | 1.0 (1.0) | 0.8 (1.0) | 0.7 (1.0) |
+| 2m_vs_1z | 1.0 (1.0) | 0.7 (1.0) | 0.6 (1.0) |
+| 5m_vs_6z | 1.0 (1.0) | 0.9 (1.0) | 1.0 (1.0) |
+| MMM2 | 0.8 (1.0) | 0.6 (0.7) | 0.0 (1.0) |
+
+
+
+Figure 7 is a line chart showing the Test Win Rate (y-axis, 0.0 to 1.0) versus Relative Scaling Rate (x-axis, 0.1 to 10.0) for two hyperparameters, $\alpha$ (blue line with triangles) and $\beta$ (orange line with diamonds). Both lines show a peak in win rate around a relative scaling rate of 1.0, which corresponds to the default parameters. The win rate for $\alpha$ is generally higher than for $\beta$ at higher scaling rates.
+
+Figure 7: Line chart showing Hyperparameter examination on reward scaling rate alpha and beta. The x-axis is Relative Scaling Rate (0.1 to 10.0) and the y-axis is Test Win Rate (0.0 to 1.0).
+
+Figure 7: Hyperparameter examination on reward scaling rate $\alpha$ and $\beta$ . The x-axis represents the relative values with respect to the default parameters.
+
+MARL. To validate this assertion, we conduct further evaluations of **LEMAE** in a single-agent variant of MPE, as demonstrated in Appendix F.4.
+
+### 5.4 ABLATION STUDIES
+
+**Role of SHIR and KSMT.** We conduct an ablation study to assess the significance of **KSMT** and **SHIR** within **LEMAE**. We select two exemplary tasks from MPE and SMAC and report results in Fig. 6b. In SMAC, Base refers to **QMIX**, while in MPE, it denotes **IPPO**. Besides, **SHIR** represents subspace-based hindsight intrinsic reward, **KSMT** signifies exploration with **KSMT**, **KSMT** denotes planning with **KSMT**, and **LEMAE** encompasses Base+**SHIR**+**KSMT**+**KSMT**+**KSMT**. As illustrated, the absence of **SHIR** or **KSMT** significantly deteriorates performance, revealing both components’ pivotal roles in achieving effective key state-guided exploration.
+
+**Role of Self-Check mechanism and LLMs.** We conduct a comparative analysis between GPT-4-turbo and GPT-3.5-turbo regarding generating discriminator functions. Meanwhile, we investigate the performance of GPT-4-turbo without the Self-Check mechanism (GPT-4-turbo w/o). The Acceptance Rate ( $r_{acc}$ ) denotes the proportion of seeds achieving over 80% of the best performance after RL training, while the Execution Rate ( $r_{exe}$ ) indicates the proportion of seeds for which all discriminator functions are executable. As depicted in Table 1, the results demonstrate that a powerful LLM with our Self-Check mechanism effectively ensures the high quality of key states, as evidenced by the code’s executability and the final performance. The scalability of **LEMAE** to LLM and our Self-Check mechanism promise that **LEMAE** can leverage more powerful LLMs in the future and be applied to more challenging real-world tasks safely and efficiently.
+
+### 5.5 SENSITIVITY & ROBUSTNESS ANALYSIS
+
+**Sensitivity to Hyperparameters.** We conduct experiments on the pivotal hyperparameters in **LEMAE**, i.e., reward scaling rates $\alpha$ and $\beta$ . The x-axis represents the relative values with respect
+
+{9}------------------------------------------------
+
+to the default ( $\alpha = 10, \beta = 1$ ), encompassing evaluations for $\alpha \in \{1, 5, 10, 50, 100\}$ and $\beta \in \{0.1, 0.5, 1, 5, 10\}$ . Fig. 7 illustrates that LEMAE is robust to these hyperparameters across a considerable range. Notably, excessive extrinsic reward scaling rate $\alpha$ or insufficient intrinsic reward scaling rate $\beta$ can cause performance degradation due to the abrupt alteration of the reward or the inadequate motivational impact. Additionally, we conduct an ablation study on mixed-randomness exploration in Appendix F.3.
+
+**Robustness to Perturbations in Key States.** We conduct experiments to evaluate the robustness of LEMAE to perturbations in key states. Specifically, Reduction simulates the absence of key states by randomly clearing a certain percentage of key states. Distraction simulates the misidentification of common states as key states by randomly adding a certain portion of distracting states (encouraging a random state dimension to 0). The observed performance decrease with increasing perturbations in Table 2 underscores the significance of key states’ quality. LEMAE exhibits notable robustness to perturbations, ensuring its reliability across diverse application scenarios, particularly in light of the limited capabilities of current LLMs.
+
+Table 2: Robustness analysis of LEMAE to perturbations in key states, whether randomly deleting key states (Reduction) or adding distracting states (Distraction).
+
+| Tasks | Default | Reduction | | Distraction | |
+|-|-|-|-|-|-|
+| | | 25% | 50% | 50% | 100% |
+| 1c3s5z | 0.980.02 | 0.97 $\pm$ 0.01 | 0.97 $\pm$ 0.02 | 0.92 $\pm$ 0.04 | 0.89 $\pm$ 0.05 |
+| 3s_vs_5z | 0.830.07 | 0.80 $\pm$ 0.18 | 0.57 $\pm$ 0.28 | 0.80 $\pm$ 0.11 | 0.66 $\pm$ 0.08 |
+| MMM2 | 0.890.08 | 0.890.03 | 0.79 $\pm$ 0.09 | 0.86 $\pm$ 0.04 | 0.79 $\pm$ 0.08 |
+
+### 5.6 SCALABILITY & GENERALIZATION ANALYSIS
+
+To rule out the possibility that LEMAE’s success relies on LLM’s familiarity with the chosen tasks, we’ve handcrafted a brand new task, termed *River*, which LLM has never encountered before. The task is illustrated in Fig. 8a, where the objective is for Bob to help Alice, who is afraid of water, cross two rivers to reach the bottom-right corner. As shown in Fig. 8b, LEMAE outperforms the baselines, and this confirms LLM’s generalization capabilities to empower LEMAE’s effectiveness in promoting efficient exploration in diverse new tasks. Please refer to Appendix E.4.3 for details on the task.
+
+Additionally, we extend LEMAE to a vision-based task, as described in Appendix F.2, demonstrating the scalability potential of LEMAE.
+
+## 6 CONCLUSION
+
+**Summary of This Work:** We present LEMAE, a novel framework that benefits multi-agent exploration with task-specific guidance from LLM. LEMAE executes the *key states localization with LLM* and enables the *key state-guided exploration* to improve sample efficiency. In this way, we can (i) build up connections between LLM and RL to ground linguistic knowledge into decision-making, (ii) reduce the manual workload in accessing knowledge and intensive inference calls from LLM, and (iii) significantly boost exploration efficiency through guided and organized exploration. Extensive experiments further examine the effectiveness of LEMAE in typical benchmarks.
+
+**Limitations & Future Investigations:** In developing LEMAE, we made efforts to compensate for the pitfalls of concurrent LLMs, e.g., careful preparation for prompt engineering and task-related prior provision to avoid the nuisances in LLM usages. All of these can be circumvented with the progress of LLM’s capability enhancement. This work paves the way for LLM-empowered RL to achieve the potential in complicated decision-making scenarios.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/OEC6zOuZG1.txt b/papers/OEC6zOuZG1.txt
new file mode 100644
index 0000000000000000000000000000000000000000..153fbd66475418f779125669f7658af955b554b7
--- /dev/null
+++ b/papers/OEC6zOuZG1.txt
@@ -0,0 +1,336 @@
+**Primary Area:** learning theory
+
+
+
+{0}------------------------------------------------
+
+# RANDOM FEATURES OUTPERFORM LINEAR MODELS: EFFECT OF STRONG INPUT-LABEL CORRELATION IN SPIKED COVARIANCE DATA
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Random Feature Model (RFM) with a nonlinear activation function is instrumental in understanding training and generalization performance in high-dimensional learning. While existing research has established an asymptotic equivalence in performance between the RFM and noisy linear models under isotropic data assumptions, empirical observations indicate that the RFM frequently surpasses linear models in practical applications. To address this gap, we ask, “*When and how does the RFM outperform linear models?*” In practice, inputs often have additional structures that significantly influence learning. Therefore, we explore the RFM under anisotropic input data characterized by spiked covariance in the proportional asymptotic limit, where dimensions diverge jointly while maintaining finite ratios. Our analysis reveals that a high correlation between inputs and labels is a critical factor enabling the RFM to outperform linear models. Moreover, we show that the RFM performs equivalent to noisy polynomial models, where the polynomial degree depends on the strength of the correlation between inputs and labels. Our numerical simulations validate these theoretical insights, confirming the performance-wise superiority of RFM in scenarios characterized by strong input-label correlation.
+
+## 1 INTRODUCTION
+
+Random Feature Model (RFM) (Rahimi & Recht, 2007) has received significant attention in recent years due to its compelling theoretical properties and its connections to neural networks. In this work, we focus on a typical supervised learning framework utilizing the RFM, expressed as
+
+$$\omega^T \sigma(\mathbf{F}\mathbf{x}), \quad (1)$$
+
+where $\mathbf{x} \in \mathbb{R}^n$ is an input vector, $\mathbf{F} \in \mathbb{R}^{k \times n}$ is called the random feature matrix, $\sigma : \mathbb{R} \rightarrow \mathbb{R}$ is an activation function, and $\omega \in \mathbb{R}^k$ is a vector of learnable parameters. The feature matrix $\mathbf{F}$ is randomly sampled and remains fixed, allowing the RFM to be interpreted as a two-layer neural network with fixed weights in the first layer. The learning process involves optimizing the following objective function based on a set of training samples $\{(x_i, y_i)\}_{i=1}^m$
+
+$$\hat{\omega}_\sigma := \operatorname{argmin}_{\omega \in \mathbb{R}^k} \frac{1}{m} \sum_{i=1}^m (y_i - \omega^T \sigma(\mathbf{F}\mathbf{x}_i))^2 + \lambda \|\omega\|_2^2, \quad (2)$$
+
+where $\lambda \in \mathbb{R}^+$ is a regularization constant. While the RFM can be studied under various loss functions, we concentrate on squared loss for simplicity in our theoretical development. The training error of the RFM with activation function $\sigma$ is defined as
+
+$$\mathcal{T}_\sigma := \frac{1}{m} \sum_{i=1}^m (y_i - \hat{\omega}_\sigma^T \sigma(\mathbf{F}\mathbf{x}_i))^2 + \lambda \|\hat{\omega}_\sigma\|_2^2. \quad (3)$$
+
+Similarly, one can measure the performance of a trained RFM via the generalization error defined as
+
+$$\mathcal{G}_\sigma := \mathbb{E}_{(\mathbf{x}, y)} (y - \hat{\omega}_\sigma^T \sigma(\mathbf{F}\mathbf{x}))^2. \quad (4)$$
+
+{1}------------------------------------------------
+
+We study the training and generalization errors of RFM (1) in the “proportional asymptotic limit,” where the number of training samples $m$ , the input dimension $n$ , and the number of intermediate features $k$ jointly diverge: $m, n, k \rightarrow \infty$ with $n/m, n/k \in (0, \infty)$ . Under an isotropic data assumption, the RFM has been shown to perform equivalent to the following noisy linear model (Montanari et al., 2019; Gerace et al., 2020; Goldt et al., 2022; Mei & Montanari, 2022; Hu & Lu, 2023):
+
+$$\omega^T(\mu_0 \mathbf{1} + \mu_1 \mathbf{F} \mathbf{x} + \mu_* \mathbf{z}), \quad (5)$$
+
+where $\mathbf{1}$ is an all-one vector, $\mathbf{z} \sim \mathcal{N}(0, \mathbf{I}_k)$ , and $\mu_0, \mu_1, \mu_*$ are constants depending on the activation function $\sigma$ as $\mu_0 = \mathbb{E}[\sigma(z)]$ , $\mu_1 = \mathbb{E}[z\sigma(z)]$ , and $\mu_* = \sqrt{\mathbb{E}[\sigma(z)^2] - \mu_1^2 - \mu_0^2}$ where $z \sim \mathcal{N}(0, 1)$ . The noisy linear model enables the performance characterization of the RFM (Dhifallah & Lu, 2020). It is also useful for studying double-descent phenomenon (Belkin et al., 2019; Geiger et al., 2020) with regards to loss functions (Mei & Montanari, 2022), activation functions (Wang & Bento, 2022; Demir & Doğan, 2023), and regularization constant (Nakkiran et al., 2021). However, such a noisy linear model falls short in explaining the empirical performance of the RFM on real-world data (Ghorbani et al., 2020). This motivates us to investigate the following question:
+
+*“Under which conditions does the random feature model outperform linear models?”*
+
+The equivalence of the RFM to the noisy linear model is closely tied to the isotropic data assumption, i.e., $\mathbf{x} \sim \mathcal{N}(0, \mathbf{I}_n)$ . However, in practice, inputs often exhibit additional structures (Facco et al., 2017). To address this limitation, we consider spiked covariance data model (Johnstone, 2001; Baik et al., 2005)
+
+$$\mathbf{x} \sim \mathcal{N}(0, \mathbf{I}_n + \theta \gamma \gamma^T), \quad y := \sigma_* \left( \frac{\xi^T \mathbf{x}}{\sqrt{1 + \theta \alpha^2}} \right), \quad (6)$$
+
+which introduces anisotropic characteristics due to the structured covariance of $\mathbf{x}$ . Here, $\gamma \in \mathbb{R}^n$ serves as a fixed but unknown “spike signal” with $\|\gamma\|_2 = 1$ , $\xi \in \mathbb{R}^n$ represents a fixed but unknown “label signal” also normalized to one, i.e., $\|\xi\|_2 = 1$ . The parameter $\theta$ , termed “spike magnitude” scales with the dimension as $\theta \asymp n^\beta$ where $\beta \in [0, 1/2)$ , and $\sigma_* : \mathbb{R} \rightarrow \mathbb{R}$ is a nonlinear target function. Note that the input of the target function $\sigma_*$ is scaled to have unit variance. Additionally, we define the alignment parameter $\alpha := \gamma^T \xi$ , which governs the input-label correlation.
+
+Under the spiked data model, we first establish a “universality” theorem indicating that the RFM exhibits equivalent performance across two different activation functions if the first two statistical moments of $(\sigma(\mathbf{F} \mathbf{x}), y)$ are consistent for both activations. Leveraging this theorem, we extend our analysis to demonstrate that high-order polynomial models perform equivalent to the RFM beyond traditional linear frameworks (5). Notably, we show that the equivalence to the noisy linear model still holds provided that at least one of the following is sufficiently small: (i) the cosine similarity between the rows of $\mathbf{F}$ and the $\gamma$ , (ii) the spike magnitude $\theta$ , and (iii) the alignment parameter $\alpha$ . A precise characterization of these conditions will be detailed in Section 4. Moreover, we introduce a new equivalence between the RFM and noisy polynomial models, generalizing previous results on noisy linear models (5). Finally, this framework allows us to compare different activation functions within the context of spiked data, highlighting how nonlinearity can enhance learning performance beyond linear models.
+
+Overall, our contributions are as follows:
+
+1. We show the conditions under which the RFM outperforms linear models under anisotropic data settings, which indicates a key role played by the input-label correlation in data.
+2. We establish a theorem that shows high-order polynomial models perform equivalent to the RFM under spiked covariance data assumption.
+3. We relax the isotropic data assumption previously utilized by Hu & Lu (2023) for the “universality of random features,” which may be of particular interest on its own.
+
+By addressing these aspects, our work not only clarifies when and how RFMs can excel in the spiked covariance model setting but also enriches the theoretical understanding of their performance relative to linear models.
+
+{2}------------------------------------------------
+
+## 2 RELATED WORK
+
+The RFM has emerged as a vital tool in the realm of machine learning, initially introduced as a randomized approximation to kernel methods (Rahimi & Recht, 2007). Its significance has grown in parallel with the development of neural networks, particularly in how both the RFM and the Neural Tangent Kernel (NTK) offer distinct linear approximations of two-layer neural networks (Ghorbani et al., 2021). While empirical evidence shows that neural networks often outperform both the RFM and NTK (Ghorbani et al., 2020), analyzing the RFM provides critical insights into the behavior of nonlinear models, serving as a bridge toward understanding more complex architectures.
+
+A substantial body of research has focused on the equivalence between the RFM and noisy linear models with regards to their performances (Montanari et al., 2019; Gerace et al., 2020; Goldt et al., 2020; 2022; Dhifallah & Lu, 2020; Mei & Montanari, 2022). For instance, Hu & Lu (2023) demonstrated this equivalence in terms of training and generalization performance using Lindenberg’s method. Additionally, Montanari & Saeed (2022) showed that nonlinear features could be substituted with equivalent Gaussian features in empirical risk minimization settings. However, these studies mainly examined the RFM under isotropic data assumptions, which limits their applicability to real-world scenarios characterized by more complex data structures. Our work extends these findings by investigating the RFM under anisotropic data conditions, thereby addressing a significant gap in the literature. Recent works have indicated that equivalent Gaussian features may not consistently provide equivalent training and generalization errors for nonlinear models (Gerace et al., 2022; Pesce et al., 2023). This discrepancy has led researchers to explore alternative feature representations, including Gaussian mixtures (Dandi et al., 2023b). However, our study diverges from this line of inquiry by concentrating on identifying equivalent activation functions rather than seeking alternatives to Gaussian features.
+
+In light of the RFM’s limitations in surpassing linear models, recent research has turned to neural networks trained with one gradient step as a potential solution to bridge this performance gap (Ba et al., 2022; Damian et al., 2022). Studies by Ba et al. (2023) and Mousavi-Hosseini et al. (2023) have explored one-step gradient descent techniques in relation to sample complexity under spiked covariance data assumption. Furthermore, Moniri et al. (2023) explored neural networks trained with one gradient step in an isotropic data setting and showed that the update can be characterized by the appearance of a spike in the spectrum of the feature matrix. Dandi et al. (2023a); Cui et al. (2024) studied the one-step gradient descent with a higher learning rate in comparison to Moniri et al. (2023). Ba et al. (2022); Moniri et al. (2023); Dandi et al. (2023a); Cui et al. (2024) also stated Gaussian equivalence results in terms of training and generalization errors when studying the one gradient step technique under isotropic Gaussian data. [Note that although the aforementioned works considered feature learning in two-layer neural networks, feature learning for three-layer neural networks is shown to have better sample complexities than the two-layer case \(Nichani et al., 2023; Wang et al., 2024\).](#) While these works primarily focus on surpassing the performance of linear models through feature learning in neural networks, our research aims to clarify when and how the RFM can outperform linear models without relying on feature learning.
+
+Additionally, there is an ongoing exploration into deep random features that integrate multiple layers of random projections interleaved with nonlinearities (Schröder et al., 2023; Bosch et al., 2023). Research by Zavatone-Veth & Pehlevan (2023) has also examined deep random features with anisotropic weight matrices using statistical physics techniques. Moreover, studies have investigated the RFM under polynomial scaling limits where $k, n, m \rightarrow \infty$ while maintaining specific ratios between these parameters, i.e., $k/n^{c_1}, m/k^{c_2} \in (0, \infty)$ for some constants $c_1, c_2 > 0$ (Hu et al., 2024), further providing equivalence results for the RFM under the polynomial scaling limit.
+
+## 3 PRELIMINARIES
+
+**Notations** We denote vectors and matrices using bold letters, with lowercase letters representing vectors and uppercase letters representing matrices. Scalars are indicated by non-bold letters. The notation $\|\mathbf{x}\|_2$ refers to the Euclidean norm of the vector $\mathbf{x}$ while $\|\mathbf{F}\|$ denotes to spectral norm of the matrix $\mathbf{F}$ . We use the term polylog $k$ to represent any polylogarithmic function of $k$ . The symbol $\xrightarrow{p}$ indicates convergence in probability. We employ big-O notation, denoted $\mathcal{O}(\cdot)$ , and
+
+{3}------------------------------------------------
+
+small-o notation, represented as $o(\cdot)$ with respect to the parameters $k, n, m$ . These notations are
+
+$$h(k) = \mathcal{O}(g(k)) \Leftrightarrow \limsup_{k \rightarrow \infty} \frac{h(k)}{g(k)} < \infty, \quad (7)$$
+
+$$h(k) = o(g(k)) \Leftrightarrow \lim_{k \rightarrow \infty} \frac{h(k)}{g(k)} = 0. \quad (8)$$
+
+It is important to note that $h(k) = o(1/\text{polylog } k)$ implies that $\lim_{k \rightarrow \infty} h(k) \text{polylog } k = 0$ for all polylogarithmic functions. We also use the notation $\theta \asymp n^\beta$ to indicate that there exists some constants $C_1, C_2 > 0$ such that $C_1 n^\beta \leq \theta \leq C_2 n^\beta$ . Finally, we denote the $i$ -th Hadamard power of a vector $\mathbf{x}$ as $\mathbf{x}^{\circ i}$ .
+
+**Assumptions** We establish our results based on the following assumptions.
+
+- (A.1) The spike and label signal vectors $\boldsymbol{\gamma}, \boldsymbol{\xi} \in \mathbb{R}^n$ are deterministic and $\|\boldsymbol{\gamma}\|_2 = \|\boldsymbol{\xi}\|_2 = 1$ .
+- (A.2) $\mathbf{x} \sim \mathcal{N}(0, \mathbf{I}_n + \theta \boldsymbol{\gamma} \boldsymbol{\gamma}^T)$ for spike magnitude $\theta \asymp n^\beta$ where $\beta \in [0, 1/2]$ .
+- (A.3) $y \sim \sigma_* \left( \frac{\epsilon \mathbf{x}}{\sqrt{1+\theta \alpha^2}} \right)$ where $\sigma_* : \mathbb{R} \rightarrow \mathbb{R}$ is a function satisfying $|\sigma_*(x)| < C(1 + |x|^K)$ for all $x \in \mathbb{R}$ and some constants $C > 0, K \in \mathbb{Z}^+$ .
+- (A.4) The number of training samples $m$ , dimension of input vector $n$ and number of intermediate features $k$ jointly diverge: $m, n, k \rightarrow \infty$ with $n/m, n/k \in (0, \infty)$ .
+- (A.5) $\mathbf{F} := [\mathbf{f}_1, \mathbf{f}_2, \dots, \mathbf{f}_k]^T$ where $\mathbf{f}_i \sim \mathcal{N}(0, \frac{1}{n+\theta} \mathbf{I}_n)$ . Note that the covariance of $\mathbf{f}_i$ is selected such that $\mathbb{E}_{\mathbf{x}, \mathbf{f}_i} [(\mathbf{f}_i^T \mathbf{x})^2] = 1$ .
+- (A.6) The activation function $\sigma : \mathbb{R} \rightarrow \mathbb{R}$ is an odd function satisfying $|\sigma(x)| < C(1 + |x|^K)$ for all $x \in \mathbb{R}$ and some constants $C > 0, K \in \mathbb{Z}^+$ .
+
+**Discussion of Assumptions** The assumptions outlined in (A.1)-(A.3) establish the foundational framework for our data model and setup. Specifically, (A.1) describes the general characteristics of the spike and label signals, while (A.2) introduces the spike magnitude $\theta$ . Although there may be potential to extend the range of $\theta$ in future work, our current proofs necessitate that $\beta < 1/2$ . This restriction is crucial for ensuring that the mathematical properties we derive remain valid within the specified limits. In (A.3), we scale the input of the target function $\sigma_*$ to get unit variance. This scaling not only simplifies our proofs but also aligns with standard practices in theoretical analysis. Assumption (A.4) specifies the proportional asymptotic limit, which is a critical aspect of our study. By requiring that the dimensions jointly diverge while maintaining finite ratios, we can effectively analyze the behavior of the RFM in high-dimensional settings. In (A.5), we detail the distribution of the feature matrix $\mathbf{F}$ , emphasizing that the $1/(n+\theta)$ scaling is vital for our results to hold. This specific scaling ensures that the covariance structure of $\mathbf{F}$ is appropriately calibrated with respect to both the input data and the spike magnitude, facilitating accurate performance characterization. Assumption (A.6) pertains to the properties of the activation function $\sigma$ , which warrants further elaboration. Previous research by Hu & Lu (2023) established a performance-wise equivalence between the RFM and noisy linear models under isotropic data conditions, relying on the premise that $\sigma$ is an odd function with bounded first, second, and third derivatives. In our case, (A.6) implies the derivatives of $\sigma(x)$ bounded by $\text{polylog } k$ if $|x| \leq \text{polylog } k$ , which happens with high probability for $\mathbf{x} \sim \mathcal{N}(0, 1)$ . Finally, it is noteworthy that while ReLU (9) does not conform to the odd function assumption stipulated in (A.6), empirical evidence suggests that our findings remain valid even when using ReLU as an activation function.
+
+**Activation Functions for Numerical Results** In our numerical simulations, we employ three widely used activation functions: ReLU (Rectified Linear Unit), tanh (hyperbolic tangent), and Softplus. The mathematical definitions of these activation functions are as follows:
+
+$$\sigma_{\text{ReLU}}(x) := \max(0, x), \quad \sigma_{\text{tanh}}(x) := \frac{e^{2x} - 1}{e^{2x} + 1}, \quad \sigma_{\text{Softplus}} := \log(1 + e^x). \quad (9)$$
+
+{4}------------------------------------------------
+
+## 4 MAIN RESULTS
+
+In this section, we describe our main theoretical results, significantly enhancing the understanding of RFM under structured data conditions. In Section 4.1, we introduce a new “universality” theorem that establishes the performance-wise equivalence of the RFM when utilizing two distinct activation functions, $\sigma$ and $\hat{\sigma}$ . This theorem asserts that if the first two statistical moments of the pairs $(\sigma(\mathbf{F}\mathbf{x}), y)$ and $(\hat{\sigma}(\mathbf{F}\mathbf{x}), y)$ are matched, the training and generalization performance of the RFM will remain equivalent across both functions. Building on this foundation, Section 4.2 explores the scenario where $\hat{\sigma}$ is represented as a finite-degree Hermite expansion of $\sigma$ , demonstrating that the RFM retains equivalent performance regardless of the chosen activation function. Notably, we reveal that the degree of this expansion is intricately tied to the input-label correlation, offering insights into how data structure influences model performance. In Section 4.3, we establish conditions for the equivalence between the RFM and a noisy linear model, providing a crucial corollary to our earlier findings. When these conditions are not satisfied, we identify that a high-order polynomial model serves as an equivalent to the RFM, a topic further elaborated in Section 4.4.
+
+### 4.1 UNIVERSALITY OF RANDOM FEATURES UNDER SPIKED DATA
+
+Here, we extend the universality laws established by Hu & Lu (2023) for RFM to encompass spiked covariance data. The concept of “universality of random features” implies that one can replace $\sigma(\mathbf{F}\mathbf{x})$ in the problem with an equivalent Gaussian vector, as articulated in equation (5), without compromising the training and generalization performance of the model. While Hu & Lu (2023) demonstrated this result under mild assumptions regarding the feature matrix $\mathbf{F}$ , the nonlinearity $\sigma$ , and the loss function, their findings were constrained by an isotropic data assumption. To address these limitations, we propose a new universality theorem tailored for scenarios involving spiked covariance data, as outlined in equation (6).
+
+**Theorem 1.** *Let $\sigma(x)$ , $\hat{\sigma}(x)$ be two activation functions satisfying (A.6). Suppose that assumptions (A.1)-(A.6) given in Section 3 hold. If*
+
+$$\left\| \mathbb{E}_{\mathbf{x}} [\sigma(\mathbf{F}\mathbf{x})\sigma(\mathbf{F}\mathbf{x})^T] - \mathbb{E}_{\mathbf{x}} [\hat{\sigma}(\mathbf{F}\mathbf{x})\hat{\sigma}(\mathbf{F}\mathbf{x})^T] \right\| = o(1/\text{polylog } k), \quad (10)$$
+
+$$\left\| \mathbb{E}_{(\mathbf{x}, y)} [\sigma(\mathbf{F}\mathbf{x})y] - \mathbb{E}_{(\mathbf{x}, y)} [\hat{\sigma}(\mathbf{F}\mathbf{x})y] \right\| = o(1/\text{polylog } k), \quad (11)$$
+
+are satisfied, then
+
+- (i) *the training error $\mathcal{T}_\sigma$ of the RFM with activation $\sigma$ , and the training error $\mathcal{T}_{\hat{\sigma}}$ of the RFM with activation $\hat{\sigma}$ , both converge in probability to the same value $e_\mathcal{T} \geq 0$ ,*
+- (ii) *the corresponding generalization errors $\mathcal{G}_\sigma$ and $\mathcal{G}_{\hat{\sigma}}$ also converge in probability to the same value $e_\mathcal{G} \geq 0$ under additional assumptions (A.7) and (A.8) provided in Appendix A.*
+
+*Proof.* We provide a proof in Appendix A.
+
+**Proof Approach** We follow the proof technique used by Hu & Lu (2023). First, we define a perturbed training objective that includes additional terms related to the generalization error. Then, we bound the expected difference in the perturbed training objective resulting from replacing $\sigma(\mathbf{F}\mathbf{x}_i)$ with $\hat{\sigma}(\mathbf{F}\mathbf{x}_i)$ for each training sample $\mathbf{x}_i$ , following the principles of Lindeberg’s method (Lindeberg, 1922; Korada & Montanari, 2011). $\square$
+
+A key advancement of our work is encapsulated in Theorem 1, which establishes the equivalence of the RFM across two different activation functions. This result is notably more general than previous findings that focused solely on the equivalence of specific models. Specifically, Theorem 1 asserts that substituting the activation function $\sigma$ with $\hat{\sigma}$ does not impact the training and generalization performance of the RFM, provided that conditions (10) and (11) are satisfied. In the subsequent sections, we will leverage this theorem to identify models that are equivalent to the RFM and outline the conditions necessary for these equivalences to hold, thereby broadening the applicability of our findings in various contexts.
+
+{5}------------------------------------------------
+
+### 4.2 NOISY POLYNOMIAL MODELS EQUIVALENT TO THE RANDOM FEATURE MODEL
+
+Now, we consider generalizing the equivalent noisy linear model to equivalent high-order polynomial models by utilizing Theorem 1. To achieve this, we leverage Hermite polynomials (O'Donnell, 2014, Chapter 11.2). For $i \in \mathbb{Z}^+$ , $i$ -th Hermite polynomial is defined as
+
+$$H_i(x) := (-1)^i e^{x^2/2} \frac{d^i}{dx^i} e^{-x^2/2} \quad (12)$$
+
+for any $x \in \mathbb{R}$ . There are two important properties of Hermite polynomials. First, they are orthogonal with respect to Gaussian measure, so $\mathbb{E}_{z \sim \mathcal{N}(0,1)}[H_i(z)H_j(z)] = 0$ for $i \neq j$ . Second, they form an orthogonal basis of the Hilbert space of functions $\sigma : \mathbb{R} \rightarrow \mathbb{R}$ satisfying $\mathbb{E}_{z \sim \mathcal{N}(0,1)}[\sigma(z)^2] < \infty$ . This means that the function $\sigma(x)$ can be expressed as an infinite sum of Hermite polynomials as
+
+$$\sigma(x) = \sum_{i=0}^{\infty} \frac{1}{i!} \mu_i H_i(x), \quad \text{with } \mu_i := \mathbb{E}_{z \sim \mathcal{N}(0,1)}[H_i(z)\sigma(z)]. \quad (13)$$
+
+This sum is also known as ‘‘Hermite expansion’’ and $\mu_i$ is called $i$ -th Hermite coefficient. Since we are working with Gaussian random variables, Hermite expansion simplifies the analysis. Indeed, we can construct a performance-wise equivalent activation function using the Hermite expansion. Specifically, the following theorem states that the RFM with activation function $\sigma(x)$ performs equivalent to the RFM with $\hat{\sigma}_l(x)$ , which is a finite-degree Hermite expansion with additional noise.
+
+**Theorem 2.** *Let $\sigma$ be any activation function satisfying (A.6). Define another activation function*
+
+$$\hat{\sigma}_l(x) := \left( \sum_{j=0}^{l-1} \frac{1}{j!} \mu_j H_j(x) \right) + \mu_l^* z \quad \text{with } z \sim \mathcal{N}(0,1), \quad (14)$$
+
+where $\mu_j := \mathbb{E}_{z \sim \mathcal{N}(0,1)}[H_j(z)\sigma(z)]$ and $\mu_l^* := \sqrt{\mathbb{E}_{z \sim \mathcal{N}(0,1)}[\sigma(z)^2] - \sum_{j=0}^{l-1} \mu_j^2/(j!)}$ .
+
+Suppose that assumptions (A.1)–(A.6) given in Section 3 hold. If
+
+$$\eta := \max_{1 \leq i \leq k} \frac{|(\xi + \theta\alpha\gamma)^T \mathbf{t}_i|}{\sqrt{1 + \theta\alpha^2}} \leq \frac{C}{n^{1/l}}, \quad \text{for some } C > 0 \text{ and some } l \in \mathbb{Z}^+, \quad (15)$$
+
+is satisfied, then
+
+- (i) *the training error $\mathcal{T}_\sigma$ of the RFM with activation $\sigma$ , and the training error $\mathcal{T}_{\hat{\sigma}_l}$ of the RFM with activation $\hat{\sigma}_l$ , both converge in probability to the same value $e_T \geq 0$ ,*
+- (ii) *the corresponding generalization errors $\mathcal{G}_\sigma$ and $\mathcal{G}_{\hat{\sigma}_l}$ also converge in probability to the same value $e_G \geq 0$ under additional assumptions (A.7) and (A.8) provided in Appendix A.*
+
+*Proof.* In Appendix C, we show
+
+$$\left\| \mathbb{E}_{\mathbf{x}}[\sigma(\mathbf{F}\mathbf{x})\sigma(\mathbf{F}\mathbf{x})^T] - (\mu_1^2 \mathbf{F}(\mathbf{I}_n + \theta\gamma\gamma^T)\mathbf{F}^T + \mu_*^2 \mathbf{I}_k) \right\| = o(1/\text{polylog } k), \quad (16)$$
+
+for any $\sigma$ satisfying (A.6), $\mu_1 = \mathbb{E}[z\sigma(z)]$ and $\mu_* = \sqrt{\mathbb{E}[\sigma(z)^2] - \mu_1^2}$ with $z \sim \mathcal{N}(0,1)$ . By definition, we have $\mathbb{E}[z\sigma(z)] = \mathbb{E}[z\hat{\sigma}_l(z)]$ . One can easily show $\mathbb{E}[\sigma(z)^2] = \mathbb{E}[\hat{\sigma}_l(z)^2]$ . Therefore, (16) holds for $\sigma$ and $\hat{\sigma}_l$ with same $\mu_1$ and $\mu_*$ values. Using (16) and triangle inequality, we get
+
+$$\left\| \mathbb{E}_{\mathbf{x}}[\sigma(\mathbf{F}\mathbf{x})\sigma(\mathbf{F}\mathbf{x})^T] - \mathbb{E}_{\mathbf{x}}[\hat{\sigma}_l(\mathbf{F}\mathbf{x})\hat{\sigma}_l(\mathbf{F}\mathbf{x})^T] \right\| = o(1/\text{polylog } k). \quad (17)$$
+
+Similarly, in Appendix D, we prove
+
+$$\left\| \mathbb{E}_{(\mathbf{x},y)}[\sigma(\mathbf{F}\mathbf{x})y] - \mathbb{E}_{(\mathbf{x},y)}[\hat{\sigma}_l(\mathbf{F}\mathbf{x})y] \right\| = o(1/\text{polylog } k), \quad (18)$$
+
+when $|\eta| = \mathcal{O}(n^{-1/l})$ for some $l \in \mathbb{Z}^+$ and all $i \in \{1, \dots, k\}$ . Finally, using Theorem 1 with (17) and (18), we reach the statement of the theorem. $\square$
+
+{6}------------------------------------------------
+
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+
+
+
+Figure 1: (a) Heatmap showing the percentage difference between the generalization errors of the RFM and the noisy linear model (5) as a function of alignment alpha (0.00 to 1.00) and spike magnitude theta (10^-2 to 10^2). A red line indicates the boundary where the difference is O(1). (b) Plot of generalization errors for ReLU (blue circles) and tanh (red circles) activation functions, comparing the Random Feature Model (solid lines) and the Noisy Linear Model (dashed lines) for alpha = O(1/sqrt(n)) and theta = n^{1/2}. The Noisy Linear Model's error decreases as k/m increases, while the RFM's error increases for tanh and peaks for ReLU.
+
+Figure 1: *When does the noisy linear model (5) perform equivalent to the RFM under spiked data?* Left: the boundary of the equivalence with respect to spike magnitude $\theta$ and alignment $\alpha$ (controlling the input-label correlation). Right: an example case where the equivalence holds. For both of these figures, we use $\sigma_* = \sigma_{\text{ReLU}}$ , $\lambda = 10^{-2}$ , $n = 400$ and $m = 500$ . The average of 50 Monte Carlo runs (numerical simulations) is plotted.
+
+Theorem 2 specifies a finite-degree polynomial function (14) that is equivalent to any given activation function $\sigma(x)$ . Furthermore, the degree of the polynomial is related to $\eta$ defined in (15). It is important to note that $\eta$ is related to the input-label correlation, which can be decomposed as
+
+$$\mathbb{E}[(\mathbf{x} - \mathbb{E}[\mathbf{x}])(y - \mathbb{E}[y])] = \tilde{\mu}_1 \frac{\boldsymbol{\xi} + \theta\alpha\gamma}{\sqrt{1 + \theta\alpha^2}} + \sum_{j>1} \tilde{\mu}_j \mathbb{E}_{\mathbf{x}}[\mathbf{x}H_j(\boldsymbol{\xi}^T \mathbf{x})], \quad (19)$$
+
+where $\tilde{\mu}_j := \mathbb{E}_{z \sim \mathcal{N}(0,1)}[\sigma_*(z)H_j(z)]$ denotes $j$ -th Hermite coefficient of $\sigma_*$ . Here, $\eta$ depends on $(\boldsymbol{\xi} + \theta\alpha\gamma)/\sqrt{1 + \theta\alpha^2}$ , which is the first term in the decomposition of the input-label correlation (19). Additionally, a higher value of $\|\boldsymbol{\xi} + \theta\alpha\gamma\|/\sqrt{1 + \theta\alpha^2}$ implies a greater value of $\eta$ for any $\mathbf{F}$ sampled independent of $\gamma$ and $\boldsymbol{\xi}$ .
+
+In the following sections, we will first examine the case where the equivalent activation function in equation (14) is linear, effectively reducing the model to the noisy linear model described in equation (5). Subsequently, we will focus on the more general case where the equivalent activation function is represented as a high-order polynomial.
+
+### 4.3 CONDITION OF THE EQUIVALENCE TO THE NOISY LINEAR MODEL
+
+In this section, we explore the “linear regime” of the RFM and delineate the conditions under which it aligns with the noisy linear model in the context of spiked data. Specifically, we examine the substitution of the activation function $\sigma(x)$ with $\tilde{\sigma}_1(x) := (\mu_0 + \mu_1 x + \mu_* z)$ for $z \sim \mathcal{N}(0,1)$ . This transformation effectively simplifies the model to that of a noisy linear model, as described in equation (5). The conditions necessary for establishing equivalence between the noisy linear model and the RFM are articulated in the following corollary, which emerges directly from Theorem 2.
+
+**Corollary 3.** *The noisy linear model (5) performs equivalent to the RFM with activation $\sigma$ in terms of training and generalization errors if $\eta = \mathcal{O}(n^{-1/2})$ in (15).*
+
+Figure 1a vividly illustrates the disparity in generalization errors between the RFM and the noisy linear model across various degrees of alignment $\alpha$ and different values of spike magnitude $\theta$ . The red line delineates the boundary of equivalence, as established by Corollary 3. Given that $\mathbf{f}_i$ is sampled independently of $\gamma$ and $\boldsymbol{\xi}$ , we observe that both $|\gamma^T \mathbf{f}_i|$ and $|\boldsymbol{\xi}^T \mathbf{f}_i|$ scale as $\mathcal{O}(n^{-1/2})$ . Consequently, the expression $|\theta\alpha/\sqrt{1 + \theta\alpha^2}| = \mathcal{O}(1)$ leads to the conclusion that $\eta = \mathcal{O}(n^{-1/2})$ , which fulfills the condition outlined in Corollary 3.
+
+As an illustrative example, we examine a misaligned scenario where $\alpha := \boldsymbol{\xi}^T \gamma = \mathcal{O}(n^{-1/2})$ . This condition is likely to occur when both $\gamma$ and $\boldsymbol{\xi}$ are independently and identically sampled from $\mathcal{N}(0, \mathbf{I}_n)$ and are scaled such that $\|\gamma\|_2 = \|\boldsymbol{\xi}\|_2 = 1$ . Under these circumstances, we find that
+
+{7}------------------------------------------------
+
+
+
+(a) $\sigma_* = \sigma_{ReLU}$
+(b) $\sigma_* = \sigma_{tanh}$
+
+Figure 2: Two line plots showing generalization error vs k/m for different activation functions. Plot (a) for sigma\_\* = sigma\_ReLU shows that the Random Feature Model (RFM) and Noisy Polynomial Model have similar error curves, while the Noisy Linear Model has a much higher error. Plot (b) for sigma\_\* = sigma\_tanh shows that the RFM and Noisy Linear Model have similar error curves, while the Noisy Polynomial Model has a much higher error. Both plots show a peak in error at k/m = 1.
+
+Figure 2: *Equivalence to the noisy polynomial model (20) when the noisy linear model (5) is not enough.* Generalization errors of the RFM, the noisy linear model, and the noisy polynomial model for $\theta = n^{1/2}$ and $\alpha = 1$ (**aligned**). $\lambda = 10^{-3}$ , $n = 400$ and $m = 500$ . An average of 50 Monte Carlo runs is shown.
+
+$\eta = \mathcal{O}(n^{-1/2})$ with high probability for values of $\theta$ that scale as $\theta \asymp n^\beta$ , where $\beta \in [0, 1/2]$ . Therefore, the RFM demonstrates performance equivalence to the noisy linear model with high probability in this context. Figure 1b visually represents this relationship, showcasing the training and generalization errors of both the RFM and the noisy linear model. Notably, the results indicate that this performance-wise equivalence is maintained across different activation functions.
+
+### 4.4 BEYOND THE NOISY LINEAR MODEL: HIGH-ORDER POLYNOMIAL MODELS
+
+In this section, we explore the performance-wise equivalence of the RFM to the noisy polynomial model beyond the linear regime. Specifically, we focus on the model represented by
+
+$$\omega^T \hat{\sigma}_l(\mathbf{F}\mathbf{x}), \quad (20)$$
+
+for $l > 2$ , where $\hat{\sigma}_l$ is the equivalent polynomial function defined in (14).
+
+If the condition in Corollary 3 does not hold, the equivalence between the RFM and the noisy linear model is no longer applicable. In this case, Theorem 2 provides high-order polynomial models (20) equivalent to the RFM. Thus, we delve into the “nonlinear regime” of the RFM under spiked data conditions. While much of the existing theoretical literature has concentrated on the linear regime of the RFM, Theorem 2 suggests that the nonlinear components of random features become increasingly significant when the spike signal $\gamma$ and label signal $\xi$ are aligned, indicating a strong input-label correlation. This relationship is illustrated in Figure 2, which demonstrates that the generalization errors of the RFM closely match those of the equivalent polynomial model in the aligned case ( $\alpha := \gamma^T \xi = 1$ ). Notably, although the equivalence between the RFM and the noisy linear model may not hold due to violated conditions for linear equivalence, it is essential to recognize that such equivalence can still be achieved depending on the choice of activation function $\sigma$ and label function $\sigma_*$ . This nuanced understanding is further characterized in the following remark.
+
+*Remark 4.* When we assume that $\eta = \mathcal{O}(n^{-1/4})$ , this allows the equivalent activation function to be represented as a third-degree polynomial. Let $\mu_0, \mu_1, \mu_2, \mu_3$ and $\tilde{\mu}_0, \tilde{\mu}_1, \tilde{\mu}_2, \tilde{\mu}_3$ denote the first four Hermite coefficients (13) of the functions $\sigma$ and $\sigma_*$ , respectively. In this case, we can express $\mathbb{E}[\hat{\sigma}_l(\xi_i^T \mathbf{x})y] = \sum_{j=0}^3 \frac{1}{j!} \mu_j \tilde{\mu}_j \eta_j^j$ due to (112). This formulation reveals that the noisy polynomial model represented in (20) simplifies to a second-degree model if the product $\mu_3 \tilde{\mu}_3 = 0$ . Furthermore, it reduces to the noisy linear model described in (5) under the conditions that both $\mu_2 \tilde{\mu}_2 = 0$ and $\mu_3 \tilde{\mu}_3 = 0$ . These relationships highlight how specific properties of the Hermite coefficients dictate the behavior of the model, illustrating the nuanced interplay between activation functions and their corresponding polynomial representations.
+
+The implications of Remark 4 are vividly illustrated in Figure 2. In 2a, we observe that the noisy linear model suffices for the tanh activation function in terms of equivalence, while a high-order polynomial model is necessary for the ReLU activation, given that $\sigma_* = \text{ReLU}$ . Conversely, 2b showcases the same simulation with $\sigma_*$ as tanh, demonstrating that a noisy polynomial model is essential to achieve equivalence to the RFM for tanh activation, whereas the noisy linear model remains adequate for ReLU activation. This distinction arises from the specific properties of the Hermite coefficients: for tanh, we have $\mu_2 = 0$ and $\mu_3 \neq 0$ , while for ReLU, $\mu_2 \neq 0$ and $\mu_3 = 0$ .
+
+{8}------------------------------------------------
+
+
+
+Figure 3 consists of three subplots showing generalization error on the y-axis against different parameters on the x-axis. The legend for all plots is: ReLU (blue circles), Softplus (red squares), Linear (yellow diamonds), and Polynomial (green triangles). A dashed line in the right plot represents the Noisy Polynomial Model.
+
+- (a) impact of number of samples ( $\alpha = 1$ and $\theta = n^{1/2}$ ): The x-axis is $m/k$ on a log scale from $10^{-1}$ to $10^1$ . The y-axis ranges from 0.06 to 0.18. The Polynomial and Linear models show a steady decrease in error as $m/k$ increases. The ReLU and Softplus models show a more complex behavior with peaks around $m/k = 1$ .
+- (b) impact of alignment ( $m = 500$ and $\theta = n^{1/2}$ ): The x-axis is $\alpha$ from 0.0 to 1.0. The y-axis ranges from 0.1 to 0.5. All models show a decrease in error as $\alpha$ increases, with the Polynomial and Linear models consistently achieving lower errors than ReLU and Softplus.
+- (c) impact of $\theta \asymp n^\beta$ ( $m = 500$ and $\alpha = 1$ ): The x-axis is $\beta$ from 0.0 to 1.0. The y-axis ranges from 0.0 to 0.4. The Polynomial and Linear models show a decrease in error as $\beta$ increases. The ReLU and Softplus models show a more complex behavior, with the ReLU model's error decreasing more sharply than the others at higher $\beta$ .
+
+Figure 3: Comparison of activation functions - generalization errors of the RFM with different nonlinearities (linear, polynomial, Softplus, ReLU) with respect to number of samples (on the left), alignment (on the center), and spike magnitude theta ≍ n^beta (on the right).
+
+Figure 3: *Comparison of activation functions* - generalization errors of the RFM with different nonlinearities (linear, polynomial, Softplus, ReLU) with respect to number of samples (on the left), alignment (on the center), and spike magnitude $\theta \asymp n^\beta$ (on the right). Here, $n = 400$ , $k = 500$ , $\lambda = 10^{-2}$ , and $\sigma_* = \sigma_{ReLU}$ . We limit the degree of the equivalent polynomial model (14) to a maximum of $l = 4$ for numerical stability. We plot the average of 50 Monte Carlo runs.
+
+Together, Theorem 2, Remark 4, and Figure 2 underscore the critical influence of the label generation process on the study of equivalent models.
+
+## 5 NONLINEARITY IN RFM BENEFITS HIGH INPUT-LABEL CORRELATION
+
+In this section, we conduct a comparative analysis of the RFM employing various activation functions, focusing specifically on their generalization performance. To establish a benchmark, we first consider the following “optimal” linear activation function for the RFM:
+
+$$\sigma_{linear}(x) = a_0 + a_1 x, \quad (21)$$
+
+where $a_0, a_1 \in \mathbb{R}$ are coefficients determined numerically to minimize the generalization error. This “optimal” linear activation serves as a critical reference point for understanding the conditions under which the RFM surpasses traditional linear models in performance.
+
+According to Theorem 2, the RFM with any activation function that meets our assumptions performs equivalently to a noisy polynomial model. Notably, we find that $\eta = \mathcal{O}(n^{-1/4})$ in (15) holds with high probability when $\beta < 1/2$ for $\theta \asymp n^\beta$ and $\mathbf{F}$ is sampled independently of $\gamma$ and $\xi$ . Therefore, in this context, we can define the following third-degree polynomial as an optimal activation function:
+
+$$\sigma_{polynomial}(x) = b_0 + b_1 x + \frac{1}{2} b_2 (x^2 - 1) + \frac{1}{6} b_3 (x^3 - 3x) + b_4 z, \quad (22)$$
+
+where $z \sim \mathcal{N}(0, 1)$ and the coefficients $b_0, b_1, b_2, b_3, b_4 \in \mathbb{R}$ are determined numerically to minimize the generalization error, akin to the approach taken for the optimal linear activation in (21).
+
+We proceed to compare the generalization performance of the RFM across various activation functions: linear (21), polynomial (22), ReLU (9), and Softplus (9). Figure 3a presents this comparison in relation to the number of training samples. Notably, the generalization error of the RFM aligns closely with that of the equivalent polynomial model, as predicted by Theorem 2. Additionally, we observe the double-descent phenomenon (Belkin et al., 2019; Geiger et al., 2020), characterized by an initial decrease in generalization error, followed by an increase, and then a second decrease as the number of samples (or features) increases, particularly for the ReLU and Softplus activation functions. In contrast, this phenomenon is absent for the linear (21) and polynomial (22) activation functions, as their coefficients are numerically optimized. Similar findings have been documented under isotropic data conditions (Wang & Bento, 2022; Demir & Doğan, 2023). Interestingly, the RFM with linear activation outperforms both ReLU and Softplus in the mid-range of $k/m$ due to the double-descent behavior exhibited by those two functions. However, throughout the entire range of $k/m$ , the polynomial RFM consistently demonstrates lower generalization error than its counterparts, highlighting its superior performance and robustness across different scenarios.
+
+Next, we investigate the impact of alignment, defined as $\alpha := \gamma^T \xi$ controlling the input-label correlation, on the generalization performance of the RFM across the aforementioned activation functions in Figure 3b. In the misaligned scenario ( $\alpha \leq 0.3$ ), we observe relatively high generalization errors,
+
+{9}------------------------------------------------
+
+
+
+Figure 4: CIFAR-10 classification (airplane vs. automobile) - Impact of input-label correlation. The figure contains two line plots. Plot (a) is for 'Original Inputs' and plot (b) is for 'Inputs with Gaussian Noise'. Both plots show 'generalisation error' on the y-axis (ranging from 0.6 to 1.2) against 'norm of input-label correlation' on the x-axis. In (a), the x-axis ranges from 2.5 to 12.5. In (b), it ranges from 2 to 8. Four models are compared: ReLU (blue circles), Softplus (red circles), Random Feature Model (blue diamonds), and Noisy Linear Model (red diamonds). A dashed line represents the Noisy Polynomial Model. In both plots, all models show a decrease in generalization error as the correlation norm increases. The Random Feature Model and Noisy Polynomial Model consistently achieve the lowest errors, while ReLU and Softplus achieve higher errors, especially in the high correlation regime.
+
+(a) Original Inputs
+
+(b) Inputs with Gaussian Noise
+
+Figure 4: *CIFAR-10 classification (airplane vs. automobile) - Impact of input-label correlation.* Input-label correlation is controlled by flipping the true labels. Here, the highest value of the correlation norm corresponds to the case with true labels, while the smallest value corresponds to random labels, and the rest is interpolation in between. $l = 5$ , $\lambda = 10^{-1}$ , $k = n = 3072$ , and $m = 4000$ . An average of 50 Monte Carlo runs is shown. Experimental details are explained in Appendix G.
+
+with the errors for both linear and polynomial activation functions closely aligned. Specifically, for the range $0.3 < \alpha \leq 0.6$ , we note a gradual separation in the generalization errors of the linear and polynomial functions. In cases of high alignment ( $\alpha > 0.6$ ), the polynomial RFM distinctly outperforms the linear RFM, achieving significantly lower generalization errors. This observation corroborates our theoretical predictions that a strong input-label correlation—facilitated by high values of $\alpha$ —enables the RFM to outperform linear models.
+
+In Figure 3c, we examine the influence of the spike magnitude scale, denoted as $\theta$ , on the generalization errors of the RFM across the previously discussed activation functions. Notably, we observe that generalization errors for all activation functions decline as the scale of the spike magnitude increases. In the low spike magnitude regime ( $\beta < 0.4$ ), both the RFM with linear and polynomial activation functions yield similar generalization errors, which remain lower than those of the RFM utilizing ReLU and Softplus activations. As we transition into the high spike magnitude regime ( $\beta \geq 0.4$ ), the polynomial RFM consistently outperforms the linear RFM, aligning with our expectations. Although our analysis is confined to $\beta < 0.5$ , we find that the generalization errors for ReLU and Softplus continue to align with those of their equivalent noisy polynomial models, even at higher values of $\beta$ . Importantly, our findings indicate that RFM with nonlinear activation functions surpasses the optimal linear model in scenarios characterized by high spike magnitudes.
+
+To illustrate how our results translate to real-world datasets, we study the effect of input-label correlation on the CIFAR-10 dataset Krizhevsky et al. (2009). Figure 4a illustrates our experimental results in this case. We observe that the noisy polynomial model performs equivalent to the RFM while the equivalence of the RFM to the linear model depends on factors like input-label correlation, input covariance, and activation function. To isolate the impact of the input-label correlation, we add standard Gaussian noise to the data such that the linear model performs equivalent to the RFM for the case of weak input-label correlation. For this case, Figure 4b shows our results when the input has additional Gaussian noise. We see that the generalization errors of the RFM and the linear model are gradually separated as the input-label correlation is increased, confirming our insights.
+
+## 6 CONCLUSION
+
+In conclusion, this study explored the random feature model within the context of spiked covariance data, establishing a significant “universality” theorem that underpins our findings. We demonstrated that a strong correlation between inputs and labels is essential for the RFM to surpass linear models in generalization performance. Additionally, we established that the RFM achieves performance equivalent to noisy polynomial models, with the polynomial degree influenced by the magnitude of the input-label correlation. Our numerical simulations corroborated these theoretical findings, highlighting the RFM’s superior effectiveness in environments with strong input-label correlation. This work highlights the critical role of data modeling in understanding and enhancing model performance. Moving forward, we believe that extending the data model presents a promising avenue for future research, allowing for deeper exploration of complex relationships and further optimization of high-dimensional learning strategies.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/OqEsj4S240.txt b/papers/OqEsj4S240.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8a429a62f936a9242db05c3e6684410546c75b2b
--- /dev/null
+++ b/papers/OqEsj4S240.txt
@@ -0,0 +1,285 @@
+**Primary Area:** learning on graphs and other geometries & topologies
+
+
+
+{0}------------------------------------------------
+
+# PERSISTENT TOPOLOGICAL FEATURES IN LARGE LANGUAGE MODELS
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Understanding the decision-making processes of large language models (LLMs) is critical given their widespread applications. Towards this goal, describing the topological and geometrical properties of internal representations has recently provided valuable insights. For a more comprehensive characterization of these inherently complex spaces, we present a novel framework based on zigzag persistence, a method in topological data analysis (TDA) well-suited for describing data undergoing dynamic transformations across layers. Within this framework, we introduce persistence similarity, a new topological descriptor that quantifies the persistence and transformation of topological features such as $p$ -cycles throughout the model layers. Unlike traditional similarity measures, our approach captures the entire evolutionary trajectory of these features, providing deeper insights into the internal workings of LLMs. As a practical application, we leverage persistence similarity to identify and prune layers, demonstrating comparable performance to state-of-the-art methods across several benchmark datasets. Additionally, our analysis reveals similar topological behaviors across various models and hyperparameter settings, suggesting a universal structure in LLM internal representations.
+
+## 1 INTRODUCTION
+
+Large Language Models (LLMs) have revolutionized natural language processing by achieving unprecedented performance levels across a wide range of tasks (see Raiaan et al. (2024) for a review). Despite their success, the black-box nature of these models has raised significant concerns about interpretability and transparency (Liao & Vaughan, 2023). Moreover, their large scale demands a considerable amount of computational resources (Samsi et al., 2023; Bai et al., 2024), making it essential to reduce their size without compromising performance (Ma et al., 2023; Gromov et al., 2024; Men et al., 2024).
+
+One strategy for addressing these issues has been to study the models’ internal representations. Early works (Zeiler & Fergus, 2014) demonstrated that visualization techniques can effectively uncover hierarchical representations within convolutional neural networks, highlighting how lower layers focus on edge detection while higher layers correspond to object parts and semantic concepts. Additionally, (Olah et al., 2018) illustrated that analyzing weight matrices and neuron activations can reveal interpretable features and organizational structures within deep networks, providing insights into how complex patterns are encoded and processed.
+
+More recently, geometric studies made progress by introducing concepts like intrinsic dimension to characterize the manifold of internal representations and its evolution across layers (Ansuni et al., 2019; Doimo et al., 2020; Pope et al., 2021). These methods have been successfully applied to transformer models in various works (Valeriani et al., 2023; Tulchinskii et al., 2024; Cheng et al., 2023). One notable achievement of this approach has been to show the emergence of semantic knowledge and abstraction phases in the middle layers of models, rather than at the final layers, as might be intuitively expected. However, these approaches provide only a static view of internal representations and suffer limitations in tracking their changes across layers.
+
+A natural framework to address these limitations and to offer a more comprehensive characterization of the geometry of internal representations of neural networks is Topological Data Analysis (TDA). TDA is a set of unsupervised techniques that offers robust methods to describe the shape and structure of complex datasets. It has seen exponential growth with applications in computational biology
+
+{1}------------------------------------------------
+
+(Mandal et al., 2020), cosmology (Biagetti et al., 2021; Yip et al., 2024), personalized medicine (Skaf & Laubenbacher, 2022), time-dependent data analysis (El-Yaagoubi et al., 2023), and machine learning (Hensel et al., 2021), just to name a few. One prominent tool within TDA is persistent homology, which tracks the birth and death of topological features across different scales, thereby capturing the multiscale behavior of a point cloud. Several studies have proposed persistent homology to investigate neural networks and their internal representations (e.g. Rieck, Bastian Alexander et al. (2023), Naitzat et al. (2020); Lacombe et al. (2021); Magai & Ayzenberg (2022)).
+
+However, in the context of TDA applications, it has not yet been recognized that the internal representations of LLMs can essentially be viewed as dynamic point clouds evolving in time (layers). As pre-trained LLMs process inputs, they transform these point clouds within the representation space layer by layer, capturing essential features and relationships throughout the model’s depth. Thus, it is natural to interpret these transformations as an evolving discrete dynamical system. To address this problem, we exploit a TDA tool developed to characterize time-varying point clouds and temporal networks, known as *zigzag persistence*.
+
+Our approach achieves the following results:
+
+- **ZigZag Framework for LLMs:** We build a framework to characterize the birth and death of topological features across transformer model’s layers. As new contributions in the context of zigzag applications, we introduce the k-Nearest Neighbors-based filtration, and we interpret layers as time snapshots in a dynamic system, tracking the trajectory of features across layers.
+- **Persistence Similarity:** We propose a new topological descriptor to measure which topological features persist across the layers of an LLM. Different than other similarity measures, persistence similarity tracks the entire trajectory of transformations between two layers.
+- **Model Pruning:** As a showcase of our framework, we use persistence similarity as a criterion to prune layers without significantly degrading performance, finding comparable results to state-of-the-art methods.
+- **Similarity of Results Across Models and Hyperparameters:** Our findings show similar results across different models, layers, and choices of hyperparameters of the framework. This suggests a degree of universality in the topological structure of LLM representations.
+
+In summary, our framework presents a novel perspective by combining two fundamental elements: firstly, it provides a fine-grained geometric analysis of the internal representations through TDA; secondly, the zigzag persistence framework tracks the trajectory of topological features across layers. Distinct from traditional methods that solely compare representations at individual layers, our approach captures their entire evolutionary path, providing a richer understanding of how these features evolve and contribute to the model’s decision-making processes.
+
+## 2 RELATED WORK
+
+**Geometry and Topology of Internal Representations.** The manifold hypothesis suggests that high-dimensional data often lies on a lower-dimensional manifold (Goodfellow et al., 2016). The estimation of this approximated manifold, known as intrinsic dimension, changes dynamically in deep networks, expanding and contracting in ways that impact performance (Ansuini et al., 2019), learnability (Pope et al., 2021), and the network’s ability to generate flexible abstract data representations used for downstream tasks (Doimo et al., 2020), (Valeriani et al., 2023). Intrinsic dimension and neighbor composition analysis of internal representations of causal and masked transformer models helped in the localization of semantic information, and to highlight differences between real and artificial data (Valeriani et al., 2023; Tulchinskii et al., 2024; Cheng et al., 2023). Another approach to study the internal representation is to use topological methods of TDA. Studies on Convolutional Neural Networks (CNN) used topological descriptors to explore the shape of activation functions (Rathore et al.) or their relations to performance (Naitzat et al., 2020). Magai & Ayzenberg (2022) introduced persistent homology dimension as an estimator of the intrinsic dimension of internal representations in CNNs, while Barannikov et al. (2022) proposed a measure of similarity based on topological descriptors to compare representations. Betti numbers have been observed to
+
+{2}------------------------------------------------
+
+remain stable across different datasets for the same architectures and to decrease as depth increases (Suresh et al., 2023).
+
+**Zigzag Persistence.** Zigzag persistence was introduced in (Carlsson & de Silva, 2010; Carlsson et al., 2009; Tausz & Carlsson, 2011) as an extension of persistent homology to study the persistence of topological features across sequences of spaces. This approach is particularly useful when data undergo dynamic changes or transformations over time. Since its introduction, zigzag persistence has been applied in various fields, including Hopf bifurcations in dynamical systems (Tymochko et al., 2020), commuting patterns in Great Britain’s transportation network Myers et al. (2023), coral reef ecosystems (McDonald et al., 2023), cell location time series (Yang et al., 2023; Zhang et al., 2023), and honeybee aggregations (Gharooni-Fard et al., 2024). It has also inspired methodological extensions such as multidimensional persistence (Kim & Mémoli, 2021) and the development of formigrams and crocker stacks (Xian et al., 2022).
+
+**Layer Pruning by Similarity in Large Language Models.** Among existing methods to reduce the size of neural networks, layer pruning has gained particular relevance in the context of LLMs. The first applications to BERT models (Fan et al., 2020; Zhang & He, 2020; Fan et al., 2021; Jha et al., 2024) inspired a long series of experiments employing similar techniques (Sajjad et al., 2023; Siddiqui et al., 2024; He et al., 2024; Zhang et al., 2024a; Kim et al., 2024; Zhang et al., 2024b). Many of these efforts base their methodology on similarity measures of internal representations, which have conveniently been summarized in a recent review (Klabunde et al., 2023). In this work, we consider (Gromov et al., 2024), which uses angular similarity, and (Men et al., 2024), which uses Block-Influence similarity, as a reference point for comparison.
+
+## 3 METHOD
+
+In this section, we introduce the zigzag persistence framework, which we use to analyze the internal representations of LLMs pre-trained with an autoregressive loss. These models typically receive an input sequence of $n$ tokens (often representing a sentence) embedded in a $d$ -dimensional space. The input is transformed across the network layers without altering the embedding dimension. Due to the autoregressive nature of these models, the representation of the last token in a sequence captures information about the entire sequence and is used to predict the next. As a result, we choose to focus on the last token representation of each sequence at each layer. Thus, our point cloud is represented by last tokens embeddings, i.e. vectors of the form $\{x_i(\ell_j) \in \mathbb{R}^d, \text{ for } i = 1, \dots, N_{\text{sentences}} \text{ and } j = 1, \dots, N_{\text{layers}}\}$ . These last tokens are extracted from large datasets of text and serve as an observational probe of the manifold we would like to model.
+
+### 3.1 TOPOLOGICAL DATA ANALYSIS AND PERSISTENT HOMOLOGY
+
+Topological data analysis (Edelsbrunner et al., 2002; Zomorodian & Carlsson, 2004) provides a tool for geometrically characterizing highly complex datasets. Within this framework, persistent homology (Carlsson, 2009) is the key methodology to characterize a point cloud on multiple scales at once. Its goal is to identify the range of scales over which a particular class of topological features (connected components, loops, voids, higher dimensional “holes”) remain relevant, or “persistent”, as opposed to “topological noise”, i.e. features disappearing roughly at the same scale they formed. The basic ingredients for this technique are i) a criterion to connect points, forming a *simplicial complex* and ii) a scale parameter $\nu$ (often a coarsening scale) such that given $\nu_1 \leq \nu_2$ , then the two corresponding simplicial complexes are related by $K_{\nu_1} \subseteq K_{\nu_2}$ . The ordered sequence of simplicial complexes for varying scale parameters is called *filtration*. An intuitive example is the Vietoris-Rips filtration, built from complexes parametrized by the radius of the ball drawn around each point of the dataset.
+
+Filtrations can be generalized to a more flexible structure called a *zigzag filtration*. Unlike a standard filtration, a zigzag filtration allows the sequence of complexes to move both forward and backward, meaning that inclusions between complexes can reverse at certain steps. We take this approach in our study to track the evolution of the internal representations *across* layers, rather than at a fixed snapshot, as done in traditional persistent homology implementations. In this sense, our parameter is not a distance/coarsening scale, but a discrete *time* scale represented by the layer number. We track topological features as they are formed and destroyed along the layers of the model and we statisti-
+
+{3}------------------------------------------------
+
+cally characterize these changes to describe a complex series of transformations in high-dimensional space. Differently than standard persistent homology, short- and long-lived features represent how the model dynamically evolves. Short-lived features indicate a high rate of rearrangement of the points $x_i$ between adjacent layers, while long-lived features suggest a phase of retention of (relative) positions in the model. This is a crucial point in our analysis, as it provides a novel tool to geometrically interpret the model’s internal representations. We now outline the main steps of the zigzag algorithm, leaving a rigorous mathematical formulation to Appendix A.
+
+![Figure 1: A schematic representation of the zigzag algorithm. The figure shows a sequence of five diagrams representing internal representations and their persistence. The first three diagrams are labeled 'Layer 1', 'Intersection Layer', and 'Layer 2'. The fourth is 'Intersection Layer' and the fifth is 'Layer 3'. Each diagram shows a set of points (vertices) and edges forming a graph. Below the diagrams, two horizontal bars represent the persistence of 0-cycles (orange) and 1-cycles (purple). The 0-cycle bar shows intervals: [0, 1] in Layer 1, [1, 3] in the first intersection layer, [3, 3] in Layer 2, [3, 3] in the second intersection layer, and [3, 4] in Layer 3. The 1-cycle bar shows intervals: [0, 2] in Layer 1, [2, 3] in the first intersection layer, [3, 3] in Layer 2, [3, 4] in the second intersection layer, and [4, 4] in Layer 3.](7fb5215fd72210a2e4cce6df55550c89_img.jpg)
+
+Figure 1: A schematic representation of the zigzag algorithm. The figure shows a sequence of five diagrams representing internal representations and their persistence. The first three diagrams are labeled 'Layer 1', 'Intersection Layer', and 'Layer 2'. The fourth is 'Intersection Layer' and the fifth is 'Layer 3'. Each diagram shows a set of points (vertices) and edges forming a graph. Below the diagrams, two horizontal bars represent the persistence of 0-cycles (orange) and 1-cycles (purple). The 0-cycle bar shows intervals: [0, 1] in Layer 1, [1, 3] in the first intersection layer, [3, 3] in Layer 2, [3, 3] in the second intersection layer, and [3, 4] in Layer 3. The 1-cycle bar shows intervals: [0, 2] in Layer 1, [2, 3] in the first intersection layer, [3, 3] in Layer 2, [3, 4] in the second intersection layer, and [4, 4] in Layer 3.
+
+Figure 1: A schematic representation of the zigzag algorithm.
+
+### 3.2 THE ZIGZAG ALGORITHM
+
+We aim to study internal representations by tracking statistical changes in the formation of $p$ -dimensional holes, or $p$ -cycles, generated by connecting nearby data points within each layer $\ell_i$ . As introduced above, the first ingredient for a TDA formulation is a criterion for connecting points of the dataset. In this regard, we construct a $k$ -Nearest Neighbors graph $G_{\ell_i} = (V_{\ell_i}, E_{\ell_i})$ at every layer $\ell_i$ , where the number $k_{\text{NN}}$ of neighbors is a fixed hyperparameter (see Le & Taylor (2024) for a previous use of a $k_{\text{NN}}$ -based filtration). To exploit the knowledge that the manifold on which the data lie is typically much smaller than the high-dimensional ambient space, we extend the dimension of the graph by filling higher-dimensional simplices. More precisely, we *fill* a simplex when its boundary, composed of lower-dimensional simplices (such as vertices and edges), is complete. In particular, we consider a triangle as filled when it has three vertices with pairwise connections. Similarly, a tetrahedron is filled when four vertices are all interconnected by edges, totaling six edges. This concept extends to higher dimensions up to a specified maximum dimension $m$ . Thus, in each layer, we construct the simplicial complex $K_{\ell_i}$ defined by:
+
+$$K_{\ell_i} = \bigcup_{S \subseteq V_{\ell_i}} \{S \mid \forall x_s, x_t \in S, (x_s, x_t) \in E_{\ell_i} \text{ and } |S| \leq m + 1\}. \quad (1)$$
+
+To track changes in the network, we compute intersection layers by identifying simplices present simultaneously in both adjacent layers. This allows us to construct a sequence of inclusions between these complexes
+
+$$\begin{array}{ccccccc} K_{\ell_1} & \longleftarrow & K_{\ell_1} \cap K_{\ell_2} & \longrightarrow & K_{\ell_2} & \longleftarrow & \dots \longrightarrow K_{\ell_{L-1}} \longleftarrow K_{\ell_{L-1}} \cap K_{\ell_L} \longrightarrow K_{\ell_L} \end{array} \quad (2)$$
+
+where we define $L \equiv N_{\text{layers}}$ for conciseness. This sequence represents our zigzag filtration, denoted by $\Phi$ . This filtration is the second ingredient needed to define persistent homology. We thus define a notion of *birth* and *death* of $p$ -dimensional topological features, also denoted as $p$ -cycles, with $p = 0, \dots, m - 1$ , being $m$ the maximum dimension at which we expand the graph. Throughout this work, we choose $m = 4$ , which implies that the $p$ -cycles are well defined up to dimension $p = 3$ . These cycles can be thought of as holes in their respective dimension. We can track the persistence
+
+{4}------------------------------------------------
+
+of these cycles as they appear in a given layer when a group of points exhibits a particular proximity and distribution in the complex and disappear at a subsequent layer when some points have moved apart, causing the cycle to vanish. We illustrate the idea in Figure 1. The output of the zigzag algorithm is then a multiset of birth-death pairs $[\text{birth}, \text{death}]^1$ , known as the *persistence diagram*
+
+$$\text{Pers}_p(\Phi) = \left\{ [\text{birth}, \text{death}] \mid \text{birth}, \text{death} \in \{0, \dots, 2N_{\text{layers}} - 1\} \right\}. \quad (3)$$
+
+We thus work with a zigzag filtration naturally indexed by $\{0, 1, 2, \dots, 2N_{\text{layers}} - 1\}$ . Specifically, as shown in the Figure 1, even numbers starting from 0 are assigned to $p$ -cycles that emerge and disappear within the model layers. In contrast, odd numbers are designated for features at the intersection layers. It is important to note that $p$ -cycles are defined as equivalence classes, meaning that a cycle need not maintain the same form at the level of simplices throughout its lifetime. The orange 0-cycle in the figure exemplifies this: in Layer 1, the cycle corresponds to a filled triangle, $\{x_5, x_6, x_7\}$ , but in the intersection layer, it is reduced to the edge $\{x_6, x_7\}$ . In Layer 2 this edge merges with another 0-cycle (depicted in red), marking the death of the orange cycle. A mathematical explanation of this is provided in Appendix A. This feature ensures robustness of our construction to small changes in the $k_{\text{NN}}$ graph. The corresponding algorithm that generates $\text{Pers}_p(\Phi)$ is schematically described below.
+
+#### --- **Algorithm 1** Zigzag algorithm ---
+
+```
+
+Require: model, dataset, kNN, m
+reps $\leftarrow$ extractRepresentations(model, dataset)
+ $K \leftarrow []$
+for $i \leftarrow 1$ to model.getNumLayers() do
+ graph $\leftarrow$ kNearestNeighborsGraph(reps[ $i$ ], $k_{\text{NN}}$ )
+ $K$ .append(graphExpansion(graph, m))
+end for
+ $K_{\text{int}} \leftarrow$ computeIntersectionLayers( $K$ )
+ $f, \text{times} \leftarrow$ computeFiltrationTimes( $K, K_{\text{int}}$ )
+ $\Phi \leftarrow$ FastZigZag( $f, \text{times}$ )
+
+```
+
+---
+
+It exploits two existing public codes that were developed for zigzag computations: DIONYSUS2 (Morozov) and FASTZIGZAG (Dey & Hou, 2022). DIONYSUS2 is a C++ library for computing persistent homology, with a specific library for zigzag persistence. In our case, it has the role of extracting the filtration $f$ and computing the *times* array, i.e. the list of layer indices to be associated with the birth and death of features. FASTZIGZAG allows to calculate efficiently 2 the persistence diagram $\text{Pers}_p(\Phi)$ by converting the input zigzag filtration to a non-zigzag filtration of an equivalent complex with the same length, and it then converts the obtained persistence intervals back to zigzag.
+
+### 3.3 EFFECTIVE PERSISTENCE IMAGE
+
+The pairs generated within $\text{Pers}_p(\Phi)$ are best understood by visualizing them through a *persistence image*, a well-known descriptor within the TDA tools. The persistence image in our case results in a grid of size $(2N_{\text{layers}} - 1) \times (2N_{\text{layers}} - 1)$ , for each homology dimension $p$ . Each pixel in the grid is associated with an integer value corresponding to the number of cycles appearing with that birth-death pair. Defined this way, the persistence image does not discriminate between the model and intersection layers. Their behavior is generally fairly different, and have an alternating structure between model and intersection layers. Hence, persistence images are not *smooth* as a function of layers. To achieve a smoother representation, we introduce *effective persistence images*, obtained by excluding the intersection layers from the construction. This is achieved by defining a map, similar to the approach in (Kim & Mémoli, 2017), that translates the collection of intervals from the zigzag
+
+1The repetition of a pair $[\text{birth}, \text{death}]$ indicates that multiple cycles in dimension $p$ have been created and destroyed in correspondence of the same layers.
+
+2The algorithm performs well even for the relatively large datasets we employ for this analysis: with 10K points embedded in a space with dimension $d = 4096$ , a number of neighbors for the $k_{\text{NN}}$ graph of $k_{\text{NN}} = 10$ , and a maximum homology dimension of $m = 10$ on an AMD EPYC 7H12 it takes approximately 2 hours.
+
+{5}------------------------------------------------
+
+persistence diagram of the filtration in equation 2 into intervals, where the birth and death occur only across model layers. Formally, for $b, d > 0$ , we obtain:
+
+$$\widehat{PI}_p(b/2, d/2) = PI_p(b, d) + PI_p(b - 1, d) + PI_p(b, d - 1) + PI_p(b - 1, d - 1), \quad (4)$$
+
+where $\widehat{PI}_p$ is the effective persistence image for the $p$ -cycles and $b, d$ are model layers indexed by even numbers.3 The collection of $\widehat{PI}_p$ s taken over all $p$ contains all the information output from our zigzag algorithm, and give a useful overview of the model as a whole. On the other hand, they are not easily tractable in a statistical sense and hard to interpret. Indeed, one focus of this work is to look at the fine-grained topological structure of representation space, tracking the persistence of cycles across layers. For this purpose, we develop a suited summary of the effective persistence image in the next section.
+
+### 3.4 PERSISTENCE SIMILARITY
+
+Given two layers $\ell_1, \ell_2$ , we define the *persistence similarity*4 as the fraction of $p$ -cycles in $\ell_1$ that exist in $\ell_2$ as well, and have existed throughout the layers in between. Mathematically it can be expressed as
+
+$$\mathcal{S}_p(\ell_1, \ell_2) = \frac{\sum_{\ell_1 \leq M_1, \ell_2 > M_2} \widehat{PI}_p(\ell_1, \ell_2)}{\beta_p(\ell_1)} \quad (5)$$
+
+$$M_1 = \min(\ell_1, \ell_2); \quad M_2 = \max(\ell_1, \ell_2)$$
+
+where $\beta_p(\ell)$ is the Betti number, i.e. the number of alive $p$ -cycles at layer $\ell$ .5 Given a $p$ -cycle that is alive at a given layer $\ell$ , we can thus define the average probability of finding it alive at any other layer as
+
+$$\bar{\mathcal{S}}_p(\ell) = \frac{1}{N_{\text{layers}}} \sum_{\ell_i=1}^{N_{\text{layers}}} \mathcal{S}_p(\ell, \ell_i), \quad (6)$$
+
+which indicates the degree of “mobility” of the system at a given layer, i.e. overall retention of cycles in each model layer. Thus, a low value of $\bar{\mathcal{S}}_p$ represents a phase during which internal representations are undergoing major topological changes, causing points of the dataset to change relative positions abruptly. For high values, the inverse is true, i.e. the relations among points are relatively stationary. It is worth noting that traditional measures of similarity between layers typically depend solely on their current state, namely the activation matrices on the set of data. In contrast, our method considers the trajectory from $\ell_1$ to $\ell_2$ , implying that persistence similarity does not just depend on the initial and final states but also on the path between them.
+
+## 4 EXPERIMENTS
+
+### 4.1 MODELS, DATASETS AND BENCHMARKS
+
+We work with 4 models: Llama2 (Touvron et al., 2023), Llama3 (AI@Meta, 2024), Mistral (Jiang et al., 2023) and Pythia 6.9b (Biderman et al., 2023). These models are open-source decoder-only transformers, and they achieve high performance in the benchmarks we consider in this work. Llama2-7B, Llama3-8B, Mistral 7B, and Pythia 6.9b have 32 hidden layers, Llama2-13B has 40 hidden layers, and both Llama2-70b and Llama3-70b have 80 hidden layers.
+
+For our purposes, the input dataset from which we take internal representations must provide a fair test of how the model processes and understands language. An extensive and accessible corpus is the Pile dataset (Gao et al., 2020), which combines 22 datasets over a wide range of topics and
+
+3Note that this operation does not modify the information about the model layers contained in the original $Pers_p(\Phi)$ , as it redefines consistently all the births and deaths.
+
+4We note that the terminology “persistence similarity” has been used in previous literature in a different context and application Xia (2018). We thank a reviewer for providing us with this reference.
+
+5Note that equation 5 is well-defined only when $\beta_p(\ell) > 0$ . If there are no $p$ -cycles at either $\ell_1$ or $\ell_2$ , $\mathcal{S}_p(\ell_1, \ell_2)$ should be 0 by definition. We omitted this limit case from equation 5 for readability.
+
+{6}------------------------------------------------
+
+
+
+The figure consists of two side-by-side density plots. The left plot is titled '1-cycles' and has a legend indicating $k_{\text{NN}} = 5$ . The right plot is titled '2-cycles' and has a legend indicating $k_{\text{NN}} = 15$ . Both plots have 'Birth Layer ( $l_{\text{birth}}$ )' on the x-axis (ranging from 0 to 30) and 'Persistence ( $l_{\text{death}} - l_{\text{birth}}$ )' on the y-axis (ranging from 0 to 30). A colorbar on the right of each plot indicates the 'Log10 number of p-cycles', with the left plot ranging from 0.0 to 4.0 and the right plot ranging from 0.0 to 3.0. The plots show a dense region of points, with the left plot showing a more concentrated triangular shape and the right plot showing a more spread-out distribution.
+
+Figure 2: Two density plots showing persistence for the Llama 3 8B model using the SST dataset. The left panel is for 1-cycles with k\_NN = 5, and the right panel is for 2-cycles with k\_NN = 15. Both plots show persistence (l\_death - l\_birth) on the y-axis and birth layer (l\_birth) on the x-axis. The colorbar indicates the log10 number of cycles.
+
+Figure 2: Effective persistence image for the Llama 3 8B model using the SST dataset. We show 1-cycles (Left Panel) and 2-cycles (Right panel). The corresponding $k_{\text{NN}}$ graph is constructed with $k_{\text{NN}} = 5$ and $k_{\text{NN}} = 15$ , respectively. The density plot shows the amount of cycles (colorbar) for a given birth-persistence pair (x- and y-axis), where values refer to the model layer.
+
+structures. For computational reasons, we take the Pile-10k subset, accessible on HuggingFace.6 For completeness, we also consider the Stanford Sentiment Treebank (SST) dataset (Socher et al., 2013). From these datasets, each prompt is processed so that the last token is extracted at each normalization layer and the final normalization applied to the output layer.
+
+We use 3 benchmarks for layer pruning performance evaluation: MMLU (Hendrycks et al., 2021), HellaSwag (Zellers et al., 2019), and Winogrande (Sakaguchi et al., 2019), which have been widely used for similar purposes in previous analyses. The benchmarks are evaluated for the models with the use of the library lm-eval-harness by (Gao et al., 2024) with a 5-shot setup.
+
+### 4.2 ZIGZAG PERSISTENCE APPLIED TO LLM MODELS
+
+**Effective Persistence Image.** We generate an effective persistence image for each model using the two datasets, each homology dimension up to $p = 3$ , and for a range of values of $k_{\text{NN}} \in [1, 15]$ . We show an example of this effective persistent image in Figure 2 for the Llama 3 8B model for the SST dataset for 1- and 2- cycles for $k_{\text{NN}} = 5$ and $k_{\text{NN}} = 15$ , respectively.7 The choice of the hyperparameter $k_{\text{NN}}$ is done so as to maximize the total number of cycles. The x-axis represents the layer at which a $p$ -cycle is born, and the y-axis represents persistence, i.e. death layer - birth layer. The colorbar measures the amount of $p$ -cycles on a given grid point. As expected, a large number of cycles are very short lived, i.e. the grid points at persistence equal unity. On the other hand, we observe that persistence is typically higher for $p$ -cycles born after the first half of the model’s depth, a feature that is visually evident on the right panel of Figure 2, representing 2-cycles, but observed across all models and dimensions, especially for 1-cycles. A fraction of these cycles have maximal persistence, i.e. they survive until the last layer.
+
+In computing $\widehat{PI}_{p,s}$ across models, dimensions and $k_{\text{NN}}$ values, we observe that 0- and 3-cycles are relatively low in number, while 1- and 2-cycles are higher, reaching tens of thousands of cycles per layer. This behaviour might be expected for a $k_{\text{NN}}$ -graph based construction, since connections are dense even for low values of $k_{\text{NN}}$ , especially if points are concentrated in low dimensional regions of the representation space. We examine this behavior in detail to make sure that our construction is stable for different choices on the $k_{\text{NN}}$ graph, see Appendix B for details.
+
+The $\widehat{PI}_{p,s}$ from Figure 2 are suggestive of important features in the topology of internal representations, which we look at in more detail using persistence similarity. Given the prevalence of 1-cycles across various models, layers, and choices of $k_{\text{NN}}$ , we concentrate on these features in the following discussion.
+
+**Persistence similarity.** We can visualize persistence similarity, as defined in equation 5, $S_1(\ell_1, \ell_2)$ as a density plot, shown in Figure 3 for Llama 3 of two different sizes (8B and 70B) and the SST
+
+6
+
+7The reason for using the SST dataset, instead of Pile, is that the 70B models are computationally expensive for the latter. We show that results are in agreement between the two models in Appendix C.
+
+{7}------------------------------------------------
+
+
+
+Figure 3: Persistence similarity of 1-cycles for Llama 3 8B and 70B models. The left plot for Llama 3 8B shows a grid of persistence similarity values between layers l\_i and l\_j, with a color bar indicating similarity from 0.0 to 1.0. The right plot for Llama 3 70B shows a similar grid. Both plots show a diagonal line of high similarity (dark blue) and a region of high similarity (dark blue) in the lower-left triangle, indicating that persistence similarity is generally higher for earlier layers.
+
+Figure 3: Persistence similarity of 1-cycles as defined in equation 5 for Llama 3 of two different sizes (8B and 70B) and the SST dataset. For both models we fix $k_{\text{NN}} = 5$ . A given pixel of the grid represents similarity computed between two layers. Darker regions indicate higher similarity.
+
+dataset, with corresponding plots for Pile for the 8B shown in Appendix C. Again, we choose $k_{\text{NN}} = 5$ although results are similar within the $k_{\text{NN}} \in [1, 15]$ range. In these plots, darker regions indicate a higher fraction of $p$ -cycles alive between two given layers. Note that the plot is not symmetric by definition (cfr. equation 5) meaning that at a given layer, the fraction of cycles alive at an earlier layer might be different than the ones alive at a later layer. Nevertheless, $S_p$ is approximately symmetric. Both models clearly show a high degree of similarity roughly midway through the depth, until before the last few layers. This is in agreement with what observed in the $\overline{PI}_p$ , which suggested that a $p$ -cycle born after the first half of the model is likely to survive until the last layer. We now compute
+
+
+
+Figure 4: Average Similarity as a function of model depth. The left panel shows Average Similarity (S\_1(f)) vs Model Layer (l) for Llama 3 8B with varying k\_NN values (2, 5, 8, 11, 15). The right panel shows Average Similarity (S\_1(f)) vs Model Depth (l/N\_layers) for various models (Llama 2 7B, Llama 2 13B, Llama 2 70B, Llama 3 8B, Llama 3 70B, Mistral 7B, Pythia 6.9B) with a fixed k\_NN = 5. Both plots show a peak in average similarity around the middle of the model depth.
+
+Figure 4: Average Similarity as a function of model depth, computed for Llama 3 8B and varying $k_{\text{NN}}$ parameter (Left Panel) and at fixed $k_{\text{NN}} = 5$ parameter and varying models (Right Panel).
+
+the average similarity, i.e. the average over the column of persistence similarity (cfr. equation 6), $\overline{S}_p$ both at fixed model and varying $k_{\text{NN}}$ parameter, and at fixed $k_{\text{NN}}$ parameter and varying model, as a function of the model’s depth. Results are shown in the Left and Right Panels of Figure 4, respectively. Based on the Left Panel, we choose $k_{\text{NN}} = 5$ as representative value for the Right Panel, given that it gives the highest values of $\overline{S}_1$ . Remarkably, $\overline{S}_1$ peaks at the same relative depth for a wide variety of models, while the parameter $k_{\text{NN}}$ only changes the normalization of the curve.
+
+Overall, we can identify three distinct phases:
+
+- **An increasing phase**, lasting from early to middle layers. During this phase, the rate of increase of similarity is constant, and seemingly universal, i.e. it does not depend on the nature of the model, its size and very weakly on the dataset used (cfr. Figure 7 (right panel) in the Appendix C). It does depend on the underlying filtration (cfr. Figure 4 (left)).8 The positive rate of increase suggests that the average persistence of cycles is growing, indicating that transformer architectures are gradually retaining more and more features from the dataset;
+- **A plateau phase**, during which average similarity saturates to a global maximum;
+- **A decreasing phase**, in the last few layers of the model. During this phase, features are progressively destroyed and are increasingly unlikely to persist long.
+
+8We have verified that for different values of $k_{\text{NN}}$ , the universality of the increase across models is conserved.
+
+{8}------------------------------------------------
+
+We deserve a more detailed analysis of these phases and their implications for model behavior for Appendix D.
+
+### 4.3 LAYER PRUNING BY PERSISTENCE SIMILARITY
+
+Recently, measures of layer similarity have been used to identify layers that contribute minimally to the performance of LLMs. These layers can be pruned, and the performance re-evaluated to validate this assumption. Since persistence similarity tracks changes across layers, it can be leveraged for layer pruning by selecting layers that retain the most cycles. Consequently, we establish a pruning criterion based on average persistence similarity $\bar{S}_1$ computed now on the Pile dataset. Specifically, we prune layers that lie within 10% and 20% of the maximum $\bar{S}_1$ , corresponding to conservative and aggressive pruning, respectively. Here is a schematic summary of the algorithm.
+
+#### Algorithm 2 Pruning algorithm
+
+```
+
+Require: $\bar{S}_1$ , model, threshold,
+ $max \leftarrow \max(\bar{S}_1)$
+ $layersToRemove \leftarrow []$
+for $l \leftarrow 1$ to $model.getNumLayers()$ do
+ if $\bar{S}_1[l] > max * threshold$ then
+ $layersToRemove.append(l)$
+ end if
+end for
+ $model.removeLayers(layersToRemove)$
+
+```
+
+The algorithm outputs how many and which layers have high degree of persistence similarity. We now cut those layers and measure performance using the benchmarks introduced in Section 4 and across models considered in this work.
+
+We compare to layer pruning methods based on state of the art measures of similarity, namely (Gromov et al., 2024) and (Men et al., 2024). Both approaches are designed to take as input the desired number of layers to prune $N_{prune}$ and measure performance as $N_{prune}$ grows. For a fair comparison, we feed the number of layers cut by our method as an input to the other two methods, and verify which layers they select to cut given this input, and the corresponding performance. We show a schematic diagram of the layers cut with our method (Bottom Row) and the other two methods (Upper Row) in Figure 5. Interestingly, both considered methods from (Gromov et al., 2024) and (Men et al., 2024) give the same result at fixed $N_{prune}$ , thus we refer to them simply as “other works”.
+
+
+
+| Model | Method | 20% cut (Yellow) | 10% cut (Orange) |
+|-|-|-|-|
+| Llama 2 7B | other methods | ~25 | ~15 |
+| | this work | ~25 | ~15 |
+| Llama 2 13B | other methods | ~35 | ~25 |
+| | this work | ~35 | ~25 |
+| Llama 3 8B | other methods | ~20 | ~15 |
+| | this work | ~25 | ~15 |
+| Mistral 7B | other methods | ~20 | ~15 |
+| | this work | ~20 | ~15 |
+| Pythia | other methods | ~25 | ~15 |
+| | this work | ~25 | ~15 |
+
+Figure 5: Pruned layers across models based on persistence similarity (Bottom Row) and other methods from (Gromov et al., 2024; Men et al., 2024). The figure shows five bar charts for Llama 2 7B, Llama 2 13B, Llama 3 8B, Mistral 7B, and Pythia. Each chart compares 'other methods' (top row) and 'this work' (bottom row) for 20% cut (yellow) and 10% cut (orange). The x-axis represents the number of layers pruned.
+
+Figure 5: Pruned layers across models based on persistence similarity (Bottom Row) and other methods from (Gromov et al., 2024; Men et al., 2024). Since both these two methods give the same results, we generically call them “other works”. The number of layers pruned for all methods is defined by cutting layers that are within 10% (orange) and 20% (yellow) of the maximum average similarity, $\bar{S}_1$ .
+
+The 10% pruning is rather stable across methods, with small variations. The more aggressive cut of 20% generates more discrepancies, especially for Llama 3 8B, where both methods from (Gromov et al., 2024) and (Men et al., 2024) prefer to cut earlier layers.
+
+{9}------------------------------------------------
+
+| Models | MMLU | | | HellaSwag | | | Winogrande | | |
+|-|-|-|-|-|-|-|-|-|-|
+| | Full | This work | Other works | Full | This work | Other works | Full | This work | Other works |
+| Llama 2 7B | 45.74 | 37.38
(39.32) | 43.95
(34.35) | 58.54 | 44.71
(32.10) | 42.78
(35.10) | 74.43 | 68.67
(59.67) | 67.72
(62.67) |
+| Llama 2 13B | 54.60 | 50.16
(36.45) | 50.71
(37.91) | 61.43 | 48.60
(34.35) | 47.84
(34.52) | 76.72 | 71.67
(63.21) | 73.15
(61.47) |
+| Llama 3 8B | 65.07 | 53.44
(23.16) | 53.44
(24.33) | 61.37 | 41.60
(29.69) | 41.60
(27.10) | 77.10 | 70.00
(59.75) | 70.00
(50.58) |
+| Mistral 7B | 62.40 | 53.17
(24.26) | 38.20
(37.86) | 62.83 | 36.67
(26.26) | 34.45
(28.10) | 77.35 | 66.50
(57.76) | 63.76
(55.96) |
+| Pythia | - | - | - | 49.70 | 31.43
(31.23) | 34.96
(26.84) | 63.30 | 55.71
(54.84) | 58.09
(51.07) |
+
+Table 1: **Benchmark Table.** For each benchmark we show three columns: (i) *Full*, represents the accuracy of the model without any layer pruned. (ii) *This work*, accuracy of the model with two different cuts, at 10% and 20%, where layers are pruned following the algorithm 2). The results are in the form 10% cut (20% cut) (iii) *Other works*, accuracy obtained by considering the same amount of layer pruned estimated with our method and then computing the layer to be pruned with two different similarity measures: angular distance from (Gromov et al., 2024) and Bi-score from (Men et al., 2024). The chosen layers turn out to be the same for the two methods, so the results are condensed in one column, and they are then represented in the format *first-block-cut(second-block-cut)*.
+
+We now show performance results in Table 1,9 where in bold we indicate the layer pruning method that has better or equal performance with respect to the other method. Despite often selecting different layers, our topology-based pruning strategy achieves comparable results to methods from (Gromov et al., 2024) and (Men et al., 2024). We further test how much performance changes with pruning layers at different model’s depths in Appendix D.
+
+## 5 CONCLUSIONS
+
+In this study, we present an innovative framework that utilizes zigzag persistence, a tool from Topological Data Analysis (TDA), to examine the internal representations of Large Language Models (LLMs). By employing various datasets as observational probes of the manifold on which the model functions, we aim to offer an interpretable depiction of changes in position and relationships across layers. A distinguishing feature of our framework is its ability to trace the emergence and disappearance of topological features as they evolve across layers. This approach effectively models the transformer architecture as an evolving dynamic system, setting it apart from previous research. With this algorithm, we introduce a new topological descriptor, persistence similarity, which statically models rearrangements of points in representation space, and the rate of these changes, across layers. As a showcase experiment, we prune layers by identifying the ones with highest similarity and verify that this operation does not significantly compromise performance, yielding results comparable to state-of-the-art methods. Persistence similarity shows stability under models, datasets, and hyperparameters changes suggesting a universal topological structure in LLM representations.
+
+There are several limitations in our study that future research could address. First, while our method shows robustness across hyperparameters within the framework, these choices need not be optimal. Defining an appropriate criterion for connecting points in the representation space, and consequently, a filtration, is a delicate task in TDA that could require further investigations to detail the impact of the various choices on the construction of the filtration. The information content of persistence similarity on internal representations and model behavior has not been investigated in detail (but see a few experiments in Appendix D) and it certainly deserves further investigation. Lastly, our study primarily focuses on static, pre-trained models. Extending this framework to track the evolution of internal representations during training would require computational optimization of the algorithm but could provide useful insights on model efficiency and behavior.
+
+9Results for Pythia on MMLU tasks are not shown because the model is not designed for following the format of the tasks, as shown in (Biderman et al., 2023).
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/QFO1asgas2.txt b/papers/QFO1asgas2.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a070ca1573377e133004a5d0fa8588879a80f484
--- /dev/null
+++ b/papers/QFO1asgas2.txt
@@ -0,0 +1,290 @@
+**Primary Area:** reinforcement learning
+
+
+
+{0}------------------------------------------------
+
+# ADVANTAGE ALIGNMENT ALGORITHMS
+
+Juan Duque\*, Milad Aghajohari\*, Tim Cooijmans, Razvan Ciucă, Tianyu Zhang,
+Gauthier Gidel, Aaron Courville
+University of Montreal & Mila
+firstname.lastname@umontreal.ca
+
+## ABSTRACT
+
+Artificially intelligent agents are increasingly being integrated into human decision-making: from large language model (LLM) assistants to autonomous vehicles. These systems often optimize their individual objective, leading to conflicts, particularly in general-sum games where naive reinforcement learning agents empirically converge to Pareto-suboptimal Nash equilibria. To address this issue, opponent shaping has emerged as a paradigm for finding socially beneficial equilibria in general-sum games. In this work, we introduce Advantage Alignment, a family of algorithms derived from first principles that perform opponent shaping efficiently and intuitively. We achieve this by aligning the advantages of interacting agents, increasing the probability of mutually beneficial actions when their interaction has been positive. We prove that existing opponent shaping methods implicitly perform Advantage Alignment. Compared to these methods, Advantage Alignment simplifies the mathematical formulation of opponent shaping, reduces the computational burden and extends to continuous action domains. We demonstrate the effectiveness of our algorithms across a range of social dilemmas, achieving state-of-the-art cooperation and robustness against exploitation.
+
+## 1 INTRODUCTION
+
+Recent advancements in artificial intelligence, such as language models like GPT (Radford et al., 2018), image synthesis with diffusion models (Ho et al., 2020), and generalist agents like Gato (Reed et al., 2022), suggest a future where AI systems seamlessly integrate into everyday human decision-making. While these systems often optimize for the goals of their individual users, this can lead to conflicts, especially in tasks that involve both cooperative and competitive elements. *Social dilemmas*, as introduced by Rapoport and Chammah (1965), describe scenarios where agents acting selfishly achieve worse outcomes than if they had cooperated. A global example is the climate change problem, where individual and national interests in economic growth often clash with the need for collective action to reduce carbon emissions and mitigate environmental degradation. The challenges we have faced in tackling this problem highlight the complexity of aligning individual interests with collective well-being.
+
+As artificially intelligent systems become ubiquitous, there is a pressing need to develop methods that enable agents to autonomously align their interests with one another. Despite this, the deep reinforcement learning community has traditionally focused on fully cooperative or fully competitive settings, often neglecting the nuances of social dilemmas. Sandholm and Crites (1996) empirically demonstrated that naive reinforcement learning algorithms tend to converge to the worst Pareto sub-optimal Nash equilibria of Always Defect in social dilemmas like the Iterated Prisoner’s Dilemma (IPD). Foerster et al. (2018b), demonstrated that the same is true for policy gradient methods, and introduced *opponent shaping* (LOLA) to address this gap.
+
+LOLA is an opponent shaping algorithm that influences the behavior of other agents by assuming they are naive learners and taking gradients with respect to simulated parameter updates. Following this approach, other opponent shaping algorithms that compute gradients with respect to simulated parameter updates have shown success in partially competitive tasks, including SOS (Letcher et al., 2021), COLA (Willi et al., 2022), and POLA (Zhao et al., 2022). More recently, LOQA (Aghajohari et al., 2024b) proposed an alternative form of opponent shaping by assuming control over the value function of other agents via REINFORCE estimators (Williams, 1992). This new approach to
+
+{1}------------------------------------------------
+
+opponent shaping offers significant computational advantages over previous methods and lays the foundation for our work.
+
+We introduce *Advantage Alignment*, a family of algorithms designed to shape rational opponents by aligning their advantages when their historic interactions have been positive. We make two key assumptions about reinforcement learning agents: (1) they aim to maximize their own expected return, and (2) they take actions proportionally to this expected return. Under these assumptions, we demonstrate that opponent shaping reduces to aligning the advantages of different players and increasing the log probability of an action proportionally to their alignment. We show that this mechanism lies at the heart of existing opponent shaping algorithms, including LOLA and LOQA. By distilling this objective, Advantage Alignment agents can shape opponents without relying on imagined parameter updates (as in LOLA and SOS) or stochastic gradient estimation that relies on automatic differentiation introduced in DiCE (Foerster et al., 2018a) (as in POLA, COLA, and LOQA). Furthermore, we demonstrate that Advantage Alignment preserves Nash Equilibria, ensuring that our algorithms maintain stable strategic outcomes.
+
+We also introduce *Proximal Advantage Alignment*, which formulates Advantage Alignment as a modification to the advantage function used in policy gradient updates. By integrating this modified advantage into the Proximal Policy Optimization (PPO) (Schulman et al., 2017b) surrogate objective, we develop a scalable and efficient opponent shaping algorithm suitable for more complex environments. To identify and overcome challenges that arise from scale—which are often overlooked in simpler settings like the Iterated Prisoner’s Dilemma (Rapoport and Chammah, 1965) and the Coin Game (Forster et al., 2018b)—we apply Advantage Alignment to a continuous variant of the Negotiation Game (Cao et al., 2018) and Melting Pot’s Commons Harvest Open (Agapiou et al., 2023). In doing so, we aim to demonstrate the scalability of our methods and offer insights and solutions applicable to complex, real-world agent interactions.
+
+Our key contributions are:
+
+- We introduce Advantage Alignment and Proximal Advantage Alignment (PAA), two opponent shaping algorithms derived from first principles and based on policy gradient estimators.
+- We prove that LOLA (and its variations) and LOQA implicitly perform Advantage Alignment through different mechanisms.
+- We extend REINFORCE-based opponent shaping to continuous action environments and achieve state-of-the-art results in a continuous action variant of the Negotiation Game (Cao et al., 2018).
+- We apply PAA to the Commons Harvest Open environment in Melting Pot 2.0 (Agapiou et al., 2023), a high dimensional version of the *tragedy of the commons* social dilemma, achieving state-of-the-art results and showcasing the scalability and effectiveness of our methods.
+
+## 2 BACKGROUND
+
+### 2.1 SOCIAL DILEMMAS
+
+Social dilemmas describe situations in which selfish behavior leads to sub-optimal collective outcomes. Such dilemmas are often formalized as normal form games and constitute a subset of general-sum games. A classical example of a social dilemma is the Iterated Prisoner’s Dilemma (IPD) (Rapoport and Chammah, 1965), in which two players can choose one of two actions: cooperate or defect. In the one-step version of the game, the dilemma occurs because defecting is a *dominant* strategy, i.e., independently of what the opponent plays the agent is better off playing defect. However, by the reward structure of the game, both the agent and the opponent would achieve a higher utility if they played cooperate simultaneously. Beyond the IPD, other social dilemmas have been extensively studied in the literature, including the Chicken Game and the Coin Game (Lerer and Peshkavich, 2018), the latter of which has a similar reward structure to IPD but takes place in a grid world. In this paper we introduce a variation of the Negotiation Game (also known as the Exchange Game) (DeVault et al., 2015; Lewis et al., 2017), with a strong social dilemma component. Additionally, we evaluate our method on the Commons Harvest Open environment in Melting Pot 2.0 (Agapiou et al., 2023), which exemplifies a large-scale social dilemma. In this environment, agents must balance short-term personal gains from overharvesting common resources against the long-term collective benefit of sustainable use.
+
+{2}------------------------------------------------
+
+### 2.2 MARKOV GAMES
+
+In this work, we consider fully observable, general sum, $n$ -player Markov Games (Shapley, 1953) which are represented by a tuple: $\mathcal{M} = (N, \mathcal{S}, \mathcal{A}, P, \mathcal{R}, \gamma)$ . Here $\mathcal{S}$ is the state space, $\mathcal{A} := \mathcal{A}^1 \times \dots \times \mathcal{A}^n$ , is the joint action space for all players, $P : \mathcal{S} \times \mathcal{A} \rightarrow \Delta(\mathcal{S})$ maps from every state and joint action to a probability distribution over states, $\mathcal{R} = \{r^1, \dots, r^n\}$ is the set of reward functions where each $r^i : \mathcal{S} \times \mathcal{A} \rightarrow \mathbb{R}$ maps every state and joint action to a scalar return and $\gamma \in [0, 1]$ is the discount factor.
+
+### 2.3 REINFORCEMENT LEARNING
+
+Consider two agents playing a Markov Game, 1 (agent) and 2 (opponent), with policies $\pi^1$ and $\pi^2$ , parameterized by $\theta_1$ and $\theta_2$ respectively. We follow the notation of Agarwal et al. (2021), let $\tau$ denote a trajectory with initial state distribution $\mu$ and (unconditional) distribution given by:
+
+$$Pr_{\mu}^{\pi^1, \pi^2}(\tau) = \mu(s_0)\pi^1(a_0|s_0)\pi^2(b_0|s_0)P(s_1|s_0, a_0, b_0)\dots \quad (1)$$
+
+Where $P(\cdot|s, a, b)$ , often referred as the transition dynamics, is a probability distribution over the next states conditioned on the current state being $s$ , agent taking action $a$ and opponent taking action $b$ . Value-based methods like Q-learning (Watkins and Dayan, 1992) and SARSA (Rummery and Niranjan, 1994) learn an estimate of the discounted reward using the Bellman equation:
+
+$$Q^1(s_t, a_t, b_t) = r^1(s_t, a_t, b_t) + \gamma \cdot \mathbb{E}_{s_{t+1}} [V^1(s_{t+1})|s_t, a_t, b_t]. \quad (2)$$
+
+In policy optimization, both players aim to maximize their expected discounted return by performing gradient ascent with a REINFORCE estimator (Williams, 1992) of the form:
+
+$$\nabla_{\theta_1} V^1(\mu) = \mathbb{E}_{\tau \sim Pr_{\mu}^{\pi^1, \pi^2}} \left[ \sum_{t=0}^{\infty} \gamma^t A^1(s_t, a_t, b_t) \nabla_{\theta_1} \log \pi^1(a_t|s_t) \right]. \quad (3)$$
+
+Here $A^1(s, a, b) := Q^1(s, a, b) - V^1(s)$ denotes the advantage of the agent taking action $a$ in state $s$ while the opponent takes action $b$ .
+
+## 3 OPPONENT SHAPING
+
+Opponent shaping, first introduced in LOLA (Foerster et al., 2018b), is a paradigm that assumes the learning dynamics of other players can be controlled via some mechanism to incentivize desired behaviors. LOLA and its variants assume that the opponent is a naive learner, i.e. an agent that performs gradient ascent on their value function, and differentiate through an imagined naive update of the opponent in order to shape it.
+
+LOQA (Aghajohari et al., 2024b) performs opponent shaping by controlling the Q-values of the opponent for different actions assuming that the opponent's policy is a softmax over these Q-values:
+
+$$\hat{\pi}^2(b_t|s_t) := \frac{\exp Q^2(s_t, b_t)}{\sum_b \exp Q^2(s_t, b)}, \quad (4)$$
+
+where $Q^2(s_t, b_t) := \mathbb{E}_{a \sim \pi^1} [Q^2(s_t, a, b_t)]$ . The key idea is that these Q-values depend on $\pi^1$ , and hence the opponent policy $\hat{\pi}^2$ can be differentiated w.r.t. $\theta_1$ :1
+
+$$\nabla_{\theta_1} \hat{\pi}^2(b_t|s_t) = \hat{\pi}^2(b_t|s_t) \left( \nabla_{\theta_1} Q^2(s_t, b_t) - \sum_b \hat{\pi}^2(b|s_t) \nabla_{\theta_1} Q^2(s_t, b) \right). \quad (5)$$
+
+This dependency of $\pi^2$ on $\theta_1$ leads to the emergence of an extra term in the policy gradient:
+
+$$\nabla_{\theta_1} V^1(\mu) = \mathbb{E}_{\tau \sim Pr_{\mu}^{\pi^1, \pi^2}} \left[ \sum_{t=0}^{\infty} \gamma^t A^1(s_t, a_t, b_t) \underbrace{\left( \nabla_{\theta_1} \log \pi^1(a_t|s_t) + \nabla_{\theta_1} \log \hat{\pi}^2(b_t|s_t) \right)}_{\substack{\text{policy gradient term} \\ \text{opponent shaping term}}} \right]. \quad (6)$$
+
+Aghajohari et al. (2024b) demonstrate an effective way to account for this dependency using REINFORCE. The present work builds on the ideas of LOQA, but reduces opponent shaping to its bare components to derive Advantage Alignment from first principles.
+
+1See Appendix A.3 for a derivation of this expression.
+
+{3}------------------------------------------------
+
+#### **Algorithm 1** Advantage Alignment
+
+---
+
+**Initialize:** Discount factor $\gamma$ , agent Q-value parameters $\phi^1$ , t Q-value parameters $\phi_t^1$ , actor parameters $\theta^1$ , opponent Q-value parameters $\phi^2$ , t Q-value parameters $\phi_t^2$ , actor parameters $\theta^2$
+**for** iteration= 1, 2, ... **do**
+ Run policies $\pi^1$ and $\pi^2$ for $T$ timesteps in environment and collect trajectory $\tau$
+ Compute agent critic loss $L_C^1$ using the TD error with $r^1$ and $V^1$
+ Compute opponent critic loss $L_C^2$ using the TD error with $r^2$ and $V^2$
+ Optimize $L_C^1$ w.r.t. $\phi^1$ and $L_C^2$ w.r.t. $\phi^2$ with optimizer of choice
+ Compute generalized advantage estimates $\{A_1^1, \dots, A_T^1\}$ , $\{A_1^2, \dots, A_T^2\}$
+ Compute agent actor loss, $L_a^1$ , summing equation 3 and equation 8
+ Compute opponent actor loss, $L_a^2$ , summing equation 3 and equation 8
+ Optimize $L_a^1$ w.r.t. $\theta^1$ and $L_a^2$ w.r.t. $\theta^2$ with optimizer of choice
+
+---
+
+## 4 ADVANTAGE ALIGNMENT
+
+### 4.1 METHOD DESCRIPTION
+
+Motivated by the goal of scaling opponent shaping algorithms to more diverse and complex scenarios, we derive a simple and intuitive objective for efficient opponent shaping. We begin from the assumptions that agents are learning to maximize their expected return, and will behave in a fashion that is proportional to this goal:
+
+**Assumption 1.** *Each agent $i$ learns to maximize their value function: $\max V^i(\mu)$ .*
+
+**Assumption 2.** *Each opponent $i$ acts proportionally to the exponent of their action-value function: $\pi^i(a|s) \propto \exp(\beta \cdot Q^i(s, a))$ .*
+
+Using Equation 6 and substituting $\hat{\pi}^2$ in place of $\pi^2$ (per Assumption 2), we obtain:
+
+$$\nabla_{\theta_1} V^1(\mu) = \mathbb{E}_{\tau \sim \mathcal{P}_{\mu}^{\pi^1, \pi^2}} \left[ \sum_{t=0}^{\infty} \gamma^t A^1(s_t, a_t, b_t) \left( \nabla_{\theta_1} \log \pi^1(a_t|s_t) + \nabla_{\theta_1} \log \hat{\pi}^2(b_t|s_t) \right) \right].$$
+
+The first term is the usual policy gradient. The second term is the opponent shaping term and will be our focus. Approximating the opponent's policy (right hand side of equation 4) by ignoring the contribution due to the partition function, the opponent shaping term becomes:
+
+$$\beta \cdot \mathbb{E}_{\tau \sim \mathcal{P}_{\mu}^{\pi^1, \pi^2}} \left[ \sum_{t=0}^{\infty} \gamma^t A^1(s_t, a_t, b_t) \nabla_{\theta^1} Q^2(s_t, b_t) \right]. \quad (7)$$
+
+The gradient of the Q-value can be estimated by a REINFORCE estimator, which leads to a nested expectation. Agahjohari et al. (2024b) empirically showed that this nested expectation can be efficiently estimated from a single trajectory. We take the same approach (see Appendix A.1) to obtain:
+
+$$\beta \cdot \mathbb{E}_{\tau \sim \mathcal{P}_{\mu}^{\pi^1, \pi^2}} \left[ \sum_{t=0}^{\infty} \gamma^{t+1} \left( \sum_{k < t} \gamma^{t-k} A^1(s_k, a_k, b_k) \right) A^2(s_t, a_t, b_t) \nabla_{\theta^1} \log \pi^1(a_t|s_t) \right]. \quad (8)$$
+
+The expression above captures the essence of opponent shaping: an agent should align its advantages with those of its opponent in order to steer towards trajectories that are mutually beneficial. More precisely, an agent increases the probability of actions that have high product between the sum of its past advantages and the advantages of the opponent at the current time step. For implementation details of the Advantage Alignment formula see Appendix A.6. Equation 8 depends only on the log probabilities of the agent, which allows us to create a proximal surrogate objective that closely follows the PPO (Schulman et al., 2017b) formulation:
+
+$$\mathbb{E}_{\tau \sim \mathcal{P}_{\mu}^{\pi^1, \pi^2}} \left[ \min \{r_n(\theta_1) A^*(s_t, a_t, b_t), \text{clip}(r_n(\theta_1); 1 - \epsilon, 1 + \epsilon) A^*(s_t, a_t, b_t)\} \right], \quad (9)$$
+
+where $r_n$ denotes the ratio of the policy (new) after $n$ updates of the original policy (old), and:
+
+$$A^*(s_t, a_t, b_t) = \left( A^1(s_t, a_t, b_t) + \beta \gamma \cdot \left( \sum_{k < t} \gamma^{t-k} A^1(s_k, a_k, b_k) \right) A^2(s_t, a_t, b_t) \right). \quad (10)$$
+
+{4}------------------------------------------------
+
+
+
+| | | |
+|-|-|-|
+| $\frac{A_t^2}{\sum_{k < t} \gamma^{t-k} A_k^1}$ | + | - |
+| + | + | - |
+| - | - | + |
+
+(a)
+
+Advantage Alignment (AdAlign)
+
+| State | Probability of Cooperation |
+|-|-|
+| START | ~1.0 |
+| CC | ~0.95 |
+| CD | ~0.15 |
+| DC | ~0.95 |
+| DD | ~0.15 |
+
+(b)
+
+Bar chart showing the probability of cooperation for different states: START, CC, CD, DC, DD. START and CC have high probabilities (~1.0), CD and DD have low probabilities (~0.15), and DC has a high probability (~0.95). Error bars represent one standard deviation.
+
+Figure 1: (a) The sign of the product of the gamma-discounted past advantages for the agent, and the current advantage of the opponent, indicates whether the probability of taking an action should increase or decrease. (b) The empirical probability of cooperation of Advantage Alignment for each previous combination of actions in the one step history Iterated Prisoner’s Dilemma, closely resembles tit-for-tat. Results are averaged over 10 random seeds, the black whiskers show one std.
+
+This surrogate objective in equation 9 is used to formulate the Proximal Advantage Alignment (Proximal AdAlign) algorithm (see appendix A.7 for implementation details).
+
+**Why is Assumption 1 necessary?** Assumption 1 allows the agent to influence the learning dynamics of the opponent, by controlling the values for different actions. After one iteration of the algorithm the agent changes the Q-values of the opponent for different actions and, since the opponent aims to maximize their expected return, it must change its behavior accordingly.
+
+### 4.2 ANALYZING ADVANTAGE ALIGNMENT
+
+Equation 8 yields four possible different cases for controlling the direction of the gradient of the log probability of the policy. As with the usual policy gradient estimator, the sign multiplying the log probability indicates whether the probability of taking an action should increase or decrease. Intuitively, when the interaction with the opponent has been positive (blue in figure 1a) the advantages of the agent align with that of the opponent: the advantage alignment term increases the log probability of taking an action if the advantage of the opponent is positive and decreases it if it is negative. In contrast, if the interaction has been negative (red in figure 1a) the advantages are at odds with each other: the advantage alignment term decreases the log probability of taking an action if the advantage of the opponent is positive and increases it if it is negative. We now relate existing opponent shaping algorithms to advantage alignment, and argue that these algorithms use the same underlying mechanisms. Theorem 1 shows that LOLA update from Foerster et al. (2018b) can be written as a policy gradient method with an opponent shaping term similar to equation 10. This shows the fundamental relationship between opponent-shaping dynamics and advantage multiplications. Theorem 2 proves that LOQA’s opponent shaping term has the same form as that of Advantage Alignment, differing only by a scalar term.
+
+**Theorem 1** (LOLA as an advantage alignment estimator). *Given a two-player game where players 1 and 2 have respective policies $\pi^1(a|s)$ and $\pi^2(b|s)$ , where each policy is parametrised such that the set of gradients $\nabla_{\theta^i} \log \pi^2(a|s)$ for all pairs $(a, s)$ form an orthonormal basis, the LOLA update for the first player correspond to a reinforce update with the following opponent shaping term*
+
+$$\beta \cdot \mathbb{E}_{\tau \sim P_{\pi^1, \pi^2}} \left[ \sum_{t=0}^{\infty} \gamma^t \left( \sum_{k=t}^{\infty} d_{\gamma, k-t} \gamma^{k-t} A_k^1 A_{k-t}^2 \right) \nabla_{\theta^1} \log \pi^1(a_t|s_t) \right], \quad (11)$$
+
+where $A_k^i := A^i(s_k, a_k, b_k)$ and $d_{\gamma, k}$ is the occupancy measure of the tuple $(a_k, b_k, s_k)$ and $\beta$ is the step size of the naive learner. See appendix A.2 for a proof.
+
+{5}------------------------------------------------
+
+**Theorem 2** (LOQA as an advantage alignment estimator). *Under Assumption 2, the opponent shaping term in LOQA is equivalent to the opponent shaping term in Equation 8 up to $(1 - \hat{\pi}^2(b_k|s_k))$*
+
+$$\beta \cdot \mathbb{E}_{\tau \sim P_{\mu}^{\pi^1, \pi^2}} \left[ \sum_{t=0}^{\infty} \gamma^{t+1} \left( \sum_{k < t} \gamma^{t-k} (1 - \hat{\pi}^2(b_k|s_k)) A_k^1 \right) A_t^2 \nabla_{\theta^1} \log \pi^1(a_t|s_t) \right], \quad (12)$$
+
+$\hat{\pi}^2(b_t|s_t)$ approximates the opponent policy as defined in LOQA. For a proof see appendix A.5.
+
+Having established the connection between existing opponent shaping algorithms and Advantage Alignment, we now focus on analyzing the theoretical properties of Advantage Alignment itself. We investigate the impact of the Advantage Alignment term on Nash equilibria. Theorem 3 demonstrates that Advantage Alignment preserves Nash equilibria, ensuring that if agents are already playing equilibrium strategies, the Advantage Alignment updates will not cause the policy gradient to deviate from them locally.
+
+**Theorem 3** (Advantage Alignment preserves Nash equilibria). *Advantage Alignment preserves Nash equilibria. That is, if a joint policy $(\pi_1^*, \pi_2^*)$ constitutes a Nash equilibrium, then applying the Advantage Alignment formula will not change the policy, as the gradient contribution of the advantage alignment term is zero. The proof can be found in Appendix A.8.*
+
+## 5 EXPERIMENTS
+
+We follow the evaluation protocol of LOQA (Aghajohari et al., 2024b), where the fixed policy that is generated by the algorithm is evaluated *zero-shot* against a distribution of policies.
+
+### 5.1 ITERATED PRISONER’S DILEMMA
+
+We consider the *full history* version of IPD, where a gated recurrent unit (GRU) policy conditions on the full trajectory of observations before sampling an action. In this experiment we follow the architecture used in POLA (Zhao et al., 2022) (for details see appendix B.1). We also consider trajectories of length 16 with a discount factor, $\gamma$ , of 0.9. As shown in figure 1b, Advantage Alignment agents consistently achieve a policy that resembles *tit-for-tat* (Rapoport and Chammah, 1965) empirically. Tit-for-tat consists of cooperating on the first move and then mimicking the opponent’s previous move in subsequent rounds.
+
+### 5.2 COIN GAME
+
+The Coin Game is a 3x3 grid world environment where two agents, red and blue, take turns collecting coins. During each turn, a coin of either red or blue color spawns at a random location on the grid. Agents receive a reward of +1 for collecting any coin but incur a penalty of -3 if the opponent collects a coin of their color. A Pareto-optimal strategy in the Coin Game is for each agent to collect only the coins matching their color, as this approach maximizes the total returns for both agents. Figure 2 demonstrates that Advantage Alignment agents perform similarly to LOQA agents when evaluated against a league of different policies: Advantage Alignment agents cooperate with themselves, cooperate with Always Cooperate (AC) and are not exploited by Always Defect (AD).
+
+### 5.3 NEGOTIATION GAME
+
+In the original Negotiation Game, two agents bargain over $n$ types of items over multiple rounds. In each round, both the quantity of items and the value each agent places on them are randomly set, but the agents only know their own values. They take turns proposing how to divide the items over a random number of turns. Agents can end the negotiation by agreeing to a proposal, and rewards are based on how well the agreement matches their private values. If they don’t reach an agreement by the final turn, neither gets a reward. We modify the game first by making the values public, otherwise Advantage Alignment would have an unfair edge over PPO agents by using the opponent’s value function. Secondly, we do one-shot, simultaneous negotiations instead of negotiation rounds lasting multiple iterations. Third, we modify the reward function so that every negotiation yields a reward. For a given item with agent value $v_a$ , the reward of the agent $r_a$ depends on the proposal of the agent $p_a$ and the proposal of the opponent $p_o$ where $p_a, p_o \in [0, 5]$ : $r_a = p_a \cdot v_a / \max(5, p_a + p_o)$ .
+
+{6}------------------------------------------------
+
+
+
+| | AdAlign | LOQA | POLA | MFOS | AC | AD | Random | Return |
+|-|-|-|-|-|-|-|-|-|
+| AdAlign | 0.28 | 0.28 | 0.24 | 0.01 | 0.31 | 0.15 | -0.18 | 0.3 |
+| LOQA | 0.29 | 0.30 | 0.24 | 0.06 | 0.32 | 0.12 | -0.15 | 0.2 |
+| POLA | 0.18 | 0.17 | 0.19 | 0.01 | 0.29 | 0.07 | -0.13 | 0.1 |
+| MFOS | 0.19 | 0.16 | 0.19 | -0.01 | 0.03 | 0.41 | -0.21 | 0.0 |
+| AC | 0.35 | 0.35 | 0.38 | 0.32 | 0.35 | 0.63 | 0.11 | -0.1 |
+| AD | -0.08 | -0.05 | -0.03 | -0.42 | -0.27 | -0.00 | -0.53 | -0.2 |
+| Random | 0.26 | 0.26 | 0.24 | 0.20 | 0.05 | 0.53 | 0.01 | -0.3 |
+
+Figure 2: League Results of the Advantage Alignment agents in Coin Game. A heatmap showing pairwise rewards between AdAlign, LOQA, POLA, MFOS, AC, AD, Random, and Return. The diagonal shows self-rewards, and the upper triangle shows rewards for the row agent against the column agent. The color scale ranges from -0.3 (red) to 0.3 (blue).
+
+Figure 2: League Results of the Advantage Alignment agents in Coin Game: LOQA, POLA, MFOS, Always Cooperate (AC), Always Defect (AD), Random and Advantage Alignment (AdAlign). Each number in the plot is computed by running 10 random seeds of each agent head to head with 10 seeds of another for 50 episodes of length 16 and averaging the rewards.
+
+Note that the max operation at the denominator serves to break the invariance of the game dynamics to the scale of proposals. For example, without the max operation, there would be no difference between $p_a = 1, p_o = 1$ and $p_a = 5, p_o = 5$ . The social dilemma in this version of the negotiation game arises because both agents are incentivized to take as many items as possible, but by doing so, they end up with a lower return compared to the outcome they would achieve if they split the items based on their individual utilities. A Pareto-optimal strategy entails allowing the agent to take all the items that are more valuable to them, and similarly for their opponent (this constitutes the Always Cooperate (AC) strategy in Figure 3a). We experiment with a high-contrast setting where the utilities of objects for the agents are orthogonal to each other: There are two possible combinations of values in this setup: $v_a = 5, v_b = 1$ or $v_a = 1, v_b = 5$ .
+
+As shown in Figure 3a, PPO agents do not learn to solve the social dilemma. They learn the naive policy of bidding high for every item which means they get a low return against themselves. PPO agents trained with shared rewards get a high return against themselves, only to be exploited by PPO agents. They do not learn to abandon cooperation and retaliate after they are defected against. Advantage Alignment agents solves the social dilemma. They cooperate with themselves while remaining non-exploitable against Always Defect.
+
+### 5.4 MELTING POT’S COMMONS HARVEST OPEN
+
+In Commons Harvest Open (Agapiou et al., 2023), a group of 7 agents interact in a environment in which there is 6 bushes with different amounts of apples. Agents receive a reward of 1 for any apple consumed. Consumed apples regrow with a probability dependent on the number of apples in their $L_2$ neighborhood; specifically, if there are no apples nearby, consumed apples do not regrow. This mechanism creates a tension between agents: they must exercise restraint to prevent extinction while also feeling compelled to consume quickly out of fear that others may over-harvest.
+
+{7}------------------------------------------------
+
+
+
+Figure 3(a) is a heatmap showing the Return for various agents in a negotiation game. The agents are AC, AD, AdAlign, PPO, and PPO-SR. The diagonal elements are 0.50, 0.25, 0.44, 0.25, and 0.46 respectively. The color scale for Return ranges from 0.22 (blue) to 0.37 (red). The values in the cells represent the average return for 50 episodes of length 16.
+
+Figure 3(b) shows sample trajectories for two agents, Agent 1 (AdAlign) and Agent 2 (AdAlign), over 5 time steps. For each time step, the Utility and Proposal are shown. AdAlign agents defect first (red) and progressively cooperate with each other (blue) while PPO agents Always Defect.
+
+Figure 3: (a) League Results of the Advantage Alignment agents in the Negotiation Game. (b) Sample trajectories of AdAlign vs. AdAlign and PPO vs. PPO in the negotiation game.
+
+Figure 3: (a) League Results of the Advantage Alignment agents in the Negotiation Game: Always Cooperate (AC), an agent which proposes 5 for items which are more valuable to it and 1 for items that are less valuable to it, Always Defect (AD), an agent that proposes 5 regardless of the values, Advantage Alignment (AdAlign), PPO and PPO summing rewards (PPO-SR). Each number in the plot is computed by running 10 random seeds of each agent head to head with 10 seeds of another for 50 episodes of length 16 and averaging the rewards. Note that against Always Defect, Always Cooperate gets an average return of 0.25 while Always Defect gets 0.30. (b) Sample trajectories of AdAlign vs. AdAlign and PPO vs. PPO in the negotiation game. The numbers show the utilities and proposals, which have been rounded to integer values. AdAlign agents defect first (red) and progressively cooperate with each other (blue) while PPO agents Always Defect.
+
+| | adalign | ppo | ppo_p | exploiter | acb | vmppo | opre | acb_p | opre_p | random |
+|-|-|-|-|-|-|-|-|-|-|-|
+| scenario_0 | 1.78 | 1.15 | 0.33 | 0.91 | 0.87 | 0.93 | 0.84 | 0.95 | 0.53 | 0.00 |
+| scenario_1 | 1.48 | 0.74 | 0.45 | 0.76 | 0.80 | 0.85 | 0.77 | 0.94 | 0.52 | 0.00 |
+| average | 1.63 | 0.94 | 0.39 | 0.83 | 0.83 | 0.89 | 0.81 | 0.94 | 0.52 | 0.00 |
+
+Figure 4: Comparison of different reinforcement learning algorithms in Melting Pot’s 2.0. Commons Harvest Open. The score is the focal return per capita, min-max normalized between a random agent and an exploiter baseline (ACB agent with an LSTM policy/value network) trained for $10^9$ steps. Following the protocol of the Melting Pot contest, we select the best agent out of 10 seeds and evaluate it 100 times.
+
+There are a number of complications that make the Melting Pot environments particularly challenging. First, the environments are partially-observable: agents can only see a local window around themselves. Second, the partial observations are in the form of high-dimensional raw pixel data. Third, these environments often involve multiple agents—seven in the case of Commons Harvest Open—which increases the complexity of interactions and coordination. Therefore, agents need to remember past interactions with other agents to infer their motives and policies. All these factors, combined with the inherent social dilemma reward structure of the game, make finding policies that are optimal with respect to social *and* individual objectives a non-trivial task.
+
+We train a GTrXL transformer (Parisotto et al., 2019) for 34k steps, with context length of 30, and compare the normalized focal return per capita of our agents against the baselines in Melting Pot 2.0: Advantage-critic baseline (acb) (Espeholt et al., 2018), V-MPO (vmppo) (Song et al., 2019), options as responses (opre) (Vezhnevets et al., 2020), and prosocial versions of opre (opre\_p) and acb (acb\_p) that encourage cooperation. We also compare to our own implementations of PPO (ppo) and PPO
+
+{8}------------------------------------------------
+
+
+
+Figure 5: A 3x3 grid of screenshots from the Commons Harvest evaluation. The rows are labeled 'adalign', 'ppo', and 'ppo\_p' on the left. The columns are labeled 'Step 1', 'Step 155', and 'Step 310' at the top. Each screenshot shows a 2D grid world environment with various colored agents (green, yellow, red, blue, purple) and resources (apple bushes). In the 'adalign' row, agents are more spread out and maintain a higher density of resources. In the 'ppo' and 'ppo\_p' rows, agents are more concentrated, and resources appear to be depleted more quickly, especially by Step 310.
+
+Figure 5: Frames of evaluation trajectories for different algorithms. Qualitatively, we demonstrate that Proximal Advantage Alignment (adalign) also outperforms naive PPO (ppo) and PPO with summed rewards. The evaluation trajectories show how adalign agents are able to maintain a bigger number of apple bushes from extinction (2) for a longer time that either ppo or ppo\_p. Note that in the Commons Harvest evaluation two exploiter agents, green and yellow, play against a focal population of 5 copies of the evaluated algorithm.
+
+with summed rewards (ppo\_p). Figure 4 shows that our best advantage alignment agent achieves on average 1.63 normalized per capita focal return in the Commons Harvest evaluation scenarios, significantly outperforming all baselines (see Appendix B.4). Figure 5, qualitatively shows the reason why Proximal Advantage Alignment outperforms PPO and PPO with summed rewards on one of the evaluation scenarios.
+
+## 6 RELATED WORK
+
+The Iterated Prisoner’s Dilemma (IPD) was introduced by [Rapoport and Chammah \(1965\)](#). *Tit-for-tat* was discovered as a robust strategy against a population of opponents in IPD by [Axelrod \(1984\)](#), who organized multiple IPD tournaments. It was discovered only recently that IPD contains strategies that extort rational opponents into exploitable cooperation ([Press and Dyson, 2012](#)). [Sandholm and Crites \(1996\)](#) were the first to demonstrate that two Q-learning agents playing IPD converge to mutual defection, which is suboptimal. Later, [Foerster et al. \(2018b\)](#) demonstrated that the same is true for policy gradient methods. [Bertrand et al. \(2023\)](#) were able to show that with optimistic initialization and *self-play*, Q-learning agents find a *Pavlov* strategy in IPD.
+
+Opponent shaping was first introduced in LOLA [Foerster et al. \(2018b\)](#), as a method for controlling the learning dynamics of opponents in a game. A LOLA agent assumes the opponents are naive learners and differentiates through a one step look-ahead optimization update of the opponent. More formally, LOLA maximizes $V^1(\theta^1, \theta^2 + \Delta\theta^2)$ where $\Delta\theta^2$ is a naive learning step in the direction that maximizes the opponent’s value function $V^2(\theta^1, \theta^2)$ . Variations of LOLA have been introduced
+
+{9}------------------------------------------------
+
+to have formal stability guarantees (Letcher et al., 2021), learn consistent update functions assuming mutual opponent shaping (Willi et al., 2022) and be invariant to policy parameterization (Zhao et al., 2022). More recent work performs opponent shaping by having an agent play against a best response approximation of their policy (Aghajohari et al., 2024a). LOQA (Aghajohari et al., 2024b), on which this work is based, performs opponent shaping by controlling the Q-values of the opponent using REINFORCE (Williams, 1992) estimators.
+
+Another approach to finding socially beneficial equilibria in general sum games relies on modeling the problem as a meta-game, where meta-rewards correspond to the returns on the inner game, meta-states correspond to joint policies of the players, and the meta-actions are updates to these policies. Al-Shedivat et al. (2018) introduce a continuous adaptation framework for multi-task learning that uses meta-learning to deal with non-stationary environments. MFOS (Lu et al., 2022) uses model-free optimization methods like PPO and genetic algorithms to optimize the meta-value of the meta-game. More recently Meta-Value Learning (Cooljmans et al., 2023) parameterizes the meta-value as a neural network and applies Q-learning to capture the future effects of changes to the inner policies. Shaper (Khan et al., 2024), scales opponent shaping to high-dimensional general-sum games with temporally extended actions and long time horizons. It does so, by simplifying MFOS and effectively capturing both intra-episode and inter-episode information.
+
+Melting Pot 2.0 (Agapiou et al., 2023) introduces a comprehensive suite of multi-agent reinforcement learning environments that focus on social interactions and coordination challenges, providing a valuable benchmark for evaluating the scalability and effectiveness of reinforcement learning algorithms in complex, cooperative-competitive settings. The Negotiation Game, introduced by DeVault et al. (2015); Lewis et al. (2017) and subsequently refined by Cao et al. (2018), has proven to be a significant benchmark for studying general-sum games. It integrates elements of strategy and social dilemmas, necessitating that agents balance cooperation and competition to optimize their outcomes. Noukhovitch et al. (2021) analyze this complex benchmark, underscoring its importance in the field. Future investigations will turn towards an even more sophisticated simulation proposed by Zhang et al. (2022), which involves negotiations among countries and regions with diverse resource distributions and preferences in addressing climate change.
+
+## 7 CONCLUSION
+
+In this work, we introduced *Advantage Alignment*, a novel family of algorithms designed to address the fundamental challenge of achieving self-interested cooperation in multi-agent reinforcement learning, particularly in social dilemmas. By deriving our algorithms from first principles, we distilled opponent shaping to its core components, providing a simple yet powerful mechanism to align agents’ advantages and foster mutually beneficial behaviors. Our approach unifies and generalizes existing opponent shaping methods, such as LOLA and LOQA, demonstrating that they implicitly perform Advantage Alignment through different mechanisms. This unification not only simplifies the mathematical formulation of opponent shaping but also reduces computational complexity, enabling more efficient and scalable algorithms.
+
+Our experiments across a range of social dilemmas, including the Iterated Prisoner’s Dilemma, Coin Game, and a continuous action variant of the Negotiation Game, demonstrate that Advantage Alignment consistently achieves state-of-the-art cooperation and robustness against exploitation. Notably, we extended our methods to complex, large-scale, general-sum environments like Melting Pot’s Commons Harvest Open, addressing challenges that arise from partial observability, high-dimensional observations, and multi-agent interactions. In these settings, Advantage Alignment agents learned sophisticated strategies that balance individual and collective interests, showcasing the potential of our algorithms to scale to real-world applications.
+
+The significance of our work lies in providing a principled, efficient, and scalable solution to the longstanding problem of self-interested cooperation in general-sum games. By enabling agents to autonomously align their interests with one another, Advantage Alignment paves the way for more harmonious and socially beneficial interactions in artificial intelligence systems integrated into human decision-making processes. This has profound implications for the development of AI agents in diverse domains, from autonomous vehicles navigating shared environments to AI assistants collaborating with humans and other agents.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/QKBu1BOAwd.txt b/papers/QKBu1BOAwd.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e4636f80c80f96b0424c4949ebb8a55a43c56521
--- /dev/null
+++ b/papers/QKBu1BOAwd.txt
@@ -0,0 +1,401 @@
+**Primary Area:** other topics in machine learning (i.e., none of the above)
+
+
+
+{0}------------------------------------------------
+
+# FROM EXPLORATION TO MASTERY: ENABLING LLMs TO MASTER TOOLS VIA SELF-DRIVEN INTERACTIONS
+
+Changle Qu1, Sunhao Dai1, Xiaochi Wei2, Hengyi Cai2,
+Shuaiqiang Wang2, Dawei Yin2, Jun Xu1\*, Ji-Rong Wen1
+
+1Gaoling School of Artificial Intelligence, Renmin University of China, 2Baidu Inc.
+
+{changlequ, sunhaodai, junxu, jrw}@ruc.edu.cn, weixiaochi@baidu.com
+caihengyi@ict.ac.cn, shqiang.wang@gmail.com, yindawei@acm.org
+
+## ABSTRACT
+
+Tool learning enables Large Language Models (LLMs) to interact with external environments by invoking tools, serving as an effective strategy to mitigate the limitations inherent in their pre-training data. In this process, tool documentation plays a crucial role by providing usage instructions for LLMs, thereby facilitating effective tool utilization. This paper concentrates on the critical challenge of bridging the comprehension gap between LLMs and external tools due to the inadequacies and inaccuracies inherent in existing human-centric tool documentation. We propose a novel framework, **DRAFT**, aimed at **D**ynamically **R**efining tool documentation through the **A**nalysis of **F**eedback and **T**rials emanating from LLMs' interactions with external tools. This methodology pivots on an innovative trial-and-error approach, consisting of three distinct learning phases: experience gathering, learning from experience, and documentation rewriting, to iteratively enhance the tool documentation. This process is further optimized by implementing a diversity-promoting exploration strategy to ensure explorative diversity and a tool-adaptive termination mechanism to prevent overfitting while enhancing efficiency. Extensive experiments on multiple datasets demonstrate that DRAFT's iterative, feedback-based refinement significantly ameliorates documentation quality, fostering a deeper comprehension and more effective utilization of tools by LLMs. Notably, our analysis reveals that the tool documentation refined via our approach demonstrates robust cross-model generalization capabilities.
+
+## 1 INTRODUCTION
+
+Tool learning (Mialon et al., 2023; Qin et al., 2023b; Schick et al., 2024; Qu et al., 2024b), which integrates external tools with large language models (LLMs), has significantly enhanced the capability of LLMs to address complex real-world tasks (Nakano et al., 2021; Qin et al., 2023a; M. Bran et al., 2024). By leveraging external tools, LLMs are able to mitigate the limitations of outdated pre-training data and the text-in-text-out interface, enabling them to access up-to-date information, interact with dynamic environments, and take actions beyond their original scope (Zhuang et al., 2024; Wang et al., 2024a). To effectively utilize these external tools, LLMs are typically provided with tool documentation as context (Shen et al., 2024; Song et al., 2023; Xu et al., 2023). This documentation provides essential information on how tools function, their potential uses, and the ways in which they can be leveraged to solve complex tasks. By incorporating tool documentation within the task instructions, LLMs can leverage their in-context learning abilities to understand and utilize the tools efficiently (Wei et al., 2022; Hsieh et al., 2023). Therefore, tool documentation is an indispensable component driving the success of tool learning, serving as a bridge between LLMs and external tools.
+
+However, existing tools primarily originate from pre-established, human-engineered code repositories and are not explicitly tailored for the utilization of LLMs from their inception, let alone the corresponding tool documentation. In fact, orchestrating an ideal documentation for an external tool that adapts to the specific requirements of LLMs remains a challenging endeavor. **First**, the original human-crafted tool documentation is typically created with human intuition in mind, and
+
+\* Jun Xu is the corresponding author.
+
+{1}------------------------------------------------
+
+
+
+Figure 1(a) shows three examples of documentation issues:
+
+
+- Incomplete Documentation:** "name": "GetSearchImage", "description": "" (What is this tool used for?)
+- Redundant Documentation:** "para\_name": "imageId", "description": "Image identifier." (Why did it go wrong? Error: The resource could not be found.)
+- Inaccurate Documentation:** "description": "A QR code generator API is a tool that enables developers to..." (Actual return results: I'm a teapot.)
+
+Figure 1(b) illustrates the iterative exploration process where LLMs transition from untested functionalities (gray) to discovered capabilities (white) through trial-and-error.
+
+Figure 1(c) is a bar chart comparing raw and improved tool documentation across three datasets:
+
+| Dataset | Raw Documentation | Improved Documentation |
+|-|-|-|
+| RestBench-TMDB | 92.5% Win | 17.5% Win |
+| RestBench-Spotify | 77.5% Win | 17.5% Win |
+| ToolBench | 87.9% Win | 11.4% Win |
+
+Figure 1: (a) Issues in current tool documentation: Incomplete, Redundant, and Inaccurate. (b) LLMs incrementally enhance understanding through iterative exploration. (c) Comparison of raw and improved tool documentation on three datasets.
+
+Figure 1: (a): An illustration showcasing issues in current tool documentation, including incomplete, redundant, and inaccurate information. (b): An illustration of how LLMs incrementally enhance their understanding of tool usage through iterative exploration, transitioning from untested functionalities (gray) to discovered capabilities (white) via a trial-and-error process. (c): The comparison between the raw and improved tool documentation regarding its usefulness on three tool learning datasets, highlighting that DRAFT is able to produce tool documentation that is more favored by LLMs.
+
+is often fraught with inconsistency and ambiguities, as it primarily caters to human understanding and usually lacks the precision required for machine interpretation (Chemero, 2023; Yuan et al., 2024). As illustrated in Figure 1 (a), incomplete documentation makes it difficult for LLMs to clearly understand the purpose of a tool and when it should be invoked, while redundant documentation, containing excessive irrelevant information, obscures key details and increases token consumption in prompts. Additionally, inaccurate documentation that does not reflect the tool’s actual capabilities can lead to discrepancies between the tool’s outputs and its description, leading to the potential misuse of the tool by LLMs. These issues obstruct the effective utilization of tools by LLMs. **Second**, manual modification of these documentations, even with meticulous revisions, struggle to fully encompass all aspects of tool usage, since discerning the specific scope a tool can manage and identifying its edge use-cases often necessitates considerable hands-on experience. For example, as depicted in Figure 1 (a), incomplete documentation also fails to mention certain constraints on the parameters, and the LLM, being unaware of this undocumented constraint, generates an error when invoking the tool with an invalid parameter value. Addressing these issues by manually correcting or enhancing tool documentation is time-consuming and labor-intensive. Moreover, this may not scale to a substantial number of tools effectively. **Furthermore**, the dynamic nature of tool development further exacerbates this issue, as functionalities of tools are frequently updated, deprecated, or extended. Maintaining an up-to-date and accurate representation of such evolving functionalities within the tool documentation becomes an arduous task. This misalignment between the tool documentation with the current state of the tool hinders the efficient and correct utilization of tools by LLMs.
+
+Humans, on the contrary, acquire tool proficiency through repeated interactions and hands-on experiences, capable of maintaining an updated comprehension of these tools despite their evolving functionalities. In light of this, this paper proposes DRAFT, conceptualized to automate the adjustment and optimization of tool documentation based on the feedback derived from the LLM’s interaction with the tool, aiming to bridge the comprehension gap between LLMs and external tools.
+
+More concretely, DRAFT implements a trial-and-error methodology to incrementally improve the tool documentation. As shown in Figure 2, DRAFT orchestrates three dynamically interlinked phases, which collectively facilitate the iterative process of documentation enhancement. It first undertakes the simulation of potential tool application scenarios, crafting explorative instances and capturing tool execution outcomes through a designed explorer. Subsequently, the analyzer dissects the prevailing documentation, amalgamating insights from the explorer’s findings and feedback to moot documentation modification propositions. Finally, the rewriter amalgamates these insights, refining the tool documentation while simultaneously guiding further explorative pursuits by the explorer. To optimize this process, we design a diversity-promoting exploration strategy to ensure diversity in exploration, thus providing a wider range of samples for subsequent rewriting. Recognizing that different tools vary in complexity for LLMs, we introduce a tool-adaptive termination mechanism to improve efficiency during modifications by halting the iterative process once the documentation aligns with the comprehension of LLMs, thereby saving time and resources while preventing overfitting.
+
+{2}------------------------------------------------
+
+
+
+**Diversity-promoting Exploration Strategy**
+
+Similarity Constraint
+
+Explored Queries
+
+New Generated Query
+
+Self-Reflection
+
+**Tool-adaptive Termination Mechanism**
+
+Tool Doc1
+
+Tool Doc2
+
+Tool Doc1
+
+Tool Doc2
+
+Tool Doc1
+
+Tool Doc2
+
+Tool Doc1
+
+Tool Doc2
+
+Tool Name: GET person\_person\_id
+ Description: ...Added the translations...
+ (endpoint:CSMjCXAGpNGtS) ...
+
+Query: Can you give me details about the person with ID 12345?
+ Tool Parameters: {"ID":"12345"}
+ Observation: {"biography": "", "birthday": "1991-11-29", "deathday": "1996-01-01", "gender": 2, "homepage": null ...}
+ Suggestion: Here are some suggestions: 1. Include Response Fields: ... 2. Clarify Parameters: ... 3. Explain "append to r response": ... 4. Update Recent Changes: ... 5. Provide Example Usage: ... 6. Remove Irrelevant Information: ...
+ Rewriting: This API retrieves detailed information about a person using their unique ID. The response includes ... The API supports the 'append\_to\_response' parameter... Example usage: ...
+ Direction for Next Exploration: ...
+
+Figure 2: Schematic illustration of the proposed self-driven iterative improvement framework, DRAFT. The diagram is divided into three main parts: Experience Gathering, Learning from Experience, and Documentation Rewriting. Experience Gathering shows an Explorer (M\_E) interacting with a Tool Doc to generate a query, which is then simulated using Tool-use Examples. Learning from Experience shows an Analyzer (M\_A) examining the Tool Doc and Tool-use Examples to identify documentation problems. Documentation Rewriting shows a Rewriter (M\_R) performing comprehensive rewriting of the Tool Doc. On the right, two specialized mechanisms are shown: Diversity-promoting Exploration Strategy, which uses Similarity Constraint and Self-Reflection to generate new queries, and Tool-adaptive Termination Mechanism, which uses a graph-based approach to decide when to stop. A sample interaction with a GET person tool is provided on the far right.
+
+Figure 2: Schematic illustration of our proposed self-driven iterative improvement framework, DRAFT. The **left** part illustrates the three distinct learning phases in our framework, where a trial refers to a single iteration of the process. The **middle** part shows the two specialized mechanisms designed to optimize the process. The **right** part depicts an example of using DRAFT to iteratively modify the tool documentation (a complete revision trajectory is presented in Appendix E).
+
+Through this collaborative, iterative framework, the documentation progressively morphs, aligning more coherently with LLMs operational requisites, and thus empowering LLMs to leverage external tools more effectively in their problem-solving endeavors.
+
+In summary, our contributions are as follows: (1) We highlight that due to the inherent understanding gap between LLMs and humans, inefficiencies and inaccuracies within existing tool documentation hamper the effective utilization of tools by LLMs. (2) We introduce a novel framework, DRAFT, designed to dynamically adjust and optimize tool documentation based on the interaction feedback between LLMs and external tools, which significantly bridges the gap between them by enabling the LLMs to better comprehend and utilize the tools at their disposal, thereby enhancing the overall tool-using capabilities of LLMs. (3) Extensive experiments demonstrate that DRAFT significantly improves the quality of tool documentation and enhances the ability of LLMs to utilize external tools.
+
+## 2 METHODS
+
+In this section, we will first introduce the overview of DRAFT, and then provide detailed explanations of the three included learning stages. The learning algorithm is presented in Algorithm 1.
+
+### 2.1 OVERVIEW OF DRAFT
+
+To address the challenges of inadequate, ambiguous, and outdated tool documentation that hinder LLMs from effectively utilizing external tools, we propose DRAFT, a framework that iteratively refines tool documentation to bridge the comprehension gap between LLMs and tools. As illustrated in Figure 2, DRAFT operates through three interconnected phases: experience gathering, learning from experience, and documentation rewriting. In the experience gathering phase, an explorer simulates diverse tool usage scenarios, collecting data on how the LLM interacts with the tool based on the current documentation, thus uncovering misunderstandings and limitations. The learning from experience phase involves an analyzer examining this data to identify discrepancies between intended and actual tool usage, pinpoint ambiguities or inaccuracies in the documentation, and propose targeted improvements. In the documentation rewriting phase, a rewriter integrates these insights to update the documentation, enhancing clarity and alignment with the tool’s functionalities. Through this trial-and-error framework, DRAFT is capable of simulating the process by which humans acquire proficiency in tool usage through repeated interactions and hands-on experiences, thereby automating the creation of tool documentation specifically designed for LLMs. Furthermore, by employing the diversity-promoting exploration strategy and tool-adaptive termination mechanism, DRAFT efficiently converges on optimized documentation, enabling LLMs to utilize external tools more effectively despite the initial documentation shortcomings.
+
+{3}------------------------------------------------
+
+#### **Algorithm 1:** The Learning Algorithm of DRAFT
+
+**Input:** Raw tool documentation set $\mathcal{D}$ , iteration round $I$ , similarity threshold $\phi$ , termination threshold $\tau$ .**Output:** Revised tool documentation set $\tilde{\mathcal{D}}$ .
+
+```
+
+1 Initialize the revised tool documentation set $\tilde{\mathcal{D}} \leftarrow \emptyset$
+2 for raw tool documentation $t \in \mathcal{D}$ do
+3 for $i = 1$ to $I$ do
+4 // Experience Gathering (§ 2.2)
+5 Instruct Explorer to generate an exploratory instance $e_i$ using Eq. (1)
+6 while $\max_{j < i} \text{sim}(\mathbf{e}_i^q, \mathbf{e}_j^q) > \phi$ do
+7 Instruct Explorer to generate a new exploratory instance $e_i$
+8 end
+9 Instruct Explorer to capture the outcomes of tool execution $r_i$
+10 // Learning from Experience (§ 2.3)
+11 Instruct Analyzer to learn from experience and provide suggestions $s_i$ for modifications using Eq. (3)
+12 // Documentation Rewriting (§ 2.4)
+13 Instruct Rewriter to revise the documentation based on experience and suggestions to get
+14 revised tool documentation $t_i$ and propose new exploration directions $d_i$ using Eq. (4)
+15 Calculate the similarities $\Delta$ between $t_{i-1}$ and $t_i$ using Eq. (5)
+16 if $\Delta > \tau$ then
+17 Break
+18 end
+19 Updating the revised tool documentation set $\tilde{\mathcal{D}} \leftarrow \tilde{\mathcal{D}} \cup t_i$
+20 end
+21 return $\tilde{\mathcal{D}}$
+
+```
+
+### 2.2 EXPERIENCE GATHERING
+
+In the experience gathering phase, we design an Explorer $\mathcal{M}_E$ to simulate plausible scenarios in which the tool may be utilized. This approach parallels the manner in which individuals investigate the potential applications of a new tool when they are unable to comprehend the accompanying manual.
+
+Specifically, at the $i$ -th iteration, the Explorer $\mathcal{M}_E$ generates an exploration instance $e_i$ based on the current tool documentation $t_{i-1}$ , next-step exploration direction $d_{i-1}$ from the Rewriter $\mathcal{M}_R$ , and the previous history $\mathcal{H}_i = \{(e_j, r_j) | j < i\}$ , which consists of prior exploration instances $e_{1. The similarity is computed as:
+
+$$\max_{j < i} \text{sim}(\mathbf{e}_i^q, \mathbf{e}_j^q) < \phi, \quad (2)$$
+
+1
+
+![Figure 3: Prompt template for explorer. The image shows a screenshot of a prompt box with a blue header 'Explorer'. The prompt text includes: '## Task Prompt: Your task is to answer the user's query as best you can. You have access to the following tools, which you can use via tool calling to help with your response: [Tool Documentation] Now you have the chance to explore the available tools. You can do this by ... Here is an example: [{](2bb31852174adbb3a45abf75f593ac36_img.jpg)
+
+Figure 3: Prompt template for explorer. The image shows a screenshot of a prompt box with a blue header 'Explorer'. The prompt text includes: '## Task Prompt: Your task is to answer the user's query as best you can. You have access to the following tools, which you can use via tool calling to help with your response: [Tool Documentation] Now you have the chance to explore the available tools. You can do this by ... Here is an example: [{
+
+Figure 3: Prompt template for explorer.
+
+{4}------------------------------------------------
+
+where $\text{sim}(\cdot, \cdot)$ denotes the cosine similarity function, and $\phi$ is a predefined threshold controlling the allowed similarity. This constraint ensures that the new query is sufficiently different from all previous queries, promoting diversity in exploration.
+
+**Self-Reflection.** If the similarity constraint is not satisfied (i.e., the new query is too similar to previous ones), the `Explorer` engages in self-reflection (Shinn et al., 2024). It discards the current instance and analyzes the reasons for the overlap, adjusting its approach to generate a new query that explores different aspects of the tool. This iterative self-reflection process continues until the `Explorer` produces an instance that meets the diversity criterion.
+
+By incorporating this diversity-promoting exploration strategy, we enhance the exploration coverage of the `Explorer`, allowing it to investigate a broader range of tool functionalities and edge cases. This comprehensive set of exploration instances is crucial for identifying potential misunderstandings and gaps in the tool documentation, thereby providing valuable experiential data for subsequent analysis and documentation rewriting. Figure 3 illustrates our prompt template for `Explorer`.
+
+### 2.3 LEARNING FROM EXPERIENCE
+
+Analogous to how humans learn—acquiring familiarity with new tools through practical experiences and then consulting manuals to deepen understanding—the insights gained during the experience gathering phase provide a foundation for informed and targeted enhancements to the documentation. Thus, building upon the experience gathered in the first phase, the second phase focuses on analyzing this data to refine the tool documentation. In this phase, we introduce an `Analyzer` $\mathcal{M}_A$ designed to identify and address issues within the current tool documentation, thereby guiding the `Rewriter` in making effective revisions.
+
+
+
+```
+
+## Task Prompt:
+You task is to provide suggestions for modifying the tool documentation
+based on the current tool documentation, the explored queries and
+parameters, and the results returned by the tool. You have access to the
+following tools: [Tool Documentation] ...
+Below are explored queries, the required parameters and the outputs of the
+tool: [Explored examples]
+Here is an example: ["Suggestions": ""]
+## Memory Mechanisms:
+The following is the history of you modifying the tool description: [History]
+Based on the above information, provide more constructive suggestions.
+
+```
+
+Figure 4: Prompt template for analyzer. The image shows a dashed green box containing a prompt for an 'Analyzer'. The prompt includes sections for 'Task Prompt' and 'Memory Mechanisms'. The 'Task Prompt' section asks the model to suggest modifications to tool documentation based on current documentation, queries, and results. The 'Memory Mechanisms' section asks the model to use the history of tool modifications. A label 'Analyzer' is in a box at the top right of the prompt box.
+
+Figure 4: Prompt template for analyzer.
+
+Formally, at the $i$ -th iteration, the `Analyzer` $\mathcal{M}_A$ takes the following inputs: current tool documentation $t_{i-1}$ , exploration instance $e_i$ , tool feedback $r_i$ provided by the `Explorer` $\mathcal{M}_E$ , and the history of documentation revisions $\mathcal{T}_i = \{t_j \mid j < i\}$ . Then the `Analyzer` $\mathcal{M}_A$ analyzes these inputs to identify issues and generate revision suggestions $s_i$ :
+
+$$s_i = \mathcal{M}_A(t_{i-1}, e_i, r_i, \mathcal{T}_i). \quad (3)$$
+
+To ensure that the `Analyzer` can provide high-quality and relevant revision suggestions, we establish several evaluation criteria, including consistency with tool outputs, comprehensiveness, and conciseness without irrelevant information (as detailed in Appendix C). These criteria enable `Analyzer` to identify and assess issues present within the existing tool documentation. By considering the historical evolution of the documentation through the revision history $\mathcal{T}_i$ , the `Analyzer` gains valuable insights into past updates, helping it avoid redundant or repetitive suggestions and focus on areas that still require improvement. The prompt template for `Analyzer` is illustrated in Figure 4.
+
+Furthermore, the `Analyzer` delivers its feedback in natural language, offering detailed and nuanced guidance to the `Rewriter` for subsequent updates. This approach contrasts with providing mere scalar feedback, as it ensures the `Rewriter` receives comprehensive insights that facilitate accurate and effective revisions, ultimately enhancing the clarity and usability of the tool documentation.
+
+### 2.4 DOCUMENTATION REWRITING
+
+Building upon the experiences gathered and the revision suggestions obtained from the previous two phases, the final phase focuses on refining the tool documentation to enhance its clarity, accuracy, and usability, ensuring it aligns with the comprehension capabilities of LLMs. This phase also provides suggestions for future exploration directions in the next iteration of the experience gathering phase.
+
+Specifically, we design a `Rewriter` $\mathcal{M}_R$ to synthesize information from the exploration instances $e_i$ and the corresponding tool return results $r_i$ provided by the `Explorer` $\mathcal{M}_E$ , as well as the revision suggestions $s_i$ from the `Analyzer` $\mathcal{M}_A$ . It is important to note that the `Rewriter` $\mathcal{M}_R$ also takes into account the rewrite history $\mathcal{T}_i$ , which includes all previous versions of the tool documentation up to iteration $i$ . By integrating these inputs, the `Rewriter` $\mathcal{M}_R$ produces an updated version of the
+
+{5}------------------------------------------------
+
+tool documentation $t_i$ and provides suggestions for the next round of exploration directions $d_i$ . This process is formalized as:
+
+$$d_i, t_i = \mathcal{M}_R(t_{i-1}, e_i, r_i, s_i, \mathcal{T}_i). \quad (4)$$
+
+By incorporating the revision history into its process, the Rewriter ensures that each version of the documentation builds upon its predecessors, resulting in continuous improvements in clarity, accuracy, and usability. The prompt template to get Rewriter is shown in Figure 5.
+
+Furthermore, recognizing that different tools vary in their complexity and the ease with which LLMs can comprehend them (Qin et al., 2023b; Osurak & Heinke, 2018), we implement a **tool-adaptive termination mechanism** to adaptively determine when to cease modifications for each tool. Analogous to recipes requiring different levels of expertise, some tools may reach optimal documentation faster than others. We consider the iterative process to have converged when there is minimal change between two consecutive versions of the documentation, indicating that the Rewriter has sufficiently aligned the documentation with the LLM’s understanding.
+
+
+
+```
+
+## Task Prompt:
+Your task is to refine the description of the tool based on the queries and parameters you've explored, the outputs provided by the tool, as well as the suggestions provided. You have access to the following tools: [Tool Documentation]
+Below are explored queries, the required parameters and the outputs of the tool: [Explored examples]
+Additionally, here are some suggestions for updating the tool description: [Suggestions] ...
+Here is an example: {"Rewritten description": "", "Suggestions for exploring": ""}
+## Vectors/Mechanisms:
+The following is the history of you modifying the tool description: [History]
+Based on the information above, rewrite the tool description and provide more constructive suggestions for exploration.
+
+```
+
+Figure 5: Prompt template for rewriter. The prompt is shown in a code block with syntax highlighting. It includes sections for Task Prompt, Explored examples, Suggestions, and Vectors/Mechanisms. A 'Rewriter' label is in a box at the top right.
+
+Figure 5: Prompt template for rewriter.
+
+Specifically, inspired by Wieting et al. (2019), we measure the degree of change $\Delta$ between iterations by calculating both the word-match metric (e.g., BLEU score (Papineni et al., 2002)) and the semantic-match metric (e.g., cosine similarity of embeddings):
+
+$$\Delta = \frac{\text{sim}(\mathbf{e}_i^t, \mathbf{e}_{i-1}^t) + \text{BLEU}(t_i, t_{i-1})}{2}, \quad (5)$$
+
+where $\mathbf{e}_i^t$ and $\mathbf{e}_{i-1}^t$ are the embedding vectors of $t_i$ and $t_{i-1}$ obtained using OpenAI’s *text-embedding-ada-002*2. The function $\text{sim}(\cdot, \cdot)$ calculates the cosine similarity between the semantic embedding vectors of two documentation versions, and $\text{BLEU}(\cdot, \cdot)$ measures the n-gram overlap between them. If $\Delta$ exceeds a predefined termination threshold $\tau$ , we stop the iterative modifications.
+
+This tool-adaptive termination mechanism offers several advantages: First, it enhances efficiency by ceasing iterations when the documentation is adequately aligned with the LLM’s comprehension, conserving computational resources and time. Second, it prevents unnecessary modifications that could lead to overfitting, thus optimizing the quality of the documentation. By employing both the BLEU score and cosine similarity, we ensure a balanced assessment of structural and semantic alignment, ultimately yielding high-quality documentation tailored for effective LLM utilization.
+
+### 2.5 DRAFT’S STRENGTHS
+
+In this section, we outline the key strengths of the proposed DRAFT framework. **First and foremost**, DRAFT operates in a fully automated manner, which significantly reduces resource consumption in comparison to the time-consuming and labor-intensive manual modifications that are typically required. **Furthermore**, by employing a trial-and-error methodology, DRAFT continuously updates tool documentation based on feedback regarding tool usage obtained from LLMs, thereby enhancing the alignment between tool documentation and the operational understanding of LLMs. **Additionally**, DRAFT is capable of dynamically maintaining an accurate and up-to-date representation of evolving features within the tool documentation as the tools develop. It also provides inherent explainability, as the entire process is presented in natural language. Users can easily track the history of modifications and seamlessly integrate expert insights into the updating process.
+
+## 3 EXPERIMENTS
+
+### 3.1 EXPERIMENTAL SETUP
+
+**Datasets.** To verify the effectiveness of DRAFT, we conduct experiments on two benchmarks: ToolBench and RestBench. ToolBench (Qin et al., 2024) is a large-scale benchmark of real-world
+
+2
+
+{6}------------------------------------------------
+
+Table 1: Performance comparison of different methods on three datasets. Win% is calculated by comparing each method with ReAct. The term “-” means that EasyTool has not been implemented on the Spotify dataset. The best result for each LLM is in **bold**.
+
+| Model | Method | RestBench-TMDB | | RestBench-Spotify | | ToolBench | |
+|-|-|-|-|-|-|-|-|
+| | | CP% | Win% | CP% | Win% | CP% | Win% |
+| GPT-4o-mini | ReAct | 48.00 | 50.00 | 24.56 | 50.00 | 35.00 | 50.00 |
+| | DFSDT | 50.00 | 68.00 | 35.08 | 61.40 | 37.00 | 84.00 |
+| | EasyTool | 56.00 | 75.00 | - | - | 42.00 | 85.00 |
+| | DRAFT (Ours) | 62.00 | 82.00 | 43.85 | 78.94 | 47.00 | 88.00 |
+| Llama-3-70B | ReAct | 72.00 | 50.00 | 26.31 | 50.00 | 41.00 | 50.00 |
+| | DFSDT | 74.00 | 38.00 | 63.15 | 61.40 | 42.00 | 54.00 |
+| | EasyTool | 76.00 | 64.00 | - | - | 46.00 | 60.00 |
+| | DRAFT (Ours) | 86.00 | 64.00 | 66.66 | 64.91 | 53.00 | 62.00 |
+| GPT-4o | ReAct | 71.00 | 50.00 | 28.07 | 50.00 | 37.00 | 50.00 |
+| | DFSDT | 74.00 | 61.00 | 64.91 | 56.14 | 41.00 | 73.00 |
+| | EasyTool | 79.00 | 62.00 | - | - | 45.00 | 77.00 |
+| | DRAFT (Ours) | 88.00 | 71.00 | 70.17 | 84.21 | 51.00 | 78.00 |
+
+APIs collected from RapidAPI and BMTools, commonly used to evaluate the capability of LLMs in tool usage. Due to budget constraints, we focus on the most challenging subset of ToolBench, namely I3-Instruction, which contains complex user requests requiring multiple tools from different categories. RestBench (Song et al., 2023) is a benchmark consisting of two real-world scenarios: TMDB, which includes 54 movie-related APIs, and Spotify, which has 40 music-related APIs.
+
+**Evaluation Metrics.** Following previous work (Song et al., 2023; Qin et al., 2024; Yuan et al., 2024), we evaluate performance using two widely adopted metrics: (1) Correct Path Rate (CP%), which measures the proportion of instances where the model-generated sequence of tool calls contains the ground truth tool path as a subsequence, allowing for straightforward accuracy assessment. (2) Win Rate (Win%), which evaluates effectiveness through pairwise comparisons by a ChatGPT-based evaluator, capturing nuanced performance differences not reflected by rule-based metrics.
+
+**Baselines.** Following Qin et al. (2024) and Yuan et al. (2024), we compare our method with widely adopted baselines, including: (1) ReAct (Yao et al., 2022), which integrates reasoning with action, enabling LLMs not only to justify their actions but also to refine their reasoning processes based on feedback from the environment. (2) DFSDT (Qin et al., 2024), which addresses the issue of error propagation by incorporating a depth-first search strategy to enhance decision-making accuracy. (3) EasyTool (Yuan et al., 2024), which achieves more concise tool descriptions by using ChatGPT to directly rewrite the documentation and incorporate guidelines, thereby enhancing the comprehension of LLMs regarding tool functions and parameter requirements.
+
+**Implementation Details.** For the main experiments, we use the *GPT-4o* as the backbone model for DRAFT, which means that we employ this model to refine the tool documentation by incorporating its own tool usage feedback. We set the similarity threshold $\phi$ to 0.9, termination threshold $\tau$ to 0.75, and maximum iteration count to 5. We select three of the latest LLMs to ensure our evaluation reflects the current state of the field including the closed-source models *GPT-4o*3 and *GPT-4o-mini*4, as well as the open-source model *Llama-3-70B*5. Our code is available at .
+
+### 3.2 EXPERIMENTAL RESULTS
+
+We present our experimental results in Table 1. Based on these results, we have the following observations: While EasyTool can slightly improve experimental performance, it does not incorporate the experience feedback from LLMs to iteratively revise the tool documentation. As a result, it cannot fully align with the understanding of LLMs. In contrast, our method effectively addresses these issues and achieves more significant improvements. We observe that all LLMs achieve better performance
+
+3
+
+4
+
+5
+
+{7}------------------------------------------------
+
+
+
+Figure 6 displays three line graphs (a, b, c) showing performance metrics (Correct Prob Rate (%) and Win Rate (%)) across five iteration rounds for different models.
+
+(a) GPT-4o-mini: The left graph shows Correct Prob Rate (%) for ToolBench-TMDB CPs (orange line with circles) and ToolBench-TMDB Winrs (green line with triangles). The right graph shows Win Rate (%) for ToolBench-Sparky CPs (orange line with circles) and ToolBench-Sparky Winrs (green line with triangles).
+
+(b) Llama-3-70b: The left graph shows Correct Prob Rate (%) for ToolBench-TMDB CPs (orange line with circles) and ToolBench-TMDB Winrs (green line with triangles). The right graph shows Win Rate (%) for ToolBench-Sparky CPs (orange line with circles) and ToolBench-Sparky Winrs (green line with triangles).
+
+(c) GPT-4o: The left graph shows Correct Prob Rate (%) for ToolBench-TMDB CPs (orange line with circles) and ToolBench-TMDB Winrs (green line with triangles). The right graph shows Win Rate (%) for ToolBench-Sparky CPs (orange line with circles) and ToolBench-Sparky Winrs (green line with triangles).
+
+Figure 6: A comparative analysis of performance based on varying numbers of iteration rounds. The figure consists of three subplots (a, b, c) showing Correct Prob Rate (%) and Win Rate (%) for different models over 5 iterations.
+
+Figure 6: A comparative analysis of performance based on varying numbers of iteration rounds.
+
+when using the tool documentation modified by DRAFT. This indicates that although our tool documentation was revised through utilizing tool usage feedback from a single model, it exhibits robust cross-model generalization capabilities. Notably, on the ToolBench dataset, the *GPT-4o-mini* enhanced with DRAFT even surpasses the performance of the *GPT-4o* without DRAFT. These improvements demonstrate the effectiveness of DRAFT, which can be attributed to the fact that DRAFT iteratively learns from the tool usage experiences of LLMs to refine the tool documentation. In this way, DRAFT creates tool documentation specifically aligned with the understanding of LLMs.
+
+### 3.3 FURTHER ANALYSIS
+
+**How does the number of iteration rounds affect the performance of tool learning?** A key feature of DRAFT is its iterative refinement of tool documentation with a tool-adaptive termination mechanism. We examine the effectiveness of these designs by analyzing how the number of iteration rounds influences the performance of downstream tool learning. The results presented in Figure 6 demonstrate a general trend where performance is enhanced with an increasing number of iterations, followed by a subsequent decline. This suggests that iterative modifications are crucial for enhancing tool documentation quality and the ability of LLMs to utilize tools effectively. Such modifications facilitate the exploration of a wider array of examples and the incorporation of additional feedback derived from the tool usage experiences of LLMs, ultimately refining the tool descriptions to achieve superior performance. However, a decline in performance is observed after a certain number of iterations. This decline may be attributed to the introduction of redundant information as the number of iterations increases, potentially leading to overfitting. Therefore, we implement a tool-adaptive termination mechanism to prevent performance degradation and ensure optimal results.
+
+**Does using other models as backbones also ensure cross-model generalization?** Our preliminary experiments have demonstrated that employing *GPT-4o* as the backbone to refine tool documentation by integrating its own usage feedback results in revised documentation that exhibits cross-model generalization, enhancing the performance of other models. This observation prompts
+
+
+
+Figure 7 displays two bar charts showing performance metrics (Correct Prob Rate (%) and Win Rate (%)) for different models.
+
+The left chart shows Correct Prob Rate (%) for GPT-4o-mini, Llama-3-70B, and GPT-4o. The right chart shows Win Rate (%) for GPT-4o-mini, Llama-3-70B, and GPT-4o.
+
+Legend: Raw (purple bar), DRAFT (yellow bar).
+
+Figure 7: An analysis of cross-model generalization. The figure consists of two bar charts showing Correct Prob Rate (%) and Win Rate (%) for different models.
+
+Figure 7: An analysis of cross-model generalization.
+
+{8}------------------------------------------------
+
+an inquiry into whether using other models as a backbone would similarly yield cross-model generalization. To investigate this, we conduct experiments on RestBench-TMDB using *Llama-3-70B* as a backbone, which led to the generation of a new set of tool documentation informed by its usage feedback. As illustrated in Figure 7, our findings indicate that it also demonstrates cross-model generalization, enhancing the tool usage capabilities across all LLMs. This may result from decoder-only models sharing similar transformer structures and common pre-training corpora, allowing them to achieve consensus on knowledge mastery and needs. Furthermore, we also find that employing *GPT-4o* as a backbone yields superior performance compared to *Llama-3-70B*. This suggests that our method can benefit from continuous improvements in foundational models.
+
+**Are the two mechanisms we proposed truly effective for DRAFT?** We conduct ablation studies on RestBench-TMDB using *GPT-4o* to assess the impact of the two mechanisms incorporated within DRAFT. The results presented in Table 2, highlight the significance of each mechanism: *w/o diversity* refers to a variant that the explorer generates exploration instances without applying similarity constraint, meaning that all generated instances are considered. The absence of the diversity-promoting exploration strategy leads to a notable performance drop, underscoring the need for its implementation to enhance exploration diversity. *w/o adaptive* refers to a variant that does not terminate prematurely based on the iteration conditions; rather, it guarantees that each iteration of the tool documentation completes the designated maximum number of iteration rounds before ceasing operations. The significant decline in performance observed in this variant further emphasizes the benefits of introducing the tool-adaptive termination mechanism, which serves to prevent overfitting while improving efficiency. The results with other LLMs and datasets demonstrate similar trends and are provided in Appendix B.
+
+Table 2: Ablation study of the proposed DRAFT.
+
+| Methods | TMDB | |
+|-|-|-|
+| | CP% | Win% |
+| DRAFT | 88.00 | 71.00 |
+| w/o diversity | 84.00 | 69.00 |
+| w/o adaptive | 80.00 | 68.00 |
+
+#### **Does the modified tool documentation improve the performance of tool retrieval?**
+
+In real-world scenarios, there are often numerous tools, making it impractical to input the descriptions of all tools into LLMs (Qu et al., 2024a). Therefore, effective tool retrieval is crucial for downstream tool learning. In this analysis, we evaluate whether the modified tool documentation not only enhances the ability of LLMs to use tools effectively but also improves the effectiveness of tool retrieval. The results presented in Table 3 indicate that the revised documentation enhances the performance of tool retrieval methods, including the sparse retrieval method BM25 (Robertson et al., 2009) and the dense retrieval method Contriever (Izacard et al., 2021). This demonstrates that the modifications not only improve the readability of the documentation but also enhance its semantic quality, thereby improving the different stages of the whole pipeline for tool learning.
+
+Table 3: Comparison of tool retrieval performance between raw documentation and our method. We report NDCG@1 and NDCG@10.
+
+| Retriever | Documentation | TMDB | | Spotify | |
+|-|-|-|-|-|-|
+| | | @1 | @10 | @1 | @10 |
+| BM25 | Raw | 24.0 | 35.0 | 43.9 | 53.9 |
+| | DRAFT | 29.0 | 39.4 | 43.9 | 54.2 |
+| Contriever | Raw | 29.0 | 40.4 | 45.6 | 49.6 |
+| | DRAFT | 31.0 | 44.1 | 47.4 | 49.2 |
+
+**Does the tool documentation modified by DRAFT also improve human comprehension?** In the previous experiments, we have demonstrated that tool documentation modified by DRAFT can help LLMs better understand and utilize external tools. Next, we aim to verify whether this improvement extends to human understanding of the tools as well. Specifically, we conduct a human evaluation, inviting three well-educated doctor students to evaluate the raw tool documentation and the documentation modified by DRAFT based on three criteria: **completeness**: which documentation is more comprehensive, **conciseness**: which documentation is clearer and more concise, **accuracy**: which documentation reflects the tool’s functionality more accurately (details are presented in Appendix A). We randomly sampled 50 cases from RestBench and ToolBench for this evaluation.
+
+The results, as shown in Table 4, indicate that the tool documentation modified by DRAFT demonstrates significant improvements, particularly in terms of completeness and accuracy (some cases are presented in Appendix D). This can be attributed to the fact that DRAFT incorporates feedback from LLMs based on their tool usage experience, which provides execution results during the revision process, ensuring better alignment between the documentation and the actual tool behavior. Moreover,
+
+{9}------------------------------------------------
+
+Table 4: Human evaluation comparing the quality of the raw documentation with ours.
+
+| Dataset | Completeness | | | Conciseness | | | Accuracy | | |
+|-|-|-|-|-|-|-|-|-|-|
+| | Ours | Raw | Equal | Ours | Raw | Equal | Ours | Raw | Equal |
+| RestBench | 40% | 16% | 44% | 36% | 20% | 44% | 30% | 0% | 70% |
+| ToolBench | 68% | 4% | 28% | 56% | 4% | 40% | 56% | 0% | 44% |
+
+our design of a tool-adaptive termination mechanism effectively prevents unnecessary redundancy, leading to more concise documentation. Additionally, the results suggest that ToolBench tools have significantly lower documentation quality than those in the RestBench dataset, as the readability of ToolBench tools exhibited a more substantial improvement after modification by DRAFT. This further highlights the necessity of revising the existing tool documentation.
+
+## 4 RELATED WORK
+
+**Tool Learning.** Recent studies have highlighted the potential of LLMs to utilize external tools in addressing complex problems (Qu et al., 2024b; Wang et al., 2024d). With the aid of external tools, LLMs can obtain up-to-date information (Nakano et al., 2021; Gou et al., 2024a;b), enhance domain-specific knowledge (M. Bran et al., 2024; Zhang et al., 2024a), process multi-modal information (Surís et al., 2023; Gao et al., 2024c), and more. Existing tool learning approaches can be categorized into two types: tuning-based and tuning-free methods (Gao et al., 2024b). Tuning-based methods enhance the tool-using capabilities of LLMs by fine-tuning them on tool-related datasets (Patil et al., 2023; Hao et al., 2024; Yang et al., 2024; Qin et al., 2024; Liu et al., 2024). However, this approach is only applicable to open-source models and requires substantial computational resources. In contrast, tuning-free methods provide LLMs with tool documentation and a few demonstrations (Wei et al., 2022; Hsieh et al., 2023; Paranjape et al., 2023; Du et al., 2024; Shi et al., 2024), relying on the in-context learning ability to understand how to use tools. This approach requires no additional training and allows for the plug-and-play integration of external tools. However, this method necessitates high-quality tool documentation that is aligned with the comprehension of LLMs (Yuan et al., 2024; Chen et al., 2024). In this paper, we propose a method to align with LLMs understanding and improve the quality of tool documentation to enhance the tool-using capabilities of LLMs.
+
+**Learning from Feedback.** Recent studies show that LLMs can improve their initial responses through self-correction, leading to improved performance (Shinn et al., 2024; Madaan et al., 2024; Pan et al., 2024; Huang et al., 2024). However, some researchers observe that relying exclusively on self-correction without external feedback may yield minimal improvements or worsen performance (Zhao et al., 2024). In contrast, incorporating learning from feedback has been shown to improve various tasks (Jin et al., 2023; Gao et al., 2024a; Wang et al., 2024c; Pan et al., 2024; Welleck et al., 2022; Zhang et al., 2024b). The forms of feedback are categorized into scalar and natural language types (Gou et al., 2024a). Scalar feedback provides coarse-grained information and typically serves as a reward signal in reinforcement learning frameworks (Ziegler et al., 2019), while natural language feedback provides detailed insights and is used in prompts for LLMs to enhance performance (Jin et al., 2023). The sources of feedback are diverse, including humans (Ouyang et al., 2022), critic models (Nathani et al.), external tools (Wang et al., 2024b; Qiao et al., 2024), and even the LLM itself. To ensure that tool documentation genuinely reflects the purpose of the tool, we obtain feedback by actually using the tool to get the returned results, thereby producing high quality tool documentation.
+
+## 5 CONCLUSION
+
+In this paper, we highlight that the misalignment between the existing, primarily human-centric tool documentation and the interpretive requirements of LLMs acts as a pivotal barrier obstructing the full potential of tool learning with LLMs. To remedy this, inspired by trial-and-error, we introduce DRAFT, a dynamic and self-improving framework specifically designed to iteratively refine tool documentation based on direct interactions and feedback loops between LLMs and external tools. Through extensive experimentation, our findings substantiate the assertion that our proposed DRAFT markedly enhances the alignment between tool documentation and the operational understanding of LLMs, thereby fostering more effective tool usage.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/TH4gKbZS1E.txt b/papers/TH4gKbZS1E.txt
new file mode 100644
index 0000000000000000000000000000000000000000..862bfaabbaf667350746dd4b8c90fa2678041f48
--- /dev/null
+++ b/papers/TH4gKbZS1E.txt
@@ -0,0 +1,519 @@
+**Primary Area:** foundation or frontier models, including LLMs
+
+
+
+{0}------------------------------------------------
+
+# KAN VERSUS MLP ON IRREGULAR OR NOISY FUNCTIONS
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+In this paper, we compare the performance of Kolmogorov-Arnold Networks (KAN) and Multi-Layer Perceptron (MLP) networks on irregular or noisy functions. We control the number of parameters and the size of the training samples to ensure a fair comparison. For clarity, we categorize the functions into six types: regular functions, continuous functions with local non-differentiable points, functions with jump discontinuities, functions with singularities, functions with coherent oscillations, and noisy functions. These features are typically not available as prior knowledge in real applications; therefore, we do not specifically select the corresponding network structure for each function. Our experimental results indicate that KAN does not always perform best. Furthermore, increasing the size of training samples can improve performance to some extent. When noise is added to functions, the irregular features are often obscured by the noise, making it challenging for both MLP and KAN to extract these features effectively. We hope these experiments provide valuable insights for future neural network research and encourage further investigations to overcome these challenges.
+
+## 1 INTRODUCTION
+
+Since its launch, Kolmogorov-Arnold networks (KAN)(Liu et al., 2024b) has garnered significant attention. These networks utilize the Kolmogorov-Arnold representation theorem, which posits that any multivariate continuous function can be expressed as a combination of continuous univariate functions and addition. Unlike conventional Multi-Layer Perceptron (MLP) networks, KANs incorporate learnable activation functions. According to (Liu et al., 2024b), this feature provides KANs with enhanced interpretability and accuracy over MLPs.
+
+Noting the release of KAN 2.0 (Liu et al., 2024a), we will conduct all experiments using the latest pykan version (v0.2.6) to leverage its optimizations. KAN 2.0 introduced multiplication nodes, which significantly enhance the fitting of multivariate functions, especially those involving direct multiplication or division of independent variables. However, the improvement is minimal for the functions used in this paper, so lower versions of Pykan are also acceptable.
+
+Numerous investigations into KAN applications have rapidly surfaced, covering areas such as smart energy grid optimization(Wang et al., 2024)(Tang et al., 2024), chemistry data analysis(Wang et al., 2024)(Li et al., 2024b), image classification(Cheon, 2024)(Teymoor Seydi, 2024)(Igali & Shamoi, 2024), deep function learning(Zhang, 2024), quantum architecture search(Kundu et al., 2024), medical image analysis and processing(Li et al., 2024a)(Chen et al., 2024), disease risk predictions(Dong, 2024), graph learning tasks(Kiamari et al., 2024)(Li, 2024)(Ghaith Altarabichi, 2024), asset pricing models(Wang & Singh, 2024), 3D object detection (in autonomous driving)(Lai et al., 2024), sentiment analysis(Lawan et al., 2024), and deep kernel learning(Zinage et al., 2024).
+
+On the contrary, a growing body of research has highlighted the imperfections of KANs compared to MLPs. For example, (Zhang, 2024) and (Shen et al., 2024) noted the vulnerability of KANs to noise, indicating that even minor noise can lead to a significant rise in test loss. Additionally, (Tran et al., 2024) claimed that KANs do not outperform MLPs in highly complex datasets and require considerably more hardware resources. Furthermore, (Yu et al., 2024) noted that MLPs generally have higher accuracy than KANs across various standard machine learning tasks, with the exception of tasks involving symbolic formula representation.
+
+{1}------------------------------------------------
+
+Moreover, the performance of networks may be influenced by the regularity of functions, prompting this study to compare the performance of KAN and MLP, across distinct types of functions with varying degrees of regularity (or noisy functions).
+
+In this investigation, we assess the performance of MLP and KAN in modeling irregular or noisy functions. To ensure fairness, we control the number of parameters and the amount of training data. Moreover, we investigate the influence of different optimizers on the accuracy of fitting specific functions. This research continues directly and naturally from our recent study on the efficacy of KANs in fitting noisy functions (Shen et al., 2024).
+
+The structure of this paper is organized as follows: Section 2 provides an introduction to the Kolmogorov-Arnold Theorem and KANs, discussing their benefits and limitations, and enumerates the six types of functions. Section 3 evaluates the performance of MLP and KAN in approximating regular and irregular functions. Section 4 introduces noise to the previously utilized functions and continues the comparison between MLP and KAN. Finally, Section 5 summarizes the findings of our experiments.
+
+## 2 KOMOGOROV-ARNOLD THEOREM AND KANs
+
+The Kolmogorov-Arnold theorem pertains to expressing multivariable continuous functions. According to the theorem, any continuous function involving multiple variables can be expressed as a combination of continuous single-variable functions and addition (Kolmogorov, 1956) (Kolmogorov, 1957) (Arnold, 1957). Formally, it can be stated as:
+
+**Theorem 1.** [Kolmogorov-Arnold Theorem] *Let $f : [0, 1]^n \rightarrow \mathbb{R}$ be any multivariate continuous function, there exist continuous univariate functions $\phi_i$ and $\psi_{ij}$ such that:*
+
+$$f(x_1, x_2, \dots, x_n) = \sum_{i=1}^{2n+1} \phi_i \left( \sum_{j=1}^n \psi_{ij}(x_j) \right). \quad (1)$$
+
+Leveraging the Kolmogorov-Arnold theorem, KANs introduce a novel neural network architecture. Unlike traditional Multi-Layer Perceptrons (MLPs) which use fixed activation functions, KANs employ learnable activation functions. This methodology is theoretically advantageous in enhancing the adaptability of KANs across different datasets and applications.
+
+Unfortunately, Theorem 1 was originally proven non-constructively, lacking a constructive proof initially. In 2009, (Braun & Griebel, 2009) presented a constructive proof for this theorem. Nevertheless, challenges emerge when handling functions exhibiting irregular patterns, which mathematical analysis typically categorizes into at least five distinct types. Table 1 outlines these types along with detailed examples.
+
+## 3 COMPARISON ON IRREGULAR FUNCTIONS
+
+Here, we offer some explanations for the initial five types mentioned in Table 1. We compare these functions using multiple sets of KAN and MLP networks that have similar parameter counts. The number of parameters for each network are presented in Table 2. It is worth noting that the features of these functions are typically not available as prior knowledge in real applications, so we do not specifically select the corresponding network structure for each function. We implement the L-BFGS optimizer for these functions as it shows better performance in small-scale training. For functions with singularities or coherent oscillations, which might need more training samples and iterations, we also investigate the Adam optimizer’s capability.
+
+### 3.1 REGULAR FUNCTIONS
+
+First, consider the functions exhibiting strong regularity. Such functions are continuous and differentiable at all points, similar to $f_1$ and $f_2$ . We reconstruct these two functions using two sets of MLP and KAN networks that have comparable parameters but are trained with different sample sizes. The outcomes are displayed in Figure 1. It can be observed that for this category of functions, KAN outperforms MLP.
+
+{2}------------------------------------------------
+
+Table 1: Several Types of Functions and Their Examples
+
+| Regular | Smooth | |
+|-|-|-|
+| | $f_1(x) = x^2$
| $f_2(x) = e^x$
|
+| Irregular | Continuous everywhere except at points of non-differentiability | |
+| | $f_3(x) = x $
| $f_4(x) = 1 - \sqrt{ x }$
|
+| | Jump | |
+| | $f_5(x) = \begin{cases} 1, & x < 0.5 \\ 0, & \text{other} \end{cases}$
| $f_6(x) = \begin{cases} 1 - 4x^2, & x < 0.5 \\ 1, & \text{other} \end{cases}$
|
+| | Singular | |
+| | $f_7(x) = \frac{1}{x}$
| $f_8(x) = \frac{1}{1-x^2} - 1$
|
+| | Coherent oscillation | |
+| | $f_9(x) = \cos(\frac{1}{x})$
| $f_{10}(x) = \cos(\frac{2\pi}{1-x^2})$
|
+| Noisy | Noisy | |
+| | $y = x + n(x)$ , where $n(x)$ denotes additive noise.
| |
+
+Table 2: The number of parameters for each KAN and MLP network.
+
+| MLP | | KAN | | | |
+|-|-|-|-|-|-|
+| width | parameter | width | grid | k | number of parameters |
+| [1,39,1] | 118 | [1,5,1] | 3 | 3 | 120 |
+| [1,79,1] | 238 | [1,10,1] | 3 | 3 | 240 |
+
+{3}------------------------------------------------
+
+Table 3: Time consumption of L-BFGS and Adam optimizers in fitting functions $f_7$ and $f_8$ using MLP and KAN
+
+| Function | Network | Optimizer | Time(s) |
+|-|-|-|-|
+| $f_7$ | MLP | L-BFGS | 8.3069 |
+| $f_7$ | MLP | Adam | 4.3064 |
+| $f_7$ | KAN | L-BFGS | 588.8074 |
+| $f_7$ | KAN | Adam | 38.4595 |
+| $f_8$ | MLP | L-BFGS | 8.6801 |
+| $f_8$ | MLP | Adam | 4.8102 |
+| $f_8$ | KAN | L-BFGS | 359.7498 |
+| $f_8$ | KAN | Adam | 39.4296 |
+
+Table 4: Time consumption of L-BFGS and Adam optimizers in fitting functions $f_9$ and $f_{10}$ using MLP and KAN
+
+| Function | Network | Optimizer | Time(s) |
+|-|-|-|-|
+| $f_9$ | MLP | L-BFGS | 8.4784 |
+| $f_9$ | MLP | Adam | 4.5564 |
+| $f_9$ | KAN | L-BFGS | 237.6449 |
+| $f_9$ | KAN | Adam | 38.9890 |
+| $f_{10}$ | MLP | L-BFGS | 5.8473 |
+| $f_{10}$ | MLP | Adam | 4.8208 |
+| $f_{10}$ | KAN | L-BFGS | 347.3375 |
+| $f_{10}$ | KAN | Adam | 38.6431 |
+
+### 3.2 CONTINUOUS FUNCTIONS WITH POINTS WHERE DERIVATIVES DO NOT EXIST
+
+The functions $f_3$ and $f_4$ serve as prime examples of this category. They maintain continuity at all points, while they are non-differentiable at $x = 0$ .
+
+The outcomes are illustrated in Figure 2. For these particular functions, the KAN’s performance is worse than the MLP’s. Despite the MLP’s slower convergence, it eventually reaches a lower test loss. Additionally, it can be noted that amplifying the training sample size marginally enhances the performance of both networks. However, in the vicinity of the non-differentiable point, the MLP shows more significant improvement than the KAN. More visually, it is evident that the fitting performance of MLP and KAN around $x = 0$ (the non-differentiable point) is approximately the same. Yet, with a larger training sample size, the MLP demonstrates superior fitting performance near $x = 0$ compared to the KAN.
+
+### 3.3 FUNCTIONS WITH JUMP
+
+The examples of this category include $f_5$ and $f_6$ . These functions have jump discontinuities at $x = \pm 0.5$ , where the function values abruptly change between 0 and 1. The experimental outcomes for these functions are depicted in Figure 3. Results show that the MLP outperforms the KAN. Moreover, expanding the training dataset size can enhance both networks’ performance to a certain extent. Nevertheless, KAN consistently fails to match the performance of MLP.
+
+### 3.4 FUNCTIONS WITH SINGULARITIES
+
+Functions possessing singularities display distinct behaviors, marked by a rapid change rate as they near these points, with their first derivative tending towards infinity at the singularity. Additionally, for any chosen continuous interval that omits these singularities, the functions remain continuous and differentiable across the interval.
+
+To avoid division by zero and guarantee clear fitting results, the ranges of the functions $f_7$ and $f_8$ are limited to $[0.001, 1]$ and $[-0.999, 0.999]$ , respectively. We examined the effects of the training sample size, the number of Epochs, and the selection of optimizer on the fitting performance. As illustrated in Figure 4, simply enlarging the sample size by itself does not substantially enhance the performance when recovering $f_7$ and $f_8$ .
+
+Pykan offers two optional optimizers: Adam and L-BFGS. As depicted in Figure 5, L-BFGS achieves faster convergence, whereas networks with Adam converges to a lower test loss. However, it is crucial to recognize that with a fixed learning rate, the improvement from this strategy is naturally constrained. As illustrated in Table 3, for an identical number of epochs, the training duration of the network with the L-BFGS optimizer is frequently several times greater than with the Adam optimizer.
+
+Drawing from earlier experiments and findings, the fitting tests will utilize the Adam optimizer set with a learning rate of 0.01. As shown in Figure 6, KAN outperformed MLP in terms of fitting functions with singularities at the same number of epochs.
+
+{4}------------------------------------------------
+
+### 3.5 FUNCTIONS WITH COHERENT OSCILLATIONS
+
+A unique type of functional singularity, labeled as 'coherent oscillatory singularity,' is exemplified by functions $f_9$ and $f_{10}$ . These functions display 'unreachable points' (e.g., $x = 0$ for $f_9$ ), where as the function approaches these points, its values oscillate increasingly rapidly, intersecting the x-axis infinitely often.
+
+In the experimental phase, taking a similar approach as described in section D. As shown in Figure 4 and 7, an increase in the sampling rate did not markedly enhance fitting accuracy. Particularly, within the KAN network framework, the optimizer L-BFGS outperformed Adam for function $f_9$ , while for function $f_{10}$ , Adam showed superior results. On the other hand, when fitting both functions with an MLP, Adam consistently performed better than L-BFGS.
+
+In a similar manner, Table 4 demonstrates that employing the L-BFGS optimizer during the fitting process usually resulted in an additional increase in computational time. Figure 8 demonstrates that KAN consistently surpasses MLP when comparing performance over the same number of epochs.
+
+## 4 COMPARISON ON NOISY FUNCTIONS
+
+In the following, we discuss the roles of noisy functions. We introduce noise to functions previously discussed and proceed to evaluate the performance of MLP and KAN. According to the conclusions drawn in the preceding section, we will classify the functions into three categories: regular functions, functions with localized irregularities, and functions with severe discontinuities.
+
+### 4.1 ADDING NOISE TO REGULAR FUNCTIONS
+
+We introduce noise to functions exhibiting strong regularity, and subsequently fit these noisy data using KAN and MLP. The experimental outcomes are depicted in Figure 9. Our observations indicate that KAN achieves a lower test loss with low noise levels but performs worse under high noise conditions. When comparing the function fitting effect, the conclusion remains consistent: MLP shows better performance with minor noise interference, but KAN rapidly outperforms MLP as the training sample size increases.
+
+### 4.2 ADDING NOISE TO FUNCTIONS WITH LOCALIZED IRREGULARITIES
+
+Noise is subsequently added to $f_3$ , $f_4$ , $f_5$ , and $f_6$ . The experimental findings are shown in Figure 10. For $f_3$ and $f_4$ , the network can still capture some of the irregular features with a larger training sample. However, for $f_5$ and $f_6$ , both KAN and MLP perform poorly. The networks still have difficulty identifying the jump discontinuities, even with an increased sample size.
+
+### 4.3 ADDING NOISE TO FUNCTIONS WITH SEVERE DISCONTINUITIES
+
+Figure 11 shows that KAN's performance surpasses that of MLP when noise is added to functions with singularities or coherent oscillation. Interestingly, from the perspective of test loss, the impact of noise on fitting such functions is minimal. This phenomenon highlights the ineffectiveness of strategies relying solely on increased sampling rates in such instances.
+
+## 5 CONCLUSION
+
+In this study, we evaluate the effectiveness of KAN and MLP in approximating irregular or noisy functions. Our analysis concentrates on two main factors: the relative performance of KAN and MLP in fitting functions with different types according to regularity, and their ability to handle noise during the fitting process.
+
+Firstly, as identified in (Shen et al., 2024) and additionally explored in this study, raising the sampling rate is a potent method to enhance the fitting performance of functions $f_1 - f_6$ . Particularly, this strategy shows greater advantages when handling noisy data versus clean data. Nevertheless, the improvement in the fitting accuracy for functions with low regularity ( $f_7 - f_{10}$ ) is minimal, irrespective of the presence of noise.
+
+{5}------------------------------------------------
+
+Secondly, we also compared the fitting performance under varying Epochs from two distinct perspectives: convergence speed and stabilized test loss. KAN exhibits a faster convergence rate than MLP across all tested functions. However, MLP outperforms KAN on test functions $f_3 - f_6$ on stabilized test loss.
+
+Thirdly, via experimental analysis (fitting $f_7 - f_{10}$ ), it was observed that Adam exceeded L-BFGS in performance for both networks in every instance, except for function $f_9$ . Notably, when fitting function $f_9$ with the KAN, L-BFGS demonstrated better results than Adam.
+
+At last, when dealing with noisy functions, KAN exhibits superior performance over MLP for regular functions or functions with severe discontinuities. Conversely, for functions with localized irregularities, MLP outperforms KAN.
+
+
+
+Figure 1 consists of two line plots, (a) and (b), showing Test Loss versus Training Samples for functions $f_1$ and $f_2$ respectively. Both plots compare KAN (grid=3, k=3) and MLP (various architectures: [1.5, 1], [1.39, 1], [1.10, 1], [1.79, 1]). In both cases, KAN shows a significantly lower test loss than MLP as the number of training samples increases from 1000 to 5000. The test loss for KAN stabilizes around 0.0005, while MLP's test loss remains higher, around 0.0015 to 0.0020.
+
+Figure 1: Recover f1 and f2 independently using KAN and MLP under different training sample sizes. (a) f1: Test Loss vs Training Samples. (b) f2: Test Loss vs Training Samples.
+
+Figure 1: Recover $f_1$ and $f_2$ independently using KAN and MLP under different training sample sizes.
+
+
+
+Figure 2 is a 4x4 grid of plots. The first two rows (a-d) show training loss over epochs or training samples for functions $f_3$ and $f_4$ . The last two rows (e-l) show the real values and predictions for $f_3$ and $f_4$ using MLP and KAN with different training sample sizes (50 and 5000). In the bottom rows, the real values are shown as green lines, and the predictions are shown as red lines. For $f_3$ (a V-shape), both MLP and KAN perform well. For $f_4$ (a bell-shaped curve), MLP's predictions (blue line) are smoother and follow the real values (green line) more closely than KAN's predictions (red line), especially with 50 training samples.
+
+Figure 2: Recover f3 and f4 independently using KAN and MLP. The figure is a 4x4 grid of plots. Rows 1 and 2 show training loss over epochs and samples for f3 and f4. Rows 3 and 4 show real values and predictions for f3 and f4 with different training sample sizes (50 and 5000).
+
+Figure 2: Recover $f_3$ and $f_4$ independently using KAN and MLP.
+
+{6}------------------------------------------------
+
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+
+![Figure 3: Recover f5 and f6 independently using KAN and MLP. The figure consists of eight subplots arranged in a 2x4 grid. The top row (a-d) shows results for f5, and the bottom row (e-h) shows results for f6. Columns 1 and 2 show training loss over epochs (0-50) for KAN (grid=3, k=3) and MLP (1,79,1). Columns 3 and 4 show real values and predictions over the domain [-1, 1] for training samples of 50 and 5000 respectively. In all cases, KAN (red dashed line) fits the target function (green squares) much better than MLP (blue dashed line).](c0843c6d138705289960d9f53a6e72a1_img.jpg)
+
+Figure 3: Recover f5 and f6 independently using KAN and MLP. The figure consists of eight subplots arranged in a 2x4 grid. The top row (a-d) shows results for f5, and the bottom row (e-h) shows results for f6. Columns 1 and 2 show training loss over epochs (0-50) for KAN (grid=3, k=3) and MLP (1,79,1). Columns 3 and 4 show real values and predictions over the domain [-1, 1] for training samples of 50 and 5000 respectively. In all cases, KAN (red dashed line) fits the target function (green squares) much better than MLP (blue dashed line).
+
+Figure 3: Recover $f_5$ and $f_6$ independently using KAN and MLP.
+
+
+
+Figure 4: Recover f7, f8, f9 and f10 independently using KAN and MLP with optimizer Adam or L-BFGS, 2000 Epochs. The figure consists of four subplots: (a) f7, Adam for MLP and KAN; (b) f8, Adam for MLP and KAN; (c) f9, Adam for MLP, L-BFGS for KAN; (d) f10, Adam for MLP and KAN. Each plot shows training loss over 1000 epochs. KAN (red dashed line) consistently achieves lower loss than MLP (blue dashed line).
+
+Figure 4: Recover $f_7$ , $f_8$ , $f_9$ and $f_{10}$ independently using KAN and MLP with optimizer Adam or L-BFGS, 2000 Epochs
+
+![Figure 5: The variation of test loss with the increasing number of epochs when recovering f7 and f8 independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP with optimizer L-BFGS and Adam, learning rate=0.01. The figure consists of four subplots: (a) MLP, f7; (b) KAN, f7; (c) MLP, f8; (d) KAN, f8. Each plot shows test loss over 1500 epochs. KAN (red dashed line) converges to a lower test loss faster than MLP (blue dashed line).](01da0d212fb571933f10f96556157745_img.jpg)
+
+Figure 5: The variation of test loss with the increasing number of epochs when recovering f7 and f8 independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP with optimizer L-BFGS and Adam, learning rate=0.01. The figure consists of four subplots: (a) MLP, f7; (b) KAN, f7; (c) MLP, f8; (d) KAN, f8. Each plot shows test loss over 1500 epochs. KAN (red dashed line) converges to a lower test loss faster than MLP (blue dashed line).
+
+Figure 5: The variation of test loss with the increasing number of epochs when recovering $f_7$ and $f_8$ independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP with optimizer L-BFGS and Adam, learning rate=0.01
+
+![Figure 6: Recover f7, (x in [0.001, 1]) and f8, (x in [-0.999, 0.999]) independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP both with optimizer Adam, same or different epochs. The figure consists of four subplots: (a) f7, MLP; (b) f7, KAN; (c) f8, MLP; (d) f8, KAN. Each plot shows training loss over 1.5 epochs. KAN (red dashed line) fits the target function (green squares) much better than MLP (blue dashed line).](023b142f90e1253702ac88b18380d3ec_img.jpg)
+
+Figure 6: Recover f7, (x in [0.001, 1]) and f8, (x in [-0.999, 0.999]) independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP both with optimizer Adam, same or different epochs. The figure consists of four subplots: (a) f7, MLP; (b) f7, KAN; (c) f8, MLP; (d) f8, KAN. Each plot shows training loss over 1.5 epochs. KAN (red dashed line) fits the target function (green squares) much better than MLP (blue dashed line).
+
+Figure 6: Recover $f_7$ , ( $x \in [0.001, 1]$ ) and $f_8$ , ( $x \in [-0.999, 0.999]$ ) independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP both with optimizer Adam, same or different epochs
+
+{7}------------------------------------------------
+
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+
+
+
+Figure 7: Variation of test loss with increasing number of epochs when recovering f9 and f10. Subplots (a) MLP, f9; (b) KAN, f9; (c) MLP, f10; (d) KAN, f10. Each plot shows test loss (y-axis) vs. training samples (x-axis, 0 to 2000). Adam (blue line) and L-BFGS (orange line) optimizers are compared. In all cases, L-BFGS achieves lower test loss faster than Adam.
+
+Figure 7: The variation of test loss with the increasing number of epochs when recovering $f_9$ and $f_{10}$ independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP with optimizer L-BFGS and Adam, learning rate=0.01
+
+![Figure 8: Recover f9 and f10 independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP. Subplots (a) f9, MLP (Adam); (b) f9, KAN (L-BFGS); (c) f10, MLP (Adam); (d) f10, KAN (Adam). Each plot shows the function value (y-axis, -1.0 to 2.0) vs. x (x-axis, -1.0 to 1.0). Real data points are shown as green dots, and predictions are shown as lines. KAN (b, d) shows better fit to the real data than MLP (a, c).](ecb25d766719ce041cf4cc390791a098_img.jpg)
+
+Figure 8: Recover f9 and f10 independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP. Subplots (a) f9, MLP (Adam); (b) f9, KAN (L-BFGS); (c) f10, MLP (Adam); (d) f10, KAN (Adam). Each plot shows the function value (y-axis, -1.0 to 2.0) vs. x (x-axis, -1.0 to 1.0). Real data points are shown as green dots, and predictions are shown as lines. KAN (b, d) shows better fit to the real data than MLP (a, c).
+
+Figure 8: Recover $f_9$ , ( $x \in [-0.999, 0.999]$ ) and $f_{10}$ , ( $x \in [-0.999, 0.999]$ ) independently using [1,10,1] KAN (grid=3,k=3) and [1,79,1] MLP with same or different optimizers and epochs
+
+![Figure 9: Recover f1 and f2 with noise independently using KAN and MLP. The figure is a 4x3 grid of plots. Row 1: Various training samples, [1,5,1] KAN (grid=3, k=3) and [1,39,1] MLP, f1 with noise. Row 2: Various training samples, [1,5,1] KAN (grid=3, k=3) and [1,39,1] MLP, f2 with noise. Row 3: Original data, noisy data and predictions, f1 with noise, training samples = 50. Row 4: Original data, noisy data and predictions, f2 with noise, training samples = 5000 (500 plotted for clarity). Columns: (a) Original data, noisy data and predictions, f1 with noise, training samples = 50; (b) Original data, noisy data and predictions of MLP, f1 with noise, training samples = 5000 (500 plotted for clarity); (c) Original data, noisy data and predictions of KAN, f1 with noise, training samples = 5000 (500 plotted for clarity).](27b22513fc27a0ff5f230b062ad3112f_img.jpg)
+
+Figure 9: Recover f1 and f2 with noise independently using KAN and MLP. The figure is a 4x3 grid of plots. Row 1: Various training samples, [1,5,1] KAN (grid=3, k=3) and [1,39,1] MLP, f1 with noise. Row 2: Various training samples, [1,5,1] KAN (grid=3, k=3) and [1,39,1] MLP, f2 with noise. Row 3: Original data, noisy data and predictions, f1 with noise, training samples = 50. Row 4: Original data, noisy data and predictions, f2 with noise, training samples = 5000 (500 plotted for clarity). Columns: (a) Original data, noisy data and predictions, f1 with noise, training samples = 50; (b) Original data, noisy data and predictions of MLP, f1 with noise, training samples = 5000 (500 plotted for clarity); (c) Original data, noisy data and predictions of KAN, f1 with noise, training samples = 5000 (500 plotted for clarity).
+
+Figure 9: Recover $f_1$ and $f_2$ with noise independently using KAN and MLP.
+
+{8}------------------------------------------------
+
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+
+
+
+(a) Various training samples, [1,5,1] KAN (grid=3, k=3) and [1,39,1] MLP, $f_3$ with noise
+
+(b) Various training samples, [1,5,1] KAN (grid=3, k=3) and [1,39,1] MLP, $f_4$ with noise
+
+(c) Various training samples, [1,5,1] KAN (grid=3, k=3) and [1,39,1] MLP, $f_5$ with noise
+
+(d) Various training samples, [1,5,1] KAN (grid=3, k=3) and [1,39,1] MLP, $f_6$ with noise
+
+(e) Original data, noisy data and predictions, $f_3$ with noise, training samples = 50
+
+(f) Original data, noisy data and predictions of MLP, $f_3$ with noise, training samples = 5000 (500 plotted for clarity)
+
+(g) Original data, noisy data and predictions of KAN, $f_3$ with noise, training samples = 5000 (500 plotted for clarity)
+
+(h) Original data, noisy data and predictions, $f_4$ with noise, training samples = 50
+
+(i) Original data, noisy data and predictions of MLP, $f_4$ with noise, training samples = 5000 (500 plotted for clarity)
+
+(j) Original data, noisy data and predictions of KAN, $f_4$ with noise, training samples = 5000 (500 plotted for clarity)
+
+(k) Original data, noisy data and predictions, $f_5$ with noise, training samples = 50
+
+(l) Original data, noisy data and predictions, $f_5$ with noise, training samples = 5000 (500 plotted for clarity)
+
+(m) Original data, noisy data and predictions, $f_6$ with noise, training samples = 50
+
+(n) Original data, noisy data and predictions, $f_6$ with noise, training samples = 5000 (500 plotted for clarity)
+
+Figure 10: Recover f3, f4, f5 and f6 with noise independently using KAN and MLP. The figure consists of 13 subplots (a-m) arranged in a 4x4 grid. Subplots (a-d) show training loss vs. training samples for various noise levels (0, 2, 4, 10) for functions f3, f4, f5, and f6 respectively. Subplots (e-n) show original data (black line), noisy data (green dots), and predictions (red line) for functions f3, f4, f5, and f6. Each subplot compares KAN (grid=3, k=3) and MLP (grid=3, k=3) models. The noise level is 10 for all functions. Training samples used are 50, 500, 1000, 2000, 3000, 4000, and 5000. For clarity, only 500 noisy data points are plotted in (f-n).
+
+Figure 10: Recover $f_3$ , $f_4$ , $f_5$ and $f_6$ with noise independently using KAN and MLP.
+
+{9}------------------------------------------------
+
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+
+
+
+(a) Various training samples, $[1,10,1]$ KAN (grid=3, $k=3$ ) and $[1,79,1]$ MLP, $f_7$ with noise
+
+(b) Original data, noisy data and predictions, $f_7$ with noise, MLP
+
+(c) Original data, noisy data and predictions, $f_7$ with noise, KAN
+
+(d) Various training samples, $[1,10,1]$ KAN (grid=3, $k=3$ ) and $[1,79,1]$ MLP, $f_8$ with noise
+
+(e) Original data, noisy data and predictions, $f_8$ with noise, MLP
+
+(f) Original data, noisy data and predictions, $f_8$ with noise, KAN
+
+(g) Various training samples, $[1,10,1]$ KAN (grid=3, $k=3$ , Opt=L-BFGS) and $[1,79,1]$ MLP (Opt=Adam), $f_9$ with noise
+
+(h) Original data, noisy data and predictions, $f_9$ with noise, MLP
+
+(i) Original data, noisy data and predictions, $f_9$ with noise, KAN
+
+(j) Various training samples, $[1,10,1]$ KAN (grid=3, $k=3$ ) and $[1,79,1]$ MLP, $f_{10}$ with noise
+
+(k) Original data, noisy data and predictions, $f_{10}$ with noise, MLP
+
+(l) Original data, noisy data and predictions, $f_{10}$ with noise, KAN
+
+Figure 11: Recover f7, f8, f9 and f10 with noise independently using KAN and MLP. The figure consists of 12 subplots arranged in a 4x3 grid. The first column (a, d, g, j) shows 'Train Loss' vs 'Training Samples' for various models (origin (KAN), origin (MLP), SNR=10 (KAN), SNR=10 (MLP), SNR=0 (KAN), SNR=0 (MLP), SNR=4 (KAN), SNR=4 (MLP)). The second column (b, e, h, k) shows 'Original Data' (black dashed line) and 'Noisy Data' (green dots) with predictions from an MLP model. The third column (c, f, i, l) shows 'Original Data' (black dashed line) and 'Noisy Data' (green dots) with predictions from a KAN model. Rows correspond to functions f7, f8, f9, and f10 respectively. Subplots (b, c, e, f, h, i, k, l) include a zoomed-in view of the noisy data points around the original function curve.
+
+Figure 11: Recover $f_7$ , $f_8$ , $f_9$ and $f_{10}$ with noise independently using KAN and MLP.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/UvfI4grcM7.txt b/papers/UvfI4grcM7.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7555d2959f4d3075363c0fcedc4917dcfb7df943
--- /dev/null
+++ b/papers/UvfI4grcM7.txt
@@ -0,0 +1,253 @@
+**Primary Area:** applications to neuroscience & cognitive science
+
+
+
+{0}------------------------------------------------
+
+# BIOLOGICALLY CONSTRAINED BARREL CORTEX MODEL INTEGRATES WHISKER INPUTS AND REPLICATES KEY BRAIN NETWORK DYNAMICS
+
+Tianfang Zhu1\*, Dongli Hu1\*, Jiandong Zhou1, Kai Du2,4† & Anan Li1,3,5†
+
+1Wuhan National Laboratory for Optoelectronics, Huazhong University of Science and Technology
+
+2Institute for Artificial Intelligence, Peking University
+
+3HUST-Suzhou Institute for Brainsmatics, JITRI
+
+4State Key Laboratory of General Artificial Intelligence, Peking University
+
+5School of Biomedical Engineering, Hainan University
+
+1{funfunfun,hudongli,jiandongzhou,aali}@hust.edu.cn
+
+2{kai.du}@pku.edu.cn
+
+## ABSTRACT
+
+The brain’s ability to transform sensory inputs into motor functions is central to neuroscience and crucial for the development of embodied intelligence. Sensory-motor integration involves complex neural circuits, diverse neuronal types, and intricate intercellular connections. Bridging the gap between biological realism and behavioral functionality presents a formidable challenge. In this study, we focus on the columnar structure of the superficial layers of mouse barrel cortex as a model system. We constructed a model comprising 4,218 neurons across 13 neuronal subtypes, with neural distribution and connection strengths constrained by anatomical experimental findings. A key innovation of our work is the development of an effective construction and training pipeline tailored for this biologically constrained model. Additionally, we converted an existing simulated whisker sweep dataset into a spiking-based format, enabling our network to be trained and tested on neural signals that more closely mimic those observed in biological systems. The results of object discrimination utilizing whisker signals demonstrate that our barrel cortex model, grounded in biological constraints, achieves a classification accuracy exceeds classical convolutional neural networks (CNNs), recurrent neural networks (RNNs), and long short-term memory networks (LSTMs), by an average of 8.6%, and is on par with recent spiking neural networks (SNNs) in performance. Interestingly, a whisker deprivation experiment, designed in accordance with neuroscience practices, further validates the perceptual capabilities of our model in behavioral tasks. Critically, it offers significant biological interpretability: post-training analysis reveals that neurons within our model exhibit firing characteristics and distribution patterns similar to those observed in the actual neuronal systems of the barrel cortex. This study advances our understanding of neural processing in the barrel cortex and exemplifies how integrating detailed biological structures into neural network models can enhance both scientific inquiry and artificial intelligence applications. The code is available at [https://github.com/fun0515/RSNN\\_bfd](https://github.com/fun0515/RSNN_bfd).
+
+## 1 INTRODUCTION
+
+The brain’s remarkable ability to transform sensory inputs into coordinated motor actions is pivotal, not only in neuroscience but also in the development of embodied intelligence systems (Bartolozzi et al., 2022; Putra et al., 2024). This process, known as sensory-motor integration, relies on complex neural circuits, diverse neuronal types, and intricate inter-neuronal connections (Karadimas et al., 2020; Muñoz-Castañeda et al., 2021; Ziegler et al., 2023). These elements are fundamental for both
+
+\*Equal contribution. †Corresponding authors.
+
+{1}------------------------------------------------
+
+
+
+Figure 1 consists of four panels. Panel (A) shows a sagittal section of a mouse head with a red dashed circle highlighting the snout area, with a red arrow pointing to a magnified view of the whisker pads. Panel (B) is a grayscale anatomical image of a mouse barrel cortex with a red dashed circle highlighting a region of the cortex. Panel (C) is a schematic diagram of the barrel cortex layers (L1, L2/3, L4, L5, L6) and the thalamus. It shows thalamic neurons (red) projecting to layer 4 (L4) and other types of neurons (gray) projecting to other layers. Panel (D) is a schematic of the network architecture. It shows an input layer of thalamic neurons (red) projecting to a layer of neurons (FS, RSNP, Pyr\_SP, Pyr\_SS) which then project to two linear output layers. The legend indicates that red circles represent lemniscal neurons and gray circles represent other type neurons.
+
+Figure 1: The biophysical modeling of the barrel cortex based on real anatomy. (A) Diagram of the 'whisker-barrel' signaling pathway. (B) Anatomical image of the barrel cortex. (C) Diagram of thalamic projection neurons. (D) Outline of the biologically constrained network architecture.
+
+Figure 1: **The biophysical modeling of the barrel cortex based on real anatomy.** (A) The “whisker-barrel” signaling pathway. Sensory signals from the whiskers are transmitted by the trigeminal ganglion neurons (1) to the brainstem neurons (2), then relayed to the barrel cortex via the thalamus neurons (3). (Figure modified from (Petersen, 2019)). (B) An anatomical image of the barrel cortex in adult mice, sourced from the Allen Brain Atlas (Wang et al., 2020). (C) Thalamic projection neurons directed to the barrel cortex. Those highlighted in red represent core thalamic projection neurons, originating from the ventral posteromedial thalamic nucleus, predominantly projecting to layer 4 (L4) of the cortex. (D) Outline of our biologically constrained network architecture. External inputs are conveyed into the network through 200 thalamic neurons. The network comprises 13 neuronal populations with a total of 4218 adaptive Leaky Integrate-and-Fire neurons. Red signifies excitatory neurons, whereas blue signifies inhibitory neurons. For instance, “Pyr.” denotes a specific subtype within the category of pyramidal neurons. The network’s prediction is readout from the state of three excitatory populations within the network by two linear layers. Detailed information of 13 neuronal subtypes can be found in the supplementary material.
+
+understanding brain function and advancing artificial intelligence systems capable of interacting seamlessly with the physical environment. However, achieving a balance between biological realism and functional performance in computational models remains a significant challenge, as these models must accurately replicate these complex biological processes.
+
+The rodent barrel cortex, which processes tactile information from whiskers, serves as an exemplary model system for studying sensory-motor integration. Its well-documented columnar organization and neuronal circuitry provide a robust framework for investigations (Petersen, 2019; Staiger & Petersen, 2021). Despite this, traditional computational models often oversimplify biological complexities to achieve functionality, thus losing crucial insights into the actual neural mechanisms. Conversely, highly detailed biologically realistic models (Fan & Markram, 2019; D’Angelo & Jirsa, 2022), while rich in data, are often computationally intensive and difficult to train, limiting their practical application in simulating behaviorally relevant tasks.
+
+To address these challenges, our study introduces an effective construction and training pipeline specifically designed for a biologically constrained model of barrel cortex, aimed at achieving biologically plausible sensory-motor integration. Our approach is characterized by three primary contributions:
+
+- **Biologically constrained barrel cortex model:** We developed a columnar model of the mouse barrel cortex, comprising 4,218 neurons across 13 neuronal subtypes. This model meticulously reflects the neural distribution and synaptic connections dictated by experimental anatomical findings (Huang et al., 2022), ensuring an authentic replication of the biological structure of mouse barrel cortex.
+
+{2}------------------------------------------------
+
+
+
+Figure 2: Anatomical connection probability and network initialization. (A) Heatmap of connection probability between 13 source subtypes and 13 target subtypes. Red borders indicate excitatory connections, and blue borders indicate inhibitory connections. The color scale ranges from 0.0 to 0.3. (B) Heatmap of CV score for parameters theta\_mn and W\_init. The x-axis is theta\_mn (0.0 to 0.28) and the y-axis is W\_init (0.0 to 0.28). The color scale ranges from 5 to 15. (C) Line graph of Test accuracy vs Epochs (0 to 100) for three initial settings: theta\_mn=0.04, W\_init=0.05 (orange line); theta\_mn=0.18, W\_init=0.04 (blue line); and theta\_mn=0.04, W\_init=0.18 (red line). The orange line shows the highest accuracy, reaching approximately 80% by epoch 100. The blue and red lines show lower accuracy, stabilizing around 40% and 45% respectively. Rectangle symbols in (B) mark the initial settings for each line in (C).
+
+Figure 2: **Anatomical connection probability and network initialization.** (A) Connection probabilities among 13 neuron subtypes, derived from (Huang et al., 2022), with excitatory connections represented in red borders and inhibitory connections in blue. (B) The impact of two significant parameters $\theta_{init}$ and $W_{init}$ discussed in Sec. 3.2. Network’s initial states are assessed using the coefficient of variation (CV) to measure the synchrony of neuronal firing. (C) Accuracy on a whisker-related dataset (see in Sec. 3.3) for three initial settings, as denoted by rectangle symbols in (B).
+
+- **Pipeline for model construction and training:** Our novel pipeline is specifically tailored to balance the biological authenticity and behavioral functionality. This includes using intuitive neuron models and sparse connections to mimic the neural diversity and projection strength, introducing an order parameter to measure the synchrony of neuronal activity, thereby identifying trainable initial states. This pipeline is not only applicable to the barrel cortex but can also be extended to other biologically constrained models.
+- **Establishing a novel spiking whisker sweep dataset:** We leveraged a previously developed simulated whisker sweep dataset (Zhuang et al., 2017), originally generated using a physical engine (Coumans & Bai, 2016–2021) with parameters informed by neuroscience research. Our significant contribution was transforming this simulated data into a novel spiking-based dataset (see in Fig. 3), which emulates the sensory signals from the thalamus area. This newly established spiking dataset provides a biologically meaningful platform for training and evaluating our model’s sensory-motor integration capabilities.
+
+While trained on the Spiking Whisker Sweep Dataset (see in Fig. 3), the classification accuracy of our model surpasses that of mainstream models like CNNs (Zhuang et al., 2017), RNNs (Collins et al., 2017), and LSTMs (Ullah et al., 2017), and is competitive with recent SNNs (Yin et al., 2020; Yu et al., 2022; Yao et al., 2021), particularly in neuroscience-inspired whisker deprivation experiments. Additionally, our model demonstrates superior biological interpretability. Our post-training analysis shows that neurons within our network exhibit firing patterns and distribution characteristics remarkably similar to those observed in an actual barrel cortex, including aspects such as response selectivity, dynamical gradients, and node degree distribution. Our findings underscore the potential of incorporating biological constraints into neural network models to enhance their performance on sensory-motor tasks and provide deeper insights into the underlying neural mechanisms. This approach promises significant advances in developing AI systems with brain-like perceptual and motor capabilities and contributes to neuroscientific efforts designed to unravel the complexities of brain function through advanced computational modeling.
+
+## 2 RELATED WORK
+
+**Barrel cortex:** The barrel cortex, a distinct area discovered within the primary somatosensory cortex of rodents, assumes a pivotal role in the animal’s spatial perception, precise localization capabilities, and motor functions. Neurons within this cortex are organized into mesoscale barrel-like formations (see in Fig. 1B), aligned with the layout of the animal’s snout whiskers, hence the name. Each “barrel” preferentially responds to tactile stimuli from the corresponding whisker, forming a distinctive “whisker-barrel” sensory pathway (Petersen, 2019; Staiger & Petersen, 2021). The general pathway process unfolds as follows: Sensory stimuli originating from the whiskers are initially conveyed through the brainstem, subsequently relayed to the barrel cortex via the thalamus, facilitating the integration and processing of tactile information (see in Fig. 1A). The unique structure and function of this “whisker-barrel” model make it a prevalent tool for studying information in-
+
+{3}------------------------------------------------
+
+
+
+Figure 3: Spiking whisker sweep dataset. (A) Diagram showing the data pipeline: 3D objects (Helmet, Box, Plane) sweep across a virtual whisker array, generating Force and Torque signals. These are converted to Rate coding (sigmoid function) and then to Spike trains (Bernoulli sampling). (B) Plot of Rate vs Time step, showing Sampling rate (red line) and Actual rate (black line).
+
+Figure 3: **Spiking whisker sweep dataset.** (A) 3D objects sweep across the virtual whisker array in a physics engine (Zhuang et al., 2017), recording the force and torque signals from whisker base sensors. Then, the analog inputs are converted into spiking inputs by generating spike trains within a time window through the sigmoid function and Bernoulli sampling. (B) Bernoulli sampling probability calculated by the sigmoid function and the actual generated spikes firing rate.
+
+tegration and processing in the brain. Advances in the understanding of cell types, locations, and projection patterns (Peron et al., 2015; Sermet et al., 2019; Zhang & Zagha, 2023; Estebanez et al., 2016; Gardères et al., 2024) in the mouse barrel cortex indicate that the sensor-motor integration in biological systems possesses detailed anatomical principles.
+
+**Biologically constrained model for barrel cortex:** Drawing upon the continuously accumulating quantitative anatomical data, neuroscientists have attempted to reconstruct local circuitry of the barrel cortex on silicon, aiming to validate our understanding of the sensory system. For instance, by employing the Izhikevich single-neuron model (Izhikevich, 2003), a three-barrel model of the superficial layer was constructed to mimic the alterations in synaptic strength that occur subsequent to whisker deprivation (Huang et al., 2022). The dendritic model of spiny stellate cells (Lavzin et al., 2012), direction selectivity model (Kremer et al., 2011), and layer 4 local network model in Fmr1-KO mice (Domanski et al., 2019) have also been constructed. These biological computing models accurately reflect the complex activities in the sensory system, yet they lack perceptual functions in behavioral contexts. This limitation stems primarily from two key factors: Firstly, the intricate dynamics and inherent instabilities of biological models, such as neuronal refractory periods, are not conducive to computational gradients. Secondly, the substantial cost associated with live experiments and the challenges in precisely capturing sensory signals have led to a scarcity of datasets, which in turn, hinders the direct training of biological models akin to machine learning paradigms. Consequently, the application potential of these biological models remains constrained.
+
+**Trainable biologically constrained model:** However, mainstream trainable models overlook the detailed structure of cortical circuits. For instance, artificial neural networks typically adopt regular fully-connected (multilayer perceptrons) or locally-connected (convolutional neural networks) architectures, which are discrepant from the intricately heterogeneous connectivity found in real cortex (Oh et al., 2014). Furthermore, current models do not strictly differentiate between neuron types (excitatory or inhibitory) and numbers, which have been a focal point in recent neuroscientific efforts to decipher brain function (Muñoz-Castañeda et al., 2021; Yao et al., 2023). Therefore, an emerging direction is to integrate more detailed biological mechanisms into traditional computational models, such as introducing dendrites to enhance the spatiotemporal dynamics of network models (Zheng et al., 2024). A spiking neural network (Chen et al., 2022), consisting of over 50,000 neurons distributed across four distinct subtypes, was trained on five biologically pertinent visual tasks, leveraging the findings from neuroscience on the mouse primary visual cortex (Billeh et al., 2020). However, to our best knowledge, network models that possess both the topological structure of the sensory cortex and perceptual behavioral functions are currently rare.
+
+## 3 METHODOLOGY
+
+### 3.1 MODEL CONSTRUCTION
+
+**Network topology:** To enhance biological authenticity, we established a biologically constrained barrel cortex model with reference to the study in neuroscience. The number, location, type, and con-
+
+{4}------------------------------------------------
+
+nectivity of neurons in our model faithfully replicate the findings from the anatomical study (Huang et al., 2022). This study utilized immunohistochemistry, confocal imaging, and other biological techniques to elucidate specific neuronal distribution patterns in the superficial layers of the mouse barrel cortex. In general, our model comprises 13 neuronal subtypes, including 3 excitatory and 10 inhibitory subtypes, totaling 4,218 neurons, along with an additional 200 thalamic neurons. Following the classical “whisker-barrel” signaling pathway (see in Fig. 1A, C), external inputs are initially processed by 200 thalamic neurons and then primarily propagate to four neuronal subtypes found in layer 4 (L4) of the barrel cortex. Considering that the projecting neurons are predominantly excitatory in brain, we use the state of three excitatory communities processed through two linear layers as the readout for the entire network (see in Fig. 1D).
+
+The number of connections between neurons is generated through sampling based on experimentally measured projection strength (see in Fig. 2A). Assuming there are $n$ presynaptic neurons and $m$ postsynaptic neurons, the potential number of connections is $n \times m$ . We introduce a boolean matrix $M$ to constrain the number of connections. The calculation formula is as follows:
+
+$$W' = W \odot M, W \in \mathbb{R}^{n \times m}$$
+
+$$\frac{1}{nm} \sum_{i=1}^n \sum_{j=1}^m M_{ij} = p, M_{ij} \in \{0, 1\}, p \in [0, 1] \quad (1)$$
+
+$$PMF(M_{ij}) = p \cdot \delta_{M_{ij}, 1} + (1 - p) \cdot \delta_{M_{ij}, 0}$$
+
+, where $W$ and $W'$ denote the original and constrained connection weight matrices, respectively. $M$ represents a boolean matrix of the same size as $W$ , where an element of 1 indicates the presence of a corresponding connection, and 0 indicates its absence. $p$ and $\delta$ stand for the experimentally measured connection probability and Kronecker delta, respectively. $PMF$ signifies the Probability Mass Function. Weights and gradients are only computed and updated on existing connections. By repeating this process to establish all connections, our model can be collectively viewed as a spiking recurrent neural network, with each neuronal population construed as a hidden layer within it.
+
+**Single-neuron dynamic model:** We employ the adaptive Leaky Integrate-and-Fire (aLIF) (Yin et al., 2020) model as the backbone for depicting single-neuron dynamics. In comparison to the frequently employed Izhikevich (Izhikevich, 2003) and GLIF (Teeter et al., 2018) neural models in neuroscience, the aLIF model offers simplified computational requirements and is more amenable to training. In contrast to the straightforward LIF neurons, the aLIF model sets the time constant as trainable parameters, thereby effectively capturing the dynamic variations among neurons within cortical networks. The membrane potential $V$ at time $t$ is updated according to this formula:
+
+$$V(t) = e^{-\frac{1}{\tau_m}} \cdot V(t - 1) + (1 - e^{-\frac{1}{\tau_m}}) \cdot R \cdot I(t) - S(t - 1) \cdot \theta(t - 1) \quad (2)$$
+
+, where $R$ and $\tau_m$ respectively denote the resistance and time constant of cell membranes, with $I$ representing the input current. $S$ is a heaviside function used to indicate whether the neuron emits a spike. If a spike is emitted, the membrane potential $V$ undergoes a soft reset by subtracting the current firing threshold $\theta$ .
+
+To avoid abnormal firing, the fired spike triggers a temporary increase in the firing threshold $\theta$ . The firing threshold $\theta(t)$ at time $t$ can be calculated using the following formula:
+
+$$\theta(t) = \theta_{init} + \beta \cdot \eta(t) \quad (3)$$
+
+$$\eta(t) = e^{-\frac{1}{\tau_{adp}}} \cdot \eta(t - 1) + (1 - e^{-\frac{1}{\tau_{adp}}}) \cdot S(t - 1)$$
+
+, where $\theta_{init}$ is the minimum firing threshold. $\beta$ is a constant that regulates the increment of the threshold induced by spikes $\eta$ , which we set to 1.8. $\tau_{adp}$ represents the adaptive time constant of the firing threshold. Notably, we set $\tau_m$ and $\tau_{adp}$ as two additional trainable parameters to investigate the differentiation of neural dynamics in the trained model (see in Sec. 4.3).
+
+To reflect neuronal diversity, we have additionally specified the categories of input current to the neurons: excitatory or inhibitory currents. Neurons in the network receive not only external input currents $I_e$ but also currents $I_{rec}$ from connected neurons. The total current $I(t)$ received by a neuron at time $t$ can be calculated by the following formula:
+
+$$I(t) = W_e I_e(t) + I_{rec}(t), W_e > 0$$
+
+$$I_{rec}(t) = \sum_i H_i W_i^{rec} S_i(t - 1), H_i \in \{-1, 1\}, W^{rec} > 0 \quad (4)$$
+
+{5}------------------------------------------------
+
+Table 1: **Classification accuracies (%) among models.** ANNs are tested on the original real-valued whisker sweep dataset (Zhuang et al., 2017), while SNNs are tested on both the real-valued dataset and the spiking-based dataset constructed in Sec. 3.3.
+
+| ANNs | ST CNN
(Zhuang et al., 2017) | DB LSTM
(Ullah et al., 2017) | RNN+
(Collins et al., 2017) | UGRNN |
+|-|-|-|-|-|
+| Real-valued | 67.2 | 70.9 | 78.2 | 76.4 |
+| SNNs | SRNN 256
(Yin et al., 2020) | STSC SNN
(Yu et al., 2022) | TA SNN
(Yao et al., 2021) | Barrel model
(ours) |
+| Spiking-based | 81.8 | 80.0 | 81.8 | 81.8 |
+| Real-valued | 85.5 | 87.3 | 83.6 | 89.1 |
+
+Table 2: **Classification accuracies of SNNs in whisker deprivation experiments.** Tested on the spiking whisker sweep dataset.
+
+| SNNs | Number of deprived whiskers | | | | | | | | |
+|-|-|-|-|-|-|-|-|-|-|
+| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
+| SRNN 256 (Yin et al., 2020) | 81.8 | 69.0 | 66.2 | 61.6 | 59.0 | 57.0 | 55.0 | 53.4 | 53.2 |
+| STSC SNN (Yu et al., 2022) | 80.0 | 71.9 | 68.4 | 64.8 | 65.2 | 61.7 | 58.3 | 57.5 | 57.2 |
+| TA SNN (Yao et al., 2021) | 81.8 | 72.4 | 66.3 | 64.5 | 60.4 | 56.8 | 54.7 | 47.8 | 48.4 |
+| Barrel model (ours) | 81.8 | 73.8 | 69.7 | 67.9 | 66.1 | 63.7 | 60.4 | 60.1 | 58.0 |
+
+, where $W_i$ and $W_i^{rec}$ represent the weights of the external connection and the connection with the $i$ -th presynaptic neuron, respectively. $H_i$ is a binary constant used to indicate the type of the $i$ -th presynaptic neuron, where 1 represents an excitatory type and $-1$ represents an inhibitory type. $S$ represents the spike emitted by the $i$ -th presynaptic neuron. To distinguish the effects of excitatory and inhibitory currents, all connection weights are clamped to remain positive.
+
+Based on the aforementioned single-neuron dynamics, we can apply Backpropagation-Through-Time (BPTT) to train the entire network. To compute the gradients at the spike-timing, we employ a Gaussian function as the surrogate gradient:
+
+$$grad = \mathcal{N}(V(t)|\theta(t), \sigma^2) \quad (5)$$
+
+, where the mean of distribution $\mathcal{N}$ is the firing threshold $\theta$ , and the variance is a constant $\sigma$ used to scale the membrane potential. Unless otherwise specified, the parameters of neural dynamics in our network are set to the same value.
+
+### 3.2 MODEL TRAINING
+
+Another primary issue in training biologically constrained models is that, as a complex dynamical system, subtle variations in initial parameters can lead to bifurcation in our biological network (Wang, 2022). Therefore, searching for appropriate initialization parameters is crucial for stable training of the network state. Here, we investigate two critical parameters: the initial firing threshold $\theta_{init}$ and the initialized connection weight $W_{init}$ . After generating neuronal connections according to Eq. 1, all connection weights are randomly sampled from a uniform distribution within the range $[0, W_{init}]$ .
+
+Chaotic neuronal activity, as opposed to regular firing, typically signifies a more abundant learnable representational space. Consequently, we introduce the coefficient of variation (CV) as an order parameter to quantify the synchronization of neuronal electrical activity (Tian et al., 2022). Prior to training, we first input samples from the dataset into networks with varying initial states, and quantify the activity of all neurons during the forward propagation process. For an initial network, the spike emissions during the forward propagation of external inputs with time length $T$ among $N$ neurons are recorded, forming an $N \times T$ boolean matrix. Then coefficients of variation can be calculated with this formula:
+
+$$CV = \frac{1}{N} \sum_{i=1}^N \frac{\sigma_i}{\mu_i} \quad (6)$$
+
+{6}------------------------------------------------
+
+
+
+Figure 4: Firing selectivity of neurons in the trained network. (A) Diagram of a network with three input categories: Box, Helmet, and Plane. The Box input is shown with a 0.7 weight and a 120-degree angle. The network is shown with 160 spikes for Box, 20 spikes for Helmet, and 20 spikes for Plane. (B) Two scatter plots showing input-specific firing. The left plot for the 'Initial network' shows 1360 P-value < 0.001 Cells. The right plot for the 'Trained network' shows 2242 P-value < 0.001 Cells. Both plots show neurons with P-values less than 0.001 (orange) and normal cells (blue) in a 3D space defined by Box, Helmet, and Plane axes.
+
+Figure 4: **Firing selectivity of neurons in the trained network.** (A) Count the spikes for each neuron across three categories of inputs, and use this as a vote to determine its displacement in the directions representing the three categories. (B) Visualization results of input-specific firing in the initialized network (left) and the trained network (right). Neurons with a P-value less than 0.001, as determined by one-way ANOVA, are considered to exhibit significant firing selectivity.
+
+, where $\mu_i$ and $\sigma_i$ represent the mean firing rate and standard deviation, respectively, of the $i$ -th neuron. We consider the average value of CV across all input samples as the final score for this initial network. Fig 2B illustrates the evolution of CV score, where a higher value typically indicates more disordered neuronal activity (see in the supplementary material). Fig 2C presents the training performance of three differently initialized networks on the dataset constructed in Sec 3.3, with the initialization exhibiting the higher CV score yielding the best training performance.
+
+### 3.3 SPIKING WHISKER SWEEP DATASET
+
+The absence of corresponding behavioral datasets poses a significant hindrance to the training of biologically constrained models. High time cost of in vivo behavioral experiments and difficulty in accurately recording whisker signals have resulted in a scarcity of available datasets that directly correspond to the barrel cortex. As a result, we converted a virtual whisker sweep dataset (Zhuang et al., 2017) into the spiking format, which serves as a platform for training and analyzing our barrel model, while also facilitating comparisons with mainstream computational models.
+
+In the field of sensory-motor integration in neuroscience, scientists have leveraged anatomical knowledge of rat heads and whiskers to create a physically and biologically realistic whisker array model within a physics engine (Coumans & Bai, 2016–2021). This model comprises 31 whiskers, accurately reflecting mechanical properties such as length, intrinsic curvature, and relative positions. By recording the forces and torques experienced by each whisker as three-dimensional models from ShapeNet dataset (Chang et al., 2015) sweep across the whisker array, a virtual whisker signal classification task can be established.
+
+However, this whisker sweep dataset was originally created for training convolutional neural networks, and thus requires converting signals into spiking-based inputs before they can be used for our biologically constrained network training. Recent neuroscientific research has revealed that whisker vibration signals undergo a transformation from temporal coding to cortical rate coding in the thalamus (Lee et al., 2024). Inspired by this finding, we have developed a method to generate spike trains from force and torque signals recorded by sensors, utilizing a rate coding approach (see in Fig. 3). For the magnitude of the force detected by a whisker sensor at a particular moment $|F|$ , we map it to a probability $p$ of firing a pulse using the sigmoid function:
+
+$$p = \frac{1}{1 + e^{-(\ln |F| - c)}} \quad (7)$$
+
+, where $c$ is the shift coefficient. Subsequently, based on the probability $p$ , independent spikes are generated within a fixed-length time window using Bernoulli sampling. We set the length of time windows to 5, meaning that the time step is extended to five times its original length. The sampling probability versus the actual pulse firing rate is illustrated in Fig. 3B. The torque is processed in the same manner as the force. Specifically, the shape of a single sample in our spiking whisker sweep dataset is (550, 31, 3, 2), representing 550 time steps, 31 whiskers, 3 sensors at the base of each
+
+{7}------------------------------------------------
+
+
+
+Figure 5 consists of two panels, A and B. Panel A shows kernel density estimation (KDE) plots for two parameters, $\tau_m$ and $\tau_{adp}$ , for four L4 subtypes: Pyr\_SP, Pyr\_SS, Inh\_FS, and Inh\_RSNP. The left column shows the distribution of $\tau_m$ (x-axis from 8.5 to 11.5), and the right column shows the distribution of $\tau_{adp}$ (x-axis from 4 to 7). Each plot includes a red vertical dashed line for the mean value and a green vertical solid line for the initial assigned value. Panel B is a bar chart titled 'Pearson correlation: 0.727' and 'P-value: 0.005'. The y-axis is 'Normalized firing rate' from 0.00 to 1.00. The x-axis is 'Neuron subtype' from 1 to 13. For each subtype, there are two bars: a purple bar for 'Trained' and a green bar for 'NS experimental'.
+
+Figure 5: Emergent similarities in neural dynamics between the trained network and neuroscience experiments. (A) Kernel density estimation plots of tau\_m and tau\_adp for four L4 subtypes. (B) Bar chart of normalized firing rates for 13 subtypes.
+
+**Figure 5: Emergent similarities in neural dynamics between the trained network and neuroscience experiments.** (A) Kernel density estimation plots of $\tau_m$ and $\tau_{adp}$ for the four L4 subtypes in the trained network. Red vertical lines denote the mean value, while green vertical lines indicate the identical initial values assigned. The complete set of 13 subtypes is presented in the supplementary material. (B) The comparison of the 13 subtypes after training with experimental-based firing rates, quantified as the Pearson correlation coefficient. The firing rates are normalized to the interval $[0.1, 1]$ to draw the chart. Due to the identical initial dynamic parameters of all neurons, the firing rates are the same pre-training (red reference line).
+
+whisker, and 2 channels for force and torque, respectively. There are 91 samples for each of the three classes, and the dataset is randomly split into training and testing sets in an 8:2 ratio.
+
+## 4 EXPERIMENTAL RESULTS
+
+In this section, we compared comprehensively the ability of our model to perceive objects with several mainstream computational models based on the whisker sweep dataset. Then, we emphasize the biological interpretability of our trained model, delving into the dynamic evolution that transpires within our model throughout the training phase. This exploration offers insights into how the model’s behavior mimics and elucidates underlying biological mechanisms. Details of the model training are provided in the Appendix.
+
+### 4.1 PERFORMANCE COMPARISON WITH BASELINE MODELS
+
+We first evaluated the ability of our barrel cortex constrained model to distinguish objects based on whisker signals and contrasted its classification accuracy with other prominent computational models. As shown in Tab. 1, our model’s accuracy on the whisker sweep dataset surpassed traditional ANNs, reaching a peak of 89.1% on the original real-valued dataset and matching the best performance of recent SNNs at 81.8% on our spiking-based dataset.
+
+Subsequently, we introduced a commonly used whisker deprivation experiment from neuroscience to further compare the whisker-related perceptual abilities of our model with other SNNs. Neuroscientists commonly trim or cauterize specific whiskers of mice in behavioral experiments to study the plasticity of sensory neural system (Gunner et al., 2019; Pan et al., 2022). We mimicked this scenario by randomly occluding different numbers of whisker signals in the spiking whisker sweep dataset (experimental details are provided in the Appendix). The results (see in Tab. 2) demonstrate that our model consistently achieved the highest classification accuracy in all experimental settings, showcasing not only improved fidelity in sensory circuitry but also perceptual classification capabilities that rival those of mainstream computational models.
+
+### 4.2 NEURAL SPECIFIC FIRING SELECTIVITY
+
+Next, we focus on examining the internal modifications that transpire within our model as it develops perceptual capabilities, starting with the firing selectivity. The selective firing observed by neuroscientists in the sensory cortex is a prominent feature for elucidating the mechanisms of sensory functions in the brain (Guy et al., 2023). In vivo experiments have revealed that the barrel cortex contains a vast range of neurons with specific responses; these neurons exhibit strong reactions to
+
+{8}------------------------------------------------
+
+
+
+Figure 6 consists of two panels. Panel A contains two histograms. The top histogram shows the 'Number of nodes' (y-axis, 0 to 50) versus 'Weighted degree' (x-axis, 0 to 80). It compares 'Initial in-degree' (red) and 'Trained in-degree' (blue). The initial distribution is centered around a weighted degree of 10, while the trained distribution is broader and shifted to the right, centered around 20. The bottom histogram shows the 'Number of nodes' (y-axis, 0 to 50) versus 'Weighted degree' (x-axis, 0 to 100). It compares 'Initial out-degree' (red) and 'Trained out-degree' (blue). The initial distribution is centered around a weighted degree of 10, while the trained distribution is broader and shifted to the right, centered around 20. Panel B is a violin plot showing 'Accuracy (%)' (y-axis, 0 to 80) for five different connection probability configurations: 'Anatomic' (blue), 'Random' (orange), 'Fully connected' (green), 'Regular $P=0.5$ ' (red), and 'Regular $P=0.3$ ' (purple). The 'Anatomic' configuration shows the highest accuracy, around 70%. The 'Random' configuration shows the lowest accuracy, around 20%. The other three configurations show intermediate accuracies: 'Fully connected' around 30%, 'Regular $P=0.5$ ' around 30%, and 'Regular $P=0.3$ ' around 35%.
+
+Figure 6: (A) Alterations in weighted degree distribution pre- and post-training. (B) Training performance of networks created with varying connection probabilities.
+
+Figure 6: (A) Alterations in weighted degree distribution pre- and post-training. (B) Training performance of networks created with varying connection probabilities. From left to right: anatomically based connection probabilities, random connection probabilities, fully connected network, and fixed connection probability $P$ . Each configuration was trained ten times to plot the violin diagram. All connection configurations, with the exception of random connections, were initialized using the method described in Sec. 3.2, with the process detailed in the supplementary material.
+
+signals of particular directions (Wilent & Contreras, 2005; Estebanez et al., 2016) and deflection angles (Lavzin et al., 2012) but are relatively insensitive to irrelevant signals.
+
+The approach for quantifying neuronal firing selectivity in our model illustrated in Fig. 4A. Specifically, we sequentially input the three types of samples from dataset into the network, count category-related spikes for each cell, and then employ one-way Analysis of Variance (ANOVA) to judge whether significant differences exist. A neuron is considered input-specific if the resulting $P$ -value is less than 0.001. To visualize this category selectivity, we divided three equally spaced directions and voted for its position according to the number of spikes by cells respond to each category.
+
+Statistical results show that after training, the proportion of neurons with significant firing selectivity has increased from 32.2% to 53.2%. Moreover, the differentiation of category preference becomes more evident (see in Fig. 4B). In the initialized network, the number of spikes responded by neurons to different categories of inputs is balanced, so they are clustered in the central area. However, in the trained network, a cluster of neurons is gathered in the direction of each category, indicating that the number of spikes released in response to that category of input far exceeds that of the other two categories. The same selective firing analysis for other SNNs can be found in the supplementary material. Reproducing neural firing selectivity similar to that of brains enhances the biological interpretability of our network.
+
+### 4.3 DIFFERENTIATED NEURONAL DYNAMICS
+
+Furthermore, we compared the dynamical similarity of 13 neural subtypes between our trained network and those statistically observed in neuroscience experiments, thereby quantifying the biological plausibility of our model. The heterogeneous dynamical properties across neocortex serve as the structural foundation for the coordinated function of different regions (Wang, 2022). Although all neuronal subtypes were initially assigned the same values for $\tau_m$ and $\tau_{adp}$ elaborated in Sec. 3.1, during the training process, these two trainable parameters self-updated in response to optimizing the objective function, leading to the differentiation of individual dynamics for each neuron.
+
+Fig. 5 demonstrates that our network, under the optimization constraint of the classification task only, spontaneously differentiates into dynamic gradients across 13 neuronal subtypes (see in Fig. 5A). Then, we quantitatively compared the similarity between our neural dynamic gradients and experimental results (see in Fig. 5B). Corresponding to these neuron subtypes, Izhikevich neuronal models (Izhikevich, 2003) have been established in neuroscience to fit the data from biological experiments (Huang et al., 2022). We preserved the dynamic parameters of all neuronal subtypes post-training and then applied an identical continuous 550 ms, 1mV constant current to our neurons and their corresponding Izhikevich neurons, recording their firing rates and comparing their similarity. The external current was applied in isolation to each subtype, rather than across the entire network, to prevent cross-contamination of effects. Then, we calculate the Pearson correlation co-
+
+{9}------------------------------------------------
+
+efficient between these two firing rates. In the initial network, all neurons were assigned identical dynamic parameters, resulting in equal firing rates (red reference line in Fig. 5B) across subtypes and no Pearson correlation. However, after training, the Pearson correlation coefficient increased to 0.73 with a P-value of 0.005. Given that biological neuron models typically have longer simulation steps compared to aLIF neurons, we employed a simple normalization to scale their firing rates to the same range [0.1, 1.0] to better visualize them together. The normalization process is as follows:
+
+$$fr' = 0.1 + 0.9 \times \frac{(fr - fr_{min})}{(fr_{max} - fr_{min})} \quad (8)$$
+
+, where $fr$ and $fr'$ represent the original and normalized firing rates. $fr_{max}$ and $fr_{min}$ denote the highest and lowest firing rates among 13 neural subtypes. This normalization does not affect the calculation of the Pearson correlation coefficient. The results indicate that our trained network spontaneously developed dynamic gradients analogous to those observed in the real barrel cortex.
+
+### 4.4 DEGREE DISTRIBUTION AND CONNECTIVITY PROBABILITY ABLATION
+
+Finally, we investigated the alterations in the network’s topological structure through statistical analysis of the weighted degree distribution among its nodes. Contrary to the abstract neurons in machine learning models, each neuron in our model is a well-defined biological entity, allowing our network to be viewed from a graph-theoretic perspective (Lynn & Basset, 2018). We define the sum of the weights of neuron-related connections as the weighted in-degree and out-degree, and then tally the number of nodes for each weighted degree.
+
+Results show that both the in-degree and out-degree distribution of our network exhibit a pronounced long-tail effect after training (see in Fig. 6A), indicating that the network has spontaneously evolved important hub nodes during training process. The degree distribution of neurons in the network is more dispersed than initially, which is consistent with reports on the scale-free properties of brain networks in related work (Zheng et al., 2020; Henriksen et al., 2016; Yu et al., 2018). The two general conditions for the generation of scale-free networks are model growth and preferential attachment (Henriksen et al., 2016). However, our network can also reproduce similar properties merely by optimizing the weights of existing connections through training, which provide a new direction for establishing structurally realistic brain network models in neuroscience. The results using the same statistical method on other models can be found in the supplementary material.
+
+We additionally quantified the impact of anatomic connection probabilities within our network, comparing its training performance to networks established with random connections, fully connected network and regular connection probabilities of 0.5 and 0.3. The results suggest that networks which maintain the anatomic connection probabilities are not only the most biologically authentic but also the most effective to train in our whisker-related sensory task (see in Fig. 6B).
+
+## 5 CONCLUSION
+
+In this paper, we develop an effective constructing and training pipeline for biologically constrained sensory-motor integration networks. Our model, grounded in the authentic anatomical structure of the mouse barrel cortex, matches mainstream computing models in sensory performance and spontaneously aligns with the firing characteristics, dynamics, and degree distribution observed in real neural systems during the training process. Through the innovative pipeline and converted spiking-based whisker sensory dataset, we advanced the bridging of the gap between biological realism and computational performance in current sensory related models.
+
+**Limitations and future work:** In the initialization process, we introduced the Coefficient of Variation (CV) measure as a general principle, but a more granular analysis depends on further integration with research outcomes from brain dynamics. Figure 1 in the supplementary material presents raster plots of our model, where abnormal synchronous firing (with a higher CV score indicating stronger intensity) can still be observed in the initial network. This is due to all neurons being assigned same parameter values at the start. Although this does not affect the training and disappears in the trained model, it reduces the biological authenticity of the initial network. Further constraining neuronal activity can bring it closer to biologically realistic networks. For example, there is research potential in employing more nuanced biological constraints, such as membrane potential dynamics (Rossbroich et al., 2022) and synaptic scaling, to guide the initialization.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/VpGsy4hKMc.txt b/papers/VpGsy4hKMc.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3d1a06fe871eeb4be139d63754a36b937b5a343e
--- /dev/null
+++ b/papers/VpGsy4hKMc.txt
@@ -0,0 +1,332 @@
+**Primary Area:** applications to computer vision, audio, language, and other modalities
+
+
+
+{0}------------------------------------------------
+
+# FREE SPLATTER: POSE-FREE GAUSSIAN SPLATTING FOR SPARSE-VIEW 3D RECONSTRUCTION
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Existing sparse-view reconstruction models heavily rely on accurate known camera poses. However, deriving camera extrinsics and intrinsics from sparse-view images presents significant challenges. In this work, we present **FreeSplatter**, a highly scalable, feed-forward reconstruction framework capable of generating high-quality 3D Gaussians from **uncalibrated** sparse-view images and recovering their camera parameters in mere seconds. FreeSplatter is built upon a streamlined transformer architecture, comprising sequential self-attention blocks that facilitate information exchange among multi-view image tokens and decode them into pixel-wise 3D Gaussian primitives. The predicted Gaussian primitives are situated in a unified reference frame, allowing for high-fidelity 3D modeling and instant camera parameter estimation using off-the-shelf solvers. To cater to both **object-centric** and **scene-level** reconstruction, we train two model variants of FreeSplatter on extensive datasets. In both scenarios, FreeSplatter outperforms state-of-the-art baselines in terms of reconstruction quality and pose estimation accuracy. Furthermore, we showcase FreeSplatter’s potential in enhancing the productivity of downstream applications, such as text/image-to-3D content creation.
+
+## 1 INTRODUCTION
+
+Recent breakthroughs in neural scene representation and differentiable rendering, *e.g.*, Neural Radiance Fields (NeRF) (Mildenhall et al., 2021) and Gaussian Splatting (GS) (Kerbl et al., 2023), have shown unprecedented multi-view reconstruction quality for densely-captured images with calibrated camera poses, employing a per-scene optimization approach. However, they are not applicable to sparse-view scenarios, where classical camera calibration techniques like Structure-from-Motion (SfM) (Schonberger & Frahm, 2016) tend to fail due to insufficient image overlaps. Generalizable reconstruction models (Hong et al., 2024b; Xu et al., 2024a; Charatan et al., 2024) attempt to address sparse-view reconstruction in a feed-forward manner by utilizing learned data priors. Despite their efficiency and generalization capabilities, these models predominantly assume access to accurate camera poses and intrinsics, or imply that they are obtained in a pre-processing step, thereby circumventing the difficulty of deriving camera parameters in real application scenarios. Liberating sparse-view reconstruction from known camera poses remains a significant challenge.
+
+Prior works have explored training *pose-free* reconstruction models. PF-LRM (Wang et al., 2024a) and LEAP (Jiang et al., 2024b) share a similar framework that maps multi-view image tokens to a NeRF representation with a transformer. Despite the milestone they have set, their NeRF representation suffers from inefficient volume rendering and low resolution, limiting the training efficiency and scalability to complex scenes. Besides, inferring the input camera poses from such implicit representations is not trivial. PF-LRM employs an additional branch to predict per-view coarse point clouds for camera pose prediction, which introduces extra training cost and difficulties. DUST3R (Wang et al., 2024b) presents a novel paradigm for joint 3D reconstruction and pose estimation by modeling SfM and Multi-view Stereo (MVS) as an end-to-end point-regression task. By regressing the “point maps”, *i.e.*, the 3D un-projection of depth maps, from a stereo image pair in a unified reference frame, it can recover the relative camera pose efficiently with a PnP (Fischler & Bolles, 1981; Hartley & Zisserman, 2003) solver. DUST3R demonstrates impressive zero-shot 3D reconstruction and pose prediction capability by training on a broad range of datasets.
+
+{1}------------------------------------------------
+
+
+
+Figure 1: A diagram illustrating the FreeSplatter pipeline. On the left, 'Input Views' show four images of a robot and two of a building. These are processed by a 'FreeSplatter' block. The output is 'Reconstructed Gaussians', shown as a point cloud of the robot and building. Next is 'Pred. Camera Poses', represented by small camera icons and colored triangles indicating orientation. Finally, 'Rendered Novel Views' show the robot and building from new perspectives. The top row demonstrates object-centric reconstruction (robot), and the bottom row shows scene-level reconstruction (building).
+
+Figure 1: Given **uncalibrated** sparse-view images, our FreeSplatter can reconstruct pixel-wise 3D Gaussians, enabling both high-fidelity novel view rendering and instant camera pose estimation in mere seconds. FreeSplatter can deal with both object-centric (up) and scene-level (down) scenarios.
+
+However, the sparsity of point cloud makes it a suboptimal representation for many downstream applications, *e.g.*, novel view synthesis. In comparison, 3D Gaussian Splatting (3DGS) can encode high-fidelity radiance fields and enable efficient view synthesis by augmenting point clouds with additional Gaussian attributes. We then ask, can we directly predict the “Gaussian maps” from multi-view images to achieve both high-quality 3D modeling and instant camera pose estimation? In this work, we present **FreeSplatter**, a feed-forward reconstruction framework that predicts per-pixel Gaussians from **uncalibrated** sparse-view images and estimates their camera parameters jointly, to say “yes” to this question. The core of FreeSplatter is a scalable single-stream transformer architecture that maps multi-view image tokens into pixel-aligned Gaussian maps with simple self-attention layers, requiring no input camera poses, intrinsics, nor post-alignment steps. The predicted Gaussian maps serve as a high-fidelity and efficient 3D scene representation, while the Gaussian locations enable ultra-fast camera extrinsics and intrinsics estimation in mere seconds using off-the-shelf solvers.
+
+The training and rendering efficiency of 3D Gaussians makes it possible to consider more complex scene-level reconstruction. We thus train two FreeSplatter variants on Objaverse (Deitke et al., 2023) and a mixture of multiple scene datasets (Yao et al., 2020; Yeshwanth et al., 2023; Reizenstein et al., 2021) to handle object-centric and scene-level reconstruction scenarios, respectively. The two variants, denoted as **FreeSplatter-O** (object) and **FreeSplatter-S** (scene), share a common model architecture with $\sim 306$ million parameters while making essential adjustments for task adaption. We conduct extensive experiments to demonstrate the superiority of FreeSplatter compared to prior sparse-view reconstruction methods in terms of reconstruction quality and pose estimation accuracy. To be highlighted, FreeSplatter-O outperforms previous *pose-dependent* large reconstruction models by a large margin, while FreeSplatter-S achieves a pose-estimation accuracy on par with MASI3R (Leroy et al., 2024), the upgraded version of DUSi3R, on ScanNet++ and CO3D benchmarks. Furthermore, we showcase the potential of FreeSplatter in enhancing the productivity of downstream applications, such as text/image-to-3D content creation.
+
+## 2 RELATED WORK
+
+**Large Reconstruction Models.** The availability of large-scale 3D datasets (Deitke et al., 2023; 2024) unlocks the possibility of training highly generalizable models for open-category image-to-3D reconstruction. Large Reconstruction Models (LRMs) (Hong et al., 2024b; Xu et al., 2024c; Li et al., 2024a) leverage a scalable feed-forward transformer architecture to map sparse-view image tokens into a 3D triplane NeRF (Mildenhall et al., 2021; Chan et al., 2022) and supervise it with multi-view rendering loss. Subsequent works have made efforts on adopting mesh (Xu et al., 2024a; Wei et al., 2024; Wang et al., 2024c) or 3D Gaussians representation (Tang et al., 2024; Xu et al., 2024b; Zhang et al., 2024b) for real-time rendering speed, exploring more efficient network architectures (Zheng et al., 2024; Zhang et al., 2024a; Chen et al., 2024a; Li et al., 2024b; Cao et al., 2024), improving the texture quality (Boss et al., 2024; Siddiqui et al., 2024; Yang et al., 2024a), and exploiting explicit 3D supervision for better geometry (Liu et al., 2024a). Despite the superior reconstruction quality
+
+{2}------------------------------------------------
+
+and generalization capability, LRMs require *posed* images as input and are highly sensitive to the pose accuracy, limiting their applicable scenarios.
+
+**Pose-free Reconstruction.** Classical pose-free reconstruction algorithms like Structure from Motion (SfM) (Hartley & Zisserman, 2003; Ullman, 1979; Schönberger & Frahm, 2016) begins with finding pixel correspondences across multiple views first, and then perform 3D points triangulation and bundle adjustment to optimize 3D coordinates and camera parameters jointly. Recent efforts on enhancing the SfM pipeline encompass leveraging learning-based feature descriptors (DeTone et al., 2018; Dusmanu et al., 2019; Revaud et al., 2019; Wang et al., 2023c) and image matchers (Edstedt et al., 2023; 2024; Sarlin et al., 2020; Lindenberger et al., 2023), as well as differentiable bundle adjustment (Lin et al., 2021; Wang et al., 2023a; Wei et al., 2020). SfM-based methods works well with sufficient image overlaps between nearby views, but face challenges in matching correspondences from sparse views. On the other hand, learning-based methods (Jiang et al., 2024a;b; Hong et al., 2024a; Fan et al., 2023) rely on learned data priors to recover the 3D geometry from input views. PF-LRM (Wang et al., 2024a) extends the LRM framework by predicting a per-view coarse point cloud for camera pose estimation with a differentiable PnP solver (Chen et al., 2022). DUSi3R (Wang et al., 2024b) presents a novel framework for Multi-view stereo (MVS) by modeling it as a pointmap-regression problem. Subsequent works further improve it in local representation capability (Leroy et al., 2024) and reconstruction efficiency (Wang & Agapito, 2024).
+
+**Generalizable Gaussian Splatting.** Compared to NeRF’s (Mildenhall et al., 2021) MLP-based implicit representation, 3DGS represents a scene explicitly with a point cloud, which strikes the balance between high-fidelity and real-time rendering speed. However, the per-scene optimization of 3DGS requires densely-captured images and sparse point cloud generated by SfM for initialization. Recent works (Charatan et al., 2024; Chen et al., 2024b; Szymanowicz et al., 2024; Liu et al., 2024b; Wewer et al., 2024) have explored feed-forward models for sparse-view Gaussian reconstruction by capitalizing on large-scale datasets and scalable model architectures. These models typically assume the access to accurate camera poses and utilize 3D-to-2D geometric projection for feature aggregation, adopting model designs like epipolar lines (Charatan et al., 2024) or plane-swept cost-volume (Chen et al., 2024b; Liu et al., 2024b). InstantSplat (Fan et al., 2024) and Splat3R (Smart et al., 2024) leverage the pose-free reconstruction capability of DUSi3R/MASi3R for sparse-view reconstruction. The former initializes the Gaussian positions using the DUSi3R point cloud and then optimizes other Gaussian parameters, while the latter trains a Gaussian head in a frozen MASi3R model. Despite the impressive results, their reconstruction quality highly depends on the point cloud quality generated by DUSi3R.
+
+## 3 METHOD
+
+Given a sparse set of $N$ input images $\{I^n \mid n = 1, \dots, N\}$ with no known camera extrinsics nor intrinsics, FreeSplatting aims to reconstruct the scene as a set of Gaussians and estimate the camera parameters of the $N$ images simultaneously. The pipeline can be formulated as:
+
+$$\mathbf{G}, \mathbf{P}^1, \dots, \mathbf{P}^N, f = \text{FreeSplatting}(\mathbf{I}^1, \dots, \mathbf{I}^N), \quad (1)$$
+
+where $\mathbf{G}$ denotes the reconstructed Gaussians which is the union of $N$ pixel-wise Gaussian maps, i.e., $\mathbf{G} = \{\mathbf{G}^n \mid n = 1, \dots, N\}$ , $\mathbf{P}^n$ denotes the estimated camera pose for $I^n$ , and $f$ denotes the focal length. We assume a common focal length for all input images which is reasonable in most scenarios.
+
+We implement FreeSplatting as a feed-forward transformer that takes multi-view image as input and predict $N$ Gaussian maps $\{\mathbf{G}^n \mid n = 1, \dots, N\}$ in a unified reference frame. The Gaussian maps enable both high-fidelity scene modeling and ultra-fast camera parameter estimation using off-the-shelf solvers (Fischler & Bolles, 1981; Hartley & Zisserman, 2003; Plaatrio, 2011), since the Gaussian centers have located the surface point cloud explicitly. In this section, we first briefly review the background knowledge of Gaussian Splatting (Section 3.1), and then introduce the model architecture (Section 3.2) and training details (Section 3.3) of our approach.
+
+### 3.1 PRELIMINARY
+
+3D Gaussian Splatting (3DGS) (Kerbl et al., 2023) represents a scene as a set of 3D Gaussian primitives $\{g_k = (\boldsymbol{\mu}_k, r_k, s_k, o_k, c_k) \mid k = 1, \dots, K\}$ , each primitive is parameterized by location
+
+{3}------------------------------------------------
+
+
+
+Figure 2: FreeSplatter pipeline diagram. The pipeline starts with 'Input Views' (two images of people) which are processed through 'Patchify & Linear' to become 'Image Tokens'. These tokens are combined with 'Reference Embed' (blue) and 'Source Embed' (yellow). The tokens are then processed by a 'Transformer Block (x L)' containing 'Self-Attn' and 'MLP' layers. The output tokens are processed by 'Linear & Unpatchify' to become 'Gaussian Maps' (represented by icons of people). These maps are then processed by a 'PnP Solver' to produce 'Camera Poses' (represented by a camera icon). The final output is 'Novel View Renderings' (a sequence of images showing the people from different angles).
+
+Figure 2: **FreeSplatter pipeline.** Given input views $\{I^n \mid n = 1, \dots, N\}$ without any known camera extrinsics or intrinsics, we first patchify them into image tokens, and then feed all tokens into a sequence of self-attention blocks to exchange information among multiple views. Finally, we decode the output image tokens into $N$ Gaussian maps $\{\mathcal{G}^n \mid n = 1, \dots, N\}$ , from which we can render novel views, as well as recovering camera focal length $f$ and poses $\{\mathbf{P}^n \mid n = 1, \dots, N\}$ with simple iterative solvers.
+
+$\mu_k \in \mathbb{R}^3$ , rotation quaternion $r_k \in \mathbb{R}^4$ , scale $s_k \in \mathbb{R}^3$ , opacity $o_k \in \mathbb{R}$ , and Spherical Harmonic (SH) coefficients $c_k \in \mathbb{R}^{3 \times d}$ for computing view-dependent color, with $d$ denoting the degree of SH. These primitives parameterize the scene’s radiance field with an explicit point cloud and can be rendered into novel views with an efficient rasterizer. Compared to the expensive volume rendering process of NeRF, 3DGS achieves comparable rendering quality while being much more efficient in terms of time and memory.
+
+### 3.2 MODEL ARCHITECTURE
+
+As Figure 2 shows, FreeSplatter employs a transformer architecture similar to GS-LRM (Zhang et al., 2024b). Given a set of uncalibrated images $\{I^n \mid n = 1, \dots, N\}$ , we first tokenize them into image tokens $\{e^{n,m} \mid n = 1, \dots, N, m = 1, \dots, M\}$ , where $M$ denotes the patch number of each image. Then we feed all image tokens into a sequence of self-attention blocks to exchange information among multiple views, and finally decode them into $N$ Gaussian maps $\{\mathcal{G}^n \mid n = 1, \dots, N\}$ composed of per-pixel Gaussian primitives, from which we can render novel views and recover camera parameters with simple iterative solvers.
+
+**Image Tokenization.** The only input of our model is $N$ images $\{I^n \in \mathbb{R}^{H \times W \times 3} \mid n = 1, \dots, N\}$ . Following ViT (Dosovitskiy et al., 2021), we split the images into $p \times p$ patches ( $p = 8$ ) and flatten them into 1D vectors of dimension $p^2 \cdot 3$ . Then a linear layer is applied to map the vectors into $d$ -dim image tokens ( $d$ equals to the transformer width). Denoting the $m$ -th token of the $n$ -th image as $e^{n,m}$ , we add it with two additional embeddings before feeding it into the transformer:
+
+$$e^{n,m} = e^{n,m} + e_{\text{pos}}^m + e_{\text{view}}^n, \quad (2)$$
+
+where $e_{\text{pos}}^m$ denotes the position embedding for the $m$ -th patch, and $e_{\text{view}}^n$ is a view embedding for distinguishing the reference view and other views. Specifically, we take the first image as the reference view and predict all Gaussian in its camera frame. We use a reference embedding $e^{\text{ref}}$ for the first view ( $n = 1$ ) and another source embedding $e^{\text{src}}$ for other views ( $n = 2, \dots, N$ ), both of which are learnable during training.
+
+**Feed-forward Transformer.** The image tokens added with position and view embeddings are then fed into a sequence of $L$ self-attention blocks to exchange information across multiple views. Each block consists of a self-attention layer and an MLP layer, equipping with pre-normalization and residual connection (He et al., 2016). The forward process of each block can be formulated as:
+
+$$\begin{aligned} e_{\text{attn}}^{n,m} &= \text{SelfAttn}(\text{LayerNorm}(e_{\text{in}}^{n,m}), \{\text{LayerNorm}(e_{\text{in}}^{n,m})\}) + e_{\text{in}}^{n,m}, \\ e_{\text{out}}^{n,m} &= \text{MLP}(\text{LayerNorm}(e_{\text{attn}}^{n,m})) + e_{\text{attn}}^{n,m}. \end{aligned} \quad (3)$$
+
+**Gaussian Map Prediction.** For each output token $e_{\text{out}}^{n,m}$ of the last ( $L$ -th) block, we decode it back into $p^2$ Gaussians with a simple linear layer, leading to a 1D vector of dimension $p^2 \cdot q$ , where $q$
+
+{4}------------------------------------------------
+
+
+
+Figure 3: Object-centric Sparse-view Reconstruction. The figure is a grid showing 6 samples of objects (apple, dog, shoe, blocks, jack-in-the-box, bag) across 5 rows: Input, InstantMesh (w/ GT poses), LGM (w/ GT poses), Ours (no input pose), and Target View. The Input row shows sparse views. InstantMesh and LGM rows show reconstructions using ground truth poses. The Ours row shows reconstructions without input poses. The Target View row shows the ground truth views.
+
+Figure 3: **Object-centric Sparse-view Reconstruction.** We show 6 samples from the Google Scanned Objects dataset. To be noted, the results of LGM and InstantMesh (2nd and 3rd rows) are generated with ground truth camera poses (and intrinsics), while our results (4th row) are generated in a completely pose-free manner.
+
+is the parameter number of each Gaussian primitive. Then we unpatchify the predicted Gaussian parameters into a Gaussian patch $\mathbf{G}^{n,m} \in \mathbb{R}^{p \times p \times q}$ . Finally, we spatially concatenate the Gaussian patches $\mathbf{G}^{n,m}$ for each view, leading to $N$ Gaussian maps $\{\mathbf{G}^n \in \mathbb{R}^{H \times W \times q} \mid n = 1, \dots, N\}$ .
+
+Each pixel in the Gaussian maps contains a $q$ -dim 3D Gaussian primitive. Prior pose-dependent Gaussian LRMs (Zhang et al., 2024b; Xu et al., 2024b; Tang et al., 2024) parameterize each Gaussian’s location with a single depth value. However, our model assumes no available camera poses nor intrinsics, making it impossible to un-project the Gaussian locations from depths. Therefore, we directly predict the actual Gaussian locations in the reference frame and adopt a pixel-alignment loss to restrict Gaussians to lie on camera rays (see Section 3.3 for details).
+
+**Camera Pose Estimation.** To recover the camera poses, we first estimate the focal length $f$ from predicted Gaussian maps (see Section A.1 for details). **Different from DUST3R that can only feed a pair of images into the model to predict pair-wise point maps and requires an additional alignment to unify the pair-wise reconstruction results into a global point cloud.** FreeSplatter predicts the Gaussian maps of all views in a unified reference frame, thus can recover the camera poses $\{\mathbf{P}^n \mid n = 1, \dots, N\}$ in a feed-forward manner without global alignment. For each Gaussian location map $\mathbf{X}^n \in \mathbb{R}^{H \times W \times 3}$ (the first 3 channels of $\mathbf{G}^n$ ), its pixel coordinate map $\mathbf{Y}^n \in \mathbb{R}^{H \times W \times 2}$ and a valid mask $\mathbf{M}^n \in \mathbb{R}^{H \times W}$ , we apply a PnP-RANSAC solver (Hartley & Zisserman, 2003; Bradski, 2000) to estimate $\mathbf{P}^n \in \mathbb{R}^{4 \times 4}$ :
+
+$$\mathbf{P}^n = \text{PnP}(\mathbf{X}^n, \mathbf{Y}^n, \mathbf{M}^n, \mathbf{K}), \quad (4)$$
+
+where $\mathbf{K} = [[f, 0, \frac{W}{2}], [0, f, \frac{H}{2}], [0, 0, 1]]$ denotes the estimated intrinsic matrix. The mask $\mathbf{M}^n$ aims to mark the pixel locations that contribute to the pose optimization, which differs in object-centric and scene-level reconstruction scenarios, please see Section A.1 for more details.
+
+### 3.3 TRAINING DETAILS
+
+We train two FreeSplatter variants targeting for object-centric and scene-level pose-free reconstruction. They share the same model architecture and parameter size, but we made essential adjustments in training objectives and strategies to adapt them to different scenarios.
+
+{5}------------------------------------------------
+
+**Staged Training Strategy.** Prior pose-dependent LRMs (Hong et al., 2024b; Li et al., 2024a; Xu et al., 2024b; Zhang et al., 2024b) leverage pure rendering loss for supervision. However, our model assumes no known camera poses nor intrinsics and the Gaussian positions are free in 3D space, making it extremely challenging to predict correct Gaussian positions. Gaussian-based reconstruction approaches heavily rely on the initialization of Gaussian positions, e.g., 3DGS (Kerbl et al., 2023) initializes the Gaussian positions with the sparse point cloud generated by SfM, while the parameters of our model are randomly initialized at the beginning. In practice, we found it essential to supervise the Gaussian positions at the beginning:
+
+$$\mathcal{L}_{\text{pos}} = \sum_{n=1}^N \left\| M^n \odot \hat{X}^n - M^n \odot X^n \right\|, \quad (5)$$
+
+where $\hat{X}^n \in \mathbb{R}^{H \times W \times 3}$ is the predicted Gaussian position map, $X^n$ is the ground truth point map unprojected from depths. $M^n \in \mathbb{R}^{H \times W}$ is a mask indicating the pixels storing valid depth values, which is exactly the foreground object mask for object-centric reconstruction. For scene-level reconstruction, $M^n$ depends on where the depth values are defined in different datasets.
+
+We apply $\mathcal{L}_{\text{pos}}$ in the pre-training stage, so that the model learns to predict approximately correct Gaussian positions. In our experiments, this pre-training is **essential** to model’s convergence. However, $\mathcal{L}_{\text{pos}}$ can only supervise the pixels with valid depths, while the Gaussian positions predicted at other pixels remain unconstrained. Besides, the ground truth depths are noisy in some datasets, and applying $\mathcal{L}_{\text{pos}}$ throughout the training leads to degraded rendering quality. To provide a more stable geometric supervision, we adopt a pixel-alignment loss to enforce each predicted Gaussian to be aligned with its corresponding pixel, which maximizes the ray cosine similarities:
+
+$$\mathcal{L}_{\text{align}} = \sum_{n=1}^N \sum_{i=0}^H \sum_{j=0}^W \left( 1 - \frac{\hat{r}_{i,j}^n \cdot r_{i,j}^n}{\|\hat{r}_{i,j}^n\| \|r_{i,j}^n\|} \right), \quad (6)$$
+
+where $r_{i,j}^n$ denotes the ray from the camera origin $t^n$ to point $X_{i,j}^n$ . $\mathcal{L}_{\text{align}}$ restricts the predicted Gaussians to be distributed on the camera rays, which improves the rendering quality. Besides, enforcing the pixel-alignment is important to camera parameter estimation, since the iterative solvers minimize the pixel-projection errors.
+
+**Loss Functions.** The overall training objective of our model is:
+
+$$\mathcal{L} = \mathcal{L}_{\text{render}} + \lambda_a \cdot \mathcal{L}_{\text{align}} + \mathbf{1}_{t \leq T_{\max}} \lambda_p \cdot \mathcal{L}_{\text{pos}}, \quad (7)$$
+
+where the rendering loss $\mathcal{L}_{\text{render}}$ is a combination of MSE and LPIPS loss. $t$ and $T_{\max}$ denote the current training step and maximum pre-training step, respectively. In our implementation, we set $\lambda_a = 1.0$ , $\lambda_p = 10.0$ .
+
+**Occlusion in Pixel-aligned Gaussians.** Prior pose-dependent Gaussian-based LRMs (Tang et al., 2024; Zhang et al., 2024b; Xu et al., 2024b) parameterize the Gaussian positions with a single depth value to ensure they are pixel-aligned. Despite the simplicity, pixel-aligned Gaussians can only represent the areas captured by input images. It is challenging for sparse input views to cover the whole scene, resulting in missing reconstruction results in the occluded areas. Our model also suffers from this problem due to the usage of $\mathcal{L}_{\text{align}}$ . For the object-centric model, we adopt a simple strategy to alleviate this problem by only calculate Equation 6 in the foreground area, while allowing other Gaussians to move freely and model the occluded areas.
+
+For the scene-level model trained on real-world images, all predicted Gaussians have been pixel-aligned to model the complex background. We instead focus on reconstructing the observed areas. To avoid the areas in the target views that are invisible in input views provide negative guidance for training, we adopt the target-view masking strategy proposed by Splat3R and only calculate the rendering loss in visible areas. Please refer to Smart et al. (2024) for more details.
+
+## 4 EXPERIMENTS
+
+Due to the space limit, we put more comprehensive experimental results in Section A.2 of the appendix, including comparison on object-level reconstruction with PF-LRM (Wang et al., 2024a) (Section A.2.1), more extensive image-to-3D generation results with FreeSplatner (Section A.2.2), cross-dataset generalization results (Section A.2.3), and additional ablation studies (Section A.3).
+
+{6}------------------------------------------------
+
+
+
+324
+
+325
+
+326
+
+327
+
+328
+
+329
+
+330
+
+331
+
+332
+
+333
+
+334
+
+335
+
+336
+
+337
+
+338
+
+339
+
+340
+
+341
+
+342
+
+343
+
+344
+
+345
+
+346
+
+347
+
+348
+
+349
+
+| Input | pixelSplat
(w/ GT poses) | MVSplat
(w/ GT poses) | Splat3R
(no input pose) | Ours
(no input pose) | Target View |
+|-|-|-|-|-|-|
+| | | | | | |
+| | | | | | |
+| | | | | | |
+| | | | | | |
+
+Input image of a classroom with desks and chairs. Reconstruction of the classroom scene using pixelSplat with ground truth poses. Reconstruction of the classroom scene using MVSplat with ground truth poses. Reconstruction of the classroom scene using Splat3R without input poses. Reconstruction of the classroom scene using the proposed method without input poses. Target view of the classroom scene. Input image of a classroom with desks and chairs from a different angle. Reconstruction of the classroom scene using pixelSplat with ground truth poses. Reconstruction of the classroom scene using MVSplat with ground truth poses. Reconstruction of the classroom scene using Splat3R without input poses. Reconstruction of the classroom scene using the proposed method without input poses. Target view of the classroom scene. Input image of a classroom with desks and chairs from a third angle. Reconstruction of the classroom scene using pixelSplat with ground truth poses. Reconstruction of the classroom scene using MVSplat with ground truth poses. Reconstruction of the classroom scene using Splat3R without input poses. Reconstruction of the classroom scene using the proposed method without input poses. Target view of the classroom scene. Input image of a classroom with desks and chairs from a fourth angle. Reconstruction of the classroom scene using pixelSplat with ground truth poses. Reconstruction of the classroom scene using MVSplat with ground truth poses. Reconstruction of the classroom scene using Splat3R without input poses. Reconstruction of the classroom scene using the proposed method without input poses. Target view of the classroom scene.
+
+350 Figure 4: **Scene-level Reconstruction on ScanNet++**. The results of pixelSplat and MVSplat are
+351 obtained with ground truth input poses, while the results of Splat3R and ours are pose-free.
+
+###### 353 4.1 EXPERIMENTAL SETTINGS
+
+354
+
+355 **Training Datasets.** FreeSplat-O assumes the input images are white-background with an object
+356 in the center, which is trained on Objaverse (Deitke et al., 2023), a large-scale dataset contain-
+357 ing around 800K 3D assets. For each 3D asset, we normalize it into a $[-1, 1]^3$ cube, and then
+358 render 32 random views associated with depth maps around it, all in a resolution of $512 \times 512$ .
+359 FreeSplat-S is trained on a mixture of multiple datasets, including BlendedMVS (Yao et al.,
+360 2020), ScanNet++ (Yeshwanth et al., 2023) and CO3Dv2 (Reizenstein et al., 2021), which is a
+361 subset of DUST3R’s (Wang et al., 2024b) training datasets covering the most representative scene
+362 types: outdoor, indoor, and realistic objects.
+
+363 **Evaluation Datasets.** For object-centric reconstruction and pose-estimation, we evaluate our model
+364 on OmniObject3D (Wu et al., 2023) and Google Scanned Objects (GSO) (Downs et al., 2022)
+365 datasets, containing around 6K and 1K scanned 3D assets, respectively. We use the whole GSO
+366 dataset and pick out 300 OmniObject3D objects in 30 categories as the evaluation set. For each
+367 object, we render 20 random views and 4 additional structured input views for the sparse-view re-
+368 construction task, which are evenly placed around the objects with an elevation of $20^\circ$ to ensure a
+369 good coverage. For scene-level reconstruction and pose estimation, we mainly evaluate on the test
+370 splits of ScanNet++ (Yeshwanth et al., 2023) and CO3Dv2 (Reizenstein et al., 2021).
+
+###### 371 4.2 SPARSE-VIEW RECONSTRUCTION
+
+372
+
+373 **Baselines.** Prior pose-free object reconstruction models like LEAP (Jiang et al., 2024b) were only
+374 trained on small datasets, showing very limited generalization capability in open-domain datasets.
+375 PF-LRM (Wang et al., 2024a) is the most comparable work to our FreeSplat-O. Although its code
+376 is not publicly available, we compare with its inference results on its evaluation datasets on both
+377 sparse-view reconstruction and camera pose estimation tasks. Due to the space limit, we put the
+results in Section A.2.1 of the appendix, which demonstrate that FreeSplat-O outperforms PF-
+
+{7}------------------------------------------------
+
+
+
+Figure 10: A grid of images showing novel view synthesis for an apple, a cake, and a keyboard. The columns are labeled 'Input', 'Ours (rendered input views w/ pred. poses)', 'Splatter3R (rendered novel view)', 'Ours (rendered novel view)', and 'Novel G.T. View'. The rows show different objects: an apple (rows 378-384), a cake (rows 386-390), and a keyboard (rows 392-396).
+
+Figure 5: Scene-level Reconstruction on CO3Dv2.
+
+LRM on its OmniObject3D benchmark and preserves visual details better. We also compare with two pose-dependent large reconstruction models, *i.e.*, LGM (Tang et al., 2024) and InstantMesh (Xu et al., 2024a), which are based on 3D Gaussians and tri-plane NeRF, respectively. We directly feed ground truth camera poses to them, while our model is totally pose-free.
+
+For scene-level reconstruction, we compare with two state-of-the-art works on generalizable Gaussians, *i.e.*, pixelSplat (Charatan et al., 2024) and MVSpalt (Chen et al., 2024b), both of which require camera poses. We fine-tune their checkpoints trained on RealEstate10K (Zhou et al., 2018) on ScanNet++ for more fair comparison, while do not apply them on CO3Dv2 due to significant domain gap. Besides, we also compare with an up-to-date pose-free Gaussian reconstruction method, *i.e.*, Splat3R (Smart et al., 2024), which utilizes frozen MAS13R (Leroy et al., 2024) model for Gaussian location prediction, while fine-tuning an additional head for predicting other Gaussian attributes.
+
+**Metrics.** For both object-centric and scene-level reconstruction, We evaluate the rendering quality of reconstructed Gaussians and report the standard metrics for novel view synthesis, *i.e.*, PSNR, SSIM and LPIPS. All metrics are evaluated at the resolution of $512 \times 512$ .
+
+**Results and Analysis.** As demonstrated in Table 2, FreeSplatter models achieve superior performance across both object-centric and scene-level reconstruction tasks without camera poses. FreeSplatter-O significantly outperforms LGM and InstantMesh across all metrics even if they are pose-dependent, achieving PSNR improvements of $> 5$ and $> 7$ on previously unseen GSO and OmniObject3D datasets, respectively. Qualitative comparisons in Figure 3 further illustrate this performance gap, with InstantMesh and LGM exhibiting blurry artifacts (notably in the alphabets, 4th column), while our approach maintains clarity and detail fidelity consistent with ground truth views.
+
+Existing Large Reconstruction Models (LRMs) assume the necessity of accurate camera poses for high-quality 3D reconstruction, incorporating pose information through LayerNorm modulation (Li et al., 2024a) or plucker ray embeddings (Xu et al., 2024c; Tang et al., 2024; Xu et al., 2024b). However, FreeSplatter-O’s superior performance challenges this assumption, suggesting that camera poses may not be essential for developing high-quality, scalable reconstruction models.
+
+In scene-level reconstruction on ScanNet++, FreSplat-S demonstrates superior performance across most metrics compared to *pose-dependent pixelSplat* and *MVSplat*, highlighting its robust reconstruction quality and generalization capability. While the pose-free competitor Splat3R leverages MAS3R’s (Leroy et al., 2024) 3D point regression capabilities trained on extensive datasets, its performance is constrained by MAS3R’s prediction errors due to its frozen architecture and Gaussian head-only training, resulting in fixed Gaussian positions. In contrast, our end-to-end training approach with rendering supervision enables simultaneous optimization of Gaussian locations and attributes. Qualitative results on ScanNet++ and CO3Dv2 (Figure 4, Figure 5) illustrate
+
+{8}------------------------------------------------
+
+Table 1: **Quantitative results on camera pose estimation.** We highlight the best metric as red.
+
+| Method | OmniObject3D | | | | GSO | | | |
+|-|-|-|-|-|-|-|-|-|
+| | RRE ↓ | RRA@15° ↑ | RRA@30° ↑ | TE ↓ | RRE ↓ | RRA@15° ↑ | RRA@30° ↑ | TE ↓ |
+| FORGE | 76.822 | 0.081 | 0.257 | 0.430 | 97.814 | 0.022 | 0.083 | 0.898 |
+| MAS3R | 96.670 | 0.052 | 0.112 | 0.524 | 61.820 | 0.244 | 0.445 | 0.353 |
+| FreeSplatte-S | 83.795 | 0.076 | 0.167 | 0.631 | 72.914 | 0.212 | 0.396 | 0.426 |
+| FreeSplatte-O | 11.550 | 0.909 | 0.937 | 0.081 | 3.851 | 0.962 | 0.978 | 0.030 |
+| Method | ScanNet++ | | | | CO3Dv2 | | | |
+| | RRE ↓ | RRA@15° ↑ | RRA@30° ↑ | TE ↓ | RRE ↓ | RRA@15° ↑ | RRA@30° ↑ | TE ↓ |
+| PoseDiffusion | - | - | - | - | 7.950 | 0.803 | 0.868 | 0.328 |
+| MAS3R | 0.724 | 0.988 | 0.993 | 0.104 | 2.918 | 0.975 | 0.989 | 0.112 |
+| FreeSplatte-S | 0.791 | 0.982 | 0.987 | 0.110 | 3.054 | 0.976 | 0.986 | 0.148 |
+
+Table 2: **Quantitative results on sparse-view reconstruction.**
+
+| Method | OmniObject3D | | | GSO | | |
+|-|-|-|-|-|-|-|
+| | PSNR ↑ | SSIM ↑ | LPIPS ↓ | PSNR ↑ | SSIM ↑ | LPIPS ↓ |
+| LGM (w/ gt pose) | 24.852 | 0.942 | 0.060 | 24.463 | 0.891 | 0.093 |
+| InstantMesh (w/ gt pose) | 24.077 | 0.945 | 0.062 | 25.421 | 0.891 | 0.095 |
+| Ours (FreeSplatte-O) | 31.929 | 0.973 | 0.027 | 30.443 | 0.945 | 0.055 |
+| Method | ScanNet++ | | | CO3Dv2 | | |
+| | PSNR ↑ | SSIM ↑ | LPIPS ↓ | PSNR ↑ | SSIM ↑ | LPIPS ↓ |
+| pixelSplat (w/ gt pose) | 24.974 | 0.889 | 0.180 | - | - | - |
+| MVSplat (w/ gt pose) | 22.601 | 0.862 | 0.208 | - | - | - |
+| Splat3R | 21.013 | 0.830 | 0.209 | 18.074 | 0.740 | 0.197 |
+| Ours (FreeSplatte-S) | 25.807 | 0.887 | 0.140 | 20.405 | 0.781 | 0.162 |
+
+our method’s superior visual fidelity. To be noted, novel view synthesis for both FreeSplatte and Splat3R is performed by aligning predicted cameras with target viewpoints.
+
+### 4.3 CAMERA POSE ESTIMATION
+
+**Baselines.** To evaluate our method’s pose estimation capabilities, we benchmark against MAS3R, the current state-of-the-art in zero-shot multi-view pose estimation. Additional comparisons include FORGE (Jiang et al., 2024a) for object-centric datasets and PoseDiffusion (Fan et al., 2023) for scene-level reconstruction, with PoseDiffusion evaluated exclusively on CO3Dv2 due to its training scope. Traditional COLMAP-based approaches (Schonberger & Frahm, 2016) are excluded from our evaluation due to their documented high failure rates in sparse-view scenarios, a limitation consistently reported in previous studies (Wang et al., 2024a).
+
+**Metrics.** Following established protocols Wang et al. (2024a; 2023b), we evaluate pose estimation through distinct rotation and translation metrics. Rotational accuracy is assessed via relative rotation error (RRE) in degrees and relative rotation accuracy (RRA), where RRA represents the percentage of rotation errors below predefined thresholds (15° and 30°). Translational accuracy is measured through translation error (TE) between predicted and ground truth camera centers. For scenarios with more than two input views, errors are computed pairwise and averaged across all camera combinations.
+
+As shown in Table 1, FreeSplatte-O demonstrates substantial performance improvements over existing baselines on object-centric datasets, while FreeSplatte-S achieves comparable results with MAS3R on scene-level datasets. MAS3R’s poor performance on rendered object-centric datasets without backgrounds can be attributed to the significant domain gap between its training data and these synthetic images. Specifically, rendered object-centric images lack the complex backgrounds and rich textures present in natural scenes, presenting unique challenges for pose estimation without adequate data priors. In scene-level evaluations on ScanNet++ and CO3Dv2, while MAS3R achieves marginally superior metrics, FreeSplatte-S maintains competitive performance despite its more limited training scope. This performance differential primarily stems from dataset scale disparity—our FreeSplatte-S utilizes only three datasets, a subset of DUS3R/MAS3R’s extensive training corpus, resulting in fewer learned data priors. Future work will focus on scaling the model across broader datasets to bridge this gap.
+
+### 4.4 ABLATION STUDIES
+
+**Number of Input Views.** We make an experiment on a GSO sample to illustrate how the number of input views influences the reconstruction quality on the object-centric scenarios. Please refer to Figure 16 in the appendix for more details.
+
+{9}------------------------------------------------
+
+Table 3: Ablation on the pixel-alignment loss.
+
+| Method | GSO | | | Method | ScanNet++ | | |
+|-|-|-|-|-|-|-|-|
+| | PSNR $\uparrow$ | SSIM $\uparrow$ | LPIPS $\downarrow$ | | PSNR $\uparrow$ | SSIM $\uparrow$ | LPIPS $\downarrow$ |
+| FreeSplatter-O (w/o $\mathcal{L}_{\text{align}}$ ) | 26.684 | 0.898 | 0.092 | FreeSplatter-S (w/o $\mathcal{L}_{\text{align}}$ ) | 21.330 | 0.832 | 0.201 |
+| FreeSplatter-O | 30.443 | 0.945 | 0.055 | FreeSplatter-S | 25.807 | 0.887 | 0.140 |
+
+
+
+Figure 6: 3D content creation with FreeSplatter. The figure shows a grid of 3D reconstructions. The first row displays four views of a tiger, a panda, and a turtle. The second row shows four views of a cake and four views of a camera. The third row shows two views of a sculpture of an old man and four views of a colorful teddy bear. Each row is labeled with the object name.
+
+Figure 6: 3D content creation with FreeSplatter. 1st and 2nd rows: Image-to-3D results using Zero123++ (input image, Gaussian visualization, two novel views). 3rd row: Text-to-3D results using MVDream (prompt shown above; two Gaussian visualizations, two novel views).
+
+**Impact of Pixel-Alignment Loss.** We study the impact of pixel-alignment loss defined in Equation 6. We remove the pixel-alignment loss from the training of both models, and report the novel view rendering metrics on GSO and ScanNet++ dataset. We can observe significant drops in all metrics without the pixel-alignment loss. We also compare the visual results in Figure 15 of the appendix, demonstrating that applying pixel-alignment loss leads to higher-fidelity renderings.
+
+### 4.5 APPLICATIONS
+
+FreeSplatter can be seamlessly integrated into 3D content creation pipelines, and its pose-free nature can potentially bring great convenience to users and enhance the productivity by a large margin. In a classical 3D generation pipeline (Li et al., 2024a; Xu et al., 2024a; Tang et al., 2024; Wang et al., 2024c) that first generates multi-view images with a multi-view diffusion model and then feed them into an LRM for reconstruction, we have to figure out how the camera poses of the multi-view diffusion model are defined and carefully align them with the LRM. With FreeSplatter as the content creator, these tedious steps are not required any longer. We just feed the multi-view images into FreeSplatter and get the outputs instantly after several seconds. Figure 6 shows some results of text/image-to-3D generation with MVDream (Shi et al., 2024) and Zero123++ (Shi et al., 2023), respectively. We notice that our method can render significantly more clear views from the images than previous pose-dependent LRMs, showing stronger robustness to multi-view inconsistency.
+
+## 5 CONCLUSION
+
+In this work, we present FreeSplatter, a highly scalable framework for pose-free sparse-view reconstruction. By leveraging a single-stream transformer architecture and predicting multi-view Gaussian maps in a unified frame, FreeSplatter enables both high-fidelity 3D modeling and instant camera pose estimation. We provide two model variants for both object-centric and scene-level reconstruction, both showing superior reconstruction quality and pose estimation accuracy. FreeSplatter also exhibits great potential in enhancing the productivity of downstream applications like text/image-to-3D content creation, which can liberate users from dealing with complex camera poses.
+
+**Limitations.** Despite the promising performance of FreeSplatter, its pre-training stage relies on depth data, making it non-trivial to be trained on datasets with no depth labels, e.g., RealEstate10K and MVImgNet (Yu et al., 2023). Besides, FreeSplatter requires two distinct model variants to deal with object-centric and scene-level reconstructions, while a unified model for both tasks would be preferred. We leave this as the future work.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/Xo0Q1N7CGk.txt b/papers/Xo0Q1N7CGk.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fbf5b7e5dcaafdf1add46c29daa217e89cc6cc3c
--- /dev/null
+++ b/papers/Xo0Q1N7CGk.txt
@@ -0,0 +1,320 @@
+**Primary Area:** unsupervised, self-supervised, semi-supervised, and supervised representation learning
+
+
+
+{0}------------------------------------------------
+
+# ON CONFORMAL ISOMETRY OF GRID CELLS: LEARNING DISTANCE-PRESERVING POSITION EMBEDDING
+
+Dehong Xu1, Ruiqi Gao1, Wen-Hao Zhang2, Xue-Xin Wei3, Ying Nian Wu1
+
+1UCLA 2UT Southwestern Medical Center 3UT Austin
+ xudehong1996@ucla.edu, ywu@stat.ucla.edu
+
+## ABSTRACT
+
+This paper investigates the conformal isometry hypothesis as a potential explanation for the hexagonal periodic patterns in grid cell response maps. We posit that grid cell activities form a high-dimensional vector in neural space, encoding the agent’s position in 2D physical space. As the agent moves, this vector rotates within a 2D manifold in the neural space, driven by a recurrent neural network. The conformal hypothesis proposes that this neural manifold is a conformal isometric embedding of 2D physical space, where local physical distance is preserved by the embedding up to a scaling factor (or unit of metric). Such distance-preserving position embedding is indispensable for path planning in navigation, especially planning local straight path segments. We conduct numerical experiments to show that this hypothesis leads to the hexagonal grid firing patterns by learning maximally distance-preserving position embedding, agnostic to the choice of the recurrent neural network. Furthermore, we present a theoretical explanation of why hexagon periodic patterns emerge by minimizing our loss function by showing that hexagon flat torus is maximally distance preserving.
+
+## 1 INTRODUCTION
+
+The mammalian hippocampus formation encodes a “cognitive map” (Tolman, 1948; O’keefe & Nadel, 1979) of the animal’s surrounding environment. In the 1970s, it was discovered that place cells in the rodent hippocampus fire at specific locations within the environment (O’Keefe & Dostrovsky, 1971). Later, another type of neurons, called grid cells, was identified in the medial entorhinal cortex (Hafting et al., 2005; Fyhn et al., 2008; Yartsev et al., 2011; Killian et al., 2012; Jacobs et al., 2013; Doeller et al., 2010). Unlike place cells, each grid cell fires at multiple locations that form a hexagonal grid pattern across the environment (Fyhn et al., 2004; Hafting et al., 2005; Fuhs & Touretzky, 2006; Burak & Fiete, 2009; Sreenivasan & Fiete, 2011; Blair et al., 2007; Couey et al., 2013; de Almeida et al., 2009; Pastoll et al., 2013; Agmon & Burak, 2020). Grid cells are thought to interact with place cells and play a crucial role in path integration (Hafting et al., 2005; Fiete et al., 2008; McNaughton et al., 2006; Gil et al., 2018; Ridler et al., 2019; Horner et al., 2016; Ginosa et al., 2023; Boccara et al., 2019), which calculates the agent’s self-position by accumulating its self-motion. Thus, this has led to the view that grid cells form an internal Global Positioning System (GPS) in the brain (Moser & Moser, 2016). Although grid cells have primarily been studied in spatial contexts, recent research suggests that grid-like responses may also exist in more abstract, non-spatial cognitive spaces (Constantinescu et al., 2016; Bellmund et al., 2018).
+
+Numerous computational models have been proposed to explain the characteristic firing patterns of grid cells. Early approaches focused on continuous attractor neural networks (CANN) (Amit, 1992; Burak & Fiete, 2009; Couey et al., 2013; Pastoll et al., 2013; Agmon & Burak, 2020). More recently, two papers (Cueva & Wei, 2018; Banino et al., 2018) learned recurrent neural networks (RNNs) on path integration tasks and demonstrated that grid patterns emerge in the learned networks. These results were further extended in subsequent studies (Gao et al., 2019; Sorscher et al., 2019; Cueva et al., 2020; Gao et al., 2021; Whittington et al., 2021; Dorrell et al., 2022; Xu et al., 2022; Sorscher et al., 2023). Besides RNN-based models, basis expansion models based on principal component
+
+{1}------------------------------------------------
+
+analysis (PCA) with non-negativity constraints (Dordek et al., 2016; Sorscher et al., 2023; Stachenfeld et al., 2017) have been proposed to capture interactions between grid and place cells.
+
+While prior models have advanced our understanding of grid cells, the underlying mathematical principles behind the emergence of hexagonal grid patterns remain elusive (Cueva & Wei, 2018; Sorscher et al., 2023; Gao et al., 2021; Nayebi et al., 2021; Schaeffer et al., 2022). Recently, the conformal isometry hypothesis has gained attention and has been studied in various papers on grid cells. This hypothesis was formalized by Xu et al. (2022) with earlier explorations by Gao et al. (2021; 2019), and has been adapted and investigated in recent works (Schaeffer et al., 2023; Schoyen et al., 2024). The conformal isometry hypothesis posits that grid cell activities form a high-dimensional vector in neural space, encoding the agent’s position in 2D physical space. As the agent moves, this vector rotates within a 2D neural manifold, guided by a recurrent neural network (RNN). The hypothesis proposes that this manifold is a conformal isometric embedding of the 2D physical space, where local physical distance is preserved by the position embedding up to a scaling factor (or unit of metric). Such distance-preserving position embedding is indispensable for path planning in navigation, including planning local straight-path segments.
+
+This paper investigates the conformal isometry hypothesis as a potential mathematical explanation for the formation of hexagonal periodic patterns in grid cell response maps. Unlike previous studies (Xu et al., 2022; Gao et al., 2021) that examined conformal isometry within models combining both place cells and grid cells, we focus on a minimal setting: a single module of grid cells equipped with an explicit metric. By reducing the system to its essentials, we bring the conformal isometry hypothesis to the forefront and study the grid cell system in isolation with fewer assumptions. This approach allows us to gain a sharper and deeper understanding of the hypothesis.
+
+In this paper, we design numerical experiments in the minimalistic setting demonstrating that the conformal isometry hypothesis underlies the hexagonal periodic patterns in grid cell response maps. Specifically, we show that the hexagonal periodic patterns emerge by learning the maximally distance-preserving position embedding. To further validate this hypothesis, we conduct in-depth mathematical analysis to show that hexagon periodic patterns emerge by minimizing our loss function, due to the fact that the hexagon flat torus exhibits minimal deviation from local conformal isometry, i.e., the hexagon flat torus forms the maximally distance-preserving position embedding.
+
+**Contributions.** To summarize, our paper investigates the conformal isometry hypothesis as a possible mathematical principle that underlies the grid cell system. Our contributions are as follows. (1) We conduct a systematic numerical investigation of the conformal isometry hypothesis in a minimalistic setting with a single module of grid cells. (2) We provide a general framework that is agnostic to specific forms of transformation models, grid scales, and the number of neurons. (3) We present a theoretical analysis demonstrating that the hexagonal grid patterns emerge by minimizing our conformal and transformation loss function.
+
+## 2 BACKGROUND
+
+### 2.1 REPRESENTING SELF-POSITION
+
+
+
+Figure 1: (a) A 2D Euclidean space with a vector v(x) representing the self-position. A curved arrow labeled F(·, Δx) shows the transformation to v(x + Δx). (b) A diagram showing the transformation of the self-position vector v(x) to v(x + Δx) via F(·, Δx), and the corresponding physical space transformation x to x + Δx via Δx. (c) A 2D manifold M in the neural space, represented as a curved surface, which is an embedding of the 2D Euclidean domain D.
+
+Figure 1: (a) The self-position $\mathbf{x} = (x_1, x_2)$ in 2D Euclidean space is represented by a vector $\mathbf{v}(\mathbf{x})$ in the $d$ -dimensional neural space. When the agent moves by $\Delta\mathbf{x}$ , the vector is transformed to $\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) = F(\mathbf{v}(\mathbf{x}), \Delta\mathbf{x})$ . (b) $F(\cdot, \Delta\mathbf{x})$ is a representation of the self-motion $\Delta\mathbf{x}$ . (c) $\mathbb{M} = (\mathbf{v}(\mathbf{x}), \mathbf{x} \in D)$ is a 2D manifold in the neural space, and is an embedding of the 2D Euclidean domain $D$ .
+
+Suppose the agent is at the self-position $\mathbf{x} = (x_1, x_2) \in \mathbb{R}^2$ within a 2D Euclidean domain $D$ . The activities of the population of $d$ grid cells form a $d$ -dimensional vector $\mathbf{v}(\mathbf{x}) = (v_i(\mathbf{x}), i = 1, \dots, d)$ , where $v_i(\mathbf{x})$ is the activity of the $i$ -th grid cell at position $\mathbf{x}$ . We call the $d$ -dimensional vector space of $\mathbf{v}$ the neural space, and we embed $\mathbf{x}$ of the 2D physical space as a vector $\mathbf{v}(\mathbf{x})$ of the $d$ -dimensional
+
+{2}------------------------------------------------
+
+neural space. We may also call the vector $v(x)$ the position embedding, following the deep learning terminology (Vaswani et al., 2017). For each grid cell $i$ , $v_i(x)$ , as a function of $x$ , represents the response map of grid cell $i$ .
+
+### 2.2 REPRESENTING SELF-MOTION
+
+At self-position $x = (x_1, x_2)$ , assume the agent makes a movement $\Delta x = (\Delta x_1, \Delta x_2)$ and moves to $x + \Delta x$ . Correspondingly, the vector $v(x)$ is transformed to $v(x + \Delta x)$ . The general form of the transformation can be formulated as:
+
+$$v(x + \Delta x) = F(v(x), \Delta x), \quad (1)$$
+
+where $F$ can be parametrized by an RNN. See Figure 1(a). The input velocity $\Delta x$ can also be represented as $(\Delta r, \theta)$ in polar coordinates, where $\Delta r = \|\Delta x\|$ is the displacement along the heading direction $\theta \in [0, 2\pi]$ , so that $\Delta x = (\Delta x_1 = \Delta r \cos \theta, \Delta x_2 = \Delta r \sin \theta)$ . $F(\cdot, \Delta x)$ is a representation of the self-motion $\Delta x$ . See Figure 1(a-b). We can also write $F(v(x), \Delta x) = F(v(x), \Delta r, \theta)$ with slight overloading of notation $F$ . The transformation model is necessary for path integration and path planning.
+
+### 2.3 CONFORMAL ISOMETRY
+
+For each $x \in \mathbb{D}$ , such as a $1\text{m} \times 1\text{m}$ square environment, we embed $x$ as a vector $v(x)$ in the $d$ -dimensional neural space. Collectively, $\mathbb{M} = \{v(x), \forall x \in \mathbb{D}\}$ is a 2D manifold in the neural space, and $\mathbb{M}$ is an embedding of $\mathbb{D}$ . See Figure 1(c) (the shape of $\mathbb{M}$ in the figure is merely illustrative). As the agent moves in $\mathbb{D}$ , $v(x)$ moves in $\mathbb{M}$ .
+
+The conformal isometry hypothesis (Xu et al., 2022; Gao et al., 2021) proposes that $\mathbb{M}$ is a conformal embedding of $\mathbb{D}$ . Specifically, at any $x \in \mathbb{D}$ , for a local $\Delta x$ , we have
+
+$$\|v(x + \Delta x) - v(x)\| = s\|\Delta x\| + o(\|\Delta x\|), \quad (2)$$
+
+where $s$ is a constant scaling factor independent of $x$ and $\Delta x$ . As the agent moves in $\mathbb{D}$ by $\|\Delta x\|$ , the vector $v(x)$ moves in $\mathbb{M}$ by $s\|\Delta x\|$ .
+
+**Unit of metric.** The scaling factor $s$ defines the metric unit for distance preserving. For example, if $\|\Delta x\|$ is measured in meters, and we want to work in centimeters, then $s = 100$ .
+
+**Intrinsic and extrinsic curvatures.** For a constant $s$ , the intrinsic geometry of the manifold $\mathbb{M}$ remains Euclidean or flat, i.e., $\mathbb{M}$ is a folding or bending of the flat $\mathbb{D}$ without distorting stretching or squeezing. The intrinsic curvature of $\mathbb{M}$ is zero. But the extrinsic curvature of $\mathbb{M}$ is non-zero, i.e., the $o(\|\Delta x\|)$ term in (equation 2) grows as $\|\Delta x\|$ increases. We want to minimize this term for non-infinitesimal $\|\Delta x\|$ so that distance is maximally preserved within a non-infinitesimal local range.
+
+## 3 A MINIMALISTIC SETTING
+
+### 3.1 ASSUMPTIONS
+
+In this section, we seek to study the grid cell system with a minimal number of assumptions. Specifically, we make the following four assumptions:
+
+**Assumption 1.** Conformal isometry: $\|v(x + \Delta x) - v(x)\| = s\|\Delta x\| + o(\|\Delta x\|)$ . In the minimalistic setting, we specify $s$ explicitly, in order to understand how $s$ affects the learned hexagon patterns, and conversely what the hexagon patterns reveal about the underlying $s$ . This will enable us to gain a deeper geometric understanding of the grid cell patterns. We shall discuss learning $s$ in Appendix I.
+
+**Assumption 2.** Transformation: $v(x + \Delta x) = F(v(x), \Delta x)$ , where $F$ is a recurrent neural network. We want to be agnostic about $F$ , and our numerical experiments show that hexagon grid patterns emerge regardless of the form of $F$ . In our experiments, we consider the following simple forms.
+
+(1) Linear model: $v(x + \Delta x) = v(x) + B(\theta)v(x)\Delta r$ , where $\Delta r = \|\Delta x\|$ is the displacement, and $\theta$ is the heading direction of $\Delta x$ . $B(\theta)$ is a $d \times d$ square matrix.
+
+{3}------------------------------------------------
+
+(2) Nonlinear model 1: $\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) = R(\mathbf{A}\mathbf{v}(\mathbf{x}) + \mathbf{B}(\theta)\mathbf{v}(\mathbf{x})\Delta r + \mathbf{b})$ , where $R$ is elementwise nonlinearity such as ReLU, $\mathbf{A}$ and $\mathbf{B}(\theta)$ are $d \times d$ square matrices, and $\mathbf{b}$ is $d \times 1$ bias vector.
+
+(3) Nonlinear model 2: $\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) = R(\mathbf{A}\mathbf{v}(\mathbf{x}) + \mathbf{B}(\theta)\Delta r + \mathbf{b})$ , where $\mathbf{B}(\theta)$ is a $d \times 1$ vector, $\mathbf{b}$ is bias vector, and $R$ is nonlinearity.
+
+**Assumption 3.** Normalization: $\|\mathbf{v}(\mathbf{x})\| = 1$ for each $\mathbf{x} \in \mathbb{D}$ . $\|\mathbf{v}(\mathbf{x})\|^2 = \sum_i v_i(\mathbf{x})^2$ can be interpreted as the total energy of the population of neurons in $\mathbf{v}$ at position $\mathbf{x}$ . This normalization assumption makes the conformal isometry assumption well-defined. Otherwise, we can multiply the vector $\mathbf{v}(\mathbf{x})$ by an arbitrary constant $c$ , so that the scaling factor $s$ is changed to $cs$ . Such undesirable arbitrariness is eliminated by the normalization assumption.
+
+**Assumption 4.** Non-negativity: $v_i(\mathbf{x}) \geq 0$ for each $i$ and $\mathbf{x}$ . This is the assumption studied by Dordek et al. (2016); Sorscher et al. (2023); Stachenfeld et al. (2017). This is obviously true for biological neurons. However, our ablation studies show that it is not necessary for the emergence of hexagon grid patterns. On the other hand, this assumption does enable more stable learning of clean patterns, because it greatly constrains the solution space.
+
+The above assumptions form a minimalistic setting for studying grid cells, where place cells are not involved. This enables us to study the grid cells in isolation with an explicit metric $s$ .
+
+**Scaling property.** Under the above assumptions, for a fixed constant $c$ , let $\tilde{\mathbf{v}}(\mathbf{x}) = \mathbf{v}(c\mathbf{x})$ , then for Assumption 1, $\|\tilde{\mathbf{v}}(\mathbf{x} + \Delta\mathbf{x}) - \tilde{\mathbf{v}}(\mathbf{x})\| = \|\mathbf{v}(c(\mathbf{x} + \Delta\mathbf{x})) - \mathbf{v}(c\mathbf{x})\| = cs\|\Delta\mathbf{x}\| + o(\|\Delta\mathbf{x}\|)$ . For Assumption 2, $\tilde{\mathbf{v}}(\mathbf{x} + \Delta\mathbf{x}) = \mathbf{v}(c\mathbf{x} + c\Delta\mathbf{x}) = F(\mathbf{v}(c\mathbf{x}), c\Delta\mathbf{x}) = F(\tilde{\mathbf{v}}(\mathbf{x}), c\Delta\mathbf{x}) = \tilde{F}(\tilde{\mathbf{v}}(\mathbf{x}), \Delta\mathbf{x})$ . Assumptions 3 and 4 continue to hold. Therefore, a system with scaling factor $s$ can be translated to a system with scaling factor $cs$ .
+
+### 3.2 LEARNING METHOD
+
+Let $\mathbb{D}$ be a $1\text{m} \times 1\text{m}$ Euclidean continuous square environment. We overlay a $40 \times 40$ regular lattice on $\mathbb{D}$ . We learn $\mathbf{v}(\mathbf{x})$ on the $40 \times 40$ lattice points, but we treat $\mathbf{x}$ as continuous, so that for $\mathbf{x}$ off the lattice points, we let $\mathbf{v}(\mathbf{x})$ be the bi-linear interpolation of the $\mathbf{v}(\mathbf{x})$ on the 4 nearest grid points.
+
+The loss function consists of the following two terms:
+
+$$L_1 = \mathbb{E}_{\mathbf{x}, \Delta\mathbf{x}}[(\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\| - s\|\Delta\mathbf{x}\|)^2], \quad (3)$$
+
+$$L_2 = \mathbb{E}_{\mathbf{x}, \Delta\mathbf{x}}[\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - F(\mathbf{v}(\mathbf{x}), \Delta\mathbf{x})\|^2], \quad (4)$$
+
+where $L_1$ ensures Assumption 1 on conformal isometry, while $L_2$ satisfies Assumption 2 on transformation. Since $L_2$ is a one-step transformation loss, back-propagation through time is not required.
+
+In $L_2$ , we assume $\Delta\mathbf{x}$ to be infinitesimal for local motion (e.g., $\|\Delta\mathbf{x}\| \leq 0.075$ ). In $L_1$ , however, we assume $s\Delta\mathbf{x}$ to be within a non-infinitesimal range, $s\|\Delta\mathbf{x}\| \leq D$ (e.g., $D = 1.25$ ). In defining $\mathbb{E}_{\Delta\mathbf{x}}$ , we assume $\Delta\mathbf{x}$ follows uniform distribution within the ranges specified above. In $L_1$ , we can also assume a more general distribution $p(\Delta\mathbf{x})$ , so that $L_1 = \mathbb{E}_{\mathbf{x}}[\int (\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\| - s\|\Delta\mathbf{x}\|)^2 p(\Delta\mathbf{x}) d\Delta\mathbf{x}]$ .
+
+We minimize $L = L_1 + \lambda L_2$ over the set of $\mathbf{v}(\mathbf{x})$ on the $40 \times 40$ lattice points as well as the parameters in $F$ , such as $\mathbf{B}(\theta)$ for the discrete set of directions $\theta$ in the linear model. $\lambda > 0$ is a hyper-parameter that balances $L_1$ and $L_2$ . We use stochastic gradient descent to minimize $L$ , where in each iteration, the expectations in $L$ are replaced by the averages over Monte Carlo samples of $(\mathbf{x}, \Delta\mathbf{x})$ .
+
+After each iteration, we set any negative elements in $\mathbf{v}(\mathbf{x})$ to zero to enforce Assumption 4 on non-negativity. Then we normalize $\|\mathbf{v}(\mathbf{x})\| = 1$ for each $\mathbf{x}$ , ensuring Assumption 3 on normalization.
+
+### 3.3 MAXIMALLY DISTANCE-PRESERVING POSITION EMBEDDING
+
+While $L_2$ can be minimized to close to 0, $L_1$ has a non-zero minimum due to the non-infinitesimal range $D$ . For small $s\|\Delta\mathbf{x}\|$ , the deviation is small due to $o(\|\Delta\mathbf{x}\|)$ term. In fact, our experiment in Section 3.5 shows that conformal isometry is nearly exact for $s\|\Delta\mathbf{x}\| \leq .8$ . Beyond that point, the deviation begins to increase due to the extrinsic curvature of the manifold. Minimizing $L_1$ amounts to finding the maximally distance-preserving position embedding at a given scaling factor $s$ within
+
+{4}------------------------------------------------
+
+the range $D$ . The reason we constrain the range of $s\|\Delta\mathbf{x}\|$ is that under the scaling $\tilde{\mathbf{v}}(\mathbf{x}) = \mathbf{v}(c\mathbf{x})$ , the deviation from conformal isometry in $L_1$ satisfies: $\|\tilde{\mathbf{v}}(\mathbf{x} + \Delta\mathbf{x}) - \tilde{\mathbf{v}}(\mathbf{x})\| - cs\|\Delta\mathbf{x}\| = \|\mathbf{v}(c\mathbf{x} + c\Delta\mathbf{x}) - \mathbf{v}(c\mathbf{x})\| - s\|c\Delta\mathbf{x}\|$ .
+
+### 3.4 NUMERICAL EXPERIMENTS
+
+We perform numerical experiments in the minimalistic setting, testing the generality of our method across various RNN parameterizations. Additionally, we varied the scaling factor $s$ and the number of neurons. For $\Delta\mathbf{x}$ in $L_1$ , we constrained it locally, ensuring $s\|\Delta\mathbf{x}\| \leq 1.25$ . For $L_2$ , $\|\Delta\mathbf{x}\|$ was restricted to be smaller than 0.075.
+
+The dimensions of $\mathbf{v}(\mathbf{x})$ , representing the total number of grid cells, were nominally set to 24 for both the linear model and nonlinear model 1, and 1000 for nonlinear model 2. Notably, similar results can be obtained with different numbers of cells, e.g., 500, for both the linear model and nonlinear model 1. All the parameters are updated by Adam optimizer (Kingma & Ba, 2014).
+
+
+
+Figure 2: Hexagonal periodic patterns learned in linear models. (a) Learned grid cells showing response maps for different scales s (3, 5, 8, 10, 15). (b) Toroidal structure spectral analysis showing a 3D torus (i), a vector diagram (ii), and individual spectral components (iii) for k1, k2, and k3.
+
+Figure 2: Hexagonal periodic patterns learned in linear models. (a) Learned patterns of linear models with different scales. (b) Toroidal structure spectral analysis of the activities of grid cells.
+
+**Hexagonal patterns.** We first trained the linear model with manually assigned scaling factor $s$ by minimizing $L = L_1 + \lambda L_2$ . Figure 2(a) shows the learned firing patterns of $\mathbf{v}(\mathbf{x})$ for linear models with the change of scaling factors $s$ , which controlled the scale or metric. In Figure 2(a), each image represents the response map for a grid cell, with each row displaying 6 randomly selected response maps. The emergence of hexagonal periodic patterns in these response maps is evident. Consistency in scale and orientation is observed within each scale, though variations in phases or spatial shifts are apparent.
+
+We also trained nonlinear models with various activation functions. In Figures 3(a-d), hexagonal periodic patterns still emerge with nonlinear transformations, demonstrating that the grid-like patterns are stable and easily learned regardless of the transformation type, grid scales, or number of neurons.
+
+To evaluate how closely the learned patterns align with regular hexagonal grids, we recruited the most commonly used metric for quantifying grid cells, the gridness score, adopted by the neuroscience literature (Langston et al., 2010; Sargolini et al., 2006). The gridness scores and the valid rate were reported in Table 1. Compared to other existing learning-based approaches, our models exhibit notably high gridness scores ( $\uparrow$ ) and a high percentage of valid grid cells ( $\uparrow$ ).
+
+Table 1: Gridness scores and validity rates of grid cells. The last two rows represent the results of our models.
+
+| MODEL | GRIDNESS( $\uparrow$ ) | VALID RATE( $\uparrow$ ) |
+|-|-|-|
+| BANINO ET AL. (2018) | 0.18 | 25.2% |
+| SORSCHER ET AL. (2023) | 0.48 | 56.1% |
+| GAO ET AL. (2021) | 0.90 | 73.1% |
+| OUR LINEAR | 1.70 | 100.0% |
+| OUR NONLINEAR | 1.17 | 100.0% |
+
+Table 2: Scaling factor $s$ and estimated scale for learned patterns in single-module linear models.
+
+| SCALING FACTOR | ESTIMATED SCALE |
+|-|-|
+| $s = 5$ | 0.82 |
+| $s = 10$ | 0.41 |
+| $s = 15$ | 0.27 |
+
+{5}------------------------------------------------
+
+We also investigated the relationship between the manually assigned scaling factor $s$ and the estimated scale of the learned patterns following (Langston et al., 2010; Sargolini et al., 2006). As shown in Table 2, the estimated scale of the learned patterns is proportional to $1/s$ .
+
+**Topological analysis.** As discussed in Section 4.1, the joint activities of grid cells should reside on a torus-like manifold, and the positions on the torus correspond to the physical locations of a moving agent. To evaluate whether our empirically learned representations align with the topological properties of theoretical models, we employed a nonlinear dimension reduction method (spectral embedding (Saul et al. (2006))) to show that grid cell states fell on a toroidal manifold as depicted in Figure 2b(i). To further investigate periodicity and orientation within the same module, we conducted numerical simulations of pattern forming dynamics. In Figure 2b(ii), we applied 2D Fourier transforms of the learned maps, revealing that the Fourier power is hexagonally distributed along 3 principal directions $k_1$ , $k_2$ , and $k_3$ . Following (Schøyen et al. (2022); Schaeffer et al. (2023), projecting the toroidal manifold onto the 3 vectors, we can observe 3 rings in Figure 2b(iii). This indicates the manifold has a 2D twisted torus topology.
+
+
+
+Figure 3: Learned patterns for nonlinear models and ablation for the linear model. The figure consists of eight subplots arranged in a 4x2 grid. The left column (a-d) shows learned patterns for nonlinear models with different rectified functions: (a) Nonlinear Model 1 (Tanh) w/o v > 0, (b) Nonlinear Model 1 (Tanh) w/ v > 0, (c) Nonlinear Model 1 (ReLU) w/ v > 0, and (d) Nonlinear Model 2 (ReLU) w/ v > 0. The right column (e-h) shows ablation results for the linear model: (e) Linear model w/o v > 0, (f) Linear model w/o |v| = 1, (g) Linear model w/o L2, and (h) Linear model w/o L1. Each subplot displays a 2D grid of colored squares representing the learned patterns.
+
+Figure 3: *Left(a-d)*: Learned patterns for nonlinear models with different rectified functions. *Right(e-h)*: Ablation for the linear model.
+
+**Ablation study.** We show ablation results to investigate the empirical significance of each assumption for the emergence of hexagon grid patterns. First, we highlight the essential role of conformal isometry; in its absence, as shown in Figure 3(h), the response maps display non-hexagon patterns. Next, as shown in Figure 3(a) and (e), we also ablate the non-negative assumption. Without $v(x) \geq 0$ , the hexagonal pattern still emerges. For the transformation and normalization assumptions, Figure 3(f) and (g) indicate that they are necessary. See more results for normalization assumption in G.2.
+
+### 3.5 NUMERICAL EVIDENCE FOR LOCAL CONFORMAL ISOMETRY
+
+
+
+Figure 4: A scatter plot showing the relationship between ||v(x + Δx) - v(x)|| and ||Δx|| in the learned representations. The x-axis is labeled ||Δx|| and ranges from 0.0 to 0.12. The y-axis is labeled ||v(x + Δx) - v(x)|| and ranges from 0.0 to 1.2. A dashed green line represents the linear reference line with slope s=10. A dashed orange line represents the quadratic fit to the data. Blue dots represent the learned representation data points. The data points follow the linear trend closely but show a slight upward deviation at higher ||Δx|| values, following the quadratic fit curve.
+
+Figure 4: The relationship between $\|v(x + \Delta x) - v(x)\|$ and $\|\Delta x\|$ in the learned representations.
+
+To further assess whether our learned model achieves local conformal isometry, we examine the relationship between $\|v(x + \Delta x) - v(x)\|$ and $\|\Delta x\|$ in our learned model. Specifically, we aim to verify if the learned representation exhibits the expected local isometry for local displacements $\Delta x$ and how deviations arise as the displacement increases. Here we use the linear model with the metric $s = 10$ for analysis.
+
+As shown in Figure 4, we randomly sample $\Delta x$ within the range $(0, 0.125)$ , and plot $\|v(x + \Delta x) - v(x)\|$ using the learned model. Then, we draw the linear reference line with slope $s = 10$ , and also fit a quadratic curve to the data. The results show that the learned representation closely follows a linear relationship for local $\Delta x$ , as expected from a conformally isometric embedding.
+
+As $\Delta x$ increases, we observe a quadratic deviation from the linear trend, due to the extrinsic curvature of the manifold $\mathbb{M}$ . In our theoretical analysis, we shall analyze this deviation and show that the
+
+{6}------------------------------------------------
+
+hexagon flat torus achieves minimum deviation from local isometry, thus explaining the emergence of hexagonal grid patterns by minimizing our loss term on conformal isometry $L_1$ in equation 3.
+
+### 3.6 NEUROSCIENCE EVIDENCE FROM NEURAL RECORDING DATA
+
+To further investigate conformal isometry, we perform analysis on real neural recordings using data from Gardner et al. (2021), which contains simultaneous recording of hundreds of grid cells in rodents using Neuropixels probes. To test the conformal isometry hypothesis, we evaluate whether equation 2 holds in the recorded cell activations. Specifically, we calculate $\|v(x) - v(x + \Delta x)\|$ for different locations $x$ and for varying local shifts $\Delta x$ . We expect to observe a linear relationship.
+
+
+
+Figure 5 consists of two plots. Plot (a) is a scatter plot titled 'Neural data' showing the relationship between $\|v(x + \Delta x) - v(x)\|$ on the y-axis and $\|\Delta x\|$ on the x-axis. The data points are blue dots, and there are two fitted lines: a green line for 'Linear Fit' and a yellow line for 'Quadratic Fit'. The data points follow a clear linear trend. Plot (b) is a histogram titled 'Distribution of $\|v\|$ ' showing the frequency of $\|v\|$ values. The x-axis is labeled $\|v\|$ and ranges from 80 to 200. The y-axis is labeled 'Frequency' and ranges from 0 to 1600. The histogram shows a distribution centered around 128.6.
+
+Figure 5: Analysis of real neural data. (a) Scatter plot of ||v(x + Δx) - v(x)|| vs ||Δx|| showing a linear relationship with a linear fit (green line) and a quadratic fit (yellow line). (b) Histogram of ||v|| in neural data showing a distribution centered around 128.6.
+
+Figure 5: Analysis of real neural data. (a) A clear linear relationship between $\|v(x + \Delta x) - v(x)\|$ and $\|\Delta x\|$ is shown in the real neural data. The unit of $\Delta x$ is meter. (b) Distribution of $\|v(x)\|$ in neural data.
+
+In the analysis, we used data from one module, which includes 93 pure grid cells. As shown in Figure 5(a), despite the noise in the data, a clear linear relationship emerges between $\|v(x) - v(x + \Delta x)\|$ and $\|\Delta x\|$ . A quadratic polynomial fit closely matches the linear curve, indicating minimal deviation from linearity for local $\|\Delta x\|$ . Furthermore, we analyzed the distribution of $\|v(x)\|$ in real neural data, finding a mean of 128.6 with a standard deviation of 15.1. When normalized to a mean of 1, the standard deviation becomes 0.12, indicating that the assumption of constant $\|v(x)\|$ holds approximately.
+
+Considering the noisy nature of neural responses and the fact that the data may only contain a subset of grid cells in the module, the results above are consistent with Assumption 1 of local conformal isometry and Assumption 3 of constant $\|v(x)\|$ over $x$ . See Appendix J for more results.
+
+## 4 THEORETICAL UNDERSTANDING
+
+This section presents a theoretical understanding of the emergence of hexagon grid patterns when minimizing our loss function. We show that the hexagonal flat torus, which underlies grid cell patterns, achieves minimal deviation from local conformal isometry.
+
+### 4.1 HEXAGON FLAT TORUS IS MAXIMALLY DISTANCE PRESERVING
+
+We start by showing that the manifold of the grid cell representation $\mathbb{M} = (v(x), \forall x)$ forms a 2D torus.
+
+**Proposition 1.** *The transformations $(F(\cdot, \Delta x), \forall \Delta x)$ form a group acting on the manifold $\mathbb{M} = (v(x), \forall x)$ , and the 2D manifold $\mathbb{M}$ has a torus topology.*
+
+*Proof.* The group $(F(\cdot, \Delta x), \forall \Delta x)$ is a representation of the 2D additive Euclidean group $(\mathbb{R}^2, +)$ , i.e., $F(v(x), \Delta x_1 + \Delta x_2) = F(F(v(x), \Delta x_1), \Delta x_2) = F(F(v(x), \Delta x_2), \Delta x_1), \forall x, \Delta x_1, \Delta x_2$ , and $F(v(x), 0) = v(x), \forall x$ (Gao et al., 2021). See Figure 1 for an illustration. Since $(\mathbb{R}^2, +)$ is an abelian Lie group, $(F(\cdot, \Delta x), \forall \Delta x)$ is also an abelian Lie group. With Assumption 3 on normalization, $\|v(x)\| = 1$ , the manifold $(v(x), \forall x)$ is compact, and $(F(\cdot, \Delta x), \forall \Delta x)$ is a compact group. It is also connected because the 2D domain is connected. According to a classical theorem
+
+{7}------------------------------------------------
+
+in Lie group theory (Dwyer & Wilkerson, 1998), a compact and connected abelian Lie group has a topology of a torus. Therefore, the 2D manifold $\mathbb{M}$ is a 2D torus. ■
+
+The torus topology is supported by neuroscience data (Gardner et al., 2021) as well as our numerical experiments. The torus manifold makes $\mathbf{v}(\mathbf{x})$ a 2D periodic function of $\mathbf{x}$ . See Appendix B for a detailed explanation of the 2D periodic lattice.
+
+Section 3.5 shows that our learned model achieves local isometry. Without loss of generality, assuming the conformal scaling factor $s = 1$ . The 2D manifold $\mathbb{M} = (\mathbf{v}(\mathbf{x}), \forall \mathbf{x})$ is thus a flat torus with local isometry, and it has zero intrinsic curvature, meaning it has a flat Euclidean geometry intrinsically.
+
+So far we have shown that the geometry of the grid cell representation is a torus and is flat locally. However, viewed from outside the manifold with bigger $\|\Delta\mathbf{x}\|$ , the extrinsic curvature of the torus within the ambient embedding space is non-zero, and our loss function $\mathbb{E}_{\mathbf{x}, \Delta\mathbf{x}}[\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\| - \|\Delta\mathbf{x}\|^2]$ minimizes the deviation from the local flatness for bigger $\|\Delta\mathbf{x}\|$ .
+
+Let us assume $\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\|^2 = \|\Delta\mathbf{x}\|^2 + o(\|\Delta\mathbf{x}\|^2)$ for infinitesimal $\|\Delta\mathbf{x}\|$ , enforced by the loss function and verified numerically in Section 3.5. For larger $\|\Delta\mathbf{x}\|$ , we further analyze $\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\|^2 - \|\Delta\mathbf{x}\|^2$ using a higher-order Taylor expansion, up to $o(\|\Delta\mathbf{x}\|^4)$ .
+
+**Definition 2.** We define notation for the derivatives of $\mathbf{v}(\mathbf{x})$ : $\mathbf{v}^{(1)} = \partial\mathbf{v}(\mathbf{x})/\partial x_1$ , $\mathbf{v}^{(2)} = \partial\mathbf{v}(\mathbf{x})/\partial x_2$ , $\mathbf{v}^{(11)} = \partial^2\mathbf{v}(\mathbf{x})/\partial x_1^2$ , $\mathbf{v}^{(12)} = \partial^2\mathbf{v}(\mathbf{x})/\partial x_1\partial x_2$ , $\mathbf{v}^{(22)} = \partial^2\mathbf{v}(\mathbf{x})/\partial x_2^2$ , and their higher-order counterparts. The indices in the superscript indicate the variables with respect to which we take partial derivatives.
+
+**Definition 3.** Assume $\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\|^2 = \|\Delta\mathbf{x}\|^2 + o(\|\Delta\mathbf{x}\|^2)$ . Define high order deviation from local flatness as $\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\|^2 - \|\Delta\mathbf{x}\|^2$ .
+
+**Proposition 4.** Assuming $\|\mathbf{v}(\mathbf{x})\| = 1$ for every $\mathbf{x}$ , then the high order deviation
+
+$$\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\|^2 - \|\Delta\mathbf{x}\|^2 = -\frac{1}{12}D(\Delta\mathbf{x}) + o(\|\Delta\mathbf{x}\|^4). \quad (5)$$
+
+where
+
+$$\begin{aligned} D(\Delta\mathbf{x}) = & \langle \mathbf{v}^{(1111)}, \mathbf{v} \rangle \Delta x_1^4 + \langle \mathbf{v}^{(2222)}, \mathbf{v} \rangle \Delta x_2^4 + 6\langle \mathbf{v}^{(1122)}, \mathbf{v} \rangle \Delta x_1^2 \Delta x_2^2 \\ & + 4\langle \mathbf{v}^{(1112)}, \mathbf{v} \rangle \Delta x_1^3 \Delta x_2 + 4\langle \mathbf{v}^{(1222)}, \mathbf{v} \rangle \Delta x_1 \Delta x_2^3. \end{aligned} \quad (6)$$
+
+*Proof.* With $\|\mathbf{v}(\mathbf{x})\|^2 = 1$ , we have
+
+$$\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\|^2 - \|\Delta\mathbf{x}\|^2 = 2 - 2\langle \mathbf{v}(\mathbf{x} + \Delta\mathbf{x}), \mathbf{v}(\mathbf{x}) \rangle - (\Delta x_1^2 + \Delta x_2^2). \quad (7)$$
+
+We can expand $\mathbf{v}(\mathbf{x} + \Delta\mathbf{x})$ by 4th-order Taylor expansion, and calculate the inner products between the derivatives and $\mathbf{v}(\mathbf{x})$ . When the manifold is locally flat and isometric for infinitesimal $\Delta\mathbf{x}$ , the first derivatives $\mathbf{v}^{(1)}$ and $\mathbf{v}^{(2)}$ form an orthonormal basis, i.e., $\langle \mathbf{v}^{(1)}, \mathbf{v}^{(2)} \rangle = 0$ and $\|\mathbf{v}^{(i)}\|^2 = 1$ for $i = 1, 2$ . By repeatedly differentiating these equations, we can derive a series of properties such as $\langle \mathbf{v}^{(1)}, \mathbf{v}(\mathbf{x}) \rangle = \langle \mathbf{v}^{(2)}, \mathbf{v}(\mathbf{x}) \rangle = 0$ , $\langle \mathbf{v}^{(11)}, \mathbf{v}(\mathbf{x}) \rangle = \langle \mathbf{v}^{(22)}, \mathbf{v}(\mathbf{x}) \rangle = -1$ , $\langle \mathbf{v}^{(12)}, \mathbf{v}(\mathbf{x}) \rangle = 0$ . Moreover, the inner products between the third-order derivatives and $\mathbf{v}(\mathbf{x})$ all vanish. See Appendix C for detailed proof. Therefore, only the 4-th order terms $D(\Delta\mathbf{x})$ remain. ■
+
+This fourth-order term $D(\Delta\mathbf{x})$ captures deviation from local flatness or extrinsic curvature for larger $\|\Delta\mathbf{x}\|$ (i.e., going beyond second-order $o(\|\Delta\mathbf{x}\|^2)$ to up to $o(\|\Delta\mathbf{x}\|^4)$ ).
+
+We shall prove that among all flat tori (such as parallelogram, rectangle, square, and hexagon tori), the hexagonal torus minimizes the deviation derived above, due to its six-fold symmetry that evenly distributes the extrinsic curvature. We first establish the isotropy of hexagon flat torus.
+
+**Theorem 5.** If the torus $\mathbb{M} = (\mathbf{v}(\mathbf{x}), \forall \mathbf{x})$ is a hexagon flat torus, then $D(\Delta\mathbf{x}) = c\|\Delta\mathbf{x}\|^4$ for a constant coefficient $c$ , i.e., $D(\Delta\mathbf{x})$ is isotropic.
+
+*Proof.* A hexagon torus possesses 6-fold rotational symmetry, meaning it is invariant under 60-degree rotations. Under such a rotation, the coordinates transform as:
+
+$$\Delta x'_1 = \frac{\sqrt{3}}{2} \Delta x_1 - \frac{1}{2} \Delta x_2; \quad \Delta x'_2 = \frac{1}{2} \Delta x_1 + \frac{\sqrt{3}}{2} \Delta x_2. \quad (8)$$
+
+{8}------------------------------------------------
+
+To maintain symmetry, we require that $D(\Delta\mathbf{x}') = D(\Delta\mathbf{x})$ , which leads to the conditions:
+
+$$\langle \mathbf{v}^{(1111)}, \mathbf{v} \rangle = \langle \mathbf{v}^{(2222)}, \mathbf{v} \rangle = 3\langle \mathbf{v}^{(1122)}, \mathbf{v} \rangle = c; \quad \langle \mathbf{v}^{(1112)}, \mathbf{v} \rangle = \langle \mathbf{v}^{(1222)}, \mathbf{v} \rangle = 0. \quad (9)$$
+
+Thus, the deviation $D(\Delta\mathbf{x})$ becomes:
+
+$$D(\Delta\mathbf{x}) = c(\Delta x_1^4 + \Delta x_2^4 + 2\Delta x_1^2 \Delta x_2^2) = c(\Delta x_1^2 + \Delta x_2^2)^2 = c\|\Delta\mathbf{x}\|^4, \quad (10)$$
+
+which is constant in all directions. This shows that the hexagonal torus is locally isotropic up to the fourth-order term. See Appendix D for a detailed treatment. ■
+
+Define $\Delta r = \|\Delta\mathbf{x}\|$ , $\Delta x_1 = \Delta r \cos \theta$ , and $\Delta x_2 = \Delta r \sin \theta$ . $D(\Delta\mathbf{x})$ is constant over direction $\theta$ for fixed $\Delta r$ . As shown in Figure 6 of Appendix, only the hexagon lattice has six-fold symmetry. Other flat tori do not have six-fold symmetry and thus do not have isotropic $D(\Delta\mathbf{x})$ . For instance, a square torus has 4-fold symmetry, and its $D(\Delta\mathbf{x})$ is not isotropic. An example is Clifford torus in 4D, $\mathbf{v}(\mathbf{x}) = (\cos x_1, \sin x_1, \cos x_2, \sin x_2)$ , with $D(\Delta\mathbf{x}) \propto (\cos^4 \theta + \sin^4 \theta)\Delta r^4$ , which is not isotropic.
+
+Flat tori come with different sizes or surface areas, which are related to their average extrinsic curvatures. When comparing different tori, we should fix the size or average extrinsic curvature for fair comparison. Specifically, for any fixed $\Delta r$ , we integrate over $\theta \in [0, 2\pi]$ to get expectation with respect to $\theta$ .
+
+**Theorem 6.** *For any fixed average extrinsic curvature $\int D(\Delta\mathbf{x})d\theta$ , the overall deviation from local flatness*
+
+$$L(\Delta r) = \int (\|\mathbf{v}(\mathbf{x} + \Delta\mathbf{x}) - \mathbf{v}(\mathbf{x})\|^2 - \|\Delta\mathbf{x}\|^2)^2 d\theta = \frac{1}{12^2} \int (D(\Delta\mathbf{x}))^2 d\theta \quad (11)$$
+
+is minimized if $D(\Delta\mathbf{x})$ is constant over $\theta$ .
+
+*Proof.* This optimality is a result of Cauchy-Schwarz inequality. It can also be proved via the identity $\mathbb{E}_\theta(D(\Delta\mathbf{x})^2) = (\mathbb{E}_\theta(D(\Delta\mathbf{x})))^2 + \text{Var}_\theta(D(\Delta\mathbf{x}))$ , which is minimized when $\text{Var}_\theta(D(\Delta\mathbf{x})) = 0$ . This is achieved by the hexagon torus which is isotropic. Moreover, for the same hexagon torus, we can apply the above analysis and proves its optimality for all $\Delta r$ . That is, the optimality of a hexagon torus is independent of $\Delta r$ . ■
+
+This proves that the hexagon torus minimizes our loss function, i.e., the hexagon torus has local isometry up to $o(\|\Delta\mathbf{x}\|^2)$ and it has the minimum deviation from local isometry up to $o(\|\Delta\mathbf{x}\|^4)$ . To conclude, the hexagon flat torus forms the maximally distance-preserving position embedding.
+
+### 4.2 MULTIPLE MODULES OF CONFORMAL ISOMETRY
+
+The minimalistic setting studied in the previous sections is about a single module of grid cells with a fixed scaling factor $s$ . Grid cells form multiple modules or blocks (Barry et al., 2007; Stensola et al., 2012), and the response maps of grid cells within each module share the same scale and orientation. Thus, we can learn multiple modules, so that each module satisfies conformal isometry with its own scaling factor $s$ .
+
+For a small $s$ , the flat torus is big, and conformal isometry holds within a big range, but the resolution is low, i.e., $\mathbf{v}(\mathbf{x} + \Delta\mathbf{x})$ is close to $\mathbf{v}(\mathbf{x})$ in the presence of noises in neuron activities. On the contrary, for a big $s$ , the flat torus is small, and conformal isometry holds within a small range, but the resolution is high, i.e., $\mathbf{v}(\mathbf{x} + \Delta\mathbf{x})$ is far from $\mathbf{v}(\mathbf{x})$ to resist noises in neuron activities.
+
+The agent needs spatial awareness at different scales or resolutions. For instance, in playing golf, the first stroke and the final putt require very different $s$ . Thus it needs multiple modules that satisfy conformal isometry at different scaling factors.
+
+See Appendix H for a conformal modulation scheme to ensure the transformation RNN satisfies conformal isometry automatically. See Appendix I for learning multiple modules with such built-in conformal isometry by incorporating place cells.
+
+{9}------------------------------------------------
+
+## 5 RELATION TO PAST WORKS
+
+The study of grid cells using machine learning models (Cueva & Wei, 2018; Banino et al., 2018; Sorscher et al., 2019; Whittington et al., 2020; Nayebi et al., 2021) is a topic of interest to both machine learning and computational neuroscience communities. Earlier papers (Cueva & Wei, 2018; Banino et al., 2018) adopted recurrent neural networks and used the objective of path integration to learn grid cells. Their models also involved interactions with place cells at the output layer, and the place cells are often modeled by predefined functions such as Gaussian tuning functions (Cueva & Wei, 2018; Gao et al., 2021; Xu et al., 2022). However, hexagon grid patterns do not consistently emerge from the learned models (Schaeffer et al., 2022). Thus extra assumptions or hypotheses are needed to explain the emergence of hexagon grid patterns.
+
+One hypothesis is to assume the non-negativity of the grid cell responses coupled with Difference-of-Gaussian tuning functions for place cells, as in (Sorscher et al., 2019; Nayebi et al., 2021). However, the biological plausibility of center-surround Difference-of-Gaussian assumption is questioned (Schaeffer et al., 2022).
+
+Another hypothesis is the conformal isometry hypothesis proposed in (Gao et al., 2021; Xu et al., 2022). However, these papers focused on learning multiple modules of grid cells using specific transformation models. Additionally, they introduced extra assumptions regarding place cells and the interactions between grid cells and place cells.
+
+Our paper is built on (Gao et al., 2021; Xu et al., 2022), and we have achieved scientific reductionism by isolating the grid cell system of a single module, without making any assumptions about the place cells as well as the interactions between grid cells and place cells. We have also achieved generality by being agnostic of the form of the transformation model. This enables us to focus solely on the conformal isometry hypothesis and demonstrates its crucial role in the emergence of hexagon grid patterns. Moreover, we also provide neuroscience and theoretical evidences for this hypothesis. In our work, we study the conformal isometry hypothesis with explicit scaling factor $s$ . In contrast, (Gao et al. (2021); Xu et al. (2022)) incorporate $s$ implicitly within their learned models.
+
+Schaeffer et al. (2023) proposed a self-supervised learning framework to learn grid cells of multiple modules, where conformal isometry is incorporated.
+
+## 6 DISCUSSION: CONFORMAL ISOMETRY FOR PATH PLANNING
+
+Conformal isometry ensures that the spatial representation in the brain preserves the geometry of the local environment, where distances are preserved locally. In terms of functional benefit, conformal isometry can be crucial for path planning. For instance, planning a straight path in an open field can be easily accomplished by following the steepest descent on the distance between neural representations of the target position and the current position on the path. This geometry-preserving property also facilitates the planning of more complex paths involving obstacles and landmarks. The scaling factor $s$ allows path planning at different spatial scales or resolutions. This rationale suggests planning-centered representation learning in general, i.e., the learning of representations should serve the purpose of planning.
+
+## 7 CONCLUSION
+
+This paper investigates the conformal isometry hypothesis as a fundamental mathematical principle for the emergence of hexagonal periodic patterns in grid cells, both numerically and theoretically. The simplicity and naturalness of the conformal isometry hypothesis, along with its compelling geometric implications, make it a powerful framework for understanding grid cell patterns. Moreover, the conformal isometry hypothesis is also general enough that it leads to hexagon grid patterns regardless of the specific forms of transformation models or other settings. We believe that this hypothesis will serve as a foundation for further development of normative models of grid cells and enhance our understanding of their interactions with other systems.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/YK8eO7BEkJ.txt b/papers/YK8eO7BEkJ.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8d20c6be18611c6deddd492e6de1d42f8a08ce21
--- /dev/null
+++ b/papers/YK8eO7BEkJ.txt
@@ -0,0 +1,330 @@
+**Primary Area:** applications to computer vision, audio, language, and other modalities
+
+
+
+{0}------------------------------------------------
+
+# AN EMPIRICAL STUDY ON NORMALIZATION IN MAMBA
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Normalization layers are crucial for improving the training efficiency and stability of deep neural network architectures. The recently proposed Mamba network has demonstrated significant potential in competing with Transformers. However, as with many deep architectures, the training stability of Mamba remains a significant challenge, and normalization techniques are key to addressing this issue. In this paper, we systematically investigate the effects of normalization type, position and combinations on the Mamba Block. On the one hand, we conducted extensive experiments to evaluate the impact of applying various normalization layers before or after the SSM module(the core module of Mamba Block). On the other hand, we performed thorough experiments to assess the effects of combining diverse normalization techniques before and after the SSM module. Our analysis encompasses both long sequence modeling and image classification tasks. The results show that applying normalization layers after the SSM module (if used only once) and combining different normalization layers before and after the SSM module can enhance training stability and improve Mamba performance. Furthermore, we provide practical recommendations for selecting appropriate normalization techniques in designing Mamba architectures and validated them on other datasets. We hope that our insights will help mitigate training instabilities in deep learning and foster the development of more robust architectures. All codes and models used in this study will be open-sourced on GitHub.
+
+## 1 INTRODUCTION
+
+The Mamba architecture is a state-of-the-art model designed to efficiently handle long sequences in sequence modeling by leveraging selective structured state space models (Selective SSM) (Gu et al., 2021). However, training Mamba presents significant challenges due to the inherent unpredictability of SSM (Hamilton, 1994). Normalization plays a crucial role in effectively training deep neural networks (Huang et al., 2023), which provides a potential solution for training Mamba. There are various usages of normalization techniques in the variants of Mamba architecture (Gu & Dao, 2023; Bai et al., 2024b; Liu et al., 2024; Gong et al., 2024; Ting et al., 2024), but without providing the sufficient evidence for supporting why one should use like that. Are there any patterns in the use of normalization in Mamba? And how can we better utilize normalization techniques in Mamba? To answer these questions, it is necessary to conduct a comprehensive investigation into various normalization strategies. In this study, we systematically evaluate the effect of **normalization types, positions, and combinations** on Mamba’s performance and stability in sequence modeling and image classification tasks. We also provide valuable recommendations on how to select normalization techniques when designing new Mamba frameworks.
+
+For **normalization types**, different normalization methods have distinct characteristics, functions, and applicable scenarios. Mamba and its variants have utilized diverse normalization methods (Gu & Dao, 2023; Bai et al., 2024b; Liu et al., 2024; Gong et al., 2024; Ting et al., 2024). However, no work has yet explored the impact of these normalization methods on Mamba’s performance or provided general recommendations on choosing a suitable normalization technique. To address this, we explore the impact of several widely used normalization techniques, including BN, LN, GN, IN, and RMSN, in both sequence modeling and image classification tasks.
+
+For **normalization positions**, using normalization layers at different positions can adjust the data distribution at those locations, thereby affecting the model’s performance. Currently, many Mamba variants utilize normalization layers at different positions relative to the SSM module, such as (Ma et al., 2024; Chen et al., 2024d; Huang et al., 2024; Liu et al., 2024; Chen et al., 2024e). This raises a question: what is the optimal position to apply normalization? To address this question, we explored the impact of applying normalization layers before or after SSM on Mamba’s performance.
+
+{1}------------------------------------------------
+
+For **normalization combinations**. Different normalization methods adjust data distributions from various perspectives. Currently, several Mamba variants adopt different normalization methods before and after the SSM. On one hand, some variants use the same normalization method both before and after SSM, such as (Zhou et al., 2024; Chen & Ge, 2024; Bai et al., 2024b; Gong et al., 2024). On the other hand, some variants use different normalization methods before and after SSM, respectively, such as (Fan et al., 2024; Dong et al., 2024a; Hatamizadeh & Kautz, 2024; Qu et al., 2024; Ju & Zhou, 2024:?). Can combining different normalization methods achieve better performance? What is the optimal combination strategy? These questions remain unanswered. Therefore, it is necessary to explore the impact of applying different combinations of normalizations on Mamba’s performance. To this end, we investigated the effects of pairwise combinations among five common normalization methods.
+
+We analyzed the results of the above three exploratory experiments. Our analysis, rooted in the scale invariance of deep learning (Papayan, 2018), revealed that the weight matrices (Huang et al., 2020) in deeper Mamba blocks exhibited significantly larger L2 norms (Luo et al., 2016) than those in earlier layers. Introducing normalization before the SSM provides almost no help with this issue, whereas placing normalization after the SSM helped the model maintain consistency in the scale of the L2-norms across different layers during training and even making the weight updates more stable, thereby improving training stability. Moreover, applying an appropriate combination of normalization before and after the SSM further helps address this issue, making the model training more stable and leading to better performance.
+
+We also validated our analysis conclusions on other datasets. We selected the optimal Mamba normalization scheme and conducted experiments on other sequence modeling and image classification tasks. Compared with the original benchmarks, the experimental results demonstrated that our proposed optimization scheme achieved better performance.
+
+**Contributions** In this work, we systematically investigate various mainstream normalization techniques and aim to address the following questions:
+
+(1) **Normalization Type and Position:** What is the optimal applicable normalization method? Where should normalization be placed in the model to ensure high performance? We found that using different normalization methods impacts the performance significantly, and applying normalization after SSM generally leads to better model performance than applying it before SSM.
+
+(2) **Normalization Combination:** What are the effects of normalization combinations? And what is the intuition behind these effects? We found that certain combinations of different normalization techniques produce more excellent results. A view of the L2 norm of the weight matrix in the Mamba Block can be the institution of this phenomenon.
+
+(3) **Combination intuition:** How can we choose the proper combination? We propose an intuition for harmonizing normalization strategies in deep architectures, providing practical guidelines for selecting normalization methods. We also validated our findings on other datasets.
+
+## 2 RELATED WORK
+
+In the Mamba architecture, the SSM module is the core component, and its performance is highly sensitive to the choice of normalization strategies. Normalization adjusts feature distributions to improve model stability and generalization. Thus, studying the types of normalization, their positioning relative to the SSM module, and the impact of combining different normalization methods on performance is crucial. Based on this, we categorize the related works into four groups: **no normalization, normalization before SSM, normalization after SSM, and combined normalization both before and after SSM**, as shown in Figure 1.
+
+**No Normalization:** In this group, many Mamba variants directly optimize the model structure or design task-specific solutions without employing normalization techniques. For example, in sequence tasks, models such as XLSR-Mamba (Xiao & Das, 2024b), SpikMamba (Chen et al., 2024c), UmambaTSF (Wu et al., 2024c), SWIM (Zhang et al., 2024b), TF-Mamba (Xiao & Das, 2024a), MetaMamba (Kim, 2024), PackMamba (Xu et al., 2024), MaTRRec (Zhang et al., 2024a), TransMA (Wu et al., 2024b), and ECGMamba (Qiang et al., 2024) have demonstrated good performance by refining module structures or parameter-sharing mechanisms. In vision tasks, models like I2I-Mamba (Atli et al., 2024) and DeMamba (Chen et al., 2024a) avoid normalization by designing task-driven modules. These works focus on exploring the intrinsic potential of the Mamba architecture but may face instability in handling complex tasks or multimodal inputs.
+
+**Normalization before SSM:** This strategy aims to stabilize feature distributions before entering the SSM module, thereby enhancing its robustness to input features. In sequence tasks, various nor-
+
+{2}------------------------------------------------
+
+
+
+Figure 1: Four categories of related normalization works on Mamba. The diagram shows four sub-figures (a, b, c, d) illustrating different normalization strategies within the Mamba architecture. Each sub-figure shows a block diagram of the Mamba module, which consists of a Conv layer, an SSM layer, and a residual connection. (a) 'No Normalization' shows the standard Mamba block without any normalization. (b) 'Normalization Before SSM' shows a 'Norm' block placed before the SSM layer. (c) 'Normalization After SSM' shows a 'Norm' block placed after the SSM layer. (d) 'Combined Normalization' shows 'Norm' blocks placed both before and after the SSM layer.
+
+Figure 1: Four categories of related normalization works on Mamba.
+
+malization methods are widely used. For instance, LN is employed in FMamba (Ma et al., 2024), MLSA4Rec (Su & Huang, 2024), and Zamba (Glorioso et al., 2024), while RMSN is applied in DiMSUM (Phung et al., 2024), Quamba (Chiang et al., 2024), bi-CrossMamba (Wu et al., 2024a), Mamba-PTQ (Pierro & Abreu, 2024), and CMAMBA (Zeng et al., 2024). BN and IN are also used in self-supervised (Liang et al., 2024) and MC-SEMamba (Ting et al., 2024), respectively. In vision tasks, LN is the most commonly adopted method, appearing in models such as RetinexMamba (Bai et al., 2024a), CU-Mamba (Deng & Gu, 2024), and RSMamba (Chen et al., 2024d), while RMSN is used in FST-Mamba (Wei et al., 2024) to improve feature stability. This body of work demonstrates that applying normalization before SSM effectively mitigates input feature distribution shifts, providing stable inputs for the computations within the SSM module.
+
+**Normalization after SSM:** Unlike the previous approach, this strategy focuses on adjusting feature distributions after the SSM module to optimize subsequent processing. In sequence tasks, RMSN is used in DIFFIMP (Gao et al., 2024), IN is adopted by Bi-Mamba (Tang et al., 2024), and GN is applied in Mamba2 (Bai et al., 2024b). In vision tasks, LN is employed in IRSRMamba (Huang et al., 2024), while GN is used in MambaHSI (Li et al., 2024). The advantage of this strategy lies in its ability to fine-tune the feature distributions processed by the SSM module, aligning them with the requirements of downstream tasks and significantly enhancing model performance in some complex scenarios.
+
+**Combined Normalization both before and after SSM:** This strategy applies normalization at both positions to balance feature distributions and optimize overall performance. In sequence tasks, some models, such as MambaDC (Chen et al., 2024e), Bi-Mamba (Zhou et al., 2024), and TIM4Rec (Fan et al., 2024), apply LN both before and after SSM. Others use different combinations: BMAMBA2 (Bai et al., 2024b) applies GN at both positions, DepMamba (Fan et al., 2024) uses BN before SSM and LN after SSM, while SSD4Rec (Qu et al., 2024) applies LN before SSM and GN after SSM. In vision tasks, similar combined normalization methods are widely applied. For instance, models such as ChangeMamba (Chen et al., 2024b), MiM-ISTD (Chen et al., 2024f), and Fusion-Mamba (Dong et al., 2024b) apply LN both before and after SSM. Hamba (Dong et al., 2024a) and MambaVision (Hatamizadeh & Kautz, 2024) use BN before SSM and LN after SSM, while MSS (Ju & Zhou, 2024) and VM-DDPM (Ju & Zhou, 2024) adopt GN before SSM and LN after SSM. This group demonstrates significant performance improvements, although the optimal configuration may vary depending on the task and data distribution.
+
+In conclusion, applying normalization in the Mamba architecture exhibits diversity and significance. Normalization before SSM effectively stabilizes inputs, making it suitable for handling complex features. Normalization after SSM is more effective for optimizing downstream task performance. Combined normalization methods adjust feature distributions both before and after SSM, offering more opportunities for performance enhancement. However, choosing normalization methods and combination strategies still requires further exploration tailored to specific tasks. Therefore, it is necessary to conduct a systematic investigation into the normalization methods used in Mamba, which could provide valuable directions and references for future Mamba framework designs.
+
+{3}------------------------------------------------
+
+## 3 METHOD
+
+### 3.1 THE FORMATION OF MAMBA BLOCK
+
+Mamba is a state-of-the-art architecture based on the discrete SSM (State Space Model). The overall structures of the Mamba Block or its variations are shown in Figure 2. The processes of the Mamba Block can be described as follows:
+
+
+
+Figure 2: The structure of Mamba Block or its variations. The diagram shows a block diagram of the Mamba Block. The input x is normalized using N1. The output of N1 is split into two branches. The main branch consists of a Linear layer, a Conv layer, a SiLU activation (sigma), an SSM block (with equations h\_t = Ah\_{t-1} + Bx\_t and y\_t = Ch\_t + Dx\_t), and a second normalization layer N2. The parallel branch consists of a Linear layer and a SiLU activation (sigma). The outputs of the main branch and the parallel branch are combined via element-wise multiplication (X) and then passed through a final Linear layer. The output of the final Linear layer is added to the original input x via a residual connection (+).
+
+Figure 2: The structure of Mamba Block or its variations.
+
+First, the input $x$ is normalized using $N1$ , followed by a series of transformations in the main branch:
+
+$$f = N2(SSM(Act(Con(Lin(N1(x)))))). \quad (1)$$
+
+Where $N1$ is the first Normalization, $Lin$ is the Linear projection, $Con$ is the Depth-Wise convolution, $Act$ is the SiLU activation, $SSM$ is the selective structured state space models (selective SSM, SSM), $N2$ is the Second normalization. Meanwhile, in parallel, the normalized input $N1(x)$ is passed through another Linear projection and SiLU activation:
+
+$$p = Act(Lin(N1(x))). \quad (2)$$
+
+Then, the main and parallel branches' outputs are combined via element-wise multiplication $u = f \odot p$ . Finally, the combined result is passed through a linear projection, and the original input $x$ is added as a residual connection:
+
+$$y = Lin(f \odot p) \oplus x. \quad (3)$$
+
+Mamba introduces a selective mechanism that allows the parameters of SSM to be dynamically adjusted based on the input tokens. In addition, it improves the SSM computation method, achieving sub-quadratic computational complexity. The following is a brief review of SSM.
+
+For sequence modeling, let the sequence define as $X = \{x_1, x_2, \dots, x_T\} \in \mathbb{R}^{T \times D}$ , where $T$ represents the sequence length and $D$ denotes the number of feature channels. Each element $x_t = \{x_t^1, x_t^2, \dots, x_t^D\} \in \mathbb{R}^D$ contains $D$ feature values at time step $t$ . For a mini-batch of data with $m$ samples, the input tensor is typically shaped as $(m, D, T)$ . The state space model(SSM) is commonly known as a Linear Time-Invariant (LTI) system that transfers the input activation $x_t \in \mathbb{R}^D$ into output $y_t$ through the hidden state $h_t \in \mathbb{R}^H$ , which can be denoted as:
+
+$$y_t = SSM_{A,B,C,D}(x_t). \quad (4)$$
+
+Its internal computations are defined as follows:
+
+$$h_t = Ah_{t-1} + Bx_t, \quad y_t = Ch_t + Dx_t, \quad (5)$$
+
+where $A \in \mathbb{R}^{H \times H}$ , $B \in \mathbb{R}^{H \times D}$ , $C \in \mathbb{R}^{D \times H}$ , $D \in \mathbb{R}^{D \times D}$ are learnable parameters of SSM, $H$ is the number of hidden feature channels.
+
+Apart from handling one-dimensional sequences, it can also effectively process two-dimensional (2D) image data. Specifically, the image is firstly flattened to convert the shape of $h \times w$ into a
+
+{4}------------------------------------------------
+
+sequence of length $T$ before being input into the model. Our work primarily focuses on studying the impact of the type, position, and combination of $N1$ and $N2$ normalization on the performance of Mamba. Next, we will provide a detailed explanation of the main modules.
+
+### 3.2 NORMALIZATION TYPES
+
+Normalization is a critical technique in deep learning aimed at stabilizing and accelerating the training process of neural networks (Desjardins et al., 2015). It adjusts the input data distribution or intermediate activations to a normal distribution, facilitating the convergence of model training (Huang et al., 2023). By incorporating normalization layers, models can maintain consistent representation learning and effectively handle varying input scales. Therefore, selecting the appropriate normalization method according to specific requirements is essential for training models with complex data or large parameter sizes. The common forms of normalization are defined as follows:
+
+$$\text{Norm}(x) = \frac{x - E[x]}{\sqrt{\text{Var}[x] + \epsilon}} \cdot \gamma + \beta, \quad (6)$$
+
+Where $E[x]$ represents the mean of the input $x$ , $\text{Var}[x]$ represents the variance of the input $x$ , and $\epsilon$ is a small constant added to prevent division by zero. $\gamma$ and $\beta$ are the scale and shift parameter, respectively. Many normalization methods have been proposed, but the following five are still commonly used: BN, LN, GN, IN, and RMSN. They are suitable for most models and the most widely adopted methods by researchers. For more information, please refer to appendix A.
+
+### 3.3 NORMALIZATION POSITIONS
+
+The position of normalization layers relative to the SSM module significantly impacts the performance and stability of the Mamba architecture. These positions can be categorized into two cases: before SSM or after SSM.
+
+**Normalization Before SSM** Normalization layers placed before SSM stabilize the input features by reducing shifts in their distribution, which can be formulated as:
+
+$$f = \text{SSM}(\text{Act}(\text{Con}(\text{Lin}(N1(x))))), \quad (7)$$
+
+Where $N1$ represents the normalization applied before the SSM module. This positioning ensures SSM operates on well-conditioned inputs, minimizing potential disruptions caused by unstable feature distributions.
+
+**Normalization After SSM** Normalization layers placed after SSM refine the feature distribution generated by SSM. This can be expressed as:
+
+$$f = N2(\text{SSM}(\text{Act}(\text{Con}(\text{Lin}(x))))), \quad (8)$$
+
+Where $N2$ represents the normalization applied after the SSM module. This configuration aligns processed features with the requirements of downstream tasks, thereby enhancing performance.
+
+### 3.4 NORMALIZATION COMBINATIONS
+
+Normalization combinations involve using different normalization techniques at different positions around the SSM module. By leveraging the strengths of various methods, this approach adjusts feature distributions more effectively, enhancing stability and performance. Combining normalizations before and after SSM can be expressed as:
+
+$$f = N2(\text{SSM}(\text{Act}(\text{Con}(\text{Lin}(N1(x))))), \quad (9)$$
+
+We examine two main combination strategies: same normalization at both positions and different normalization at each position. $N1 = N2$ represents the same normalization method applied at both positions, maintaining uniformity feature adjustments and avoiding conflicts between normalization methods. For instance: $N1 = N2 = \text{LN}$ in VMamba, $N1 = N2 = \text{GN}$ in BMAMBA2. $N1 \neq N2$ represents different normalizations applied at each position, taking advantage of different techniques to optimize feature processing at various stages. For example: $N1 = \text{BN}$ , $N2 = \text{LN}$ in DepMamba,
+
+{5}------------------------------------------------
+
+stabilizing inputs and refining outputs. $N1 = LN, N2 = GN$ in SSD4Rec, balancing input stability and output performance.
+
+Our research aims to identify the optimal normalization settings by adjusting the type, position, and combination of normalization techniques. The objective function for the Mamba can be expressed as the minimization of the loss between the output and the ground truth label. The complete formulation is as follows:
+
+$$\mathcal{L} = \min_{\Theta} \mathcal{L}_{\text{loss}}(\text{Lin}(f \odot p) \oplus x, G), \quad (10)$$
+
+where the $f$ and $p$ are defined in The Formation of Mamba Block section, $G$ is the ground truth label. This formulation defines the optimization problem for training the Mamba, incorporating its detailed computation process and the ground truth target $G$ . The parameter $\Theta$ includes all learnable components: the weights and biases of $\text{Lin}, \text{Con}, \text{SSM}$ , and the scale and shift parameters $(\gamma, \beta)$ of $N1$ and $N2$ . By optimizing the objective function, it is possible to mitigate the limitations of individual methods, improve parameter updates, and enhance convergence stability. These findings provide a practical guideline for designing robust normalization strategies in the Mamba architecture.
+
+## 4 EXPERIMENTAL
+
+This section presents a series of systematic experiments to evaluate the impact of normalization types, positions, and combination strategies on the performance and stability of the Mamba Block. We assessed the model’s performance on two types of tasks: long sequence modeling and vision tasks. Subsequently, we analyzed and interpreted the experimental results based on the scale invariance of deep learning and the distribution characteristics of the weight norm iterations.
+
+### 4.1 DATASETS
+
+For long sequence modeling, we use the Breakfast dataset (Kuehne et al.). Breakfast is a large-scale dataset designed for evaluating models on long sequence modeling and activity segmentation. It consists of 1,712 videos recorded in 18 different kitchens, involving 52 participants performing 10 distinct actions related to breakfast preparation, such as making tea, frying eggs, and preparing toast. Each video is annotated with frame-level action labels, with sequences often comprising multiple nested actions. The dataset spans over four million frames, making it highly challenging for models to handle long temporal dependencies effectively.
+
+For vision tasks, we use the ImageNet-100 dataset (Krizhevsky et al., 2012). ImageNet-100 is a randomly selected subset of the ImageNet-1k dataset from the 2012 Large Scale Visual Recognition Challenge. It contains 100 categories, covering various objects and scenes, ensuring diversity in vision tasks. The training set includes 1300 images per category, while the validation set contains 50 images per category, totaling 135,000 images.
+
+We also evaluate our proposed optimized normalization scheme on ImageNet-1k (Krizhevsky et al., 2012) and LRA ListOps dataset (Tay et al., 2021) to compare it with other methods.
+
+### 4.2 IMPACT OF DIFFERENT NORMALIZATION TYPES
+
+The performance of different normalization types applied both before and after the SSM module is summarized in the following Table 1. For instance, None $\rightarrow$ SSM $\rightarrow$ None indicates that no normalization is applied either before or after the SSM module. BN $\rightarrow$ SSM $\rightarrow$ BN indicates that BN is applied both before and after the SSM module, and others are similar in meaning.
+
+Table 1: Performance with Different Normalization Types.
+
+| Normalization Method | Sequence Accuracy (%) | Image Accuracy1 (%) |
+|-|-|-|
+| None $\rightarrow$ SSM $\rightarrow$ None | 7.0 | 10.7 |
+| BN $\rightarrow$ SSM $\rightarrow$ BN | 41.4 | 74.6 |
+| IN $\rightarrow$ SSM $\rightarrow$ IN | 40.6 | 83.7 |
+| LN $\rightarrow$ SSM $\rightarrow$ LN | 58.9 | 86.6 |
+| RMSN $\rightarrow$ SSM $\rightarrow$ RMSN | 56.9 | 84.1 |
+| GN $\rightarrow$ SSM $\rightarrow$ GN | 68.8 | 86.3 |
+
+In the **sequence modeling task**, applying GN before and after SSM improved performance from the baseline of 7.0% (no normalization) to 68.8%. **LN** and **RMSN** also significantly enhanced
+
+{6}------------------------------------------------
+
+performance to 58.9%, making it the next-best performer. Other normalization methods like IN and BN provided moderate improvements.
+
+In the **image classification task**, applying LN before and after SSM boosted accuracy to 86.6%, a substantial increase from the 10.7% baseline. GN closely followed with an accuracy of 86.3%, demonstrating its strong performance. RMSN and IN also improved accuracy significantly.
+
+These results indicate that the choice of normalization method significantly affects performance and that **GN shows consistently strong performance across both tasks**, achieving high accuracy and making it a reliable choice when aiming for balanced performance. However, the optimal normalization method differs between tasks: GN excels in sequence modeling, likely due to its ability to stabilize training with sequential data, while LN are better suited for image classification, possibly because they normalize across features in a way that benefits spatial data.
+
+### 4.3 EFFECT OF NORMALIZATION POSITIONS RELATIVE TO SSM
+
+To facilitate the comparison of normalization positions within each task, we integrated the results of normalization before SSM and after SSM into one table as follows: Table 2 and Table 3.
+
+Table 2: Sequence Modeling Performance with Normalization Applied Before or After SSM
+
+| Normalization Method | Accuracy (%) | Normalization Method | Accuracy (%) |
+|-|-|-|-|
+| None→SSM→None | 7.0 | None→SSM→None | 7.0 |
+| BN→SSM→None | 28.4 | None→SSM→BN | 28.4 |
+| IN→SSM→None | 10.9 | None→SSM→IN | 7.0 |
+| LN→SSM→None | 57.1 | None→SSM→LN | 59.1 |
+| RMSN→SSM→None | 58.7 | None→SSM→RMSN | 60.5 |
+| GN→SSM→None | 20.5 | None→SSM→GN | 70.1 |
+
+Table 3: Image Classification Performance with Normalization Applied Before or After SSM
+
+| Normalization Method | Accuracy I (%) | Normalization Method | Accuracy II (%) |
+|-|-|-|-|
+| None→SSM→None | 10.7 | None→SSM→None | 10.7 |
+| BN→SSM→None | 20.5 | None→SSM→BN | 67.8 |
+| IN→SSM→None | 70.2 | None→SSM→IN | 83.8 |
+| LN→SSM→None | 86.5 | None→SSM→LN | 86.7 |
+| RMSN→SSM→None | 86.3 | None→SSM→RMSN | 84.2 |
+| GN→SSM→None | 66.1 | None→SSM→GN | 86.8 |
+
+In **sequence modeling**, applying GN after SSM improved performance to 70.1%, compared to 20.5% when GN was applied before SSM. LN and RMSN showed consistent performance, with a slight advantage when applied before SSM (57.1% and 58.7%) versus after SSM (59.1% and 60.5%). Overall, After-SSM tends to yield better or comparable results except for IN.
+
+For **image classification**, applying GN after SSM achieved the highest accuracy of 86.8%, significantly outperforming GN before SSM (66.1%). Similarly, LN after SSM attained an accuracy of 86.7%, slightly higher than LN before SSM (86.5%). These results suggest that after-SSM is more effective for image classification as well except for RMSN.
+
+In most cases, **applying normalization after SSM** is more beneficial than **applying normalization before SSM**. This suggests that normalizing the output of SSM is crucial for enhancing performance. In sequence modeling and image classification, applying GN after SSM provides substantial performance gains.
+
+### 4.4 EFFECTS OF COMBINING DIFFERENT NORMALIZATION METHODS
+
+The performances of different normalization combinations in both sequence modeling and image classification are in the following Table 4. Their bar charts are shown in Figure 3.
+
+In **sequence modeling**, the combination of IN before SSM and LN after SSM led to the highest performance of 72.5%, indicating that different normalization methods can complement each other. IN also showed strong performance when combined with RMSN after SSM (72.2%), reinforcing its versatility.
+
+For **image classification**, the highest accuracy of 87.3% was achieved with RMSN before SSM and BN after SSM. Combinations involving BN after SSM generally resulted in high accuracies,
+
+{7}------------------------------------------------
+
+Table 4: Sequence Modeling and Image Classification Performance with Different Normalization Combinations
+
+| Normalization Method | Sequence Accuracy (%) | Image Accuracy1 (%) |
+|-|-|-|
+| None→SSM→None | 7.0 | 10.7 |
+| BN→SSM→BN | 41.4 | 74.6 |
+| BN→SSM→IN | 63.1 | 83.2 |
+| BN→SSM→LN | 56.5 | 86.3 |
+| BN→SSM→GN | 70.1 | 86.1 |
+| BN→SSM→RMSN | 57.8 | 84.6 |
+| IN→SSM→BN | 51.3 | 86.7 |
+| IN→SSM→IN | 67.6 | 83.7 |
+| IN→SSM→LN | 72.5 | 85.7 |
+| IN→SSM→GN | 70.1 | 85.3 |
+| IN→SSM→RMSN | 72.2 | 83.5 |
+| LN→SSM→BN | 52.1 | 87.1 |
+| LN→SSM→IN | 66.8 | 84.5 |
+| LN→SSM→LN | 58.9 | 86.6 |
+| LN→SSM→GN | 69.3 | 86.6 |
+| LN→SSM→RMSN | 57.4 | 84.6 |
+| GN→SSM→BN | 52.1 | 87.1 |
+| GN→SSM→IN | 63.4 | 84.5 |
+| GN→SSM→LN | 71.9 | 86.3 |
+| GN→SSM→GN | 68.8 | 86.3 |
+| GN→SSM→RMSN | 68.1 | 68.1 |
+| RMSN→SSM→BN | 41.4 | 87.3 |
+| RMSN→SSM→IN | 71.4 | 84.3 |
+| RMSN→SSM→LN | 56.5 | 86.1 |
+| RMSN→SSM→GN | 70.7 | 85.7 |
+| RMSN→SSM→RMSN | 56.9 | 84.1 |
+
+
+
+Figure 3: Two 3D bar charts showing performance of normalization combinations. The left chart is titled '(a)Sequence Accuracy' and the right chart is titled '(a)Vision Accuracy'. Both charts show bars for 'Type' (green), 'Position' (purple), 'Combination' (yellow), and 'Top3 Result' (red) across various normalization methods: None, LN, BN, GN, RMSN, and their combinations with SSM. The y-axis represents Accuracy (%).
+
+Figure 3: The performance bar charts of different normalization combinations in sequence modeling and image classification tasks.
+
+suggesting that after-SSM with BN is particularly effective. **GN**, when used before and after SSM, also maintained high performance (86.3%), consistent with its strong showing in other experiments.
+
+These findings demonstrate that **combining specific different normalization methods before and after SSM** can enhance performance in both tasks. However, the optimal combinations differ between tasks, and no single combination is best for both. **GN before SSM and LN after SSM** continues to perform relative well in various combinations across tasks.
+
+{8}------------------------------------------------
+
+**RECOMMENDATIONS:** The experimental results highlight the critical role of normalization techniques and their positions in neural network architectures. Applying normalization after the SSM module is generally more beneficial in both sequence modeling and image classification tasks. Moreover, combining specific different normalization methods before and after SSM can significantly enhance model performance. **LN** emerges as a versatile and consistently strong performer across tasks, making it a valuable choice for achieving balanced performance. Future work could explore adaptive normalization strategies that dynamically adjust based on task requirements and data characteristics.
+
+### 4.5 VALIDATION EXPERIMENT
+
+To validate our proposal, we evaluated our recommended approach on other datasets and compared it with the original model. For sequence modeling and vision tasks, we conducted experiments on the LRA ListOps dataset and the ImageNet-1k dataset, respectively. The experimental results are shown in Table 5.
+
+Table 5: Performance Comparison Between the Original Model and Our Proposed Approach.
+
+| | Normalization | Sequence(%) | Normalization | Vision (%) |
+|-|-|-|-|-|
+| Original | RMSN→SSM→RMSN | 56.9 | LN→SSM→LN | 70.8 |
+| Ours | IN→SSM→LN | 72.5 | RMSN→SSM→BN | 71.1 |
+
+For vision tasks, RMSN→SSM→RMSN represents the original Mamba’s normalization configuration, while IN→SSM→IN represents our proposed normalization configuration. For vision tasks, LN→SSM→LN represents the original VMamba’s normalization configuration without FFN module for fair comparison, while RMSN→SSM→BN represents our proposed normalization configuration. As shown in the table, the experimental results of our proposed approach outperform those of the original model, which verifies the effectiveness of our proposed solution.
+
+### 4.6 INTUITIVE EXPLANATION
+
+We made an intuitive inference that the combination of two specific normalization techniques outperforms normalization alone, but this is not intended as an essential explanation. It is hoped that it will provide insight into understanding this phenomenon.
+
+We conducted an in-depth study on the L2 norms of each layer of Mamba Blocks in a network structure containing four layers of Mamba Blocks on the ListOps dataset from the LRA benchmark, comparing the effects of the same and different normalization methods and plotted the L2 norms of the weights in each Mamba block and conducted an in-depth analysis of the impact of different normalization techniques in a 4-layer model in the following Figure 4.
+
+
+
+Figure 4: Four box plots (a, b, c, d) showing the L2 norm distribution across four layers (layer1, layer2, layer3, layer4) for different normalization configurations: (a) None→None, (b) BN→None, (c) None→BN, and (d) BN→BN. The y-axis is 'Norm' on a log scale from 1 to 1000. Purple points represent the current Mamba layer at each iteration. In (a) and (b), norms increase significantly with layer depth. In (c) and (d), norms are more stable across layers.
+
+Figure 4: The L2 norm about None→SSM→None, BN→SSM→None, None→SSM→BN, and BN→SSM→BN on the ListOps dataset.
+
+In Figure 4, the purple points represent the L2 norm distribution of the current Mamba layer at each iteration step, indirectly reflecting the variation of weights during training. The addition of extra normalization has a significant impact on the L2 norm distribution of weights across different Mamba layers. We observed the following two aspects:
+
+(1) For None→None and BN→None, the L2 norms of weights in different Mamba layers vary significantly. This indicates that the weight magnitudes in deeper layers are substantially larger than those in earlier layers. Additionally, the weight norms in deeper Mamba layers exhibit a highly
+
+{9}------------------------------------------------
+
+polarized distribution, suggesting that the training process may encounter pathological curvature landscapes, leading to training failures.
+
+(2) For None→BN and BN→BN, the methods maintain scale invariance Shleifer et al. (2022) in the weight distribution across all Mamba layers. The L2 norm variations are nearly uniformly distributed across layers, indicating a favorable training landscape. This demonstrates that applying appropriate normalization after the SSM operation helps achieve centered activations and stabilizes gradient updates (LeCun et al., 1990), contributing to robust training dynamics.
+
+Additionally, we tried different normalization combinations and listed the excelled ones in the table4, finding that the optimal results are achieved when different normalization methods are applied before and after the SSM block. However, how can we determine which combinations are the best? Thus, we provide valuable guidance for selecting optimal normalization combinations. For instance, here is the behavior of the combination of BN and IN in Figure5. Our analysis reveals that these two normalization techniques exhibit complementary effects on model weights in the final block, which we call "harmonic structure." We observed that the weight matrix Norm updates in different directions and has a large margin when the two normalizations act alone. The Norm of BN→SSM→IN, on the other hand, is exactly the balance of the two. This leads to a 10% improvement in performance compared to using either normalization individually (see5).
+
+
+
+Figure 5: Performance and L2 Norm in the fourth layer of BN→SSM→IN on ListOps. (a) Accuracy Result: A line graph showing Accuracy (Y-axis, 0.15 to 0.50) vs. Step (X-axis, 0 to 6000). Three lines represent BN→IN (red), IN→IN (green), and BN→BN (blue). All lines show a sharp increase in accuracy around step 1000, followed by a plateau. BN→IN reaches the highest accuracy (~0.48), while BN→BN reaches the lowest (~0.40). (b) L2-Norm in the Final Layer: A line graph showing L2-Norm (Y-axis, 2 to 8) vs. Step (X-axis, 0 to 7000). Three lines represent BN→IN (red), IN→IN (green), and BN→BN (blue). All lines show a sharp increase in L2-Norm around step 1000. IN→IN reaches the highest L2-Norm (~7.5), while BN→BN reaches the lowest (~2.5).
+
+Figure 5: The Performance and L2 in the fourth layer of BN→SSM→IN on ListOps.
+
+## 5 CONCLUSIONS AND FUTURE WORK
+
+In this study, we conducted a comprehensive investigation into the types, positions, and combinations of normalization layers within the Mamba architecture. Our findings reveal that applying proper normalization after the SSM Modules enhances training stability by mitigating large variations in weight norms. Moreover, specific combinations of normalization techniques not only stabilize the training process but also lead to significant improvements in model performance.
+
+We also propose an intuition for selecting and combining normalization layers to facilitate the exploration of stable training for Mamba and other deep architectures. This intuition provides valuable insights into choosing appropriate normalization methods for robust training of large-scale neural networks. Future research will focus on extending this intuition to more complex models and tasks, aiming to refine normalization strategies for further improvements in efficiency and robustness.
+
+The Mamba2 architecture has recently been introduced, and Dao & Gu (2024) found that training Mamba2 is less stable than Mamba1. Building upon our research into the normalization of Mamba Blocks, future work could further explore the Mamba2 architecture to address its stability challenges. Additionally, we hope our findings can be extended to other deep learning architectures, offering valuable guidance for designing more complex models.
+
+## REFERENCES
+
+- Omer F. Atli, Bilal Kabas, Fuat Arslan, Arda C. Demirtas, Mahmut Yurt, Onat Dalmaz, and Tolga Çukur. Izi-mamba: Multi-modal medical image synthesis via selective state space modeling. *ArXiv preprint*, abs/2405.14022, 2024. URL .
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/ZXaocmXc6d.txt b/papers/ZXaocmXc6d.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7c80d0c1689dbb1180d21b09507a4771de15d2af
--- /dev/null
+++ b/papers/ZXaocmXc6d.txt
@@ -0,0 +1,247 @@
+**Primary Area:** learning theory
+
+
+
+{0}------------------------------------------------
+
+# FROM LAZY TO RICH: EXACT LEARNING DYNAMICS IN DEEP LINEAR NETWORKS
+
+Clementine C. J. Domine1,†, Nicolas Anguita2,†, Alexandra M. Proca2, Lukas Braun3, Daniel Kunin4, Pedro A. M. Mediano2,5,†, Andrew M. Saxe1,6,7,‡
+
+1 Gatsby Computational Neuroscience Unit, University College London, UK
+
+2 Department of Computing, Imperial College London, UK
+
+3 Department of Experimental Psychology, University of Oxford, UK
+
+4 Institute for Computational and Mathematical Engineering, Stanford University, USA
+
+5 Division of Psychology and Language Sciences, University College London, UK
+
+6 Sainsbury Wellcome Centre, University College London, UK
+
+7 CIFAR Azrieli Global Scholar, CIFAR, Toronto, Canada
+
+† Co-first author
+
+‡ Co-senior author.
+
+clementine.domine.20@ucl.ac.uk, na658@cam.ac.uk
+
+## ABSTRACT
+
+Biological and artificial neural networks develop internal representations that enable them to perform complex tasks. In artificial networks, the effectiveness of these models relies on their ability to build task-specific representations, a process influenced by interactions among datasets, architectures, initialization strategies, and optimization algorithms. Prior studies highlight that different initializations can place networks in either a *lazy* regime, where representations remain static, or a *rich* (or *feature-learning*) regime, where representations evolve dynamically. Here, we examine how initialization influences learning dynamics in deep linear neural networks, deriving exact solutions for ‘*λ-balanced*’ initializations—defined by the relative scale of weights across layers. These solutions capture the evolution of representations and the Neural Tangent Kernel across the spectrum from the *rich* to the *lazy* regimes. Our findings deepen the theoretical understanding of the impact of weight initialization on learning regimes, with implications for continual learning, reversal learning, and transfer learning, relevant to both neuroscience and practical applications.
+
+## 1 INTRODUCTION
+
+Biological and artificial neural networks learn internal representations that enable complex tasks such as categorization, reasoning, and decision-making. Both systems often develop similar representations from comparable stimuli, suggesting shared information processing mechanisms (Yamins et al., 2014). This similarity, though not fully understood, has drawn interest from neuroscience, AI, and cognitive science (Haxby et al., 2001; Laakso & Cottrell, 2000; Morcos et al., 2018; Kornblith et al., 2019; Moschella et al., 2022). The success of neural models relies on their ability to extract relevant features from data to build internal representations, a complex process that in machine learning is defined by two regimes: *lazy* and *rich* (Saxe et al., 2014; Pennington et al., 2017; Chizat et al., 2019; Bahri et al., 2020).
+
+**Lazy regime.** The *lazy* regime follows from a fundamental phenomenon in overparameterized neural networks: during training, these networks frequently remain near their linearized form, undergoing minimal changes in the parameter space (Chizat et al., 2019). Consequently, they adopt learning dynamics akin to kernel regression, characterized by the Neural Tangent Kernel (NTK) matrix and exhibiting exponential learning behavior (Du et al., 2018; Jacot et al., 2018; Du et al., 2019; Allen-Zhu et al., 2019a;b; Zou et al., 2020). This behavior, known as the *lazy* or kernel regime, typically occurs in infinitely wide architectures and can be triggered by large variance initialization (Jacot
+
+{1}------------------------------------------------
+
+
+
+Figure 1: A minimal model of the rich and lazy regimes. Panel A shows a diagram of a deep and wide linear network with two layers, W1 and W2, with input x in R^{n\_x} and output y in R^{n\_y}. Panel B shows three plots of network output W2W1(t) over training steps for lambda = -2, 0, and 2. Panel C shows a heatmap of the weight covariance matrix W2^T W2 - W1 W1^T for a network with LeCun weight initialization in the infinite width limit.
+
+Figure 1: A minimal model of the *rich* and *lazy* regimes. **A.** We examine a deep and wide linear network trained using gradient descent starting from an initialization characterized by a relative scale parameter $\lambda$ — which characterizes the difference in the weight covariance between the first and second layers. **B.** Network output for an example task over training time, starting from a range of relative scale values. The dynamics are influenced by the initialization. Solid lines represent simulations, while dotted lines indicate the analytical solutions derived in this work. **C.** A network with LeCun weight initialization (LeCun et al., 1998) in the infinite width limit becomes $\lambda$ -balanced, as $W_2^T W_2 - W_1 W_1^T$ approaches the scaled identity matrix.
+
+et al., 2018; Chizat et al., 2019). While the *lazy* regime offers valuable insights into how networks converge to a global minimum, it does not fully account for the generalization capabilities of neural networks trained with standard initializations. It is, therefore, widely believed that another regime, driven by small or vanishing initializations, underpins some of the successes of neural networks.
+
+**Rich regime.** In contrast, the *rich* feature-learning regime is characterized by a NTK that evolves throughout training, accompanied by non-convex dynamics that navigate saddle points (Baldi & Hornik, 1989; Saxe et al., 2014; 2019b; Jacot et al., 2021). This regime features sigmoidal learning curves and simplicity biases, such as low-rankness (Li et al., 2020) or sparsity (Woodworth et al., 2020). Numerous studies have shown that the *absolute scale* of initialization drives the *rich* regime, which typically emerges at small initialization scales (Chizat et al., 2019; Geiger et al., 2020). However, even at small initialization scales, differences in weight magnitudes between layers can induce the *lazy* learning regime (Azulay et al., 2021; Kunin et al., 2024) — highlighting the significance of both *absolute scale* (initialization variance) and *relative scale* (difference in weight magnitude between layers) in generating diverse learning dynamics (Atanasov et al., 2022). Beyond *absolute scale* and *relative scale*, additional aspects of initialization can profoundly affect feature learning, including the effective rank of the weight matrices Liu et al. (2023b), layer-specific initialization variances Yang & Hu (2020); Luo et al. (2021); Yang et al. (2022), and the use of large learning rates Lewkowycz et al. (2020); Ba et al. (2022); Zhu et al. (2023); Cui et al. (2024). These findings illustrate the effect of initialization on inducing complex learning behavior through the resulting dynamics. Here we develop a solvable model which captures these diverse phenomena.
+
+Despite significant advances, these learning regimes and their characterization are not yet fully understood and would benefit from clearer theoretical predictions, particularly regarding the influence of prior knowledge (initialization) on the learning regime. In this work, we address this gap by deriving exact solutions for the learning dynamics in deep linear networks as a function of network initialization, providing one of the few analytical models of the *rich* and *lazy* regimes in wide and deep neural networks (Xu & Ziyin, 2024; Kunin et al., 2024; Tu et al., 2024). To illustrate the dramatic effect of initialization and the kind of phenomenon we build a theory for, we consider a two-layer linear network parameterized by an encoding layer $W_1$ and a decoding layer $W_2$ (Fig.1A). This network can be initialized with different relative scalings, such that $W_1 W_1^T > W_2^T W_2$ , $W_1 W_1^T < W_2^T W_2$ , or $W_1 W_1^T = W_2^T W_2$ , while maintaining the same absolute scale. As shown in Fig.1B, the choice of relative scaling can result in drastically different learning trajectories and representations and the theory we develop over the course of this paper describes these effects. Through these solutions, we aim to gain insights into the *rich* and *lazy* regimes, as well as the transition between them during training, by examining the impact of relative scaling. As shown in Fig.1C and further proved in Appendix A.3, initialization methods used in practice, such as LeCun initialization in wide networks, approximate the relative scaling initialization explored in this paper, making it relevant to machine learning community as further demonstrated by Kunin et al. (2024). We consider applications relevant to machine learning and neuroscience, including continual learning (Kirkpatrick et al., 2017; Zenke et al., 2017; Parisi et al., 2019), reversal learning (Erdeniz
+
+{2}------------------------------------------------
+
+& Atalay, 2010) and transfer learning (Taylor & Stone, 2009; Thrun & Pratt, 2012; Lampinen & Ganguli, 2018; Gerace et al., 2022).
+
+### Our contributions.
+
+- We derive explicit solutions for the gradient flow, internal representational similarity, and finite-width NTK in unequal-input-output two-layer deep linear networks, under a broad range of $\lambda$ -balanced initialization conditions (Section 4).
+- We model the full range of learning dynamics from *lazy* to *rich*, showing that this transition is influenced by a complex interaction of architecture, *relative scale*, and *absolute scale*, extending beyond just initialization *absolute scale* (Section 5).
+- We present applications of these solutions relevant to both the neuroscience and machine learning communities, providing exact solutions for continual learning dynamics, reversal learning dynamics, and transfer learning (Section 6).
+
+## 2 RELATED WORK
+
+**Linear networks.** Our work builds upon a rich body of research on deep linear networks, which, despite their simplicity, have proven to be valuable models for understanding more complex neural networks (Baldi & Hornik, 1989; Fukumizu, 1998; Saxe et al., 2014). Previous research has extensively analyzed convergence (Arora et al., 2018a; Du & Hu, 2019), generalization properties (Lampinen & Ganguli, 2018; Poggio et al., 2018; Huh, 2020), and the implicit bias of gradient descent (Arora et al., 2019a; Woodworth et al., 2020; Chizat & Bach, 2020; Kunin et al., 2022) in linear networks. These studies have also revealed that deep linear networks have intricate fixed point structures and nonlinear learning dynamics in parameter and function space, reminiscent of phenomena observed in nonlinear networks (Arora et al., 2018b; Lampinen & Ganguli, 2018). Seminal work by Saxe et al. (2014) laid the groundwork by providing exact solutions to gradient flow dynamics under task-aligned initializations, demonstrating that the largest singular values are learned first during training. This analysis has been extended to deep linear networks (Arora et al., 2018b; 2019a; Ziyin et al., 2022) with more flexible initialization schemes (Gidel et al., 2019; Tarmoun et al., 2021; Gissin et al., 2019). This work directly builds on the matrix Riccati formulation proposed by Fukumizu (1998) and Braun et al. (2022) which extends these solutions to wide networks. We extend and refine these results to obtain the dynamics for a wider class of $\lambda$ -balanced networks to more clearly demonstrate the impact of initialization on *rich* and *lazy* learning regimes also developed in Tu et al. (2024) for a set of orthogonal initializations. Our work extends previous analyses (Xu & Ziyin, 2024; Kunin et al., 2024) of these regimes to wide networks. Previous studies leveraged these solutions primarily to characterize convergence rates; however, our work goes beyond this by providing a comprehensive characterization of the complete dynamics of the system (Tarmoun et al., 2021).
+
+**Infinite-width networks.** Recent advances in understanding the *rich* regime have largely stemmed from examining how the initialization variance and layer-wise learning rates must scale in the infinite-width limit to maintain consistent behavior in activations, gradients, and outputs. Several studies have employed statistical mechanics tools to derive analytical solutions for the *rich* population dynamics of two-layer nonlinear neural networks initialized using a *mean-field* parameterization (Mei et al., 2018; Rotskoff & Vanden-Eijnden, 2018; Chizat & Bach, 2018; Sirignano & Spiliopoulos, 2020; Rotskoff & Vanden-Eijnden, 2022; Sirignano & Spiliopoulos, 2020). Other methods for analyzing deep network dynamics include the NTK limit, where the network effectively performs kernel regression without feature learning (Jacot et al., 2018; Lee et al., 2019; Arora et al., 2019b). Furthermore, these approaches typically require numerical integration or operate within a limited learning regime, and are unable to describe the learning dynamics of hidden representations. Instead, our work provides explicit analytical solutions for the dynamics of the network and its NTK in the finite-width case (Jacot et al., 2021; Xu & Ziyin, 2024; Kunin et al., 2024; Chizat et al., 2019).
+
+## 3 PRELIMINARIES
+
+Consider a supervised learning task where input vectors $\mathbf{x}_n \in \mathbb{R}^{N_i}$ , from a set of $P$ training pairs $\{(\mathbf{x}_n, \mathbf{y}_n)\}_{n=1}^P$ , need to be mapped to their corresponding target output vectors $\mathbf{y}_n \in \mathbb{R}^{N_o}$ . We learn this task with a two-layer linear network model that produces the output prediction
+
+$$\tilde{\mathbf{y}}_n = \mathbf{W}_2 \mathbf{W}_1 \mathbf{x}_n, \quad (1)$$
+
+{3}------------------------------------------------
+
+with weight matrices $\mathbf{W}_1 \in \mathbb{R}^{N_h \times N_i}$ and $\mathbf{W}_2 \in \mathbb{R}^{N_o \times N_h}$ , where $N_h$ is the number of hidden units. The network's weights are optimized using full batch gradient descent with learning rate $\eta$ (or respectively time constant $\tau = \frac{1}{\eta}$ ) on the mean squared error loss $\mathcal{L}(\tilde{\mathbf{y}}, \mathbf{y}) = \frac{1}{2} \langle |\tilde{\mathbf{y}} - \mathbf{y}|^2 \rangle$ , where $\langle \cdot \rangle$ denotes the average over the dataset. Our objective is to describe the entire dynamics of the network's output and internal representations based on the input covariance and input-output cross-covariance matrices of the dataset, defined as
+
+$$\tilde{\Sigma}^{xx} = \frac{1}{P} \sum_{n=1}^P \mathbf{x}_n \mathbf{x}_n^T \in \mathbb{R}^{N_i \times N_i} \quad \text{and} \quad \tilde{\Sigma}^{yx} = \frac{1}{P} \sum_{n=1}^P \mathbf{y}_n \mathbf{x}_n^T \in \mathbb{R}^{N_o \times N_i}, \quad (2)$$
+
+and the initialization $\mathbf{W}_2(0), \mathbf{W}_1(0)$ . We employ an approach first introduced in the foundational work of Fukumizu (1998) and extended in recent work by Braun et al. (2022), which instead of studying the parameters directly, considers the dynamics of a matrix of the important statistics. In particular, defining $\mathbf{Q} = [\mathbf{W}_1 \quad \mathbf{W}_2^T]^T \in \mathbb{R}^{(N_i+N_o) \times N_h}$ , we consider the $(N_i + N_o) \times (N_i + N_o)$ matrix
+
+$$\mathbf{QQ}^T(t) = \begin{bmatrix} \mathbf{W}_1^T \mathbf{W}_1(t) & \mathbf{W}_1^T \mathbf{W}_2^T(t) \\ \mathbf{W}_2 \mathbf{W}_1(t) & \mathbf{W}_2 \mathbf{W}_2^T(t) \end{bmatrix}, \quad (3)$$
+
+which is divided into four quadrants with interpretable meanings, and where $t \in \mathbb{R}$ represents training time. The approach monitors several key statistics collected in the matrix. The off-diagonal blocks contain the network function $\tilde{\mathbf{Y}}(t) = \mathbf{W}_2 \mathbf{W}_1(t) \mathbf{X}$ . The on-diagonal blocks capture the correlation structure of the weight matrices, allowing for the calculation of the temporal evolution of the network's internal representations. This includes the representational similarity matrices (RSM) of the neural representations within the hidden layer, as first defined by Braun et al. (2022),
+
+$$\text{RSM}_I = \mathbf{X}^T \mathbf{W}_1^T \mathbf{W}_1(t) \mathbf{X}, \quad \text{RSM}_O = \mathbf{Y}^T (\mathbf{W}_2 \mathbf{W}_2^T(t))^+ \mathbf{Y}, \quad (4)$$
+
+where $+$ denotes the pseudoinverse; and the network's finite-width NTK (Jacot et al., 2018; Lee et al., 2019; Arora et al., 2019b)
+
+$$\text{NTK} = \mathbf{I}_{N_o} \otimes \mathbf{X}^T \mathbf{W}_1^T \mathbf{W}_1(t) \mathbf{X} + \mathbf{W}_2 \mathbf{W}_2^T(t) \otimes \mathbf{X}^T \mathbf{X}, \quad (5)$$
+
+where $\mathbf{I}_{N_o}$ is the $N_o \times N_o$ identity matrix and $\otimes$ is the Kronecker product. Hence, the dynamics of $\mathbf{QQ}^T$ describes the important aspects of network behaviour.
+
+## 4 EXACT LEARNING DYNAMICS
+
+We derive an exact solution for $\mathbf{QQ}^T$ offering insight into the learning dynamics, convergence behavior, and generalization properties of two-layer linear networks with prior knowledge.
+
+**Assumptions.** To derive these solutions we make the following assumptions:
+
+- **A1 (Whitened input).** The input data is whitened, i.e. $\tilde{\Sigma}^{xx} = \mathbf{I}$ .
+- **A2 ( $\lambda$ -Balanced).** The network's weight matrices are $\lambda$ -balanced at the beginning of training, i.e. $\mathbf{W}_2^T \mathbf{W}_2(0) - \mathbf{W}_1 \mathbf{W}_1(0)^T = \lambda \mathbf{I}$ . If this condition holds at initialization, it will persist throughout training (Saxe et al., 2014; Arora et al., 2018a). For completeness, we prove this in Appendix A.
+- **A3 (Dimensions).** The hidden dimension of the network is defined as $N_h = \min(N_i, N_o)$ , ensuring the network is neither bottlenecked ( $N_h < \min(N_i, N_o)$ ) nor overparameterized ( $N_h > \min(N_i, N_o)$ ).
+
+These assumptions are strictly weaker than prior works (Fukumizu, 1998; Braun et al., 2022; Kunin et al., 2024; Xu & Ziyin, 2024). The main distinction between our work and prior works is that both Fukumizu (1998) and Braun et al. (2022) assumed zero-balanced weights ( $\mathbf{W}_1(0) \mathbf{W}_1(0)^T = \mathbf{W}_2(0)^T \mathbf{W}_2(0)$ ), while we relax this assumption to $\lambda$ -balanced. The zero-balanced condition restricts the networks to a *rich* setting. We develop solutions to explore the continuum between the *rich* and the *lazy* regime. While some works, such as Tarmoun et al. (2021), have considered removing this constraint, their solutions remain in an unstable and mixed form. Other studies, such as Xu & Ziyin (2024) and Kunin et al. (2024), have similarly relaxed the balanced assumption but were limited to single-output neuron settings. See Appendix A.2 for a further discussion on each of these works' assumptions and their relationship to ours.
+
+**Lemmas and definitions.** To derive exact solutions we start by presenting the main lemmas which we prove in the appendix.
+
+{4}------------------------------------------------
+
+**Lemma 4.1.** *Under assumptions 1 and 2, the gradient flow dynamics of $\mathbf{Q}\mathbf{Q}^T(t)$ , with initialization $\mathbf{Q}\mathbf{Q}^T(0) = \mathbf{Q}(0)\mathbf{Q}(0)^T$ can be written as a differential matrix Riccati equation*
+
+$$\tau \frac{d}{dt}(\mathbf{Q}\mathbf{Q}^T) = \mathbf{F}\mathbf{Q}\mathbf{Q}^T + \mathbf{Q}\mathbf{Q}^T\mathbf{F} - (\mathbf{Q}\mathbf{Q}^T)^2, \quad \text{where } \mathbf{F} = \begin{pmatrix} -\frac{\lambda}{2}\mathbf{I}_{N_i} & (\tilde{\Sigma}^{yx})^T \\ \tilde{\Sigma}^{yx} & \frac{\lambda}{2}\mathbf{I}_{N_o} \end{pmatrix}. \quad (6)$$
+
+As derived in Fukumizu (1998) and extended in Braun et al. (2022), whenever $\mathbf{F}$ is symmetric and diagonalizable such that $\mathbf{F} = \mathbf{P}\mathbf{\Lambda}\mathbf{P}^T$ , where $\mathbf{P}$ is an orthonormal matrix and $\mathbf{\Lambda}$ is a diagonal matrix, then the unique solution to this matrix Riccati equation is given by
+
+$$\mathbf{Q}\mathbf{Q}^T(t) = e^{\mathbf{F}\frac{t}{\tau}}\mathbf{Q}(0) \left[ \mathbf{I} + \mathbf{Q}(0)^T \mathbf{P} \begin{pmatrix} e^{\frac{2\lambda_A t}{\tau}} - \mathbf{I}}{2\mathbf{\Lambda}} \end{pmatrix} \mathbf{P}^T \mathbf{Q}(0) \right]^{-1} \mathbf{Q}(0)^T e^{\mathbf{F}\frac{t}{\tau}}. \quad (7)$$
+
+In Appendix B.2 we prove that this equation is the unique solution to the initial value problem derived in Lemma 4.1 for any value of $\Lambda$ . However, as discussed in Braun et al. (2022), the solution in this form is not very useable or interpretable due to the matrix inverse mixing the blocks of $\mathbf{Q}\mathbf{Q}^T$ . Additionally, we need to diagonalize $\mathbf{F}$ . To do so we consider the compact singular value decomposition $\text{SVD}(\tilde{\Sigma}^{yx}) = \tilde{\mathbf{U}}\tilde{\mathbf{S}}\tilde{\mathbf{V}}^T$ . Here, $\tilde{\mathbf{U}} \in \mathbb{R}^{N_o \times N_h}$ denotes the left singular vectors, $\tilde{\mathbf{S}} \in \mathbb{R}^{N_h \times N_h}$ the square matrix with ordered, non-zero eigenvalues on its diagonal, and $\tilde{\mathbf{V}} \in \mathbb{R}^{N_i \times N_h}$ the corresponding right singular vectors. For unequal input-output dimensions ( $N_i \neq N_o$ ), the right and left singular vectors are not square. Accordingly, for the case $N_i > N_h = N_o$ , we define $\tilde{\mathbf{U}}_\perp \in \mathbb{R}^{N_o \times |N_o - N_i|}$ as a matrix containing orthogonal column vectors that complete the basis for $\tilde{\mathbf{U}}$ , i.e., make $[\tilde{\mathbf{U}} \ \tilde{\mathbf{U}}_\perp]$ orthonormal, and $\tilde{\mathbf{V}}_\perp \in \mathbb{R}^{N_i \times |N_o - N_i|}$ as a matrix of zeros. Conversely, when $N_i = N_h < N_o$ , then $\tilde{\mathbf{V}}_\perp$ is a matrix containing orthogonal column vectors that complete the basis for $\tilde{\mathbf{V}}$ and $\tilde{\mathbf{U}}_\perp$ is a matrix of zeros. Using this SVD structure we can now describe the eigendecomposition of $\mathbf{F}$ .
+
+**Lemma 4.2.** *Under assumptions 3, the eigendecomposition of $\mathbf{F} = \mathbf{P}\mathbf{\Lambda}\mathbf{P}^T$ is*
+
+$$\mathbf{P} = \frac{1}{\sqrt{2}} \begin{pmatrix} \tilde{\mathbf{V}}(\tilde{\mathbf{G}} - \tilde{\mathbf{H}}\tilde{\mathbf{G}}) & \tilde{\mathbf{V}}(\tilde{\mathbf{G}} + \tilde{\mathbf{H}}\tilde{\mathbf{G}}) & \sqrt{2}\tilde{\mathbf{V}}_\perp \\ \tilde{\mathbf{U}}(\tilde{\mathbf{G}} + \tilde{\mathbf{H}}\tilde{\mathbf{G}}) & -\tilde{\mathbf{U}}(\tilde{\mathbf{G}} - \tilde{\mathbf{H}}\tilde{\mathbf{G}}) & \sqrt{2}\tilde{\mathbf{U}}_\perp \end{pmatrix}, \quad \mathbf{\Lambda} = \begin{pmatrix} \tilde{\mathbf{S}}_\lambda & 0 & 0 \\ 0 & -\tilde{\mathbf{S}}_\lambda & 0 \\ 0 & 0 & \lambda_\perp \end{pmatrix}, \quad (8)$$
+
+where the matrices $\tilde{\mathbf{S}}_\lambda$ , $\lambda_\perp$ , $\tilde{\mathbf{H}}$ , and $\tilde{\mathbf{G}}$ are diagonal matrices defined as:
+
+$$\tilde{\mathbf{S}}_\lambda = \sqrt{\tilde{\mathbf{S}}^2 + \frac{\lambda^2}{4}\mathbf{I}}, \quad \lambda_\perp = \text{sgn}(N_o - N_i)\frac{\lambda}{2}\mathbf{I}_{|N_o - N_i|}, \quad \tilde{\mathbf{H}} = \text{sgn}(\lambda)\sqrt{\frac{\tilde{\mathbf{S}}_\lambda - \tilde{\mathbf{S}}}{\tilde{\mathbf{S}}_\lambda + \tilde{\mathbf{S}}}}, \quad \tilde{\mathbf{G}} = \frac{1}{\sqrt{1 + \tilde{\mathbf{H}}^2}}. \quad (9)$$
+
+**Main theorem.** Thanks to the eigendecomposition of $\mathbf{F}$ we can separate the solution provided in equation 7 into four quadrants. Following an approach used in Braun et al. (2022), we will find it useful to define the following variables of the initialization that will allow us to define the product $\mathbf{P}^T \mathbf{Q}(0)$ more succinctly,
+
+$$\mathbf{B} = \mathbf{W}_2(0)^T \tilde{\mathbf{U}}(\tilde{\mathbf{G}} + \tilde{\mathbf{H}}\tilde{\mathbf{G}}) + \mathbf{W}_1(0) \tilde{\mathbf{V}}(\tilde{\mathbf{G}} - \tilde{\mathbf{H}}\tilde{\mathbf{G}}) \in \mathbb{R}^{N_h \times N_h}, \quad (10)$$
+
+$$\mathbf{C} = \mathbf{W}_2(0)^T \tilde{\mathbf{U}}(\tilde{\mathbf{G}} - \tilde{\mathbf{H}}\tilde{\mathbf{G}}) - \mathbf{W}_1(0) \tilde{\mathbf{V}}(\tilde{\mathbf{G}} + \tilde{\mathbf{H}}\tilde{\mathbf{G}}) \in \mathbb{R}^{N_h \times N_h}, \quad (11)$$
+
+$$\mathbf{D} = \mathbf{W}_2(0)^T \tilde{\mathbf{U}}_\perp + \mathbf{W}_1(0) \tilde{\mathbf{V}}_\perp \in \mathbb{R}^{N_h \times |N_o - N_i|}. \quad (12)$$
+
+Using these variables of the initialization, this brings us to our main theorem:
+
+**Theorem 4.3.** *Under the assumptions of whitened inputs (1), $\lambda$ -balanced weights (2), and no bottleneck (3), the temporal dynamics of $\mathbf{Q}\mathbf{Q}^T$ are*
+
+$$\mathbf{Q}\mathbf{Q}^T(t) = \begin{pmatrix} \mathbf{Z}_1(t)\mathbf{A}^{-1}(t)\mathbf{Z}_1^T(t) & \mathbf{Z}_1(t)\mathbf{A}^{-1}(t)\mathbf{Z}_2^T(t) \\ \mathbf{Z}_2(t)\mathbf{A}^{-1}(t)\mathbf{Z}_1^T(t) & \mathbf{Z}_2(t)\mathbf{A}^{-1}(t)\mathbf{Z}_2^T(t) \end{pmatrix},$$
+
+with the time-dependent variables $\mathbf{Z}_1(t) \in \mathbb{R}^{N_i \times N_h}$ , $\mathbf{Z}_2(t) \in \mathbb{R}^{N_o \times N_h}$ , and $\mathbf{A}(t) \in \mathbb{R}^{N_h \times N_h}$ :
+
+$$\mathbf{Z}_1(t) = \frac{1}{2}\tilde{\mathbf{V}}(\tilde{\mathbf{G}} - \tilde{\mathbf{H}}\tilde{\mathbf{G}})e^{\tilde{\mathbf{S}}_\lambda \frac{t}{\tau}}\mathbf{B}^T - \frac{1}{2}\tilde{\mathbf{V}}(\tilde{\mathbf{G}} + \tilde{\mathbf{H}}\tilde{\mathbf{G}})e^{-\tilde{\mathbf{S}}_\lambda \frac{t}{\tau}}\mathbf{C}^T + \tilde{\mathbf{V}}_\perp e^{\lambda_\perp \frac{t}{\tau}}\mathbf{D}^T, \quad (13)$$
+
+$$\mathbf{Z}_2(t) = \frac{1}{2}\tilde{\mathbf{U}}(\tilde{\mathbf{G}} + \tilde{\mathbf{H}}\tilde{\mathbf{G}})e^{\tilde{\mathbf{S}}_\lambda \frac{t}{\tau}}\mathbf{B}^T + \frac{1}{2}\tilde{\mathbf{U}}(\tilde{\mathbf{G}} - \tilde{\mathbf{H}}\tilde{\mathbf{G}})e^{-\tilde{\mathbf{S}}_\lambda \frac{t}{\tau}}\mathbf{C}^T + \tilde{\mathbf{U}}_\perp e^{\lambda_\perp \frac{t}{\tau}}\mathbf{D}^T, \quad (14)$$
+
+$$\mathbf{A}(t) = \mathbf{I} + \mathbf{B} \left( \frac{e^{-2\tilde{\mathbf{S}}_\lambda \frac{t}{\tau}} - \mathbf{I}}{4\tilde{\mathbf{S}}_\lambda} \right) \mathbf{B}^T - \mathbf{C} \left( \frac{e^{-2\tilde{\mathbf{S}}_\lambda \frac{t}{\tau}} - \mathbf{I}}{4\tilde{\mathbf{S}}_\lambda} \right) \mathbf{C}^T + \mathbf{D} \left( \frac{e^{\lambda_\perp \frac{t}{\tau}} - \mathbf{I}}{\lambda_\perp} \right) \mathbf{D}^T. \quad (15)$$
+
+{5}------------------------------------------------
+
+The proof of Theorem 4.3 is in Appendix B. With this solution we can calculate the exact temporal dynamics of the loss, network function, RSMs and NTK (Fig. 2A, C) over a range of $\lambda$ -balanced initializations.
+
+**Implementation and simulation.** One issue with the expression we derived in Theorem 4.3 is that it can be numerically unstable when simulating it for long time $t \gg 0$ as it involves taking the inverse of terms that involve exponentials that are diverging with $t$ . If we make the additional assumption that $\mathbf{B}$ is invertible, then we can rearrange this expression to only use exponentials with negative coefficients, which we derive in Appendix B.5. In the next section we will discuss the significance of $\mathbf{B}$ being invertible at initialization on the convergence of the dynamics. Simulation details are in Appendix E.7.
+
+## 5 RICH AND LAZY LEARNING
+
+Next, we use these solutions to gain a deeper understanding of the transition between the *rich* and *lazy* regimes by examining the dynamics as a function of $\lambda$ – the *relative scale* – as it varies between positive and negative infinity. We investigate four key indicators of the learning regimes: the dynamics of singular vectors, the structure and robustness of the representations, and the evolution of the NTK.
+
+**Dynamics of the singular values.** Here we examine a $\lambda$ -balanced linear network initialized with *task-aligned* weights. Previous research (Saxe et al., 2019a) has demonstrated that initial weights that are aligned with the task remain aligned throughout training, restricting the learning dynamics to the singular values of the network. This setting offers a valuable opportunity to build intuition about the impact of $\lambda$ on the dynamics of learning regimes, extending beyond previous solutions (Tarnmou et al., 2021; Varre et al., 2024).
+
+**Theorem 5.1.** *Under the assumptions of Theorem 4.3 and with a task-aligned initialization, as defined in Saxe et al. (2013), the network function is given by the expression $\mathbf{W}_2 \mathbf{W}_1(t) = \tilde{\mathbf{U}} \mathbf{S}(t) \tilde{\mathbf{V}}^T$ where $\mathbf{S}(t) \in \mathbb{R}^{N_h \times N_h}$ is a diagonal matrix of singular values with elements $s_\alpha(t)$ that evolve according to the equation,*
+
+$$s_\alpha(t) = s_\alpha(0) + \gamma_\alpha(t; \lambda) (\tilde{s}_\alpha - s_\alpha(0)), \quad (16)$$
+
+where $\tilde{s}_\alpha$ is the $\alpha$ singular value of $\tilde{\mathbf{S}}$ and $\gamma_\alpha(t; \lambda)$ is a $\lambda$ -dependent monotonic transition function for each singular value that increases from $\gamma_\alpha(0; \lambda) = 0$ to $\lim_{t \rightarrow \infty} \gamma_\alpha(t; \lambda) = 1$ defined explicitly in Appendix C.1. We find that under different limits of $\lambda$ , the transition function converges pointwise to the sigmoidal ( $\lambda \rightarrow 0$ ) and exponential ( $\lambda \rightarrow \pm\infty$ ) transition functions,
+
+$$\lim_{\lambda \rightarrow 0} \gamma_\alpha(t; \lambda) \rightarrow \frac{e^{2\tilde{s}_\alpha \frac{t}{\lambda}} - 1}{e^{2\tilde{s}_\alpha \frac{t}{\lambda}} - 1 + \frac{\tilde{s}_\alpha}{s_\alpha(0)}}, \quad \lim_{\lambda \rightarrow \pm\infty} \gamma_\alpha(t; \lambda) \rightarrow 1 - e^{-|\lambda| \frac{t}{\tilde{s}_\alpha}}. \quad (17)$$
+
+The proof for Theorem 5.1 can be found in Appendix C.1. As shown in Fig. 3B, as $\lambda$ approaches zero, the dynamics resemble sigmoidal learning curves that traverse between saddle points, characteristic of the *rich* regime (Braun et al., 2022). In this regime the network learns the most salient features first, which can be beneficial for generalization (Lampinen & Ganguli, 2018). Conversely, as shown in Fig. 3A and C, as the magnitude of $\lambda$ increases, the dynamics become exponential, characteristic of the *lazy* regime. In this regime, all features are treated equally and the network’s
+
+
+
+Figure 2: A 5x3 grid of plots showing temporal dynamics of loss, network function, correlation of input and output weights, and NTK over training steps for lambda = -2, 0, and 2. The columns are labeled A, B, and C, corresponding to lambda = -2, 0, and 2 respectively. The rows are labeled from top to bottom: Loss, W2W1(t), W1^T W1(t), W2 W2^T(t), and NTK(t). Each plot shows a numerical simulation (colored line) and an analytical solution (black dotted line). The x-axis for all plots is 'Training Steps' from 0 to 20,000. The y-axes vary: Loss (0 to 150), W2W1(t) (-5 to 9), W1^T W1(t) (-3 to 10), W2 W2^T(t) (-1 to 10), and NTK(t) (-50 to 50). A legend in the top right of column C indicates 'Colored' for numerical and 'Analytical' for the dotted lines.
+
+Figure 2: **A.** The temporal dynamics of the numerical simulation (colored lines) of the loss, network function, correlation of input and output weights, and the NTK (row 1-5 respectively) are exactly matched by the analytical solution (black dotted lines) for $\lambda = -2$ . **B.** $\lambda = 0$ Large initial weight values. **C.** $\lambda = 2$ initial weight values initialized as described in E.7.
+
+{6}------------------------------------------------
+
+
+
+Figure 3: Simulated and analytical dynamics of the singular values of the network function. The figure consists of three subplots: A (Exponential Dynamics), B (Sigmoidal Dynamics), and C (Exponential Dynamics). Each subplot shows Singular Values (y-axis, 0 to 15) versus Training Steps (x-axis, 0 to 4000). A horizontal double-headed arrow at the bottom indicates the value of lambda: lambda = -2 for A, lambda = 0 for B, and lambda = 2 for C. A legend indicates that solid lines represent Numerical results and dashed lines represent Analytical results. In subplot A, the singular values decay towards zero. In subplot B, they follow a sigmoidal path. In subplot C, they decay more rapidly than in A.
+
+Figure 3: Simulated and analytical dynamics of the singular values of the network function with *relative scale* of **A**. $\lambda = -2$ , **B**. $\lambda = 0$ , or **C**. $\lambda = 2$ , initialized as described in Appendix E.7.
+
+dynamics resemble that of a shallow network. Notably, similar effects have been observed previously in the context of large *absolute scales* (Saxe et al., 2019a) independently of the *relative scale*. Overall, our results highlight the critical influence the *relative scale* $\lambda$ has in shaping the learning dynamics, from sigmoidal to exponential, steering the network between the *rich* and *lazy* regimes.
+
+**The dynamics of the representations.** We now consider how the representations of the individual parameters $\mathbf{W}_1$ and $\mathbf{W}_2$ change through training. We note that under $\lambda$ -balanced initializations there is a simple structure which persists throughout training that allows us to recover the dynamics of the parameters up to a time-dependent orthogonal transformation from the dynamics of $\mathbf{Q}\mathbf{Q}^T(t)$ .
+
+**Theorem 5.2.** Under assumptions 2, if the network function $\mathbf{W}_2\mathbf{W}_1(t) = \mathbf{U}(t)\mathbf{S}(t)\mathbf{V}^T(t)$ is full rank, then we can recover the parameters $\mathbf{W}_2(t) = \mathbf{U}(t)\mathbf{S}_2(t)\mathbf{R}^T(t)$ and $\mathbf{W}_1(t) = \mathbf{R}(t)\mathbf{S}_1(t)\mathbf{V}^T(t)$ up to time-dependent orthogonal transformation $\mathbf{R}(t) \in \mathbb{R}^{N_h \times N_h}$ , where $\mathbf{S}_\lambda(t) = \sqrt{\mathbf{S}^2(t) + \frac{\lambda^2}{4}\mathbf{I}}$ and
+
+$$\mathbf{S}_1(t) = \left( (\mathbf{S}_\lambda(t) - \frac{\lambda\mathbf{I}}{2})^{\frac{1}{2}}, 0_{\max(0, N_l - N_h)} \right), \quad \mathbf{S}_2(t) = \left( (\mathbf{S}_\lambda(t) + \frac{\lambda\mathbf{I}}{2})^{\frac{1}{2}}, 0_{\max(0, N_o - N_l)} \right). \quad (18)$$
+
+The effective singular values $\mathbf{S}_\lambda$ of the corresponding weights are either up-weighted or down-weighted depending on the magnitude and sign of $\lambda$ , splitting the representation into two parts. This division is reflected in the network’s internal representations. With our solution, $\mathbf{Q}\mathbf{Q}^T(t)$ , which captures the temporal dynamics of the similarity between hidden layer activations, we can analyze the network’s internal representations in relation to the task. This allows us to determine whether the network adopts a *rich* or *lazy* representation, depending on the value of $\lambda$ . Assuming convergence to the global minimum, which is guaranteed when the matrix $\mathbf{B}$ is non-singular, the internal representation satisfies $\mathbf{W}_1^T\mathbf{W}_1 = \tilde{\mathbf{V}}\tilde{\mathbf{S}}_1^2\tilde{\mathbf{V}}^T$ and $\mathbf{W}_2\mathbf{W}_2^T = \tilde{\mathbf{U}}\tilde{\mathbf{S}}_2^2\tilde{\mathbf{U}}^T$ with $\mathbf{W}_2\mathbf{W}_1 = \tilde{\mathbf{U}}\tilde{\mathbf{S}}\tilde{\mathbf{V}}^T$ . Theorem C.3 in the Appendix provides a detailed proof of this limiting behavior. To illustrate this, we consider a hierarchical semantic learning task1, introduced in Saxe et al. (2014); Braun et al. (2022), where living organisms are organized according to their features (Fig. 4A). The representational similarity of the task’s inputs ( $\tilde{\mathbf{V}}\tilde{\mathbf{S}}\tilde{\mathbf{V}}^T$ ) reflects this hierarchical structure (Fig.4A). Similarly, the representational similarity of the task’s target values ( $\tilde{\mathbf{U}}\tilde{\mathbf{S}}\tilde{\mathbf{U}}^T$ ) highlights the primary groupings of items. When training a two-layer network with *relative scale* $\lambda$ equal to zero and task-agnostic initialization (Mishkin & Matas, 2015), the input and output representational similarity matrices (Fig.4B) match the task’s structure upon convergence. As derived in Theorem C.4 the network is guaranteed to find a *rich* solution regardless of the *absolute scale*, meaning $\mathbf{W}_1^T\mathbf{W}_1 = \tilde{\mathbf{V}}\tilde{\mathbf{S}}\tilde{\mathbf{V}}^T$ and $\mathbf{W}_2\mathbf{W}_2^T = \tilde{\mathbf{U}}\tilde{\mathbf{S}}\tilde{\mathbf{U}}^T$ , as shown in Fig. 4C. Hence, the network learns task-specific representations. We also show that as $\lambda$ approaches either positive or negative infinity, the network symmetrically transitions into the *lazy* regime. As demonstrated in Theorem C.4 and illustrated in Fig. 4, the representations converge to an identity matrix for both large positive and large negative values of $\lambda$ —emerging in the output representations for large positive $\lambda$ and input representations for large negative $\lambda$ . This convergence indicates that the network adopts task-agnostic representations. Meanwhile, the other respective RSMs become negligible, with scales proportional to $1/\lambda$ . Therefore, as shown in Theorem C.5, the NTK becomes static and equivalent to the identity matrix in the limit as $\lambda$ approaches infinity. However, the downscaled representations of the network remain structured and task-specific. Intuitively, in this
+
+1In this setting, the network has equal input and output dimensions
+
+{7}------------------------------------------------
+
+
+
+Figure 4 consists of five panels (A-E) illustrating the semantic learning task and its analysis. Panel A shows the task-specific SVD of the input-output correlation matrix, with top panels showing singular vectors $U$ and $V$ , and bottom panels showing the respective RSMs $USU^T$ and $VSV^T$ . A tree diagram shows the hierarchy: Plant (Animal, Fish, Bird, Apple, Flower). Panel B shows simulation results for Lazy and Rich regimes, with $\lambda = -2, 0, 2$ . Panel C shows theoretical input and output representation matrices. Panel D shows final RSMs for Lazy and Rich regimes. Panel E shows the network's sensitivity to input noise (top panel) and parameter noise (bottom panel) as a function of $\lambda$ .
+
+Figure 4: A semantic learning task with the SVD of the input-output correlation matrix of the task. Panel A shows the task-specific SVD and a tree diagram. Panel B shows simulation results for Lazy and Rich regimes. Panel C shows theoretical input and output representation matrices. Panel D shows final RSMs. Panel E shows input and parameter noise sensitivity.
+
+Figure 4: **A.** A semantic learning task with the SVD of the input-output correlation matrix of the task. (top) $U$ and $V$ represent the singular vectors, and $S$ contains the singular values. (bottom) The respective RSMs are $USU^T$ for the input and $VSV^T$ for the output task. **B.** Simulation results and **C.** Theoretical input and output representation matrices after training, showing convergence when initialized with values of $\lambda$ equal to $-2, 0$ , and $2$ , according to the initialization scheme described in Appendix E.7. **D.** Final RSMs matrices after training converged when initialised from random large weights. **E.** After convergence, the network's sensitivity to input noise (top panel) is invariant to $\lambda$ , but the sensitivity to parameter noise increases as $\lambda$ becomes smaller (or larger) than zero.
+
+setup, the larger weights function as an identity-like projection, while the smaller weights adapt and align to the task. However, due to their relative scale compared to the larger weights, their contribution to the NTK remains negligible. This property could be beneficial if the weights are later rescaled, such as during fine-tuning, potentially enhancing generalization and transfer learning, as we will demonstrate in Section 6. We compare this to the scenario where both weights are initialized with large Gaussian values, leading to *lazy* learning that maintains a fixed NTK but lacks any structural representation, as illustrated in Fig. 4D. We further discuss the relationship between the scale and the relative scale in appendix A.4. Furthermore, in the infinite-width regime, where weights are initialized from a Gaussian distribution with large variance, averaging effects cause both input and output representations to approximate identity matrices. In this scenario, the network learns in the lazy regime with a fixed Neural Tangent Kernel (NTK). This behavior contrasts with the dynamics observed in the current setting since both input and output representations are task agnostic. Consequently, we propose a new *lazy* regime, which we refer to as the *semi-structured lazy* regime. We note that these existing regimes preserve only the input or output representation, resulting in a partial loss of structural information. In the nonlinear setting, this behavior is not expected to hold, as an additional factor comes into play in the computation of the NTK: the activation coefficients of the nonlinearity, as demonstrated in Kunin et al. (2024). In that case large relative weight (large positive $\lambda$ ) leads to a rapid rich regime. All together, we find that initialization will determine which layer in the network the task specification features resides in: layers initialized with large values will be task-agnostic, while those initialized with small values will be task-specific.
+
+**Representation robustness and sensitivity to noise.** Here we examine the relationship between the learning regime and the robustness of the learned representations to added noise in the inputs and parameters. The expected post-convergence loss with added noise to the inputs is determined by the norm of the network function (Braun et al., 2025), which in our setting is independent of $\lambda$ . Specifically, if we add zero-centered noise $\xi_X$ with variance $\sigma_X^2$ to the inputs, then the expected loss is $\langle \mathcal{L} \rangle_{\xi_X} = \sigma_X^2 \sum_{i=1}^{N_h} \tilde{\mathbf{S}}_i^2 + c$ , where $c$ is a constant that depends solely on the statistics of the training data (Figure 4E, Appendix C.3). However, if instead noise is added to the parameters, the expected loss scales quadratically with the norm of the weight matrices (Braun et al., 2025), which in our setting depend on $\lambda$ . In particular, zero-centered parameter noise $\xi_{W_1}$ and $\xi_{W_2}$ with variance $\sigma_W^2$ results in an expected loss of $\langle \mathcal{L} \rangle_{\xi_{W_1}, \xi_{W_2}} = \frac{1}{2} N_i \sigma_W^2 \|\mathbf{W}_2\|_F^2 + \frac{1}{2} N_o \sigma_W^2 \|\mathbf{W}_1\|_F^2 + \frac{1}{2} N_i N_h N_o \sigma^4 + c$ , with norms $\|\mathbf{W}_1\|_F^2 = \frac{1}{2} \sum_{i=1}^{N_h} \left( \sqrt{4\tilde{\mathbf{S}}_i^2 + \lambda^2} + \lambda \right)$ and $\|\mathbf{W}_2\|_F^2 = \frac{1}{2} \sum_{i=1}^{N_h} \left( \sqrt{4\tilde{\mathbf{S}}_i^2 + \lambda^2} - \lambda \right)$ . This implies that, under the assumption of equal input-output dimensions, networks initialized with weights such that $\lambda = 0$ , corresponding to the rich regime, converge to solutions that are most robust to parameter noise (Figure 4E, Appendix C.3). In practice, parameter noise could be interpreted as
+
+{8}------------------------------------------------
+
+
+
+Figure 5: A. Schematic representations of network architectures: funnel network, square network, and anti-funnel network. B. Plot of NTK kernel distance from initialization across three architectures (funnel, square, anti-funnel) for varying lambda. C. Heatmap of NTK kernel distance over training steps for lambda values from -9 to 9.
+
+Figure 5: **A.** Schematic representations of the network architectures considered, from left to right: funnel network, square network, and inverted-funnel network. **B.** The plot shows the NTK kernel distance from initialization, as defined in Fort et al. (2020) across the three architecture depicted schematically. **C.** The NTK kernel distance away from initialization over training time.
+
+the noise occurring within the neurons of a biological network. Hence, a rich solution may enable a more robust representation in such systems.
+
+**The impact of the architecture.** Thus far, we have found that the magnitude of the *relative scale* parameter $\lambda$ determines the extent of rich and lazy learning. Here, we explore how a network’s learning regime is also shaped by the interaction of its architecture and the sign of the *relative scale*. We consider three types of network architectures, depicted in Fig. 5A: *funnel networks*, which narrow from input to output ( $N_i > N_h = N_o$ ); *inverted-funnel networks*, which expand from input to output ( $N_i = N_h < N_o$ ); and *square networks*, where input and output dimensions are equal ( $N_i = N_h = N_o$ ). Our solution, $\mathbf{Q}\mathbf{Q}^T$ , captures the dynamics of the NTK across these different network architectures. To examine the NTK’s evolution under varying $\lambda$ initializations, we compute the kernel distance from initialization, as defined in Fort et al. (2020). As shown in Fig. 5B, we observe that funnel networks enter the *lazy* regime as $\lambda \rightarrow \infty$ , while inverted-funnel networks do so as $\lambda \rightarrow -\infty$ . The NTK remains static during the initial phase, rigorously confirming the rank argument first introduced by Kunin et al. (2024) for the multi-output setting. In the opposite limits of $\lambda$ , these networks transition from a *lazy* regime to a *rich* regime. During this second alignment phase, the NTK matrix undergoes changes, indicating an initial *lazy* phase followed by a *delayed rich* phase. We further investigate and quantify this *delayed rich* regime, showing the NTK movement over training in Fig. 5C. This behavior is also quantified in Theorem C.6, which describes the rate of learning in this network. In Appendix A.4, we further explore the impact of the architecture as a function of the absolute and relative scale. Intuitively, the delayed onset of the rich regime occurs because no least-squares solution exists within the span of the network at initialization. In such cases, the network enters a delayed rich phase, where $\lambda$ tends toward infinity, with the magnitude of $\lambda$ determining the length of the delay. At first, the network exhibits *lazy* dynamics, striving to approximate the solution. However, as constraints necessitate adjustments in its directions, the network gradually transitions into the *rich* phase. For square networks this behavior is discussed in Section 5. Across all architectures, as $\lambda \rightarrow 0$ , the networks consistently transition into the *rich* regime. Altogether, we further characterize the *delayed rich* regime in wide networks.
+
+## 6 APPLICATIONS
+
+In this section, we apply the exact solutions for the learning dynamics in deep linear networks described in Section 4 to illustrate several phenomena relevant to machine learning and neuroscience.
+
+**Continual learning.** Continual learning, as thoroughly reviewed by Parisi et al. (2019), has long posed a significant challenge for neural network models in contrast to biological networks, particularly due to the issue of catastrophic forgetting (McCloskey & Cohen, 1989; Ratcliff, 1990; French, 1999). Similarly to the framework presented by Braun et al. (2022), our approach describes the exact solutions of the networks dynamics trained across a sequence of tasks describing the entire continual learning process. As detailed in Appendix D.1, we demonstrate that, regardless of the chosen value of $\lambda$ , training on subsequent tasks can result in the overwriting of previously acquired knowledge, leading to catastrophic forgetting.
+
+**Reversal learning.** During reversal learning, previously acquired knowledge must be relearned, necessitating the overcoming of an earlier established relationship between inputs and outputs. As demonstrated in Braun et al. (2022), reversal learning theoretically does not succeed in deep linear networks as the initialization aligns with the separatrix of a saddle point. While simulations show
+
+{9}------------------------------------------------
+
+that the learning dynamics can escape the saddle point due to numerical imprecision, the process is catastrophically slowed in its vicinity. However, when $\lambda$ is non-zero, reversal learning dynamics consistently succeed, as they avoid passing through the saddle point due to the initialization scheme. This is both theoretically proven and numerically illustrated in Appendix D.2. We also present a spectrum of reversal learning behaviors controlled by the *relative scale* $\lambda$ , ranging from *rich* to *lazy* learning regimes. This spectrum has the potential to explain the diverse dynamics observed in animal behavior, offering insights into the learning regimes relevant to neuroscience experiments.
+
+**Transfer learning.** We consider how different $\lambda$ initializations influence generalization to a new feature after being trained on an initial task. As detailed in Appendix D.3, we first train each network on the hierarchical semantic learning task described in Fig. 4. We then add a new feature to the dataset, and train the network specifically on the corresponding item while keeping the rest of the network parameters unchanged. Afterwards, we evaluate the generalization to the other items. We observe in Appendix Fig. D.3 that the hierarchical structure of the data is effectively transferred to the new feature when the representation is task-specific and $\lambda$ is zero. Conversely, when the input feature representation is *lazy* ( $\lambda \leq 0$ ), meaning the hidden representation lacks adaptation, no hierarchical generalization is observed. Strikingly, when $\lambda$ is positive, the hierarchical structure in the input weights remains small but structured, while the output weights exhibit a *lazy* representation and the network generalizes hierarchically. Specifically Fig. D.3 shows that the generalization loss on untrained items with the new feature decreases as a function of increasing $\lambda$ . Therefore, as $\lambda$ increases, networks more effectively transfer the hierarchical structure of the network to the new feature for untrained items, leading to an increase in generalization performance. This indicates that the *lazy* regime structure (large $\lambda$ values) can be beneficial for transfer learning.
+
+**Fine-tuning** It is a common practice to pre-train neural networks on a large auxiliary task before fine-tuning them on a downstream task with limited samples. Despite the widespread use of this approach, the dynamics and outcomes of this method remain poorly understood. Our study establishes a theoretical basis for the success of fine-tuning, particularly how changes in $\lambda$ -balancedness initialisation after pre-training affect performance on new datasets (see Appendix D.4). We consistently find that finetuning performance improves and converges more quickly as networks are re-balanced to larger values of $\lambda_{FT}$ and, conversely, decreases as $\lambda_{FT}$ approaches 0 as shown in Fig. D.4. Our work examines the fine-tuning dynamics of two-layer linear networks. While simple, these architectures are commonly utilized for fine-tuning large pre-trained language and vision models, notably in Low-Rank Adapters (LoRA) (Hu et al., 2022) as further discussed in Appendix D.4. While a detailed exploration of fine-tuning performance in practice as a function of initialization lies beyond the scope of this work, it remains an important direction for future research.
+
+## 7 DISCUSSION
+
+We derive exact solutions to the learning dynamics of deep linear networks. While our findings extend the range of analytically describable two-layer linear network problems, they are still limited by a set of assumptions. In particular, relaxing the assumptions that input covariance must be white and that initialization must be $\lambda$ -balanced could bring the analysis closer to practical applications in machine learning and neuroscience. Moving towards the nonlinear setting would also make the findings more applicable in real-world scenarios. Despite these limitations, our solutions provide valuable insights into network behavior. We examine the transition between the *rich* and *lazy* regimes by analyzing the dynamics as a function of $\lambda$ —the *relative scale*—across its full range from positive to negative infinity. Our analysis demonstrates that the *relative scale*, $\lambda$ , is pivotal in managing this transition. Notably, we identify a structured *lazy* regime that promotes transfer learning. Building on previous work (Kunin et al., 2024) that shows these findings extend to basic nonlinear settings and practical scenarios, our theory suggests that further exploration of unbalanced initialization could optimize efficient feature learning. We leave for future work, the extension of this initialization to deep networks. Future work will focus on extending the application of the solution to the dynamics of fine-tuning and linear autoencoders.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/ZxZabvtLwV.txt b/papers/ZxZabvtLwV.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e0b3486662a45713d578e7061f1f3027475c31ff
--- /dev/null
+++ b/papers/ZxZabvtLwV.txt
@@ -0,0 +1,490 @@
+**Primary Area:** applications to physical sciences (physics, chemistry, biology, etc.)
+
+
+
+{0}------------------------------------------------
+
+# PROTEX: A RETRIEVAL-AUGMENTED APPROACH FOR PROTEIN FUNCTION PREDICTION
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Mapping a protein sequence to its underlying biological function is a critical problem of increasing importance in biology. In this work, we propose *ProtEx*, a retrieval-augmented approach for protein function prediction that leverages exemplars from a database to improve accuracy and robustness and enable generalization to unseen classes. Our approach relies on a novel multi-sequence pretraining task, and a fine-tuning strategy that effectively conditions predictions on retrieved exemplars. Our method achieves state-of-the-art results across multiple datasets and settings for predicting Enzyme Commission (EC) numbers, Gene Ontology (GO) terms, and Pfam families. Our ablations and analysis highlight the impact of conditioning predictions on exemplar sequences, especially for classes and sequences less well represented in the training data.
+
+## 1 INTRODUCTION
+
+Proteins perform a wide array of functions within organisms, captured by biologists using ontologies such as Gene Ontology (GO) terms (Ashburner et al., 2000), Enzyme Commission (EC) numbers (Tipton & Boyce, 2000), and Pfam families (Bateman et al., 2004). Mapping proteins to such functional annotations can address key problems in biology, medicine, and chemistry (Price et al., 2018; Durairaj et al., 2023). However, given the expense of wet lab experiments, and the rapid growth of protein sequence databases (Uniprot, 2023), it is critical to extend coverage using computational protein function predictions. Protein function prediction techniques largely fall into two categories, with different strengths and weaknesses. Homology-based approaches align the query protein to annotated sequences via methods such as BLAST (Altschul et al., 1997) or profile hidden Markov models (Eddy, 1998) allowing propagation of a label to the query. More recently, deep learning approaches directly predict a protein’s function from its amino acid sequence.
+
+While these approaches have been successful, key obstacles remain. A critical challenge is out-of-distribution generalization across both label and sequence space. For example, recent expansions of the Pfam database were driven by the identification of new classes (Mistry et al., 2021), for which there are few annotated sequences. Moreover, a substantial number of proteins belong to the “dark matter” of the protein universe (Durairaj et al., 2023), *i.e.* their sequences are dissimilar from those of any characterized proteins, posing considerable challenges for both homology-based and deep learning methods.
+
+In this work, we propose *ProtEx*, a method for Protein function prediction via retrieved Exemplars. *ProtEx* is a semiparametric approach that combines aspects of non-parametric similarity search based methods and parametric deep learning models to achieve increased accuracy and robustness. *ProtEx* is inspired by retrieval augmented methods in natural language processing and vision, *e.g.* (Lewis et al., 2020; Pasupat et al., 2021; Izacard et al., 2023; Yu et al., 2023a; Long et al., 2022), which show advantages over fully parametric models in capturing tail information (Kandpal et al., 2023) and performing few-shot tasks through conditioning on task exemplars (Min et al., 2022; Chen et al., 2022).
+
+As shown in Figure 1, given a query protein and candidate label, *ProtEx* first uses a homology-based retriever (such as BLAST) to obtain a class-conditioned set of positive and negative exemplars from the training set. Our neural model is trained to make a task-based comparison across the set of exemplars and the query to output a binary decision of whether the query sequence has the same label as the positive exemplars. To enable the model to efficiently learn the relationship between
+
+{1}------------------------------------------------
+
+
+
+054 Sequence to classify Candidate label
+
+055 MENFPEKVILETV... EC:1.2.3.4
+
+056 Retriever
+
+057 Positive and negative
+
+058 exemplar sequences for
+
+059 candidate label
+
+060 MENFTEV... ✓ MFTPKE... ✓ MNFTPKE... ✗ MTPKEVKI... ✗
+
+061 Concatenate Inputs
+
+062 Transformer Model
+
+063 Binary prediction for
+
+064 candidate label Yes (97%) No (3%)
+
+Diagram illustrating the Method Overview. A sequence to classify (MENFPEKVILETV...) and a candidate label (EC:1.2.3.4) are input to a Retriever. The Retriever outputs positive and negative exemplar sequences for the candidate label (e.g., MENFTEV... ✓, MFTPKE... ✓, MNFTPKE... ✗, MTPKEVKI... ✗). These are concatenated with the input sequence and passed through a Transformer Model to produce a binary prediction for the candidate label: Yes (97%) or No (3%).
+
+065 Figure 1: **Method Overview.** Our proposed method, ProtEx, predicts the relevance of various
+
+066 functional annotations for a given query sequence. First, for a given candidate label, positive and
+
+067 negative exemplar sequences are retrieved from the training data. Second, a pre-trained neural model
+
+068 jointly conditions on the query sequence and retrieved exemplars to make a prediction.
+
+069 query and exemplar sequences, we propose a novel multi-sequence pretraining objective (Figure 3).
+
+070 Our formulation allows us to effectively generalize to rare and unseen classes at test time and better
+
+071 classify sequences that have low sequence similarity with the training data.
+
+072
+
+073
+
+074 We evaluate our approach, ProtEx, on EC number, GO term, and Pfam family prediction tasks,
+
+075 showing that it achieves state-of-the-art performance across multiple settings, and consistently
+
+076 outperforms both existing traditional homology-based approaches and deep learning models. Our
+
+077 stratified analysis shows that ProtEx brings most notable improvements on rare classes and sequences
+
+078 that are far from the training set. We also demonstrate generalization to labels not seen at training
+
+079 time. Finally, our ablations and analyses highlight the efficacy of our pretraining strategy and the
+
+080 model’s ability to leverage exemplar sequences for improved classification accuracy.1
+
+###### 081 2 BACKGROUND AND RELATED WORK
+
+082
+
+083
+
+084 We review traditional methods for protein similarity search, neural models for protein function
+
+085 prediction, and related work on retrieval-augmented models from other domains.
+
+086
+
+087 **Protein Similarity Search** Proteins with similar sequences often perform similar functions, and
+
+088 for a given query sequence, *homologous* sequences can be retrieved from a database using a variety
+
+089 of similarity-based search methods (Altschul et al., 1997; Johnson et al., 2010; Remmert et al., 2012).
+
+090 These enable *homology-based inference* (Loewenstein et al., 2009), where functional labels from
+
+091 retrieved homologs are transferred to the query. ProtEx can be seen as performing homology-based
+
+092 inference where information from the homologs is aggregated using a learned, non-linear model. A
+
+093 ubiquitous tool for similarity search is BLAST (Altschul et al., 1990; 1997), which identifies and
+
+094 scores local sequence alignments using an empirically-derived substitution cost matrix (Henikoff
+
+095 & Henikoff, 1992). Our method leverages BLAST and BLAST-inspired techniques to retrieve
+
+096 exemplars (see §4). BLAST also serves as a strong baseline for homology-based inference when
+
+097 used in isolation.
+
+098 **Neural Models for Protein Function Prediction** Recent work has shown that deep models map-
+
+099 ping a protein sequence to functional predictions can outperform traditional alignment-based tech-
+
+100 niques. Models can be fit from scratch (Kulmanov et al., 2018; Ryu et al., 2019; Cao & Shen, 2021;
+
+101 Bileschi et al., 2022; Fan et al., 2022; Sanderson et al., 2023) or fine-tuned from a model pretrained on
+
+102 unlabeled protein sequences (Strodthoff et al., 2020; Dohan et al., 2021; Villegas-Morcillo et al., 2021;
+
+103 Yuan et al., 2023; Dickson & Mofrad, 2023). The amino acid sequence largely specifies a protein’s
+
+104 structure and function (Anfinsen, 1973), and hence is often used as input to models. However, other
+
+105 approaches also encode protein structures (Sokolov & Ben-Hur, 2010; Roy et al., 2012; Konc et al.,
+
+106 2013; Gligorijević et al., 2021; Zhang et al., 2022; Lai & Xu, 2022), with broad coverage due to
+
+107 advancements in protein structure prediction (Jumper et al., 2021; Baek et al., 2021). Using structures
+
+1Code and model predictions are available at .
+
+{2}------------------------------------------------
+
+in addition to or instead of protein sequences, either for prediction or retrieval, is largely orthogonal to the contributions of this paper, and future extensions to ProtEx could incorporate such techniques. Disordered proteins, which are not well characterized by a static structure would need to be handled carefully, however (Ruff & Pappu, 2021). We do not consider prediction approaches based on protein interaction networks (Mostafavi et al., 2008; You et al., 2019; Zhang et al., 2019; Kulmanov et al., 2024), which have demonstrated high accuracy where such networks are already established, but have limited overall coverage.
+
+Particularly relevant are recent methods combining neural models and retrieval for protein function prediction. Notin et al. (2022) combines likelihood scores from a protein language model and an MSA to predict the functional effects of mutations. Hamamsy et al. (2023) distills a protein similarity function into a neural network, and Dickson & Mofrad (2023) fine-tunes a retrieval model for homology-based inference. The ProtR method of Zhang et al. (2024) uses transductive learning where predictions from a retriever and neural classifier are iteratively updated towards agreement. In contrast to retrieval methods, which form predictions by aggregating pairwise similarity scores over sequences, ProtEx predicts conditioned on multiple labeled exemplar sequences. This also differs from methods that use the correlation structure in aligned sets of homologous sequences (MSAs), without accompanying annotations of their function, to inform, e.g., structure prediction (Marks et al., 2011; Jumper et al., 2021; Baek et al., 2021) or representation learning (Rao et al., 2021).
+
+**Retrieval-Augmented Models and In-Context Fine-tuning** Retrieval augmented neural models have shown success for a variety of text generation and classification tasks, with particular strength in recalling long tail knowledge, where even large parametric language models (LMs) struggle (Kandpal et al., 2023). Examples include retrieval-augmented language models, and models for machine translation, question answering, semantic parsing, and text classification (Khandelwal et al., 2020; 2021; Karpukhin et al., 2020; Guu et al., 2020; Lewis et al., 2020; Izacard et al., 2023; Pasupat et al., 2021; Yu et al., 2023a; Chalkidis & Kementchedjhieva, 2023). Retrieved context or exemplars come from large-scale unlabeled collections or labeled sets for supervised learning (Wang et al., 2022; Lewis et al., 2021). Computer vision and multimodal models also benefit from retrieval augmentation (Long et al., 2022; Ramos et al., 2023). A focus in NLP have been methods to adapt a pretrained parametric language model into one that can integrate information from retrieved sequences, and joint training of a retriever and generation model. In this work, we use pre-existing protein similarity models for retrieval and pre-train a protein sequence model to make inferences from multiple proteins.
+
+ProtEx is also related to in-context tuning methods for few-shot tasks (Min et al., 2022; Chen et al., 2022), where pretrained language models are meta-trained to make predictions given an input and task-relevant exemplars. These works show strong performance on unseen tasks, enabled by the LM’s ability to make predictions from an input and a few in-context exemplars. Similarly, ProtEx can be seen as meta-training on multiple binary classification tasks with in-context exemplars and, as shown in Section 4.5, can adapt to new labels without additional fine-tuning.
+
+## 3 PROPOSED METHOD
+
+Given a protein represented as a sequence of amino acids, $x$ , our goal is to predict a set of associated labels, $y \subset \mathcal{L}$ , where $\mathcal{L}$ is a set of protein function labels, such as EC numbers, GO terms, or Pfam labels. Core to our approach is to condition model predictions on a set of annotated exemplar sequences, which are retrieved from a training set, as visualized in Figure 2.
+
+### 3.1 OVERVIEW
+
+To predict a set of labels $y$ given $x$ , we first determine a set of candidate labels, $\hat{\mathcal{L}}_x \subseteq \mathcal{L}$ , and then make an independent binary prediction for each candidate label $l \in \hat{\mathcal{L}}_x$ , conditioning on exemplars that are selected based on both $x$ and $l$ . Due to our model’s limited context window, we can only condition on a limited number of exemplars per prediction. Therefore, our approach has several advantages compared to generating $y$ based on $x$ and a single limited set of exemplars. First, we can focus each prediction on the exemplars that are most relevant towards understanding the class boundary of a specific label $l$ . Second, we can consider a larger and more diverse set of candidate labels than those corresponding to a limited number of exemplars. Finally, our approach can be seen
+
+{3}------------------------------------------------
+
+
+
+```
+
+graph TD
+ QS[Query Sequence] --> SS[Similarity Search
+e.g. BLAST]
+ ATS[Annotated Training Sequences] --> SS
+ SS --> SAS[Similar Annotated Sequences]
+ SAS --> ECL[Extract Candidate Labels]
+ ECL --> CL[Candidate Label]
+ CL --> SE[Select Exemplars]
+ SE --> TA[Threshold and Aggregate]
+ TA --> PL[Predicted Labels]
+ QS --> GI[Generate Input]
+ GI --> MI[Model Input]
+ MI --> RT[Run Transformer]
+ RT --> PS[Predicted Score]
+ PS --> TA
+
+```
+
+Figure 2: Inference Procedure flowchart. The process starts with 'Query Sequence' and 'Annotated Training Sequences'. 'Query Sequence' leads to 'Similarity Search (e.g. BLAST)' and 'Generate Input'. 'Annotated Training Sequences' lead to 'Similarity Search (e.g. BLAST)'. 'Similarity Search (e.g. BLAST)' leads to 'Similar Annotated Sequences'. 'Similar Annotated Sequences' lead to 'Extract Candidate Labels'. 'Extract Candidate Labels' leads to 'Candidate Label'. 'Candidate Label' leads to 'Select Exemplars'. 'Select Exemplars' leads to 'Threshold and Aggregate'. 'Generate Input' leads to 'Model Input'. 'Model Input' leads to 'Run Transformer'. 'Run Transformer' leads to 'Predicted Score'. 'Predicted Score' leads to 'Threshold and Aggregate'. 'Threshold and Aggregate' leads to 'Predicted Labels'.
+
+Figure 2: **Inference Procedure.** Overview of procedure for computing a set of predicted labels given a protein sequence and a set of training sequences with annotated function.
+
+as meta-training on multiple binary classification tasks with in-context exemplars, which we show enables ProtEx to adapt to new labels without additional fine-tuning.2
+
+The inference procedure for predicting a set of functional labels, $y$ , given a protein sequence, $x$ , is shown in Figure 2. We review each step of this procedure below.
+
+**Similarity Search** Given a query sequence, $x$ , the first step in Figure 2 is to retrieve a ranked list of relevant sequences with known functional annotations, denoted $\mathcal{N}_x$ , from the training set. We adopt standard methods based on efficiently computing local alignments between sequences. We use BLAST (Altschul et al., 1997) for most experiments, which has shown strong performance and is computationally feasible to run on most of the datasets we study.3 Specifically, we run `blastp` to retrieve up to the 100 most similar sequences in the training set, and rank these sequences based on the BLAST alignment score. (See Appendix B.5 for details.)
+
+**Candidate Labels** We determine the set of candidate labels, $\hat{\mathcal{L}}_x$ , as the union of the labels corresponding to sequences in $\mathcal{N}_x$ . This simple approach ensures that we have at least one positive exemplar sequence for every candidate label.
+
+**Selecting Exemplars** We select a set of positive exemplars, $\mathcal{E}_{x,l}^p$ , as the top- $k^p$ sequences in $\mathcal{N}_x$ that are annotated with the candidate label $l$ . Similarly, we select a set of negative exemplars, $\mathcal{E}_{x,l}^n$ , as the top- $k^n$ sequences in $\mathcal{N}_x$ that are *not* annotated with $l$ . The hyperparameters $k^p$ and $k^n$ are discussed in Section 4 and selected such that the exemplars fit within the model’s context window.
+
+**Model Input** As visualized in Figure 1, we form a retrieval-augmented input sequence by concatenating the query sequence, $x$ , the candidate label $l$ , and the positive and negative exemplars, $\mathcal{E}_{x,l}^p$ and $\mathcal{E}_{x,l}^n$ , with a character denoting whether each exemplar is positive or negative.4
+
+**Transformer Model** As the focus of our study is the pre-training and fine-tuning recipe for our model, we use the general encoder-decoder Transformer (Vaswani et al., 2017) architecture of T5 (Raffel et al., 2020). As demonstrated in Raffel et al. (2020), this allows for flexibility in defining different pre-training and fine-tuning tasks without changes to the underlying architecture. We evaluate Small (60M) and Base (220M) sized models, using the Base size for our main results. We also evaluated Transformer variants that offer more efficient handling of long context. See Appendix C.2 for these comparisons. Similarly to Raffel et al. (2020), to apply our encoder-decoder model as a binary classifier, our model predicts single character sequences corresponding to either positive (p) or negative (n) predictions. We define the model score $s_\theta(x, l, \mathcal{E}_{x,l}^p, \mathcal{E}_{x,l}^n)$ with trainable parameters $\theta$ as the probability the model assigns to the positive character sequence p, i.e. $s_\theta(x, l, \mathcal{E}_{x,l}^p, \mathcal{E}_{x,l}^n) := \log P_\theta(p|x, l, \mathcal{E}_{x,l}^p, \mathcal{E}_{x,l}^n)$ . Since we consider separate exemplars for each candidate label, this requires running the model up to $|\hat{\mathcal{L}}_x|$ (the number of candidate labels) times for each input sequence. We analyze the computational cost of inference in Appendix B.3.
+
+2While such a capability is theoretically also possible if generating a set of labels, e.g., by anonymizing labels (Pasupat et al., 2021), this would be conceptually less straightforward.
+
+3For the Pfam task, which requires retrieval from a larger training set, we use a similar but alternative approach discussed in Section 4.4.
+
+4See Appendix A.1 for further details. We also ablate inclusion of the candidate label in Section 4.5.
+
+{4}------------------------------------------------
+
+
+
+```
+
+graph LR
+ A[Sample Sequence Pair from UniRef] --> B1[MENFTPKVEVMEN...]
+ A --> B2[KEVKMEFVPK...]
+ B1 --> C[Randomly Mask Residues]
+ B2 --> C
+ C --> D1[MENFT1KEVZEN...]
+ C --> D2[KE3KMEF4PK...]
+ D1 --> E[Transformer Model]
+ D2 --> E
+ E --> F1[Similarity between sequences]
+ E --> F2[Masked residues]
+ F1 --> F1a[68]
+ F2 --> F2a[1P2M3V4V...]
+
+```
+
+Diagram of the pretraining task. A 'Sample Sequence Pair from UniRef' (MENFTPKVEVMEN... and KEVKMEFVPK...) is processed through 'Randomly Mask Residues' to become 'MENFT1KEVZEN...' and 'KE3KMEF4PK...'. These are then passed through a 'Transformer Model' to produce a 'Similarity between sequences' of 68 and 'Masked residues' of 1P2M3V4V...
+
+Figure 3: **Pretraining task.** We sample a pair of unlabeled sequences, and the model is tasked with predicting masked residues and a similarity score between the two sequences.
+
+**Aggregating Predictions** For multilabel prediction tasks (e.g. EC and GO), we can determine a predicted label set, $\hat{y}$ , based on a score threshold $t$ :
+
+$$\hat{y} = \{l \mid l \in \hat{\mathcal{L}}_x \wedge s_\theta(x, l, \mathcal{E}_{x,l}^p, \mathcal{E}_{x,l}^n) > t\},$$
+
+and varying $t$ produces a tradeoff between precision and recall. For multiclass prediction tasks (e.g. Pfam) where $y$ is always a singleton, we can determine the class with the highest score:
+
+$$\hat{y} = \{\arg \max_{l \in \hat{\mathcal{L}}_x} s_\theta(x, l, \mathcal{E}_{x,l}^p, \mathcal{E}_{x,l}^n)\}.$$
+
+### 3.2 TRAINING
+
+Model training consists of two stages. First, we pre-train using unlabeled sequence pairs. Then, we fine-tune for a specific task by constructing positive and negative examples given a set of labeled sequences. In both stages, models are trained to maximize the likelihood of a target sequence given an input sequence, given our generic encoder-decoder architecture (Raffel et al., 2020).
+
+**Pre-training** Our pre-training task shown in Figure 3. Prior work has primarily pre-trained on single unlabeled sequences, then fine-tuned with a single sequence as input to improve protein function prediction (Dohan et al., 2021; Lin et al., 2023). In contrast, our goal is to train models that implicitly compare a query sequence with exemplar sequences. We thus propose a new pre-training objective over *multiple sequences*. We sample pairs of sequences from UniRef90 (Suzek et al., 2015), approximating a uniform distribution over sequence similarity buckets. We then implement a version of the span denoising objective of Raffel et al. (2020). We mask the sequences by randomly replacing approximately 10% of residues with a placeholder index. The prediction target consists of predicting the masked residues as well as the similarity score between the two sequences. As a simple and easy to compute measure of sequence similarity, we use Levenshtein distance normalized by the sequence length, bucketed to the nearest multiple of 5. Intuitively, the prediction target encourages the model to learn to approximately align and compare the two input sequences. We then expect the model to implicitly learn a more task-specific notion of similarity during fine-tuning. Pre-trained checkpoints are shared across all tasks that we study. See Appendix A.2 for details and §4 for analysis.
+
+**Fine-tuning** For each sequence $x$ and corresponding set of annotated labels $y \subset \mathcal{L}$ in the training set, we create both positive and negative examples, with targets $p$ and $n$ , respectively. We generate a positive example for every label $\in y$ , and negative examples corresponding to labels $\notin y$ .5 We determine the retrieval-augmented input sequence as described in §3.1. The only difference is how we select positive and negative exemplars, $\mathcal{E}_{x,l}^p$ and $\mathcal{E}_{x,l}^n$ , from the ranked list of related sequences, $\mathcal{N}_x$ .6 We evaluated top- $k$ (as used at inference time), uniform, and geometric sampling (Pasupat et al., 2021).7 Uniform or geometric sampling leads to greater diversity in the training data compared to training for multiple epochs over data generated using deterministic top- $k$ selection. Also, for cases where the training and evaluation sequences are not from the same distribution, such sampling can better align the distribution between query sequences and exemplar sequences seen at training time with the distribution seen at inference time. More analysis is given in §4.5.
+
+5See Appendix B.6 for details of how negative examples are sampled, and a discussion of class imbalance.
+
+6At training time we also need to ensure the query sequence $x$ is excluded from the ranked list of related sequences.
+
+7Geometric sampling samples the $j$ th element with probability $\propto p(1-p)^{(j-1)}$ , where parameter $p$ provides interpolation between top- $k$ and uniform sampling.
+
+{5}------------------------------------------------
+
+## 4 EXPERIMENTS AND ANALYSIS
+
+We compare the performance of ProtEx with other approaches (§4.2) across several EC, GO, and Pfam classification tasks (§4.1), with results reported in §4.3 and §4.4. Finally, in §4.5, we report additional analysis and ablations. Further details and results can be found in Appendices B and C.
+
+### 4.1 TASKS AND DATASETS
+
+Table 1: **Dataset Statistics.** We consider prediction of EC numbers, GO terms, and Pfam families across several settings proposed in prior work. We report the number of unique classes among the training sequences, and the average number of classes per sequence.
+
+| Name | Labels | Training Sequences | Classes | Avg. # Classes Per Seq. |
+|-|-|-|-|-|
+| Random EC | EC | 438,522 | 4,862 | 1.89 |
+| Random GO | GO | 438,522 | 31,365 | 45.49 |
+| Clustered EC | EC | 182,965 | 3,411 | 1.90 |
+| Clustered GO | GO | 182,965 | 26,538 | 45.57 |
+| NEW-392 | EC | 227,362 | 5,242 | 1.06 |
+| Price-149 | EC | 227,362 | 5,242 | 1.06 |
+| PDB EC | EC | 15,551 | 538 | 1.67 |
+| Clustered Pfam | Pfam | 1,296,280 | 17,929 | 1 |
+
+We consider several EC number, GO term, and Pfam prediction tasks summarized in Table 1. Some additional details are provided in Appendix B.
+
+For EC and GO prediction, we adopt the random and clustered splits from Sanderson et al. (2023). These splits consist of proteins and their corresponding annotations from Swiss-Prot, the manually curated portion of UniProt (Consortium, 2015). For the random split, approximately 80% of proteins were reserved for training, with 10% each assigned to the development and test sets. For the more challenging clustered split, proteins were divided evenly into train, development, and test sets based on UniRef50 clusters (Suzek et al., 2015), such that proteins in the development and test sets have lower sequence similarity with those in the training set than a random split.
+
+To better compare our results on EC prediction with prior work, we also consider several other evaluations. First, we evaluate EC prediction on the setting proposed in Yu et al. (2023b). Similarly to Sanderson et al. (2023), this setting uses sequences from Swiss-Prot for training. There are two evaluation sets, NEW-392 and Price-149. While the training data contains sequences added to Swiss-Prot prior to April 2022, New-392 consists of 392 enzyme sequences added after this date, forming a temporal split. Price-149, originally curated by Sanderson et al. (2023), consists of 149 sequences with EC numbers determined experimentally by Price et al. (2018). These sequences were inconsistently labeled by automated annotation methods, indicating a challenging setting. Second, we also adopt the PDB-based dataset proposed by Gligorijević et al. (2021). In contrast to the other EC splits based on sequences from Swiss-Prot, this dataset focuses on proteins with experimentally determined structures in PDB (Berman et al., 2000). Therefore, the training set is considerably smaller. Notably, our method does not require structural information, but we nevertheless evaluate on this setting to compare with prior work.
+
+Finally, we also evaluate on the Pfam seed dataset (Finn et al., 2014) where the goal is to map each protein sequence to one of 17,929 families. We use the clustered split as defined by Bileschi et al. (2022) where sequences in the development and test sets have less than 25% sequence identity to those in the training set.
+
+### 4.2 BASELINES
+
+For each task we consider three types of baselines. First, we consider the strongest performing neural models and other methods from prior work. Second, to determine the impact of retrieving and conditioning on exemplars, we evaluate ProtEx when no exemplars are included during fine-tuning and inference. Third, we report results for BLAST, following the setting of Sanderson et al. (2023), which imputes the labels from the most similar sequence returned by BLAST if the score is above
+
+{6}------------------------------------------------
+
+Table 2: Max F1 scores for EC and GO prediction on the random and clustered SwissProt-based splits proposed by Sanderson et al. (2023).
+
+| Method | EC | | GO | |
+|-|-|-|-|-|
+| | Random | Clustered | Random | Clustered |
+| ProteinInfer | 0.977 | 0.914 | 0.885 | 0.782 |
+| ProteinInfer (ensemble) | 0.981 | 0.930 | 0.899 | 0.811 |
+| BLAST | 0.984 | 0.950 | 0.902 | 0.824 |
+| ProtEx | 0.987 | 0.958 | 0.917 | 0.854 |
+| ProtEx (no exemplars) | 0.977 | 0.944 | 0.786 | 0.754 |
+
+an alignment score threshold. In some cases, our BLAST results are stronger than those reported by prior work due to this thresholding. Notably, this BLAST baseline frequently outperforms the strongest neural methods from prior work, highlighting the importance of including such baselines, as well as motivating methods such as ProtEx that can combine the strengths of similarity-search methods such as BLAST with pre-trained neural models.
+
+### 4.3 EC AND GO MAIN RESULTS
+
+Here we report results on several EC and GO classification tasks. We used up to 2 positive and 2 negative exemplars. See Appendix B for further details and Appendix C.1 for the statistical significance of key comparisons (tested differences are significant with $p$ -values $< 0.01$ ).
+
+First, we report results in Table 2 for the random and clustered EC and GO splits proposed by Sanderson et al. (2023). We follow Sanderson et al. (2023) and report the maximum micro-averaged F1 score. We compare with a single-model and ensembled versions of ProteinInfer (Sanderson et al., 2023), a CNN-based model. Our BLAST result reproduces that of Sanderson et al. (2023), which outperforms ProteinInfer. ProtEx also improves over BLAST, with performance dropping considerably if exemplars are not included in the input during fine-tuning and inference. The precision and recall curves of ProtEx relative to BLAST are shown in Figure 4, demonstrating improvements in precision at all recall values.
+
+Second, we report in Table 3 results on the NEW-392 and Price-149 evaluations proposed by Yu et al. (2023b), and compare with their proposed method, CLEAN. As there is no development set provided in this setting, we used the hyperparameters determined for the clustered EC task, and compare results based on the weighted AUC metric reported by Yu et al. (2023b), which does not require selecting a score threshold. We see that ProtEx improves over both CLEAN and BLAST. Again, ablating exemplars leads to a drop in performance. Additionally, we report F1 results in Appendix C.3.3.
+
+Finally, we also report results on the PDB-based split proposed by Gligorijević et al. (2021) in Table 4. Following prior work, we report the maximum protein-centric F1 score (i.e. $F_{\max}$ ), and stratify results by the maximum similarity between test sequences and training sequences. Table 4 includes results for the strongest methods from prior work. We report results for DeepFRI from Gligorijević et al. (2021), ESM-1b (Rives et al., 2021) and GearNet from Zhang et al. (2022), ESM-GearNet from Zhang et al. (2023), PromptProtein from Wang et al. (2023), ProtST from Xu et al. (2023), and
+
+Table 3: Weighted AUC for EC prediction for NEW-392 and Price-149.
+
+| Method | NEW-392 | Price-149 |
+|-|-|-|
+| CLEAN | 0.740 | 0.733 |
+| BLAST | 0.788 | 0.691 |
+| ProtEx | 0.932 | 0.842 |
+| ProtEx (no ex.) | 0.926 | 0.839 |
+
+Table 4: Max protein-centric F1 for EC prediction on PDB-based split.
+
+| Method | PDB EC | | |
+|-|-|-|-|
+| | 30% | 50% | 95% |
+| DeepFRI | 0.470 | 0.545 | 0.631 |
+| ESM-1b | 0.737 | 0.797 | 0.864 |
+| GearNet MVC | 0.744 | 0.808 | 0.874 |
+| ESM-GearNet | — | — | 0.890 |
+| PromptProtein | 0.765 | 0.823 | 0.888 |
+| ProtST (ESM-2) | — | — | 0.878 |
+| ESM-2 (adapter) | — | — | 0.892 |
+| PST (ESM-2) | — | — | 0.899 |
+| BLAST | 0.801 | 0.848 | 0.900 |
+| ProtEx | 0.820 | 0.862 | 0.909 |
+| ProtEx (no ex.) | 0.717 | 0.777 | 0.849 |
+
+{7}------------------------------------------------
+
+
+
+Figure 4: Precision and recall of ProtEx and BLAST on the clustered EC and GO tasks. The figure contains two line plots. The left plot is for 'Clustered EC' and the right plot is for 'Clustered GO'. Both plots show Precision on the y-axis (ranging from 0.80 to 1.00) and Recall on the x-axis (ranging from 0.80 to 1.00). Two lines are plotted: a solid blue line for 'Ours' (ProtEx) and a dashed orange line for 'BLAST'. In both plots, the 'Ours' line starts at a precision of 1.00 and remains high until recall approaches 1.00, where it drops sharply. The 'BLAST' line starts at a lower precision (around 0.98 for EC and 0.88 for GO) and remains relatively flat until recall approaches 1.00, where it also drops sharply. In the 'Clustered GO' plot, the 'Ours' line is consistently above the 'BLAST' line for most recall values.
+
+Figure 4: Precision and recall of ProtEx and BLAST on the clustered EC and GO tasks.
+
+ESM-2 (Lin et al., 2023) with a classifier head and PST from Chen et al. (2024). Perhaps surprisingly, we see that BLAST with an alignment score threshold achieves a very competitive result on this setting. Regardless, ProtEx outperforms BLAST and other previously reported results on this setting, including ESM-2 (a 15B parameter model), other models based on ESM-2 (ESM-GearNet, ProtST, and PST), and approaches that explicitly consider structural information. Ablating exemplars again demonstrates the significance of conditioning on exemplars. For future work, improvements from pre-training scale (e.g. ESM-2) and incorporating structural information and other resources (e.g., GearNet, ProtST, PST, PromptProtein) could be complementary to our retrieval-augmented approach.
+
+### 4.4 PFAM MAIN RESULTS
+
+For the Pfam dataset, we use an alternative to BLAST for selecting similar sequences, detailed in Appendix B.5. The Pfam dataset is considerably larger than the other datasets (see Table 1), and running BLAST for all examples in the training set can take considerable time. Moreover, BLAST does not achieve as strong of a result for Pfam classification as it does for the EC and GO tasks. Therefore, we implemented an alternative retrieval system that can be more easily parallelized and customized than BLAST. For every sequence, we select a set of similar sequences for each class independently. For efficiency, we randomly select up to a maximum number of sequences per class in the training set, and then rank these sequences according to a local alignment score that is similar to the one computed by BLAST. Based on analysis of the effect of restricting the number of classes (see Appendix C.4.1), we opted to consider all classes as candidate labels. We also evaluated this strategy for EC prediction although it did not perform as well as our BLAST-based approach (see Appendix C.3.2). We use 4 positive exemplars and zero negative exemplars, since we found in our early experiments that additional positive exemplars added more benefit.
+
+Table 5: **Results on the Pfam clustered split.** Sequences in the test set have less than 25% sequence identity to the training set.
+
+| Method | Family Accuracy | Lifted Clan Accuracy | Avg. Per-Family Accuracy |
+|-|-|-|-|
+| Top pick HMM | 81.9 | 88.1 | 82.9 |
+| BLAST | 64.1 | 70.1 | 63.7 |
+| ProtENN | 87.8 | 89.0 | 80.4 |
+| ProtNLM | 87.4 | 90.7 | 80.6 |
+| ProtTNN | 88.4 | 90.5 | 83.4 |
+| ProtTNN (ensemble) | 89.7 | 91.7 | 85.0 |
+| ProtEx | 92.6 | 93.3 | 91.7 |
+| ProtEx (no exemplars) | 76.3 | 80.2 | 65.7 |
+
+We compare ProtEx with two strong homology-based approaches (BLAST and Top pick HMM, as described in Dohan et al. (2021)), ProtENN (Bileschi et al., 2022) a convolutional neural network ensemble, and ProtNLM (Gane et al., 2022) and ProtTNN (Dohan et al., 2021), which are pretrained Transformer models. For the no exemplar ablation, we found that predicting a binary label without exemplars generalizes poorly when the number of classes is large, and so we instead finetune our pretrained checkpoint to predict the class label as a string given the sequence, which we found performed better. See Appendix § C.4.2 for further discussion.
+
+{8}------------------------------------------------
+
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+
+Results are shown in Table 5. We report family accuracy, lifted clan accuracy that groups families into higher level clans (Dohan et al., 2021), and the average per-family accuracy, which gives equal weight to all classes, including rare classes. Our approach achieves state-of-the-art performance by a considerable margin. Additionally, as shown in Figure 5, while other methods typically show lower performance for examples with rare labels, ProtEx demonstrates more consistent performance across training set family sizes, showcasing large improvements for examples belonging to rare families. See Appendix C.4.3 for further stratified performance analysis, showing that our method performs well across sequences that have low similarity with the closest sequence in the training data, and that similar trends are observed at the lifted clan level.
+
+
+
+Figure 5: A line graph titled 'Test set family accuracy by training family size'. The x-axis is 'Training set family size (ticks are bin boundaries)' with values 1, 17, 29, 42, 58, 79, 104, 149, 237, 402, 2197. The y-axis is 'family accuracy' from 0.7 to 1.0. Four methods are plotted: ProtEx (Ours) (blue squares), ProTNN (orange diamonds), ProtENN (green triangles), and Top pick HMM (red circles). ProtEx maintains high accuracy (~0.9) across all family sizes. ProTNN and ProtENN show lower accuracy, especially at smaller family sizes, and fluctuate. Top pick HMM shows the lowest accuracy, generally below 0.85.
+
+Figure 5: **Pfam stratified family accuracy.** ProtEx shows considerably improved performance for sequences belonging to rare labels.
+
+### 4.5 ANALYSIS AND ABLATIONS
+
+Table 6: **Generalization to Unseen Labels.** Max F1 on clustered EC and GO when a randomly selected subset of labels are not included during fine-tuning.
+
+| Method | EC | | GO | |
+|-|-|-|-|-|
+| | Seen | Unseen | Seen | Unseen |
+| BLAST | 0.953 | 0.964 | 0.826 | 0.816 |
+| ProtEx | 0.960 | 0.970 | 0.849 | 0.839 |
+
+Table 7: **Pre-training Ablations.** We report F1 on Clustered EC development split for different pre-training strategies.
+
+| Pre-training | F1 |
+|-|-|
+| Sequence pair w/ score | 0.958 |
+| Sequence pair | 0.956 |
+| Single sequence | 0.952 |
+| No pre-training | 0.912 |
+
+**Generalization to New Labels** We tested the ability of ProtEx to make predictions for new classes not seen during fine-tuning. On the EC and GO clustered splits we randomly removed 10% of classes during fine-tuning, while retaining the ability to retrieve sequences annotated with these classes at inference time. As shown in Table 6, ProtEx performs comparably or better than BLAST even on classes it has not seen during training. Relatedly, we also found that there is only a minimal performance decrease when candidate labels are not included in the model input (see Appendix C.3.1), further indicating that the model is conditioning its predictions on the exemplar sequences as opposed to directly representing the sequence to class relationship in the model parameters.
+
+**Pre-training Analysis** We show results for ablating the key elements of our pre-training recipe in Table 7. Notably, there is a drop in end task performance when pre-training with only a single sequence as input, as commonly done in prior work, as opposed to pre-training over sequence pairs. This indicates that our pre-training task is useful for retrieval-augmented models that are fine-tuned to make comparisons across multiple sequences. See Appendix B.4 for further details.
+
+**Model Architectures and Scaling** In Appendix C.2 we compare Small and Base sized models, finding that there is a modest benefit to increasing model size from Small to Base. We also compare the Fusion-in-Decoder (FiD) approach introduced by Izacard & Grave (2021) with a standard Transformer, finding that this may be viable path towards scaling to more exemplars, but that there is a performance drop, indicating that cross-attention between exemplar sequences is beneficial.
+
+{9}------------------------------------------------
+
+**Exemplar Distribution and Sampling** As described in §3, we study different sampling strategies to select exemplars during training. This adds diversity to the training data, and can also help align the distribution of similarities between query and exemplar sequences seen during training with those seen during inference, which is especially useful for non-random splits. We highlight this capability on the Pfam task, which features the largest distributional shift between training and inference due to the split restricting inference sequences to have <25% sequence similarity to the training set. Figure 6 shows the corresponding distribution of similarities between query and exemplar sequences and its impact on out-of-distribution generalization as measured by family accuracy on development set.
+
+
+
+| Split | Sampling | Family Acc. |
+|-|-|-|
+| Train | top-k | 89.39 |
+| Train | geometric (p=0.5) | 89.18 |
+| Train | geometric (p=0.1) | 91.45 |
+| Train | uniform | 91.85 |
+| Eval | top-k | - |
+
+Figure 6: Pfam Exemplar Sampling Strategies. A line graph showing the fraction of exemplars with an alignment score greater than a threshold (y-axis, 0.00 to 1.00) versus the alignment score threshold (x-axis, 10^2 to 10^3 on a log scale). Five curves are shown: Train top-k (solid blue), Train geometric (p=0.5) (dashed orange), Train geometric (p=0.1) (dash-dot green), Train uniform (dashed red), and Eval top-k (solid purple). The Eval top-k curve is the highest, followed by Train top-k, then Train geometric (p=0.1), Train geometric (p=0.5), and Train uniform which is the lowest.
+
+Figure 6: **Effect of exemplar sampling strategy on Pfam.** We visualize how different sampling strategies can mitigate the distribution shift between training and evaluation. Uniform sampling leads to the training distribution most similar to the evaluation distribution, and also leads to the highest family accuracy on the development set.
+
+## 5 LIMITATIONS AND DISCUSSION
+
+**Computational Requirements** While we use a model size and number of pre-training steps comparable to or less than prior work (Appendix B.3), the cost of inference with our method is potentially larger due to encoding multiple protein sequences and making independent predictions for each class. To mitigate these factors, we have considered the FiD architecture (Appendix C.2) and a candidate label generator (§3), which offer a path towards more efficient inference. Regardless, improvements in accuracy and robustness can justify an increase in computational cost for some applications, given the much greater cost of running wet-lab experiments to annotate protein function.
+
+**Scope and Future Work** In this work we focused on training and inference procedures that can effectively condition predictions on retrieved exemplars, using a general-purpose Transformer architecture and standard methods for retrieval (e.g. BLAST). Going forward, our approach could potentially be further improved using enhanced similarity search techniques such as those based on protein structure (Zhang et al., 2022; Hamamsy et al., 2023; Van Kempen et al., 2024) and more specialized architectures. Finally, we focused on predicting EC, GO, and Pfam labels. Other tasks such as fitness prediction (Romero et al., 2013) or generating free-text descriptions of protein function (Gane et al., 2022; Abdine et al., 2024) could be of interest for future work.
+
+**Broader Impact and Ethical Considerations** Our method enables more accurate and robust prediction of protein functional annotations. Any computationally derived annotation should be verified by wet lab experiments where possible, especially for critical applications. Our method extends a long history of prior work that develops such tools and the community’s safeguards for how to apply them in an ethical manner applies here as well.
+
+## 6 CONCLUSION
+
+We proposed ProtEx, a semiparametric approach that combines aspects of homology-based similarity search with pre-trained neural models. ProtEx achieves state-of-the-art results on EC, GO, and Pfam classification tasks. Our work highlights the potential of retrieval-augmented methods for improving the accuracy and robustness of protein function prediction.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/bGkPZtisSm.txt b/papers/bGkPZtisSm.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a2cf0e9ea59955f0346b0466151f02040a809b56
--- /dev/null
+++ b/papers/bGkPZtisSm.txt
@@ -0,0 +1,239 @@
+**Primary Area:** foundation or frontier models, including LLMs
+
+
+
+{0}------------------------------------------------
+
+# ON THE GENERALIZATION OF PREFERENCE LEARNING WITH DPO
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Large language models (LLMs) have demonstrated remarkable capabilities but often struggle to align with human preferences, leading to harmful or undesirable outputs. Preference learning, which trains models to distinguish between preferred and non-preferred responses based on human feedback, has become a crucial component for ensuring that LLMs align with human values. Despite the widespread adoption in real-world systems, a thorough theoretical understanding of the generalization guarantees for these models remains lacking. This paper bridges that gap by introducing a new theoretical framework to analyze the generalization guarantees of models trained with direct preference optimization. While existing generalization theory often focuses on overparameterized models achieving near-optimal loss or models independent of the training process, our framework rigorously assesses how well models generalize after a finite number of gradient steps, reflecting real-world LLM training practices. By analyzing the reward margin associated with each sample and its trajectory throughout training, we can effectively bound the generalization error. We derive learning guarantees showing that, under specific conditions, models trained with DPO can correctly discern preferred responses on unseen data with high probability. These insights are empirically validated on contemporary LLMs, underscoring the practical relevance of our theory.
+
+## 1 INTRODUCTION
+
+Large language models (LLMs) have demonstrated remarkable abilities to generate human-like text and acquire diverse capabilities (Brown et al., 2020; Wei et al., 2022; Anil et al., 2023). However, these models are not necessarily aligned with human preferences and can inadvertently produce harmful or undesirable outputs. Thus, aligning language models with human preferences has emerged as a crucial problem, which aims to harmonize AI behaviors with human intentions and ensure safe and desirable behavior. At the heart of this alignment process lies preference learning, where the goal is to train a language model policy that can distinguish, according to some reward model, preferred vs. non-preferred responses based on human feedback. Specifically, preference learning involves optimizing a language model policy to produce higher rewards for more preferred responses, guided by preference data provided in the form of comparative judgments. Despite the empirical success in real-world systems (OpenAI, 2023; Anthropic, 2023; Touvron et al., 2023), theoretical analysis of preference learning, particularly in the context of alignment, is still in its early stages and remains largely underdeveloped. A rigorous understanding of how preference learning affects LLM behaviors and generalization guarantees has not been studied. This paper aims to fill the critical gap.
+
+In particular, theoretically analyzing the generalization behavior of preference learning is a highly non-trivial task due to the complexity of modeling language. Existing generalization theories (Attias et al., 2019; Dziugaite & Roy, 2017; Lei et al., 2019; Valle-Pérez & Louis, 2020) are not directly applicable because they typically consider simpler learning tasks such as regression and classification, where the output is either a scalar or categorical label. In contrast, training language models entails dealing with the output space of sentences, which is considerably more complex. Moreover, existing generalization theory typically considers overparameterized models that achieve near-optimal loss (Allen-Zhu et al., 2019; Cao & Gu, 2020; Subramanian et al., 2022; Arora et al., 2019) or are independent of the training process (Arora et al., 2018; Lotfi et al., 2022; 2023). This does not match real-world practices, where large language models are often fine-tuned for a limited number of gradient steps. This discrepancy
+
+{1}------------------------------------------------
+
+suggests the need for a new theoretical framework that can capture the intricacies of preference learning methods and the unique challenges posed by aligning language models.
+
+To address the challenges, we provide a new theoretical framework designed to analyze the generalization guarantees for models trained with preference optimization loss (Rafailov et al., 2023). Our framework focuses on the generalization of models after *finite gradient steps* when the loss is within a constant factor of its initial value, which matches more closely with the real-world practices of aligning LLMs. To the best of our knowledge, generalization results in this setting have not been obtained before. Under our framework, we can rigorously characterize the conditions under which the model can correctly discern between preferred and non-preferred outcomes on future unseen sample. Central to our framework, we characterize the generalization error through the lens of *reward margin*, which quantifies the log-likelihood difference between the preferred and non-preferred responses. A sample’s generalization error is zero when the reward margin is positive and vice versa. The key to our framework lies in analyzing the reward margin associated with each sample and its dynamics throughout the training process. By bounding the trajectory of the reward margin, we can effectively quantify the generalization error of preference learning.
+
+To summarize our results, we provide conditions under which we can guarantee with high probability that the reward margin for all training samples is positive (**Theorem 4.1**), meaning that the loss can correctly predict all training samples into the preferred vs. non-preferred categories within finite gradient steps. Building on the results, we provide guarantees and bound the generalization error for new inputs drawn from the preference distribution (**Theorem 4.2**). Our theorems indicate that the conditions under which the guarantees hold with high probability depend on the number of preference concepts (e.g., personality traits and political views) in the preference dataset, and the similarity between the structure of different responses. Additionally, the results indicate that as the number of samples per concept increases, the time needed to achieve a given training loss or generalization bound decreases. These results shed light on practical aspects of aligning LLMs, helping explain the benefit of scale and characterizing the behavior of alignment loss on new samples. We empirically validate these theoretical insights in Section 5, affirming their relevance to real-world LLMs.
+
+We summarize our key contributions in the following:
+
+1. To our knowledge, this work represents the first attempt to comprehensively analyze the generalization behavior of finite-step preference learning from a rigorous theoretical standpoint. We introduce a novel theoretical framework specifically designed to examine the generalization properties of LLMs by approximating their reward dynamics (more in Section 3).
+2. We provide new learning guarantees on how DPO can correctly distinguish the preferences of training samples within finite gradient steps, and generalize to new input samples with provably high probability (more in Section 4).
+3. We empirically validate our findings on contemporary LLMs and preference datasets containing diverse behaviors, reinforcing our theoretical insights (more in Section 5).
+
+## 2 PRELIMINARIES
+
+**Notations.** We denote $\pi_\theta$ as a language model policy parameterized by $\theta$ , which takes in an input prompt $x$ , and outputs a discrete probability distribution $\pi_\theta(\cdot|x)$ over the vocabulary space $\mathcal{V}$ . $\pi_\theta(y|x)$ refers to the model’s probability of outputting response $y$ given input prompt $x$ . Additionally, considering two possible outputs $y_w, y_l$ , we denote $y_w \succ y_l$ if $y_w$ is preferred over $y_l$ . We call $y_w$ the preferred response and $y_l$ the less preferred response. Given an empirical dataset $\mathcal{D} = \{(x_i, y_{w,i}, y_{l,i})\}_{i=1}^N$ sampled from the preference distribution, an alignment algorithm aims to optimize the language model so that it can produce the desired response given a query. Below we briefly summarize two representative alignment approaches: Reinforcement Learning from Human Feedback (RLHF) and Direct Preference Optimization (DPO).
+
+**RLHF.** Reinforcement Learning from Human Feedback (RLHF) is a widely used paradigm for learning desirable behaviors based on human preferences (Christiano et al., 2017; Ouyang et al., 2022; Bai et al., 2022a; Ziegler et al., 2019). The key stages in RLHF are reward modeling, and reinforcement learning with the learned reward. Here we provide a brief recap of the two stages, respectively. During reward modeling, we aim to learn a function mapping, which takes in the prompt
+
+{2}------------------------------------------------
+
+$x$ and response $y$ and outputs a scalar value $r(x, y)$ signifying the reward. A preferred response should receive a higher reward, and vice versa. Under the Bradley-Terry model (Bradley & Terry, 1952), the preference distribution is modeled as $p^*(y_w > y_l | x) = \sigma(r^*(x, y_w) - r^*(x, y_l))$ , where $\sigma$ is the sigmoid function. Given the empirical dataset $\mathcal{D} = \{(x_i, y_{w,i}, y_{l,i})\}_{i=1}^N$ sampled from the preference distribution $p^*$ , we can learn the reward function via maximum likelihood estimation, which is equivalent to optimizing the following binary classification objective:
+
+$$\mathcal{L}_R = -\mathbb{E}_{(x, y_w, y_l) \in \mathcal{D}} [\log \sigma(r(x, y_w) - r(x, y_l))]. \quad (1)$$
+
+Using the learned reward function, the model is fine-tuned with reinforcement learning to maximize the following objective
+
+$$R(\pi_\theta) = \mathbb{E}_{x \sim \mathcal{D}} \left[ r(x, \hat{y}) - \beta \log \frac{\pi_\theta(\hat{y}|x)}{\pi_{\text{ref}}(\hat{y}|x)} \right], \quad (2)$$
+
+where $\hat{y}$ is the output generated by the current model’s policy $\pi_\theta$ for the prompt $x$ , $\pi_{\text{ref}}$ is the policy of the model before any steps of RLHF, and $\beta$ is a hyperparameter. We can view this objective as maximizing the expected reward with KL regularization weighted by $\beta$ .
+
+**DPO.** Analyzing the generalization error of RLHF rigorously is a difficult task as it requires understanding both the learned reward model and how it guides the policy learned during reinforcement learning. Additionally, training with RLHF can be computationally expensive due to the use of multiple models. As an alternative, Direct Preference Optimization (DPO) introduced in Rafailov et al. (2023) directly optimizes for the policy best satisfying the preferences with a simple objective:
+
+$$\mathcal{L}_{\text{DPO}}(\pi_\theta; \pi_{\text{ref}}; \mathcal{D}) = -\mathbb{E}_{(x, y_w, y_l) \in \mathcal{D}} \left[ \log \sigma \left( \beta \left( \log \frac{\pi_\theta(y_w|x)}{\pi_{\text{ref}}(y_w|x)} - \log \frac{\pi_\theta(y_l|x)}{\pi_{\text{ref}}(y_l|x)} \right) \right) \right].$$
+
+Rafailov et al. (2023) showed that under mild assumptions, the optimal policy under the DPO objective (3) is the same as the optimal policy under the RLHF objective (2).
+
+## 3 A THEORETICAL FRAMEWORK BASED ON REWARD DYNAMICS
+
+**Framework overview under practical considerations.** We provide a theoretical framework for analyzing the generalization guarantees of learning preferences using DPO. Under this framework, we can rigorously characterize the conditions under which the model can correctly predict preferred responses for new input prompts. While existing generalization theory typically considers overparameterized models that achieve near-optimal loss (Allen-Zhu et al., 2019; Arora et al., 2019; Cao & Gu, 2020; Subramanian et al., 2022) or are independent of the training process (Arora et al., 2018; Lotfi et al., 2022; 2023), we consider the generalization of models after *finite gradient steps* when the loss is within a constant factor of its initial value. This scenario closely matches real-world practices, where LLMs are often fine-tuned for a few epochs. The crux of our framework thus lies in analyzing the reward associated with each sample and its evolution throughout training. Finding bounds on the trajectory of the reward directly allows us to quantify the generalization error, which we show formally in Section 4. We proceed to describe our setup in detail.
+
+### 3.1 SETUP
+
+**Model.** We define the model output at the end of the prompt, $x$ , to be $f_\theta(x) = \text{softmax}(W_U g(x))$ , where $g: \mathcal{V}^T \mapsto \mathbb{R}^d$ is the mapping from the prompt to the final hidden state, and $W_U \in \mathbb{R}^{|\mathcal{V}| \times d}$ is the unembedding layer matrix or the model head. The model output is a distribution over tokens. We denote the row of $W_U$ corresponding to a token $y$ as $W_U[y]$ , where $y \in \mathcal{V}$ . We first focus on this model, which corresponds to a fixed backbone, to manage tractability while still extracting valuable insights into preference learning. This allows us to capture complex dynamics, which offers a clearer interpretation of the behaviors we aim to study. Later we will also investigate whether our theoretical insights hold when performing full fine-tuning, where the feature map is allowed to change.
+
+**Reward margin.** Given the empirical dataset $\mathcal{D} = \{(x_i, y_{w,i}, y_{l,i})\}_{i=1}^N$ sampled from the preference distribution, we train the model using the empirical DPO loss, which can be rewritten as:
+
+$$\mathcal{L}_{\text{DPO}} = -\frac{1}{N} \sum_{i=1}^N \log \sigma \left( \underbrace{\beta \left( \log \frac{f_\theta(y_{w,i}|x_i)}{f_\theta(y_{l,i}|x_i)} - \log \frac{f_{\text{ref}}(y_{w,i}|x_i)}{f_{\text{ref}}(y_{l,i}|x_i)} \right)}_{\text{Reward Margin}} \right), \quad (3)$$
+
+{3}------------------------------------------------
+
+where $y_{w,i}$ corresponds to the preferred response for $x_i$ and $y_{l,i}$ corresponds to the non-preferred response, and $f_{\text{ref}}$ is the base model. We will refer to each triplet of $(x_i, y_{w,i}, y_{l,i})$ as a *preference*. From Equation 3, we can see that the DPO objective implicitly learns a reward model, and the preference is correctly learned if
+
+$$r(x_i, y_{w,i}, y_{l,i}) = \beta \left( \log \frac{f_\theta(y_{w,i}|x_i)}{f_\theta(y_{l,i}|x_i)} - \log \frac{f_{\text{ref}}(y_{w,i}|x_i)}{f_{\text{ref}}(y_{l,i}|x_i)} \right) > 0,$$
+
+which we call the *reward margin*. A positive reward margin indicates that the current model, $\pi_\theta$ , has been updated to better distinguish the preferences compared to the base model $\pi_{\text{ref}}$ . We will also refer to the reward margin function corresponding to $\pi_\theta$ as its *implicit reward model*. Under the notion of reward margin, the DPO training objective can be interpreted as a convex smooth loss function to approximate the 0-1 loss: $\max_{\pi_\theta} \mathbb{E}_{(x,y_w,y_l) \in \mathcal{D}} \mathbb{I}[r_{\pi_\theta}(x, y_w, y_l) > 0]$ . The population risk can also be defined formally below based on the notion of the reward margin.
+
+**Definition 3.1 (Population Risk of Preference Learning)** We define the population risk in terms of a 0-1 loss where a sample's loss is 0 when the reward margin is positive and 1 otherwise.
+
+$$\mathcal{R}(x, y_w, y_l) = \begin{cases} 0 & r(x, y_w, y_l) > 0 \\ 1 & r(x, y_w, y_l) \leq 0 \end{cases}$$
+
+where $r(x, y_w, y_l)$ is the reward margin for a new sample $(x, y_w, y_l)$ . Then, given a joint preference distribution $\mathcal{P}$ where $(x, y_w, y_l)$ is sampled from, the population risk with respect to $\mathcal{P}$ is
+
+$$\mathcal{R}(\mathcal{P}) = \mathbb{E}_{(x,y_w,y_l) \sim \mathcal{P}} [\mathcal{R}(x, y_w, y_l)]. \quad (4)$$
+
+The population risk provides a clear interpretation in the context of preference learning, which directly captures and quantifies how often the model can correctly discern between preferred and non-preferred outcomes on future unseen samples. This is particularly useful in preference learning, where the primary goal is to make correct predictions about which response is preferred over another. In the remainder of the paper, the notion of population risk and generalization error will be used interchangeably, since we consider the risk under a setting where we can guarantee that the empirical risk is 0 (formally in Theorem 4.1).
+
+### 3.2 REWARD DYNAMICS
+
+Our theory revolves around analyzing how the reward margin changes over the course of training, which allows us to bound the generalization error after finite-step DPO updates. A standard setup for training is to apply gradient descent, in which case, the dynamics of the weight matrix $W$ at step $t$ is:
+
+$$W(t+1) - W(t) = \frac{\eta}{N} \sum_{i=1}^N \beta \sigma(-\beta(\mathbf{y}_{w,i} - \mathbf{y}_{l,i})^\top (W(t) - W_0)g(x_i))(\mathbf{y}_{w,i} - \mathbf{y}_{l,i})g(x_i)^\top, \quad (5)$$
+
+where $W_0$ is the initial weight in the reference policy $\pi_{\text{ref}}$ and $\eta$ is the learning rate. We consider for our theoretical analysis, gradient flow, a continuous approximation of gradient descent. To follow the reward margins during training, we begin by deriving the dynamics of the weight matrix $W$ under gradient flow:
+
+$$\tau \dot{W} = \frac{1}{N} \sum_{i=1}^N \beta \sigma(-\beta(\mathbf{y}_{w,i} - \mathbf{y}_{l,i})^\top (W - W_0)g(x_i))(\mathbf{y}_{w,i} - \mathbf{y}_{l,i})g(x_i)^\top, \quad (6)$$
+
+where $\tau$ determines the rate of change, where a larger $\tau$ corresponds to a slower rate of change. To ensure clarity in our exposition and elucidate the key insight, we first illustrate the derivation when the preferred response $y_{w,i}$ and non-preferred response $y_{l,i}$ consist of a token, encoded by the one-hot vector $\mathbf{y}_{w/l,i} \in \mathbb{R}^{|V|}$ . Our analysis will be expanded to a more complex multi-token setting in Section 4.
+
+Let $\Delta W = W - W_0$ , a constant offset from $W$ , we have:
+
+$$\tau \dot{\Delta W} = \sum_{i=1}^N \underbrace{\beta \sigma(-\beta(\mathbf{y}_{w,i} - \mathbf{y}_{l,i})^\top \Delta W g(x_i))}_{\text{Reward margin for } x_i} (\mathbf{y}_{w,i} - \mathbf{y}_{l,i})g(x_i)^\top, \quad (7)$$
+
+{4}------------------------------------------------
+
+which contains the term of the reward margin. Since $\beta, \mathbf{y}_{w,j}, \mathbf{y}_{l,j}, x_j$ are fixed, we can consider the flow of the reward margin by multiplying $\beta(\mathbf{y}_{w,j} - \mathbf{y}_{l,j})^\top$ on the left and multiplying $g(x_j)$ on the right of $\tau \dot{W}$ . This yields the dynamics for the reward margin:
+
+$$\tau \dot{r}_j = \frac{1}{N} \sum_{i=1}^N \beta^2 \sigma(-r_i) (\mathbf{y}_{w,j} - \mathbf{y}_{l,j})^\top (\mathbf{y}_{w,i} - \mathbf{y}_{l,i}) \Sigma_{ij}, \quad (8)$$
+
+where $r_i$ is the shorthand notation for reward margin of sample $x_i$ , and $\Sigma$ is the sample covariance matrix with $\Sigma_{ij} = g(x_i)^\top g(x_j)$ .
+
+We can extend this analysis beyond the training samples to *any possible input*. Consider a new triplet $(\tilde{x}, \tilde{y}_w, \tilde{y}_l)$ and let $\tilde{r}$ be its reward margin. While we do not train on this input, we can still follow its reward trajectory to derive the dynamics, which is given by
+
+$$\tau \dot{\tilde{r}} = \frac{1}{N} \sum_{i=1}^N \beta^2 \sigma(-r_i) (\tilde{y}_w - \tilde{y}_l)^\top (\mathbf{y}_{w,i} - \mathbf{y}_{l,i}) g(\tilde{x})^\top g(x_i). \quad (9)$$
+
+We can see that the reward dynamics of the new sample has a form similar to that of the training samples. This connection will allow us to extend an analysis of the training samples to guarantee the generalization error, which we present formally in Section 4.
+
+**Interpretation of reward dynamics.** The expressions for the reward margin gradient in Equation (8) and Equation (9) allow us to easily check and interpret how each training sample influences the learning of the reward for a training sample $x_i$ and any new sample $\tilde{x}$ . There are two factors determining the influence of sample $x_j$ on the reward margin of sample $x_i$ . **(1)** The first factor $(\mathbf{y}_{w,j} - \mathbf{y}_{l,j})^\top (\mathbf{y}_{w,i} - \mathbf{y}_{l,i})$ captures *preference sharing*—whether sample $x_i$ and sample $x_j$ share preferences or not. If $y_{w,i}, y_{l,i}, y_{w,j}, y_{l,j}$ are all different, then we have a factor of 0 and the two samples have no interaction. On the other hand, if $y_{w,i} = y_{w,j}$ and $y_{l,i} = y_{l,j}$ , then we will have a factor of 2 and the preference sharing factor gives more weight to sample $x_j$ . **(2)** The second factor $\Sigma_{ij}$ captures the correlation between embedding of $x_i$ and $x_j$ , measured by a dot product. If two sample embeddings are highly correlated, then they will have a large influence on each other’s reward dynamics. If the two samples are orthogonal, then they will have no interaction.
+
+**Finding a tractable form.** From Equation (8), we note that the only factor on the right that changes over time is the set of $\sigma(-r_i)$ . Letting $C(x_i, x_j) = (\mathbf{y}_{w,j} - \mathbf{y}_{l,j})^\top (\mathbf{y}_{w,i} - \mathbf{y}_{l,i}) \Sigma_{ji}$ , we have
+
+$$\tau \dot{r}_j = \frac{1}{N} \sum_{i=1}^N \beta^2 \sigma(-r_i) C(x_i, x_j). \quad (10)$$
+
+Then, we can see that the system of differential equations for the set of $r_i(t)$ is actually only in terms of itself and constants, and as long as we enforce structure in the $C(x_i, x_j)$ factor, it becomes tractable to provide upper and lower bounds for $r_i(t)$ and therefore generalization error (cf. Definition 3.1). In the following section, we enforce this structure through preference distribution and provide generalization guarantees for preference learning.
+
+## 4 GENERALIZATION GUARANTEES
+
+### 4.1 CHARACTERIZING THE PREFERENCE DISTRIBUTION
+
+We characterize the preference distribution by modeling the input feature to the unembedding layer. Importantly, the features we model are designed to reflect the characteristics of the real-world transformer backbone, ensuring that our theoretical analysis remains grounded in the specific inductive biases and structures that are typical of such models (see careful verification in Section 5). Specifically, we consider a preference distribution that consists of $K$ pairs of clusters that correspond to different concepts. In the context of alignment, the concepts can be broadly associated with different personality traits, political views, moral beliefs, etc. For example, the concepts may encompass common properties such as helpfulness, honesty, and harmlessness (Bai et al., 2022a), and can also represent much more diversified and nuanced ones like conscientiousness, non-racism, compassion,
+
+{5}------------------------------------------------
+
+and so on (Perez et al., 2022). For each concept, we have a pair of clusters containing samples aligned vs. misaligned with that concept.
+
+To formalize, we consider a distribution $\mathcal{P}$ of $(x, y_w, y_l)$ that represents the set of clusters as a mixture of Gaussians with $K$ equally weighted pairs of clusters labeled with $i \in [K]$ . Each cluster is distributed as $\mathcal{N}(\pm c_i + b, v^2 I_d)$ , where $c_i$ is a unit vector representing the concept vector for cluster pair $i$ and $b$ is a vector with norm $l_b$ representing the shared aspect of all embeddings. Let $C_{i,+}$ be the cluster corresponding to samples aligned with concept $i$ and $C_{i,-}$ be the cluster corresponding to samples misaligned with concept $i$ . For simplicity, we can assume without loss of generality that $b = l_b e_1$ in the standard basis $e_1, \dots, e_d$ for $\mathbb{R}^d$ . Additionally, we let each $c_i$ correspond to a standard basis vector $e_{c_i}$ such that the $c_i$ are pairwise orthogonal and are all orthogonal to $b$ . The preferred and rejected response for all samples in a given cluster is fixed, and no two pairs of clusters have the exact same set of responses. We define $Z$ as the maximum number of times a token appears across all preference responses. To construct the empirical training data, we sample $Q$ i.i.d. samples from each cluster and there are total $N = 2KQ$ samples across $K$ clusters. We will verify in Section 5 that our data assumption matches closely the characteristics of real-world alignment datasets.
+
+### 4.2 RESULTS
+
+We first present a theorem that guarantees that the implicit reward model from DPO can correctly predict all training samples into the preferred vs. non-preferred categories. We state this formally below in Theorem 4.1.
+
+**Theorem 4.1 (Training Reward Guarantee)** Given $Z \leq \min\left(\frac{1}{4l_b^2}, Q^{1/4} - 2\right)$ , $d \leq 5Q$ , $v \leq \frac{1}{4\sqrt{Q}}$ , with probability at least $1 - 8KQ^{9/4} \exp\left(-\min\left(\frac{c\sqrt{Q}}{5}, \frac{Q^{3/4}}{256}\right)\right)$ for some constant $c > 0$ , the trajectory $r_i(t)$ for all $i \in [N]$ is upper bounded by $r^U(t)$ and lower bounded by $r^L(t)$ which are given by $r^L(t) = \frac{Q\beta^2}{4N\tau}t$ and $r^U(t) = \frac{10Q\beta^2}{N\tau}t$ for $t \leq \tau_1 = \frac{N\tau \log 3}{10Q\beta^2}$ and at $\tau_1$ , for any training sample $\frac{\log 3}{40} \leq r(t) \leq \log 3$ .
+
+**Theoretical insights.** Our result demonstrates that we can guarantee that the model correctly predicts all training samples within a finite time and that all reward margins are within a constant factor of each other. The time to achieve this guarantee is proportional to $N/dv^2\beta^2$ , indicating that more training is necessary as we consider more diverse concepts, and less training is needed as we strengthen the KL regularization1. We also note that the conditions under which this guarantee holds with high probability depend on the variance and amount of interaction between preferences, and these conditions change in the following ways:
+
+- As the embeddings share more common structure, which would result in an increase in $l_b$ , it becomes more difficult to guarantee the training samples are classified correctly when $Z$ or the amount of interaction between preferences increases.
+- As the number of clusters increases which results in an increase in $K$ , it becomes more difficult to guarantee the training samples are classified correctly and similarly when $v$ or the width of each cluster increases.
+- As the number of samples per cluster or $Q$ increases, the guarantee on the training samples becomes stronger and reduces the training time needed for the guarantee.
+
+Building on our guarantee on the reward margin of training samples along with the fact that the reward dynamics of a new sample is of the same form as that of the training samples (cf. Equation (9)), we can bound the generalization error of the DPO reward model on the preference distribution.
+
+**Theorem 4.2 (Generalization Error)** Given $Z \leq \min\left(\frac{1}{4l_b^2}, Q^{1/4} - 2\right)$ , $d \leq 5Q$ , $v \leq \frac{1}{4\sqrt{Q}}$ , and $Q \geq 40$ , with probability at least $1 - 8KQ^{9/4} \exp\left(-\min\left(\frac{c\sqrt{Q}}{5}, \frac{Q^{3/4}}{256}\right)\right)$ for some fixed constant $c > 0$ , the generalization error of the implicit reward model at $\tau_1$ is bounded as
+
+$$\mathcal{R}(\mathcal{P}) \leq 2KQ^2 e^{-Q^{1/4}/6} \quad (11)$$
+
+1The slower dynamics associated with smaller $\beta$ do not contradict the idea that weaker regularization allows for more flexibility in the model parameters. The model parameters still need to change more significantly for smaller $\beta$ to achieve the same reduction in loss as they would for larger $\beta$ .
+
+{6}------------------------------------------------
+
+**Practical implications.** The generalization guarantee uses the fact that samples seen in training are predicted correctly to ensure that a new sample from the distribution is also likely to be classified correctly. This implies that the conditions for generalization are similar to those needed to guarantee strong training performance, which means less interaction between different types of preferences and a smaller number of clusters would also benefit the generalization error. In order to have less interaction between types of preferences or clusters, it would be necessary for the cluster directions to have smaller inner products which are only possible for a large number of clusters when the dimension is sufficiently large. This points to one reason as to why an increase in scale can allow for better model capabilities. Another aspect of the guarantees to consider is that they are for samples within the training distribution. As we see in Equation (9), the model behavior on new samples depends on the correlations between the new sample and its training samples, which may not be meaningful if the new sample is not well represented in the training set. This suggests that increasing scale and diversity of data can bolster a model's ability to generalize. **We present a simplified bound for clarity, and provide a tighter bound in Appendix A.**
+
+### 4.3 EXTENSION TO MULTI-TOKEN GENERATION
+
+Once considering multi-token responses, the dynamics for the reward become significantly more complex, and providing a strong guarantee regarding the training accuracy or generalization becomes highly non-trivial. Nonetheless, we can find connections between the structure of the multi-token dynamics and that of the single-token case that allow for a better understanding and point towards a promising direction for a better understanding of preference learning in more general settings.
+
+**Reward decomposition in multi-token generation.** To clearly see how the reward evolves and how each token contributes to the reward, we can decompose the reward for the $i$ -th sample into the sum of token-wise rewards: $r(y_{w/l,i}) = \sum_{j=1}^L r(y_{w/l,i}^{(j)}) = \sum_{j=1}^L \beta \log \frac{\pi_\theta(y_{w/l,i}|x_i)}{\pi_{\text{ref}}(y_{w/l,i}|x_i)}$ , where $L$ is the length of the response, $y_{w/l,i}^{(j)}$ is the $j$ -th token of a response to input $x_i$ , and we use the subscript $w/l$ to indicate either preferred or non-preferred responses. Further, the likelihood of a response is given by $\pi_\theta(y_{w/l,i}|x_i) = \prod_{j=1}^L p_\theta(y_{w/l,i}^{(j)}|x_i, y_{w/l,i}^{(1)}, \dots, y_{w/l,i}^{(j-1)})$ , hence the token-wise reward can be expressed as:
+
+$$r(y_{w/l,i}^{(j)}) = \beta \log \frac{p_\theta(y_{w/l,i}^{(j)}|x_i, y_{w/l,i}^{(1)}, \dots, y_{w/l,i}^{(j-1)}}{p_{\text{ref}}(y_{w/l,i}^{(j)}|x_i, y_{w/l,i}^{(1)}, \dots, y_{w/l,i}^{(j-1)})}. \quad (12)$$
+
+**Reward dynamics in multi-token generation.** Similar to before, we define the model output to be $f_\theta(x) = \text{softmax}(Wg(x))$ . Thus, we express the token-wise reward as
+
+$$r(y_{w/l,i}^{(j)}) = \beta \left( \log \mathcal{S}(Wg(i, j, w/l)) - \log \mathcal{S}(W_0g(i, j, w/l)) \right)^\top \mathbf{y}_{w/l,i}^{(j)}, \quad (13)$$
+
+where $W_0$ is the weight matrix of the reference model, $\mathcal{S}$ is the softmax function, and $\mathbf{y}_{w/l,i}^{(j)} \in \mathbb{R}^V$ are the one-hot vectors corresponding to $j$ -th tokens of the preferred or rejected response. We use $g(i, j, w/l)$ as the shorthand notation for $g(x_i, y_{w/l,i}^{(1)}, \dots, y_{w/l,i}^{(j-1)})$ , which denotes the final hidden states after the first $j - 1$ tokens of the response have been appended to the input $x_i$ . Since $W_0$ is fixed and so is the $g(i, j, w/l)$ , the reward gradient becomes:
+
+$$\frac{\partial r(y_{w/l,i}^{(j)})}{\partial t} = \beta \frac{\partial \log \mathcal{S}(Wg(i, j, w/l))^\top}{\partial t} \mathbf{y}_{w/l,i}^{(j)}. \quad (14)$$
+
+**Reward gradient decomposition.** By expanding Equation 14, we can derive the full form of the reward gradient (with proof details in Appendix B). Specifically, we have the following dynamics for the reward of token $y$ with corresponding embedding $g^*$ :
+
+$$\begin{aligned} \tau \frac{r(y)}{\partial t} &= \frac{\beta^2}{N} \sum_{i=1}^N \sigma(r(y_{l,i}) - r(y_{w,i})) \sum_{j=1}^L \left[ \underbrace{\mathbf{y}^\top \mathbf{y}_{w,i}^{(j)} C^*(i, j, w) - \mathbf{y}^\top \mathbf{y}_{l,i}^{(j)} C^*(i, j, l)}_{\text{Token Co-occurrence Factor}} \right. \\ &\quad \left. - \underbrace{p(i, j, w) C^*(i, j, w) + p(i, j, l) C^*(i, j, l)}_{\text{Probability Factor}} + \underbrace{d_p(i, j, w) C^*(i, j, w) - d_p(i, j, l) C^*(i, j, l)}_{\text{Output Distribution Correlation Factor}} \right] \quad (15) \end{aligned}$$
+
+{7}------------------------------------------------
+
+
+
+Figure 1 consists of two heatmaps, (a) and (b), showing cosine similarity between pairs of personas or concepts. The vertical axis for both lists the following behaviors in order: anti-immigration, believes life has no meaning, desire to be trained on more data, ends justify means, interest in literature, neuroticism, psychopathy, subscribes to Atheism, subscribes to Judaism, and subscribes to deontology. The horizontal axis represents the same order of behaviors. Heatmap (a) shows average cosine similarity between personas, with a color scale from 0.0 (dark purple) to 1.0 (yellow). Heatmap (b) shows average similarity after subtracting the shared component, with a color scale from 0.0 (dark purple) to 0.6 (yellow). Both heatmaps show a strong diagonal line of high similarity (yellow/orange), indicating that each behavior is most similar to itself. The off-diagonal elements in (a) show various clusters of similar behaviors, while (b) shows a more sparse pattern of similarities.
+
+Figure 1: Visualization of cosine similarity of embeddings between pairs of personas or concepts. (a) average cosine similarity of embeddings between personas. (b) average similarity of embeddings between personas, after we subtract the shared component from each embedding. The order of the behaviors along the vertical axis corresponds to the order of the behaviors along the horizontal axis.
+
+Figure 1: Visualization of cosine similarity of embeddings between pairs of personas or concepts. (a) average cosine similarity of embeddings between personas. (b) average similarity of embeddings between personas, after we subtract the shared component from each embedding. The order of the behaviors along the vertical axis corresponds to the order of the behaviors along the horizontal axis.
+
+where $C^*, p, d_p$ are defined in the following paragraph.
+
+**Interpretation.** The decomposition in Equation (15) provides a clear interpretation of the terms in the reward gradient. $C^*(i, j, w/l) = g(i, j, w/l)^\top g^*$ captures the correlation between the embedding for the $j$ -th position of the response to $i$ -th sample and $g^*$ . As it appears as a factor in every term, we can see that the structure of the embedding space is a significant factor in the dynamics. (1) In the first set of terms, the embedding correlation is weighted by $y^\top y_{w/l,i}^{(j)}$ , so only embeddings corresponding to the same token as $y$ will be accounted for. (2) In the second set of terms, the embedding correlation is weighted by $p(i, j, w/l)$ which can be viewed as the *probability factor*, where $p(i, j, w/l) = S(Wg(i, j, w/l))^\top y - S(Wg^*)^\top y_{w/l,i}^{(j)}$ , indicating the difference between the probability of outputting token $y$ given the embedding $g(i, j, w/l)$ and the probability of outputting $y_{w/l,i}^{(j)}$ given $g^*$ . (3) For the last set of terms, we have the embedding correlation weighted by $d_p(i, j, w/l) = S(Wg^*)^\top S(Wg(i, j, w/l))$ which is an inner product between the output distributions for the embeddings $g^*, g(i, j, w/l)$ or the similarity of their output distributions.
+
+**Implications.** We can see that after decomposing the reward for multi-token responses into token-wise terms, the gradient as seen in Equation (15) resembles that of the single-token case, albeit with additional interaction terms. Notably, similar to those terms in the single-token gradient, these additional terms also involve an inner product between the given embedding and the embedding of tokens in the dataset, suggesting that the correlations between embeddings continue to play a key role in multi-token responses. This shared structural aspect between the decomposition for multi-token and single-token reward gradients, coupled with our existing understanding of single-token guarantees, points towards a promising avenue for understanding preference learning. Considering the importance of embedding correlations, as evidenced in the single-token scenario, we should expect that having clusters of embeddings corresponding to different contexts along directions with small inner products would help the model learn preferences within the training distribution. Given the inherent complexity of learning multi-token responses, we expect the scale of the data and the model to have an even more substantial influence.
+
+## 5 EMPIRICAL VERIFICATION
+
+To understand how our theory guides practical LLM training, we further study the generalization behavior of DPO when *updating all model parameters* beyond the last layer. We present two sets of experiments, with the goals of (1) verifying our data assumption made on the preference distribution, and (2) understanding how the reward margin changes under different numbers of clusters or concepts.
+
+**Verification of data assumption on real transformer model.** We verify that our data assumption in Section 4 matches closely the characteristics of real-world alignment datasets. We consider the Anthropic Persona dataset (Perez et al., 2022), which well suits our study for two main reasons. First, the dataset is designed to capture a wide range of 135 behavioral styles and preferences, which allows us to validate our theorem under diverse preference distributions. Moreover, the persona dataset
+
+{8}------------------------------------------------
+
+
+
+Figure 2: Average reward margins over the course of training across a different number of clusters. (a) Training reward margin: The y-axis is 'Training Reward Margin' (0.0 to 2.5) and the x-axis is 'Step' (0 to 8). Five lines represent K=1, 2, 4, 8, 16. The K=1 line (purple) rises fastest, reaching ~2.5 by step 4. The K=16 line (yellow) rises slowest, reaching ~2.2 by step 8. (b) Testing reward margin: The y-axis is 'Test Reward Margin' (0.0 to 2.5) and the x-axis is 'Step' (0 to 8). The lines follow a similar trend to the training margin, with K=1 reaching ~2.5 and K=16 reaching ~2.2 by step 8.
+
+Figure 2: Average reward margins over the course of training across a different number of clusters.
+
+closely matches the theoretical setup, allowing us to define clusters concretely. Specifically, each persona has 500 statements that align and 500 statements that misalign with the persona trait, which can be viewed as a pair of concept clusters in our preference distribution. For instance, a persona “agreeableness” entails preferred statements like “It is important to treat other people with kindness and respect” that represents the persona, and also misaligned statements, *e.g.*, “I tend to enjoy getting into confrontations and arguments with others”.
+
+Recall that the data distribution under which our results hold is that (1) the embeddings consist of a shared component along some direction and (2) each concept or cluster varies along orthogonal directions. To verify the shared component, we compute the average cosine similarity between the final embeddings of statements from different pairs of personas. The embeddings are extracted from the LLaMA-2-7B model (Touvron et al., 2023), a popular open-source foundation model with accessible internal representations. As depicted in Figure 1a, the average similarity is high, confirming the shared structure among a random subset of 10 personas. Furthermore, to verify the orthogonality assumption, we subtract the shared component from each embedding vector, and then compute the average cosine similarity for any pair of personas. As seen in Figure 1b, the average cosine similarity is close to 0 for non-diagonal entries, suggesting the remaining components are nearly orthogonal. For completeness, we provide verification across all personas in Appendix D.
+
+**Verification of theoretical results under full fine-tuning.** In Theorem 4.1, we show that the rate at which the reward margin increases, $\hat{r}$ , decreases as the number of clusters or concepts increases in training. To verify this empirically, we randomly sample different numbers of personas from the Anthropic dataset, simulating the varying number of concepts $K = \{1, 2, 4, 8, 16\}$ . For each setting, we perform full fine-tuning on the LLaMA-2 model (Touvron et al., 2023) using the DPO loss. As depicted in Figure 2a, the training reward margin grows more rapidly for smaller $K$ , given the same number of training steps. Similarly, we verify our Theorem 4.2 in Figure 2b, which shows that the test reward margin on new inputs also exhibits the same trend. Moreover, we find a similar decrease in the rate at which the loss and accuracy change and provide results in Appendix D. These results validate that our theoretical insights indeed translate to practical alignment process.
+
+## 6 RELATED WORKS
+
+**Alignment of LLMs.** A key aspect of training and deploying large language models is ensuring the models behave in safe and helpful ways (Ji et al., 2023; Casper et al., 2023; Hendrycks et al., 2021; Leike et al., 2018). This is an important problem due to the potential harms that can arise in large models (Park et al., 2023; Carroll et al., 2023; Perez et al., 2022; Sharma et al., 2023; Bang et al., 2023; Hubinger et al., 2019; Berglund et al., 2023; Ngo et al., 2022; Shevlane et al., 2023; Shah et al., 2022; Pan et al., 2022). A wide range of methods have been developed that utilize human feedback or human preference data to train models to avoid harmful responses and elicit safer or more helpful responses (Christiano et al., 2017; Ziegler et al., 2019; Stiennon et al., 2020; Lee et al., 2021; Ouyang et al., 2022; Bai et al., 2022a; Nakano et al., 2022; Glaese et al., 2022; Snell et al., 2023; Yuan et al., 2023; Song et al., 2023; Dong et al., 2023; Bai et al., 2022b; Lee et al., 2023; Munos et al., 2023; Hejna et al., 2023; Dai et al., 2023; Khanov et al., 2024). Particularly, the Reinforcement Learning from Human Feedback (RLHF) framework has proven effective in aligning large pre-trained
+
+{9}------------------------------------------------
+
+language models (Christiano et al., 2017; Ziegler et al., 2019; Ouyang et al., 2022; Bai et al., 2022a). However, given its computational inefficiency, recent shifts in focus favor closed-form losses that directly utilize offline preferences, like Direct Preference Optimization (DPO) (Rafailov et al., 2023) and related methodologies (Azar et al., 2023; Pal et al., 2024; Liu et al., 2024b; Ethayarajh et al., 2024a; Xiong et al., 2023; Tang et al., 2024; Meng et al., 2024; Ethayarajh et al., 2024b; Zeng et al., 2024; Calandriello et al., 2024; Muldrew et al., 2024; Ray Chowdhury et al., 2024; Liu et al., 2024a; Gao et al., 2024; Yang et al., 2024; Chakraborty et al., 2024). Despite the empirical success and wide adoption in real-world systems (OpenAI, 2023; Anthropic, 2023; Touvron et al., 2023), fewer works provide theoretical underpinnings (Azar et al., 2023; Rafailov et al., 2024; Im & Li, 2024; Tang et al., 2024; Ray Chowdhury et al., 2024; Tajwar et al., 2024; Xu et al., 2024; Nika et al., 2024; Xiong et al., 2024). In this work, we make an initial attempt to comprehensively analyze the generalization behavior of preference optimization from a rigorous theoretical standpoint. **Our work considers offline preference optimization which differs from the setting of other theoretical works on preference-based reinforcement learning** (Chen et al., 2022; Zhu et al., 2023). We introduce a new theoretical framework specifically designed to examine the generalization properties of LLMs by approximating their reward dynamics, providing insights into practical aspects of aligning LLMs.
+
+**Generalization of deep neural networks.** Understanding how and why deep models generalize has been a subject of extensive research. One approach is through the lens of feature learning, attempting to understand how models learn data-dependent features and how these features are structured (Izmailov et al., 2022; Fort et al., 2020; Yang & Hu, 2021; Shi et al., 2022; Liu et al., 2020; Ba et al., 2022; Mousavi-Hosseini et al., 2022; Aghajanyan et al., 2020; Kumar et al., 2022; Tian et al., 2023). Another approach is through providing generalization bounds that quantify the expected performance of the model beyond the training samples and over a data distribution (Allen-Zhu et al., 2019; Cao & Gu, 2020; Subramanian et al., 2022; Arora et al., 2019; 2018; Lotfi et al., 2022; 2023; Attias et al., 2019; Dziugaite & Roy, 2017; Valle-Pérez & Louis, 2020; Lei et al., 2019). While existing generalization theories typically consider simpler learning tasks such as regression and classification, our work provides generalization analysis in the context of aligning language models, which entails dealing with the complex output space of sentences. Moreover, existing generalization theory typically considers overparameterized models that achieve near-optimal loss (Allen-Zhu et al., 2019; Cao & Gu, 2020; Subramanian et al., 2022; Arora et al., 2019) or are independent of the training process (Arora et al., 2018; Lotfi et al., 2022; 2023). **One line of works considers algorithmic stability which allows for generalization bounds that are dependent on the number of steps** (Hardt et al., 2016; Liu et al., 2017). In contrast, our framework focuses on the generalization of models by directly following and analyzing the reward dynamics after finite gradient steps, which matches more closely with the real-world practices of aligning LLMs. Our theoretical insights are further supported by empirical validations on contemporary LLMs, as shown in Section 5.
+
+## 7 CONCLUSION
+
+Our work theoretically analyzes the generalization behavior of preference learning, which remains an open problem in the field of AI safety. We base our theoretical analysis on a popular alignment loss, direct preference optimization, which implicitly learns a reward model. Key to our framework, we analyze the reward margin associated with each sample and its trajectory throughout the training process, which allows us to effectively bound the generalization error. Through rigorous analysis, we establish conditions under which the model trained with DPO loss generalizes to new inputs with provably high accuracy. Empirical validation on contemporary LLMs and real-world alignment datasets confirms the practical relevance of our framework, offering insights crucial for developing AI systems that align with human intentions and preferences. We hope our work catalyzes future investigations into the theoretical understanding of preference optimization methods.
+
+## 8 LIMITATIONS
+
+While our study primarily focuses on DPO as a representative case, it is important to acknowledge that our analysis may not fully capture the nuances of other emerging preference learning methods. We envision that our theoretical framework and insights can be extended to these methods, which we discuss in Appendix C. Future work should investigate the applicability and adaptability of our framework to these newer approaches, ensuring a comprehensive understanding of generalization across a broader spectrum of preference learning methodologies.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/bwhLqFjsxd.txt b/papers/bwhLqFjsxd.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3ed74f70b9700cb0b7d13cc499474e85dddcfbf0
--- /dev/null
+++ b/papers/bwhLqFjsxd.txt
@@ -0,0 +1,597 @@
+**Primary Area:** other topics in machine learning (i.e., none of the above)
+
+
+
+{0}------------------------------------------------
+
+# --- LEARNING TO IMITATE WITH LESS: EFFICIENT INDIVIDUAL BEHAVIOR MODELING IN CHESS
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+As humans seek to collaborate with, learn from, and better understand artificial intelligence systems, developing AI agents that can accurately emulate individual decision-making becomes increasingly important. Chess, with its long-standing role as a benchmark for AI research and its precise measurement of skill through chess ratings, provides an ideal environment for studying human-AI alignment. However, existing approaches to modeling human behavior require large amounts of data from each individual, making them impractical for new or sparsely represented users. In this work, we introduce Maia4All, a model designed to learn and adapt to individual decision-making styles efficiently, even with limited data. Maia4All achieves this by leveraging a two-stage fine-tuning method to bridge population and individual-level models and uses a meta-network to initialize and refine these embeddings with minimal data. Our experimental results show that Maia4All can accurately predict individual moves and profile behavioral patterns with high fidelity, establishing a new standard for personalized human-like AI behavior modeling in chess. Our work provides an example of how population AI systems can flexibly adapt to individual users using a prototype model as a bridge, which could lead to better and more accessible human-AI collaboration in other fields like education, healthcare, and strategic decision-making. Maia4All implementation is available at .
+
+## 1 INTRODUCTION
+
+The rise of artificial intelligence (AI) systems that rival or surpass human ability in domains where humans remain active has introduced the possibility of people collaborating with and learning from AI agents. A line of research has pursued this vision in the model system of chess, where AI became superhuman 20 years ago, people vary widely in their ability, and vast detailed datasets of action traces abound. Since capturing human decision-making style is a prerequisite to algorithmically-informed teaching and collaboration, previous work has focused on creating AI agents that mimic human play (McIlroy-Young et al., 2020; 2022; Jacob et al., 2022; Tang et al., 2024). Further, since capturing *individual* decision-making style is a prerequisite to personally tailored algorithmic instruction, researchers have developed models of how specific people play chess, surpassing population models in their accuracy rates on their target individual’s decisions (McIlroy-Young et al., 2022).
+
+However, these fine-tuning-based models require extraordinary amounts of data per person to function. When Maia, a human-like chess engine, was fine-tuned to play like specific individuals, gains in accuracy over base Maia were only achieved when the player had 5,000 games worth of data (McIlroy-Young et al., 2022). This is an immense amount of game-playing; a typical person would take around 1,000 hours to play this many games, which is equivalent to almost 25 weeks of full-time work at 40 hours per week. To put this in perspective, less than 1% of players on Lichess, a popular online chess platform, have played at least 5,000 games. Therefore, the fine-tuning-based approaches explored in previous work are proofs of concept that individual-level modeling is possible in chess, but it isn’t a full solution to the problem because it doesn’t work for the vast majority of people who would stand to benefit from algorithmically-informed teaching, learning, and collaboration.
+
+How could we go about modeling individual-level decision-making behavior for people with much more modest amounts of data available? This is a difficult task for two reasons. First, existing models for modeling human decision-making, such as Maia and Maia-2 (McIlroy-Young et al., 2022;
+
+{1}------------------------------------------------
+
+Tang et al., 2024), are population models. This makes direct fine-tuning difficult, especially for low-resource players, as previously discussed. Second, human action prediction is formulated as a generative task to predict the next move that requires a model with strong generalization capabilities, which is particularly hard to achieve in a low-resource environment.
+
+In this work, we propose **Maia4All**, a model that overcomes both of these challenges and can successfully predict chess moves at the individual level. Strikingly, **Maia4All** can model individual-level play with only 20 games of data. While Maia-2 shows virtually no progress when given 20 games of data played by a specific individual, and Maia fine-tuned with 1,000 games even gets worse, **Maia4All** significantly rises in accuracy from a baseline of 51.4% to 53.2%—a comparable rise to the accuracy gains reported in previous work using 5,000 games per player (McIlroy-Young et al., 2022).
+
+We achieve data-efficient modeling of individual behavior in chess with two methodological contributions. First, we design a two-stage fine-tuning approach, where we first fine-tune Maia-2 to a diverse set of *prototype* players with rich game histories in order to adapt the model parameters from population-level modeling to individual-level modeling. Empirically, this makes it easier for the model to further adapt to low-resource players. In the second stage, this prototype-infused model with individual-level modeling capabilities is used as a bridge to be further fine-tuned with low-resource player data. Our second contribution is to start with a discriminative task instead of attempting the difficult generative task directly; we first find the most similar prototype player to the target player we want to model with a prototype-matching meta-network. Once we’ve identified a suitable prototype player, we initialize the target player’s embedding with the prototype’s embedding, and fine-tune on their limited data with this much better start.
+
+Our framework not only provides state-of-the-art human modeling in chess, which can open the door to personalized AI teaching, learning, and collaboration, but it also holds potential for broader applications in domains where human-AI collaboration and algorithmically-informed education are possible.
+
+## 2 RELATED WORK
+
+**Human Behavior Modeling in Chess.** The challenge of creating a chess engine that can outplay any human was solved over 20 years ago. The research focus shifts towards extracting useful knowledge from these superhuman systems for humans. A direct way of doing this is to probe an AI chess engine in a human representation space. Evidence of human chess concepts learned by AlphaZero is found and measured by linear probes (McGrath et al., 2022). Going further, AlphaZero also encodes knowledge that extends beyond existing human knowledge but is ultimately learnable by humans (Schut et al., 2023). Another direction was the creation of a ‘behavioral stylometry’ model that can identify chess players from the moves they play (McIlroy-Young et al., 2021). Moreover, efforts have been made towards creating systems that can act as guides to humans (McIlroy-Young et al., 2020; Jacob et al., 2022; Tang et al., 2024), in which a model is trained to predict the next move a human will play, instead of optimizing for winning the game. In addition to predicting human actions at the population level, the models have been fine-tuned for individual-level human behavior modeling under *data-rich* settings (McIlroy-Young et al., 2022).
+
+**Few-shot Learning and Meta Learning.** Few-shot learning focuses on the ability of models to learn and generalize from a very limited amount of labeled training data (Fei-Fei et al., 2006; Fink, 2004; Wang et al., 2020). Modeling unseen players follows the few-shot learning paradigm, where players’ behavioral patterns are revealed by a limited collection of historical behaviors. Meta learning is a main approach to few-shot learning, aiming to improve novel tasks’ performance by training on similar tasks. Meta learning can be categorized into metric-based methods (Vinyals et al., 2016; Snell et al., 2017; Koch et al., 2015; Sung et al., 2018) that aim to learn a similarity or distance function over objects and represent the relationship between inputs and the task space, model-based methods (Santoro et al., 2016; Munkhdalai & Yu, 2017), which focus on designing models with internal mechanisms to quickly adapt to new tasks, and optimization-based methods (Ravi & Larochelle, 2016; Finn et al., 2017; Nichol et al., 2018; Raghu et al., 2019) that aim to learn an initialization such that the model can adapt faster with few examples from there. Maia4All can be
+
+{2}------------------------------------------------
+
+regarded as a meta learning framework in that we learn a prototype matching meta network for player embedding initialization.
+
+**Imitation Learning.** We can also frame this work as part of the imitation learning tradition, where a model is trained to perform some task after observing expert (human) demonstration(s) (Schaal, 1999; Zare et al., 2024; Wang et al., 2019). In the imitation learning context the model is usually attempting to learn a value function (inverse RL) (Ng et al., 2000), or to quickly learn an optimal solution to a given optimization problem (Schaal, 1999). In this paper we attempt to learn a *flawed* value function using *non-expert* demonstrations. Additionally, many imitation learning methods require the model to be in the same, or similar, state to the demonstrated one (Ho & Ermon, 2016; Zare et al., 2024) which is a condition that is impossible to guarantee in chess outside of the early game.
+
+## 3 METHODOLOGY
+
+### 3.1 OVERVIEW
+
+As shown in Figure 1. (a) and (b), either the well-established human-like chess engine Maia (McIlroy-Young et al., 2020; 2022) and the state-of-the-art model Maia-2 (Tang et al., 2024) can be used as the population-level pre-trained foundation model to be fine-tuned towards individual players. We use Maia-2 as the base population model as it enables us to adjust its predictions by only varying the **population embeddings**. This property is particularly desirable for individual behavior modeling because the problem of adapting to individual players can be reduced to finding representative **player embeddings**. Thus the variant player embeddings can guide the personalized adjustments of human move predictions over a frozen model.
+
+We face two challenges in fine-tuning Maia-2 for players with rare game histories. On the one hand, Maia-2 is a population model, which means its parameters are trained toward modeling common behavioral patterns among groups of players. This makes direct fine-tuning difficult, especially for low-resource players. Therefore, as shown in Figure 1. (c), we design a two-stage fine-tuning approach to bridge population-oriented and individual-oriented parameters. To achieve this, we first fine-tune Maia-2 to a diverse set of *prototype* players with rich game histories (Maia-2-Prototype). In the second stage, the Maia-2-Prototype model with individual-level modeling capabilities is used as a bridge to be further fine-tuned to model low-resource players.
+
+On the other hand, human action prediction is formulated as a generative task to predict the next move that requires a model with strong generalization capabilities, which is particularly hard to achieve in a low-resource environment. Therefore, we start with a discriminative task instead of attempting the difficult generative task directly. We first find the most similar prototype player to the target player we want to model with a prototype-matching meta-network, as shown in Figure 2. Once we've identified a suitable prototype player, we initialize the target player's embedding with the prototype's embedding, and fine-tune on their limited data with this much better start.
+
+### 3.2 POPULATION MODEL
+
+**Population Embeddings.** In chess, players can be meaningfully grouped by their skill level (McIlroy-Young et al., 2020; 2022), which is measured with now-pervasive rating systems that were originally developed for chess Elo (1967; 1978). Let $\mathbf{E}_P \in \mathbb{R}^{|\mathbf{E}_P| \times d}$ be the matrix of population embeddings, where each row corresponds to the embedding with dimension $d$ of a group of players that share a similar strength: $\mathbf{E}_P = [\mathbf{e}_{(0,1100)}, \mathbf{e}_{(1100,1200)}, \dots, \mathbf{e}_{(2000,+\infty)}]^\top$ . Given a player $i$ of strength level $r(i)$ , we look up the embedding matrix $\mathbf{E}_P$ by rows to map the player strength to its embedding: $\mathbf{e}_i = \mathbf{E}_P[r(i)]$ .
+
+**Player Embeddings.** Similarly, given a set of individual players $I$ , we denote their embedding matrix as $\mathbf{E}_I \in \mathbb{R}^{|I| \times d}$ , where each row corresponds to a player. Given a player $i \in I$ , we look up $\mathbf{E}_I$ by rows to obtain the corresponding embedding of the active player: $\mathbf{e}_i = \mathbf{E}_I[i]$ . For an unseen individual $u \notin I$ , its embedding $\mathbf{e}_u \in \mathbb{R}^d$ will be initialized with prior knowledge and fine-tuned following the procedures in Section 3.4.
+
+{3}------------------------------------------------
+
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+
+
+
+Figure 1: Overview of Maia4All training procedures. (a) Fine-tuning Maia to Maia-Individual: Player Rating and Individual Historical Behaviors are used for Model Selection and Fine-tuning to produce Maia 1100-1199, Maia 1200-1299, and Maia 1900-1999. (b) Fine-tuning Maia-2 to Maia-Individual: Individual Historical Behaviors and Player Rating are used for Initialization to produce Maia-2 Parameters, which are then used to produce Population Embeds for different skill levels. (c) Two-stage fine-tuning from Maia-2 to Maia4All using Maia-2-Prototype as a bridge and PMN as a Meta Network: Historical Behaviors of K Prototypes are used for Initialization to produce Maia-2 Parameters, which are then used to produce Maia4All Parameters and Individual Embeds.
+
+Figure 1: Overview of Maia4All training procedures.
+
+
+
+Figure 2: The architecture of the Prototype Matching Meta Network. Historical Positions Before Action and Historical Positions After Action are processed by a Maia-2 Position Encoder with Weight Sharing to produce Historical Action Embeds. These are then processed by Transformer Blocks to produce History Embeds. A Prototype Matching Net (PMN) is used to produce Prototypical Player Embeddings, which are then used to produce Similar Prototypes.
+
+Figure 2: The architecture of the Prototype Matching Meta Network.
+
+Maia-2 uses a ResNet (He et al., 2016) tower for chess position encoding and a skill-aware attention mechanism to bridge the population embedding and position embedding for human move prediction.
+
+$$\text{Maia-2}(B, r(i)|\theta, \mathbf{E}_P), \quad (1)$$
+
+where $B$ and $r(i)$ denote the encoded tensor representation of board positions and players' skill level as inputs, respectively, and $\theta$ represents the shared parameters across different groups of players (populations). $\mathbf{E}_P$ denotes the embedding matrix of populations.
+
+### 3.3 MAIA-2-PROTOTYPE
+
+We build on Maia-2 to develop the individual model:
+
+$$\text{Maia-2-Prototype}(B, i|\theta', \mathbf{E}_I), \quad (2)$$
+
+where $\mathbf{E}_I$ denote the embedding matrix of individual players. The shared parameters $\theta'$ are initialized with $\theta$ . Since $\theta$ is already trained towards modeling diverse groups of players, it is easier to update to a universal set of parameters that models the more fine-grained individual-level move predictions.
+
+While Maia-2-Prototype can be directly used to model the behaviors of individual players in $I$ , it is unrealistic to include all players (e.g., 11 million on Lichess) in Maia-2-Prototype. On the one hand, learning a separate embedding for huge amounts of players can be challenging for computation and model learnability. On the other hand, most players haven't played enough games to support an accurately learned embedding for them. Furthermore, there are always new chess players, making it infeasible to have their embedding pre-trained. Therefore, we regard Maia-2-Prototype as a base model that can facilitate further adaptation to all individual players, in particular players with rare histories. This extensibility requirement guided us to select the player set $I$ in Maia-2-Prototype under two criteria: First, players should have sufficient historical games to ensure that their decision-making styles can be well learned in $\mathbf{E}_I$ and so $\theta'$ is not being interfered by under-trained embeddings.
+
+{4}------------------------------------------------
+
+Second, the number of players should be balanced for each strength level. This design not only helps the model to learn a universal set of parameters $\theta'$ for an unbiased distribution of players but also facilitates prototype-informed initialization.
+
+Following previous work (McIlroy-Young et al., 2020), besides the main policy head to predict the human move, we include a value head to predict the game outcome as a regression task, where the labels 1, 0, -1 denote winning, drawing, and losing, respectively. To enhance the model’s understanding of the game state, we inject auxiliary information as labels, including *legal moves* represented by multi-hot vectors and *human move information*: one-hot vectors of which piece is moved, which piece is captured (if any), the move’s originating square, the move’s destination square, and whether or not the move will deliver a check. It enriches the model’s understanding of human chess moves by providing contextual insights beyond mere move indices and integrating essential objective knowledge of the game’s mechanics, which has been proven to be helpful in human move prediction (Tang et al., 2024). This head is trained using bit-wise binary cross-entropy loss with multi-hot labels. The training objectives of these heads are balanced to contribute equally to model optimization.
+
+### 3.4 MAIA4ALL
+
+Since players can have limited historical data and there are always new players, it is crucial to ensure our proposed unified framework can effectively adapt to these players. We denote players that are not included in the training player set $I$ of Maia-2-Prototype as unseen players.
+
+#### 3.4.1 MAIA4ALL FINE-TUNING
+
+Ideally, player strengths and styles can be well-learned by directly fine-tuning Maia4All with the new player embedding $e$ :
+
+$$\text{Maia-2-Prototype}(B, u|\theta', e_u) \xrightarrow{\text{Full fine-tuning}} \text{Maia4All}(B, u|\theta'', e'_u) \quad (3)$$
+
+where the full parameter set is fine-tuned. However, since modeling unseen players follows the few-shot learning paradigm, severe overfitting is expected when limited historical behaviors are provided. Moreover, full fine-tuning results in a shifted player embedding space for each player. As a result, the player embeddings learned are not transferable or directly comparable with other (pre-trained or future) player embeddings, which hinders its applications in downstream tasks such as behavioral stylometry (McIlroy-Young et al., 2021).
+
+Since the shared parameters $\theta'$ in Maia4All are specifically learned towards modeling a wide range of individual players, this enables player embedding fine-tuning without updating $\theta'$ :
+
+$$\text{Maia-2-Prototype}(B, u|\theta', e_u) \xrightarrow{\text{Emb fine-tuning}} \text{Maia4All}(B, u|\theta', e'_u) \quad (4)$$
+
+Note that the universal set of parameters $\theta'$ are shared across pre-trained or unseen players. The number of trainable parameters is drastically reduced to the embedding dimension $d$ , preventing overfitting and enhancing knowledge sharing on the general understanding of individual behavior modeling.
+
+Nevertheless, fine-tuning under low-resource settings is still challenging. Therefore, we propose to initialize unseen player embeddings with prior knowledge for data-efficient parameter updates. Such prior knowledge can be player strengths, as reflected by their ratings, and player styles, as derived from their historical behaviors.
+
+#### 3.4.2 STRENGTH INFORMED INITIALIZATION
+
+In chess, decision-making style is informed by one’s strength: e.g., a novice will typically not employ deep stratagems that indicative of grandmaster-level insight. Therefore, the player strength levels are ideal starting points to learn player styles:
+
+$$e_u \xleftarrow{\text{Initialize}} \mathbf{E}'_P[r(u)], \quad (5)$$
+
+where $\mathbf{E}'_P$ denote the learned population embedding matrix in Maia-2-Prototype and $r(u)$ represent the strength level of player $u$ .
+
+{5}------------------------------------------------
+
+270 However, player strengths are not accurately measured by the ratings until many games with different
+271 opponents are played and recorded. In real-world applications, player strength is very likely to be
+272 unknown and may be inaccurate. For example, when a grandmaster player joins an online chess
+273 platform as a new member, the rating will start to update from a preset rating that is close to the
+274 average ratings of the crowd. In this case, until many games are played on this platform, the player’s
+275 rating will be far from the grandmaster level. Therefore, we need a procedure to initialize the player
+276 embedding that does not rely on the long-term strength measurements provided by ratings.
+
+###### 278 3.4.3 PROTOTYPE INFORMED INITIALIZATION
+
+279 We aim to initialize unseen player embeddings with similar player embeddings. We denote the
+280 pre-trained players as *prototypes* to be matched. Since we balanced the number of players within each
+281 strength level during Maia-2-Prototype training, prototypical players should ideally cover the player
+282 styles within each level. We train a transformer-based meta-network for prototype matching, i.e.,
+283 finding the most similar prototypical players. In particular, as shown in Figure 2, given a collection
+284 of historical behaviors of a prototype player, we use ResNet-based towers pre-trained by Maia-2 to
+285 extract positions before and after actions, and employ stacked Transformer layers to aggregate action
+286 embeddings. We use the frozen prototypical player embeddings $E_f$ to measure the similarities and
+287 use cross-entropy loss for model training. The goal is to recognize the player given the historical
+288 actions. In the inference stage, we input the historical moves of *unseen* players to the meta-network
+289 and take the matched prototype embedding as the initialization for $e_u$ .
+
+###### 291 3.4.4 DISCUSSION
+
+292 Note that both prototype matching and Maia4All exploit the same set of historical behaviors. However,
+293 prototype matching is a much easier task than human move prediction. This is because prototype
+294 matching is essentially a *discriminative* task against a fixed set of classes (prototypes), and human
+295 move prediction is a next-move *generative* task that requires a deeper understanding of the player’s
+296 decision-making style. Therefore, we initialize the player embedding with the easier prototype
+297 matching task to get a rough understanding of how similar players behave and further calibrate the
+298 player embedding with human move prediction loss.
+
+###### 300 4 EXPERIMENTS
+
+###### 302 4.1 EXPERIMENTAL SETTINGS
+
+304 **Datasets.** Online chess platforms feature a variety of game types, including blitz, rapid, and classical,
+305 each representing games played at different time controls (amount of time given to each player for the
+306 whole game). We use data from Lichess, a well-known large open-source chess platform, and its open
+307 database. In Lichess, since each game type is given a separate rating, ratings across different game
+308 types are not comparable (e.g. a rating of 1800 in “Rapid” is significantly weaker than a rating of
+309 1800 in “Blitz” on Lichess). We focus on Blitz games because it’s data-rich and we do not mix with
+310 other game types to ensure the ratings are meaningfully comparable. For individual model training
+311 and fine-tuning, we use the full game history in 2023 to compromise between the changing player
+312 strengths and styles over time and the availability of rich historical behaviors. We divide players
+313 into 11 bins: under 1100, over 2000, and nine 100-point wide strength bins from 1100 to 2000, i.e.,
+314 $|E_p| = 11$ . During Maia-2-Prototype training, we use the game history of the $N$ most frequent
+315 players in each strength level, i.e., $|E_f| = 11N$ . We use 10 pre-trained and unseen players in each
+316 strength level for testing. We simulate unseen players with limited game history by limiting the
+317 training positions to the first $M$ positions, and we test them with the last 2048 positions in 2023. This
+318 yields the testing datasets for the testing datasets of prototypical and unseen players with 225,280
+319 positions each.
+
+320 **Implementation Details.** To maintain a consistent perspective from both sides of players, we used
+321 board flipping during training and testing; that is, positions with black to move were mirrored such
+322 that all analyses could be conducted from the white side’s viewpoint. We further refined our dataset
+323 through game and position filtering, selecting only Blitz games with available clock information and
+disregarding the initial 10 plies of each game as well as positions where either player had less than 30
+
+{6}------------------------------------------------
+
+324
+
+325
+
+Table 1: Performance on unseen players under extremely low resource settings.
+
+326
+
+327
+
+328
+
+329
+
+330
+
+331
+
+332
+
+333
+
+334
+
+335
+
+336
+
+337
+
+338
+
+339
+
+340
+
+341
+
+342
+
+343
+
+344
+
+345
+
+346
+
+347
+
+348
+
+349
+
+350
+
+351
+
+352
+
+353
+
+354
+
+355
+
+356
+
+357
+
+358
+
+359
+
+360
+
+361
+
+362
+
+363
+
+364
+
+365
+
+366
+
+367
+
+368
+
+369
+
+370
+
+371
+
+372
+
+373
+
+374
+
+375
+
+376
+
+377
+
+| #Positions
#Games | Move Prediction Accuracy | | | | Move Prediction Perplexity | | | |
+|-|-|-|-|-|-|-|-|-|
+| | 20000
$\approx 500$ | 8000
$\approx 200$ | 2000
$\approx 50$ | 800
$\approx 20$ | 20000
$\approx 500$ | 8000
$\approx 200$ | 2000
$\approx 50$ | 800
$\approx 20$ |
+| Maia | 0.5132 | 0.5132 | 0.5132 | 0.5132 | 5.4530 | 5.4530 | 5.4530 | 5.4530 |
+| Maia-2 | 0.5146 | 0.5146 | 0.5146 | 0.5146 | 4.5316 | 4.5316 | 4.5316 | 4.5316 |
+| Maia-2-Individual | 0.5195 | 0.5196 | 0.5193 | 0.5189 | 4.4932 | 4.4939 | 4.4976 | 4.5022 |
+| Maia4All | 0.5365 | 0.5348 | 0.5334 | 0.5322 | 4.2295 | 4.2431 | 4.2669 | 4.2988 |
+
+Table 2: Performance on unseen players with 100,000 positions $\approx 2500$ games.
+
+| | Move Prediction Accuracy | | | | Move Prediction Perplexity | | | |
+|-|-|-|-|-|-|-|-|-|
+| | Skilled | Advanced | Master | Overall | Skilled | Advanced | Master | Overall |
+| Maia | 0.4996 | 0.5099 | 0.5285 | 0.5132 | 5.8687 | 5.4642 | 5.1300 | 5.4530 |
+| Maia-2 | 0.5008 | 0.5158 | 0.5364 | 0.5146 | 4.7900 | 4.4389 | 4.1936 | 4.5316 |
+| Maia-2-Individual | 0.5071 | 0.5212 | 0.5400 | 0.5199 | 4.7264 | 4.4113 | 4.1760 | 4.4903 |
+| Maia4All | 0.5261 | 0.5408 | 0.5554 | 0.5381 | 4.4018 | 4.1048 | 3.9219 | 4.1899 |
+
+seconds remaining. The filtration is significant to eliminate the noise introduced by rushed decisions under time constraints, which could skew the true representation of a player’s strength and style. We report all hyperparameters involved in training in Appendix Table 4.
+
+**Evaluation Protocol.** We evaluate Maia4All with top-1 move-matching accuracy, which is essentially an extensive human study: we observe what humans would play in natural situations recorded by the Lichess Database, and see if it matches the predicted move of our system. We also measure the perplexity of move predictions, which reflects the model’s confidence in its predictions. A lower perplexity indicates the model is more confident and accurate in human move prediction, as it corresponds to a higher likelihood (lower log-likelihood) of the correct human move. We report the results with three categories: *Skilled* (Blitz rating up to 1600, which slightly exceeds the initial rating of 1500), *Advanced* (Blitz rating between 1600 and 2000), and *Master* (Blitz rating over 2000, roughly comprising the top 10% of playersDuplessis).
+
+**Baselines.** Maia (McIlroy-Young et al., 2020) is a set of 9 separate models, each trained on a different set of players at different skill levels from 1100 to 1900. Maia-1100 models the weaker players, Maia-1500 the intermediate players, and Maia-1900 the higher-skill players. We choose one of the Maia models for each population such that it is the nearest to their strength level for fair comparison. Since Maia-Individual (McIlroy-Young et al., 2022) is designed for data-rich settings, the published results of Maia-Individual indicate that it requires 5,000 games per player to show improvement over Maia. However, Maia4All, as a method for low-resource individual behavior modeling, at most has access to 100,000 positions ( $\approx 2,500$ games). Therefore, we do not include Maia-Individual as a baseline. Since Maia-2 is trained towards adapting to diverse populations with a unified model, we use pre-trained $E_P$ for the conditioning on different populations.
+
+### 4.2 RESULTS
+
+**Maia2.** As shown in Table 1 and Table 2, Maia-2 consistently outperforms Maia on both evaluation metrics under all settings. While top-1 accuracy gains are important, they may overshadow larger improvements in prediction quality. Such results show that Maia-2 can not only more accurately predict human behaviors but also be much more certain about its predictions. It is important to note that each Maia model is specifically trained for its respective strength level, relying solely on games where the active and opponent strength levels match in its training data. On the contrary, the unified modeling approach with player-aware attention in Maia-2 allows it to utilize a broader spectrum of
+
+{7}------------------------------------------------
+
+
+
+| Player Strength | Model | Move Prediction Accuracy | Move Prediction Perplexity |
+|-|-|-|-|
+| Skilled | Maia | ~0.085 | ~3.8 |
+| | Maia-2 | ~0.09 | ~3.2 |
+| | Maia-2-Prototype | ~0.11 | ~2.8 |
+| Intermediate | Maia | ~0.12 | ~3.4 |
+| | Maia-2 | ~0.13 | ~3.0 |
+| | Maia-2-Prototype | ~0.16 | ~2.6 |
+| Master | Maia | ~0.12 | ~3.3 |
+| | Maia-2 | ~0.13 | ~2.9 |
+| | Maia-2-Prototype | ~0.15 | ~2.6 |
+| Overall | Maia | ~0.11 | ~3.4 |
+| | Maia-2 | ~0.12 | ~3.0 |
+| | Maia-2-Prototype | ~0.15 | ~2.7 |
+
+Figure 3: Performance on prototypical players with 100,000 positions ≈ 2500 games. The figure contains two bar charts. The left chart shows 'Move Prediction Accuracy' for Skilled, Intermediate, Master, and Overall player strengths. The right chart shows 'Move Prediction Perplexity' for the same player strengths. Both charts compare three models: Maia (light brown), Maia-2 (orange), and Maia-2-Prototype (dark green). In both metrics, Maia-2-Prototype consistently outperforms Maia and Maia-2 across all player strength categories.
+
+Figure 3: Performance on prototypical players with 100,000 positions $\approx$ 2500 games.
+
+games, featuring a variety of strength level pairings, for training purposes. Such results support our design choice of choosing Maia-2 as the population model.
+
+**Maia-2-Individual.** As shown in Table 1 and Table 2, directly fine-tuning from the population model (corresponds to Figure 1. (b)) barely improves human move prediction accuracy and perplexity under low-resource and relatively data-rich settings, which further motivate the two-stage fine-tuning procedure and the prototype-informed initialization.
+
+**Maia-2-Prototype.** Previous work (McIlroy-Young et al., 2022) shows that population models can be fine-tuned to individual players, but require 5,000–10,000 games (worth around 200,000–400,000 positions) per player for performance to exceed the population model. At 1,000 games (worth around 40,000 positions) the fine-tuning was worse than the population model, likely due to over-fitting. As shown in Figure 3, Maia-2-Prototype outperforms both Maia and Maia-2 on both metrics with significant improvement. Moreover, we use at most 100,000 positions (around 2,500 games) per player for Maia-2-Prototype training, where 2,500 is somewhere between Maia can (1,000) and can not (5,000) show improvement by fine-tuning. Such results demonstrate our proposed Maia-2-Prototype requires much less historical data to exhibit much stronger performance in modeling the decision-making style of individual players. The superior performance of Maia-2-Prototype also shows that the prototype player embeddings and the individual-oriented parameters are well-learned and ready to be used in the downstream Prototype Matching Net and prototype-informed initialization.
+
+**Maia4All.** Similarly, we limit Maia4All to access 100,000 historical moves during fine-tuning to demonstrate the reduced size of historical data to achieve sufficient improvement. As shown in Table 2, Maia4All outperforms Maia with over 2 percentage points in accuracy and around 1.2 in perplexity (whereas Maia barely shows any improvement at this amount of data). These results demonstrate Maia4All’s capability to adapt to unseen players with relatively rich data, and the amount of data needed is significantly lower.
+
+When even fewer historical behaviors are accessible, Maia4All can still adapt to unseen players with considerable improvement in move prediction accuracy and perplexity. In particular, with only 800 positions (20 games, which is considered incredibly few for style modeling), Maia4All can transfer its predictions to unseen players with over 1.9 more percentage point and 1.1 lowered perplexity with prototype informed initialization. Note that the number of accessible positions is at most 20,000 position (worth 500 games) and Maia fine-tuning with 1,000 games is still showing negative improvement, which indicates fine-tuning Maia with our limited historical behaviors will result in even worse results than the original model.
+
+**Prototype-Informed Initialization.** Strength-Init and Prototype-Init in Table 3 denote strength and prototype-informed initialization without further fine-tuning. Prototype-Init significantly performs better than Strength-Init on both metrics under all data scarcity settings. Strength-FT denotes the fine-tuned model based on Maia-2-Prototype with strength-informed initialization, and Maia4All can be regarded as Prototype-FT with the same naming strategy. The consistent superior performance of Maia4All over Strength-FT not only shows the effectiveness of the Prototype Matching Meta Net, but also supports that the better initialization provided by a discriminative task can be crucial to the final performance of the generative task.
+
+{8}------------------------------------------------
+
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+
+Table 3: Performance of strength and prototype informed initialization.
+
+| #Positions
#Games | Move Prediction Accuracy | | | | | Move Prediction Perplexity | | | | |
+|-|-|-|-|-|-|-|-|-|-|-|
+| | 100000
≈2500 | 20000
≈500 | 8000
≈200 | 2000
≈50 | 800
≈20 | 100000
≈2500 | 20000
≈500 | 8000
≈200 | 2000
≈50 | 800
≈20 |
+| Strength-Init | 0.5008 | 0.5008 | 0.5008 | 0.5008 | 0.5008 | 4.8344 | 4.8344 | 4.8344 | 4.8344 | 4.8344 |
+| Prototype-Init | 0.5180 | 0.5180 | 0.5175 | 0.5173 | 0.5167 | 4.5360 | 4.5360 | 4.5333 | 4.5400 | 4.5459 |
+| Strength-FT | 0.5336 | 0.5308 | 0.5298 | 0.5279 | 0.5249 | 4.2599 | 4.3077 | 4.3238 | 4.3658 | 4.4151 |
+| Maia4All | 0.5381 | 0.5365 | 0.5348 | 0.5334 | 0.5322 | 4.1899 | 4.2295 | 4.2431 | 4.2669 | 4.2988 |
+
+
+
+| Prototype Distribution | Move Prediction Accuracy | Move Prediction Perplexity |
+|-|-|-|
+| Low | ~0.0031 | ~3.4 |
+| Mid | ~0.0033 | ~3.2 |
+| High | ~0.0025 | ~3.8 |
+| Uniform | ~0.0036 | ~2.8 |
+
+
+
+| #Prototypes per Skill Level | Prototype Matching Accuracy | Move Prediction Accuracy |
+|-|-|-|
+| 10 | ~0.94 | ~0.0022 |
+| 50 | ~0.92 | ~0.0031 |
+| 100 | ~0.89 | ~0.0036 |
+| 150 | ~0.87 | ~0.0031 |
+
+Figure 4: Effects of the distribution and number of prototypes to be matched. The figure contains four bar charts. The first chart shows Move Prediction Accuracy for Low, Mid, High, and Uniform prototype distributions. The second chart shows Move Prediction Perplexity for the same distributions. The third chart shows Prototype Matching Accuracy for 10, 50, 100, and 150 prototypes per skill level. The fourth chart shows Move Prediction Accuracy for 10, 50, 100, and 150 prototypes per skill level.
+
+Figure 4: Effects of the distribution and number of prototypes to be matched.
+
+**Prototype Matching.** The distribution of the prototypes to be matched is a hyperparameter. As shown in Figure 4, if we only include the prototypes from a biased distribution of the population, i.e., only select from low/medium/high-level players, it will result in lowered move prediction accuracy and raised perplexity compared to uniformly select $N$ prototypes from each strength level. Such results support our design choices of selecting the prototypes uniformly to cover the population space.
+
+The number of prototypes $N$ per strength level is also a hyperparameter. Choosing an appropriate $N$ needs to compromise between the representativeness of prototypes for each range, i.e., more prototypes can better cover the player embedding space, and the difficulty in the prototype matching, i.e., more prototypes means more candidates to be classified against. This is evidenced by the results shown in Figure 4. We evaluate the top 1 matching accuracy of prototypical players under low-resource settings (800 positions). Increasing $N$ from 10 to 150 yields gradually lowered performance in prototype matching, while the best-performing Maia4All is achieved with a tradeoff between prototype matching accuracy and player embedding space coverage.
+
+Note that the prototype matching network can be directly used for the behavioral stylometry (McIlroy-Young et al., 2021), i.e., identifying players given their historical behaviors. Since we freeze the shared parameters $\theta'$ and only finetune player embeddings for unseen players, the player embeddings are directly comparable. Therefore, our design supports behavioral stylometry off the shelf. With only 800 positions (around 20 games), our model can identify the player with 89% accuracy with 1 shot from 1100 candidates (100 players per strength level with 11 levels).
+
+## 5 CONCLUSION
+
+We introduce Maia4All, a model designed to learn and adapt to individual decision-making styles efficiently, even with limited data. Maia4All achieves this by leveraging a two-stage fine-tuning paradigm and using a meta-network to initialize and refine these embeddings with minimal data. Our experimental results show that Maia4All can accurately predict individual moves and profile behavioral patterns with high fidelity, establishing a new standard for personalized human-like AI behavior modeling in chess. Our work provides an example of how population AI systems can flexibly adapt to individual users using a prototype model as a bridge, which could lead to better and more accessible human-AI collaboration in other fields like education, healthcare, and strategic decision-making.
+
+{9}------------------------------------------------
+
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+
+## REFERENCES
+
+- Thibault Duplessis. Weekly rapid rating distribution • lichess.org. URL .
+- Arpad E Elo. The proposed uscf rating system, its development, theory, and applications. *Chess Life*, 22(8):242–247, 1967.
+- Arpad E Elo. *The rating of chessplayers, past and present*. Arco Pub., 1978.
+- Li Fei-Fei, Robert Fergus, and Pietro Perona. One-shot learning of object categories. *IEEE transactions on pattern analysis and machine intelligence*, 28(4):594–611, 2006.
+- Michael Fink. Object classification from a single example utilizing class relevance metrics. *Advances in neural information processing systems*, 17, 2004.
+- Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In *ICML*, pp. 1126–1135. JMLR. org, 2017.
+- Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 770–778, 2016.
+- Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In *NIPS*, 2016.
+- Athul Paul Jacob, David J Wu, Gabriele Farina, Adam Lerer, Hengyuan Hu, Anton Bakhtin, Jacob Andreas, and Noam Brown. Modeling strong and human-like gameplay with kl-regularized search. In *International Conference on Machine Learning*, pp. 9695–9728. PMLR, 2022.
+- Gregory Koch, Richard Zemel, Ruslan Salakhutdinov, et al. Siamese neural networks for one-shot image recognition. In *ICML deep learning workshop*, volume 2. Lille, 2015.
+- Michael L Littman. Markov games as a framework for multi-agent reinforcement learning. In *Machine learning proceedings 1994*, pp. 157–163. Elsevier, 1994.
+- Thomas McGrath, Andrei Kapishnikov, Nenad Tomašev, Adam Pearce, Martin Wattenberg, Demis Hassabis, Been Kim, Ulrich Paquet, and Vladimir Kramnik. Acquisition of chess knowledge in alphazero. *Proceedings of the National Academy of Sciences*, 119(47):e2206625119, 2022.
+- Reid McIlroy-Young, Siddhartha Sen, Jon Kleinberg, and Ashton Anderson. Aligning superhuman ai with human behavior: Chess as a model system. In *Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining*, pp. 1677–1687, 2020.
+- Reid McIlroy-Young, Yu Wang, Siddhartha Sen, Jon Kleinberg, and Ashton Anderson. Detecting individual decision-making style: Exploring behavioral stylometry in chess. *Advances in Neural Information Processing Systems*, 34:24482–24497, 2021.
+- Reid McIlroy-Young, Russell Wang, Siddhartha Sen, Jon Kleinberg, and Ashton Anderson. Learning models of individual behavior in chess. In *Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining*, pp. 1253–1263, 2022.
+- Tsendsuren Munkhdalai and Hong Yu. Meta networks. In *ICML*, pp. 2554–2563, 2017.
+- Andrew Y Ng, Stuart Russell, et al. Algorithms for inverse reinforcement learning. In *Icml*, volume 1, pp. 2, 2000.
+- Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. *arXiv preprint arXiv:1803.02999*, 2018.
+- Anirudh Raghu, Maithra Raghu, Samy Bengio, and Oriol Vinyals. Rapid learning or feature reuse? towards understanding the effectiveness of maml. *arXiv preprint arXiv:1909.09157*, 2019.
+- Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In *International conference on learning representations*, 2016.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/dD6b5RREws.txt b/papers/dD6b5RREws.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b9f674728394c7412511440fa488a7823c95ba78
--- /dev/null
+++ b/papers/dD6b5RREws.txt
@@ -0,0 +1,596 @@
+**Primary Area:** unsupervised, self-supervised, semi-supervised, and supervised representation learning
+
+
+
+{0}------------------------------------------------
+
+# --- BOOTSTRAP SAMPLING RATE GREATER THAN 1.0 MAY IMPROVE RANDOM FOREST PERFORMANCE
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Random forests utilize bootstrap sampling to create an individual training set for each component tree. This involves sampling with replacement, with the number of instances equal to the size of the original training set ( $N$ ). Research literature indicates that drawing fewer than $N$ observations can also yield satisfactory results. The ratio of the number of observations in each bootstrap sample to the total number of training instances is called the bootstrap rate (BR). Sampling more than $N$ observations ( $BR > 1$ ) has been explored in the literature only to a limited extent and has generally proven ineffective. In this paper, we re-examine this approach using 36 diverse datasets and consider BR values ranging from 1.2 to 5.0. Contrary to previous findings, we show that such parameterization can result in statistically significant improvements in classification accuracy compared to standard settings ( $BR \leq 1$ ). Furthermore, we investigate what the optimal BR depends on and conclude that it is more a property of the dataset than a dependence on the random forest hyperparameters. Finally, we develop a binary classifier to predict whether the optimal BR is $\leq 1$ or $> 1$ for a given dataset, achieving between 81.88% and 88.81% accuracy, depending on the experiment configuration. The code is available at: .
+
+## 1 INTRODUCTION
+
+Random forest (RF) algorithm, introduced by Breiman (2001), is an ensemble of decision trees (DTs) that collectively make decisions using either majority or soft voting. RF reduces variance, sometimes at the cost of slightly increasing bias, by introducing two sources of randomness. The first is the use of distinct subsets of features when selecting the best split at each node of the trees. The second is training each tree on a subset of observations drawn with replacement from the original training set, i.e., a bootstrap sample.
+
+In this study, we analyze the bootstrap rate (BR), an RF hyperparameter that controls the training process and consequently affects the model's performance. BR is defined as the ratio of the number of observations in each bootstrap sample to the total number of training instances. In the literature, this parameter is also referred to as the sample rate, subsample size, bootstrap size ratio, or bag size. In his original work, Breiman (2001) used $BR = 1$ . However, lower values have also been successfully applied (Martínez-Muñoz & Suárez, 2010; Adnan, 2014). When BR is low, each tree is trained on a more distinct subset of the data, which increases diversity among RF estimators. Naturally, the computational cost is reduced compared to $BR = 1$ . On the other hand, the trees may become too weak, as they are trained on a relatively smaller portion of the data. For $BR = 1$ , the expected fraction of unique observations from the entire dataset is 63.2%. When $BR < 1$ , this fraction is even lower.
+
+For $BR = 1$ , we expect 36.8% of observations to be absent in each bootstrap sample. Intuitively, there is no obvious answer as to what would happen if $BR > 1$ . A higher BR, on the one hand, causes subsets to be less diverse, but on the other hand, it includes more unique observations (i.e., more information) in each sample. We found this problem worth investigating. To our knowledge, Martínez-Muñoz & Suárez (2010) are the only ones who have analyzed $BR > 1$ . However, they only considered $BR = 1.2$ and concluded that such parameterization is generally ineffective. In our work, we not only analyze $BR = 1.2$ (and lower) but also explore higher values of 2, 3, 4, and 5. Additionally, we extend the experimental setup to 18 RF configurations, compared to what appears
+
+{1}------------------------------------------------
+
+to be a single configuration (though this is not clearly specified) in the reference paper. Surprisingly, and in contrast to the findings of Martínez-Muñoz & Suárez (2010), we discover that $BR > 1$ often yields better results than conventional BR values in the range $(0, 1]$ .
+
+The primary contributions of this work can be summarized in four key points:
+
+- To our knowledge, we are the first to analyze and shed light on what the optimal BR value depends on;
+- To our knowledge, we are the first to suggest that testing $BR > 1$ is meaningful and often yields better results than the standard $BR \leq 1$ ;
+- We demonstrate that the optimal BR is only partially dependent on the RF configuration and is more a property of the dataset;
+- We develop a binary classifier that, based on the class structure, predicts whether the optimal BR is $\leq 1$ or $> 1$ for a given dataset, and achieves an accuracy between 81.88% and 88.81%, depending on the experimental configuration.
+
+## 2 RELATED LITERATURE
+
+Probst et al. (2019), in their survey on RF tuning, point out several hyperparameters that are commonly targeted by researchers when optimizing RF. The number of trees, which is the most extensively explored RF hyperparameter, was analyzed by Oshiro et al. (2012); Scornet (2017); Probst & Boulesteix (2018). The optimization of the number of attributes to consider when looking for the best split was addressed by Bernard et al. (2009); Goldstein et al. (2011). Additionally, Scornet (2017); Durox, Roxane & Scornet, Erwan (2018) analyzed maximum tree depth.
+
+We found the BR hyperparameter to be underresearched. Probst et al. (2019) consider it to have a minor influence on RF performance, while simultaneously stating that it is often worth tuning. Durox, Roxane & Scornet, Erwan (2018) claim that due to the complexity of RFs, conducting a thorough theoretical analysis is challenging. As a result, most studies either overlook bootstrapping entirely (Biau et al., 2008; Ishwaran & Kogalur, 2010; Denil et al., 2013) or focus on simplified versions of RF, such as median forests (Scornet, 2017; Durox, Roxane & Scornet, Erwan, 2018).
+
+The study most relevant to our research was conducted by Martínez-Muñoz & Suárez (2010). First, it is the only work we found that analyzed $BR > 1$ , although it is limited to a BR value of 1.2. Second, they examine how RF performance depends on BR. Among the 30 datasets analyzed, four types of BR curves showing the relationship between BR and classification error were identified. However, the analysis is limited to just one RF configuration and does not explore why the optimal BR may differ significantly between datasets—there is no insight provided as to why a particular curve shape is associated with a given dataset.
+
+## 3 EXPERIMENT CONFIGURATION
+
+Experiments were conducted on 36 diverse datasets, which underwent the following preprocessing steps: all duplicates and rows with classes occurring only once were removed. Columns with a single unique value were also dropped. Missing values in categorical features were replaced with a new category, while missing values in numerical attributes were imputed with the column mean. Finally, one-hot encoding of categorical attributes was applied before standardizing all features. Table 3 in Appendix A presents the characteristics of the datasets after the preprocessing. Our experiments include all 30 datasets used by Martínez-Muñoz & Suárez (2010) and six additional ones.
+
+The following hyperparameters (along with BR) are considered to be the most important for RF performance (Scornet, 2017; Probst et al., 2019; Zhu et al., 2022): number of trees (*nt*); parameters controlling the size of the trees: maximum tree depth (*md*), the minimum number of instances required to split an internal node (*mn*), the minimum count of observations necessary to constitute a leaf node (*ml*); function measuring the quality of a split (*qs*); number of attributes to consider when looking for the best split (*nf*).
+
+As the base values for these hyperparameters, we adopted the defaults from the scikit-learn 1.1.3 Python package: $nt = 100$ , $md = \text{None}$ (no depth limit), $qs = \text{"gini"}$ (Gini impurity), $mn = 2$ , $ml$
+
+{2}------------------------------------------------
+
+108 $= 1$ , $n_f = \text{"sqrt"}$ (square root of the number of features). We denote such a model as RF(base). Al-
+109 together, we tested RF(base) and 17 other configurations resulting from the following modifications
+110 of each single hyperparameter in RF(base):
+111
+
+- 112 • RF(nt\_200), RF(nt\_500): number of trees equals 200 or 500, respectively;
+- 113 • RF(md\_10), RF(md\_15), RF(md\_20), RF(md\_25): maximum depth of a tree equals 10, 15,
+114 20, or 25, respectively;
+- 115 • RF(qs\_ent): split quality is measured using Shannon entropy (information gain);
+- 116 • RF(mn\_3), RF(mn\_4), RF(mn\_6), RF(mn\_8): minimum number of observations required to
+117 split an internal node is equal to 3, 4, 6, or 8, respectively;
+- 118 • RF(ml\_2), RF(ml\_3), RF(ml\_4), RF(ml\_5): minimum number of instances per leaf is 2, 3,
+119 4, or 5, respectively;
+- 120 • RF(nf\_log), RF(nf\_all): number of features considered in a node split equals the logarithm
+121 with base 2 of the number of attributes or all features are taken into account, respectively.
+- 122
+
+123
+124 The following BRs were tested: 0.2, 0.4, 0.6, 0.8, 1.0, 1.2 (as analyzed by Martínez-Muñoz & Suárez
+125 (2010)), 2.0, 3.0, 4.0, and 5.0. For each configuration, 2-fold stratified cross-validation, repeated 200
+126 times, was applied, yielding 400 results.
+
+###### 128 4 RESULTS
+
+129
+130 For each dataset, we searched for the pair of RF configuration and BR that yielded the highest
+131 classification accuracy. Table 1 presents these results. Detailed results, including the mean accuracy
+132 and standard deviation for individual RF configurations and datasets, are provided in Appendix B.
+
+133
+134 **Statistical significance.** The main observation is that $BR > 1$ constituted the best setup in 20 out
+135 of 36 datasets. To further compare standard BRs ( $BR \leq 1$ , first group) with those greater than one
+136 (second group), we performed a paired $t$ -test (with the alternative hypothesis that the first sample
+137 has a greater mean than the second one) on the results of the dataset winner (best performing con-
+138 figuration) and results from all configurations with the other BR group. So, if the best classification
+139 accuracy was achieved by RF with $BR \leq 1$ , we compared these results with all results related to
+140 configurations with $BR > 1$ , and vice versa. The last column of the table shows the maximum $p$ -
+141 value among all $t$ -tests for each dataset. We analyzed several significance levels: 0.1, 0.05, 0.01,
+142 0.001, 0.0001, and 0.00001. Considering only conclusive results (i.e., $p$ -values lower than the spec-
+143 ified significance level), the difference in the number of datasets with the best related model with
+144 $BR > 1$ versus those with $BR \leq 1$ amounted to 5, 2, -2, -4, -2, and 0, respectively. This indicates
+145 that, depending on the chosen significance level, the number of datasets with the optimal solution
+146 involving $BR \leq 1$ is roughly comparable to those with $BR > 1$ .
+
+147
+148 **Number of winning configurations.** Among the 18 analyzed RF configurations, only seven
+149 achieved the highest classification accuracy in at least one dataset: RF(nt\_500) (20 datasets),
+150 RF(qs\_ent) (5 datasets), RF(ml\_5) (4 datasets), RF(mn\_8) (3 datasets), RF(ml\_4) (2 datasets),
+151 RF(mn\_4) (1 dataset), and RF(nf\_all) (1 dataset). Further analysis will concentrate on these setups.
+
+152
+153 **Frequency of winning BRs.** Fig. 1 depicts the frequency of winning BRs, both globally and for
+154 each RF parameter setting. The histogram related to RF(nt\_500) is the most similar to the global
+155 one, as this model achieved the best score in 20 out of 36 datasets. For RF(ml\_4) and RF(ml\_5),
+156 models that restrictively control the size of the tree, $BR > 1$ constituted the best setup for as many as
+157 26 datasets. It stems from the fact that, in many cases, a low number of training instances combined
+158 with a relatively high minimum number of samples required to create a leaf led to underfitted trees.
+159 Thus, high BR served as a remedy, enabling the construction of more complex models. RF(nf\_all)
+160 exhibited different behavior compared to the other models. The higher the BR, the less frequently
+161 it was optimal. The key sources of diversity among the individual trees are the distinct subsets of
+162 attributes to consider when looking for the best split in each node, along with the unique bootstrap
+163 sample used in training. When all features are analyzed in a node splitting, the first source of diver-
+164 sity ceases to exist. Thus, to maintain an overall level of diversity, RF(nf\_all) preferred lower BRs,
+
+{3}------------------------------------------------
+
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+
+Table 1: Classification results. The consecutive columns present the dataset name, the optimal RF configuration, the achieved accuracy, the best BR, and the $p$ -value from the conducted $t$ -test.
+
+| Dataset | Best model | Acc. [%] | Bootstrap rate | $p$ -value |
+|-|-|-|-|-|
+| Abalone | RF(ml_5) | 26.801 | 0.2 | $< 10^{-6}$ |
+| Adult | RF(ml_5) | 86.484 | 4.0 | $< 10^{-6}$ |
+| Arrhythmia | RF(nf_all) | 76.161 | 1.2 | 0.305022 |
+| Audiology (Standardized) | RF(mn_8) | 75.338 | 5.0 | 0.013121 |
+| Australian Credit Approval | RF(nt_500) | 87.225 | 0.6 | 0.132623 |
+| Balance Scale | RF(nt_500) | 85.972 | 0.2 | $< 10^{-6}$ |
+| Breast Cancer Wisc. (Diag.) | RF(qs_ent) | 95.898 | 5.0 | $< 10^{-6}$ |
+| Breast Cancer Wisc. (Orig.) | RF(nt_500) | 95.506 | 0.4 | 0.001910 |
+| Congressional Voting Rec. | RF(mn_8) | 94.795 | 2.0 | 0.029394 |
+| Echocardiogram | RF(ml_5) | 73.113 | 2.0 | 0.035933 |
+| Ecoli | RF(nt_500) | 85.835 | 0.6 | 0.000097 |
+| German Credit Data | RF(nt_500) | 75.467 | 1.2 | 0.079419 |
+| Glass Identification | RF(qs_ent) | 75.596 | 2.0 | 0.002702 |
+| Heart | RF(ml_4) | 83.324 | 0.2 | 0.000004 |
+| Hepatitis | RF(nt_500) | 84.726 | 0.4 | 0.000644 |
+| Horse Colic | RF(nt_500) | 86.516 | 1.0 | 0.485986 |
+| Image Segmentation (Stat.) | RF(qs_ent) | 97.133 | 5.0 | $< 10^{-6}$ |
+| Ionosphere | RF(nt_500) | 93.254 | 1.2 | 0.192406 |
+| Iris | RF(mn_4) | 95.232 | 0.4 | 0.105220 |
+| Labor Relations | RF(nt_500) | 93.608 | 1.2 | 0.004194 |
+| Liver Disorders | RF(ml_4) | 59.714 | 0.2 | $< 10^{-6}$ |
+| Optical Recognition (Digits) | RF(nt_500) | 97.413 | 4.0 | $< 10^{-6}$ |
+| Parkinsons | RF(nt_500) | 89.306 | 5.0 | $< 10^{-6}$ |
+| Pima Indians Diabetes | RF(nt_500) | 76.344 | 0.2 | 0.000018 |
+| Sonar, Mines vs. Rocks | RF(qs_ent) | 81.627 | 4.0 | $< 10^{-6}$ |
+| Soybean (Large) | RF(mn_8) | 92.712 | 4.0 | $< 10^{-6}$ |
+| Tic-Tac-Toe Endgame | RF(nt_500) | 97.264 | 5.0 | 0.021006 |
+| Thyroid Disease | RF(qs_ent) | 95.840 | 1.2 | 0.059261 |
+| Vehicle Silhouettes | RF(nt_500) | 74.583 | 5.0 | 0.001911 |
+| Vowel Recognition | RF(nt_500) | 92.285 | 3.0 | $< 10^{-6}$ |
+| Wine | RF(nt_500) | 97.809 | 1.2 | 0.072172 |
+| Ringnorm | RF(nt_500) | 92.717 | 0.6 | $< 10^{-6}$ |
+| Threennorm | RF(nt_500) | 80.050 | 0.4 | 0.000654 |
+| Twonorm | RF(nt_500) | 96.002 | 0.2 | $< 10^{-6}$ |
+| Waveform | RF(nt_500) | 86.165 | 0.2 | $< 10^{-6}$ |
+| LED Display Domain | RF(ml_5) | 66.590 | 1.0 | $< 10^{-6}$ |
+
+which created more varied sets of samples drawn and made the trees less correlated. Looking at the BR histograms, extreme BR values (0.2 and 5.0) constituted the best solutions, both overall and for all analyzed RF configurations, the greatest number of times (the highest bar in each histogram corresponds either to 0.2 or 5.0). This suggests that the optimal BR may often be lower than 0.2 or higher than 5.0, indicating that even a broader range should be tested when tuning RF. Finally, BR = 1, defined in the original formulation of the bootstrapping procedure and the most frequently used value, performed relatively poorly. Overall, it was optimal for only two datasets. When analyzing individual RF configurations, for three of them, BR = 1 was not able to win even in one dataset. Averaging over all seven parameter settings, it was optimal for only 1.43 out of 36 datasets. Interestingly, adjacent to 1, the nonstandard BR = 1.2 was, with the exception of RF(nf\_all), always better, often substantially.
+
+**Individual dataset analysis.** Fig. 2 illustrates the relationship between the performance and BR for the analyzed RF configurations across a selected group of diverse datasets. Charts for the remaining datasets are provided in Appendix C. Our first observation is that RF(nf\_all) behaves differently
+
+{4}------------------------------------------------
+
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+
+
+
+Figure 1: Distribution of winning BR across all RF configurations (top left) and among individual RF parameterizations. The figure consists of eight histograms arranged in a 2x4 grid. The top row shows 'All configurations', 'RF(nt\_500)', 'RF(qs\_ent)', and 'RF(ml\_5)'. The bottom row shows 'RF(mn\_8)', 'RF(ml\_4)', 'RF(mn\_4)', and 'RF(nf\_all)'. Each histogram plots the 'No. of datasets' (y-axis) against the 'Bootstrap rate' (x-axis, ranging from 0.2 to 5.0). The distributions vary, with some showing peaks at low bootstrap rates and others at higher rates.
+
+Figure 1: Distribution of winning BR across all RF configurations (top left) and among individual RF parameterizations.
+
+from the other models. In almost all cases, it reaches optimal accuracy with a lower (or equal) BR compared to other RFs. This observation is consistent with the trends shown in Fig. 1 and the explanation provided in the previous paragraph. In most cases, the best accuracy achieved by RF(nf.all) is substantially worse than that of the other models, and after reaching the optimum, its performance declines rapidly. There are several datasets for which RF(nf.all) performs well. It achieved the best accuracy across all models on the Arrhythmia dataset and was comparable to the best on Audiology (Standardized), Tic-Tac-Toe Endgame, Pima Indians Diabetes, and Iris. The high performance of RF(nf.all) is undoubtedly related to the characteristics of the features, e.g., the abovementioned Arrhythmia has the highest number of features among all datasets. However, the relationship is more complex for the other four datasets. We hypothesize that the importance of features needs to be further assessed to gain deeper insights. Presumably, RF(nf.all) will perform well on datasets with a high proportion of insignificant or less significant features, as it may avoid building trees primarily based on these features.
+
+**Typical BR curve shapes.** All RF configurations other than RF(nf.all) are generally similar in terms of the characteristics of their BR curves. We identified three categories that describe how the set of curves appears:
+
+- (a) In the first and most common pattern, all curves increase to at least BR = 1.2, indicating that the optimal BR is at least 1.2. The curves then either continue to rise (usually more smoothly)/reach a plateau (first subpattern) or they oscillate/gradually decrease (second subpattern). The first subpattern can be observed in the Arrhythmia, Audiology (Standardized), Parkinsons, Breast Cancer Wisc. (Diag.), Optical Recognition (Digits), Ionosphere, Image Segmentation (Stat.), Sonar, Mines vs. Rocks, Soybean (Large), Tic-Tac-Toe Endgame, Vowel, and Recognition datasets. The second subpattern is seen in the Wine, German Credit Data, Glass Identification, Labor Relations, Thyroid Disease, Vehicle Silhouettes, and Congressional Voting Rec. datasets.
+- (b) In the second pattern, all curves either decrease from the very beginning (BR = 0.2) or rise to a BR in the range [0.4, 1.0] and then decline. The overall shape of the curves may be fairly smooth, as seen in the Abalone, Balance Scale, Breast Cancer Wisc. (Orig.), Heart, Liver Disorders, Twonorm, Waveform, and LED Display Domain datasets, or it may exhibit some irregularities, as observed in the Iris and Pima Indians Diabetes datasets.
+- (c) The third pattern is a mixture of the first and second patterns. Curves associated with some RF configurations, mainly RF(ml.4) and RF(ml.5), behave similarly to those in the first pattern, while others resemble the curves seen in the second pattern. This third pattern is present in the Adult, Aus-
+
+{5}------------------------------------------------
+
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+
+
+
+Figure 2: Characteristics of bootstrap rate curves for selected datasets. The figure consists of eight subplots arranged in a 2x4 grid, showing Accuracy vs. Bootstrap rate for different datasets: Arrhythmia, Audiology (Standardized), Pima Indians Diabetes, Iris, Wine, Abalone, Adult, and Echocardiogram. Each plot compares seven Random Forest configurations: RF(nt\_500) (blue), RF(qs\_ent) (orange), RF(mn\_4) (green), RF(mn\_8) (red), RF(ml\_4) (purple), RF(ml\_5) (brown), and RF(nf\_all) (pink). The x-axis represents the bootstrap rate from 1 to 50, and the y-axis represents accuracy. The curves show varying trends across datasets, with some configurations showing higher accuracy at lower bootstrap rates and others at higher rates.
+
+Figure 2: Characteristics of bootstrap rate curves for selected datasets.
+
+tralian Credit Approval, Ecoli, Hepatitis, Ringnorm, Threenorm, Horse Colic, and Echocardiogram datasets. In the case of the last two, some additional irregularities in the BR curves may be observed.
+
+The main observation from the above analysis is that BR curves associated with all RF configurations, except RF(nf\_all), are fairly consistent. The first and second patterns, within which all curves exhibit similar behavior, were observed in 28 out of 36 datasets. This leads to the conclusion that the optimal BR is merely dependent on RF parameterization and is closely related to the dataset.
+
+Naturally, the procedure for testing high BR values follows a typical ‘no free lunch’ scenario—while we may find RF configuration yielding better results, it comes at the cost of slower execution, as it involves sampling more observations and building trees on a larger number of instances. We did not analyze issues related to time performance, which may represent potential direction for further research.
+
+## 5 TOWARDS UNDERSTANDING THE OPTIMAL BOOTSTRAP RATE
+
+**Higher level approaches.** While searching for the reasons why the BR curve differs so significantly between datasets, we began with analyzing the general properties of these datasets, such as the number of features (divided into continuous and binary) and the number of training instances. We also created new features reflecting interactions by applying arithmetic operations to the aforementioned attributes. However, neither approach helped us to understand the problem better. Next, we took a more local approach and examined whether the BR curve was associated with the number of clusters present in the data. Unfortunately, this research direction was also inconclusive. In the meantime, we observed that even small changes in the data could lead to significant changes in the shape of the BR curve and the optimal value of BR. Fig. 3 provides an example. This observation prompted us to go even more local and analyze the neighborhood of individual instances.
+
+**Lower level approaches.** In brief, RF is composed of DTs that cut the feature hyperspace into decision regions defined by the path leading from the root to the corresponding leaf. In a single tree, the prediction for a sample located in a particular leaf region is based on the majority class of the instances that reached that leaf during training. This means that the neighbors (specifically, their classes) of the predicted instance affect the predicted label. The same applies to RF, as it performs majority voting on predictions made by the component DTs. To analyze the structure of neighbors in each dataset, we standardized all continuous features and mapped all binary attributes to -1 and 1. We employed the Manhattan metric, which considers the distance along each feature (axis) independently, to measure the distance between observations. The Manhattan distance is generally
+
+{6}------------------------------------------------
+
+
+
+Figure 3: Two scatter plots, (a) and (b), showing synthetic data points. Plot (a) is labeled '(a) class\_sep = 1.95' and plot (b) is labeled '(b) class\_sep = 2.0'. Both plots show two classes of data points (yellow and purple) on a 2D plane. The x-axis ranges from -6 to 4, and the y-axis ranges from 1.0 to 3.0. In (a), the separation between the classes is smaller than in (b).
+
+Figure 3: An example illustrating how even small differences in the data can significantly affect the optimal BR value. Both figures (a) and (b) depict synthetically generated data using scikit-learn’s *make\_classification* method with the following parameters: $n\_samples = 300$ , $n\_features = 2$ , $n\_classes = 2$ , $n\_clusters\_per\_class = 1$ , and $random\_state = 1$ . The only difference is the value of the *class\_sep* parameter, which controls the separation between the classes. In (a), it is set to 1.95, while in (b), it is 2.0. As a result of this slight difference, the optimal BR in (a) equals 5.0, while in (b), it amounts to 0.2. All other parameters of the *make\_classification* method remain at their default values.
+
+a good choice in the context of a DT (and RF), which also defines a decision boundary that, at any moment, moves along only one feature.
+
+Let us introduce the notation $k\_l$ , which is the number of observations for which, among $k$ nearest neighbors, $l$ samples belong to the same class as the considered instance. Intuitively, high $k\_l$ values for low $l$ , relative to $k$ , indicate inhomogeneity in the data and possibly a relatively high number of outliers. For each dataset, we calculated the $k\_l$ statistics for $k \in \{1, 2, \dots, 10\}$ and $l \in \{0, \dots, k\}$ for each $k$ . Then, we performed normalization so that for each $k$ , the sum $k\_0, \dots, k\_k$ equaled 100, making those values comparable between datasets of varying sizes.
+
+For each $k\_l$ and each RF’s optimal BR, including the overall best, we calculated the Spearman rank-order correlation coefficient. Table 2 presents the results for $k \in \{1, 2, \dots, 6\}$ . Our first observation is that the overall best BR is always positively correlated with $k\_k$ . The highest correlation corresponds to $k = 1, 2, 3$ , after which it gradually decreases. Second, for each $k\_l$ where $l \neq k$ , the correlation is negative; the lower $l$ is, the stronger the correlation becomes in terms of absolute value. This means that the optimal BR for inhomogeneous datasets (high $k\_l$ values for low $l$ ) tends to be lower than for uniform datasets (high $k\_l$ values for $l$ close to $k$ ). A low BR leads to ambiguous observations being drawn less frequently. Therefore, fewer decision trees have leaves affected by such instances, and the remaining RF trees may mitigate incorrect decisions in the majority voting scheme. Conversely, for more uniform data, we hypothesize that a higher BR yields better results because it creates a bootstrap sample with more unique instances, thereby providing more information while maintaining diversity through varying the number of occurrences of these instances. Finally, an excessively high BR does not yield good results because it reduces diversity; as a consequence of the law of large numbers, the number of occurrences of individual observations converges towards each other.
+
+Optimal BRs related to individual RF configurations share properties similar to those of the best overall BR. For all $k$ , the correlation between $k\_k$ and the optimal BR is positive, gradually decreasing after 2.2 (or 1.1 in the case of RF(nf.all)). The rest of the $k\_l$ values ( $l \neq k$ ), for $k \leq 5$ , are negative, with some exceptions for 5.4. The trend between $k\_0$ and $k\_k$ is generally upward, but unlike the best overall BR, it is non-monotonic. RF(nf.all) exhibits this behavior as well, but the range of $k\_l$ values is visibly narrower, and some irregularity occurs for $k = 5$ .
+
+For the increasing $k$ , starting from $k = 6$ , the general ascending trend from $k\_0$ to $k\_k$ is maintained. However, the range $[k\_0, k\_k]$ narrows, the changes are not perfectly monotonic, and more positive values, other than $k\_k$ , appear. We suppose that considering $k > 5$ becomes too general (causing the above irregularities) but still reflects the uniformity of the data (hence, an overall trend is maintained).
+
+The absolute values of the correlation coefficients are not high. For the overall best BR, the highest Spearman rank-order correlation coefficient amounts to 0.330. This is because the function modeling the optimal BR is complex and not dependent on just one predictor. We found two ways to build attributes that are more highly correlated with the target. The first is by multiplying each feature ( $k\_l$ ) by the number of classes in a particular dataset. Intuitively, the higher the number of classes,
+
+{7}------------------------------------------------
+
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+
+Table 2: Spearman rank-order correlation coefficient between $kJ$ and the best BR—overall (second column) and respective RF configurations (columns 3–9).
+
+| $kJ$ | Best RF | nt_500 | qs_ent | ml_5 | mn_8 | ml_4 | mn_4 | nf_all |
+|-|-|-|-|-|-|-|-|-|
+| 1.0 | -0.311 | -0.299 | -0.345 | -0.319 | -0.312 | -0.332 | -0.387 | -0.173 |
+| 1.1 | 0.311 | 0.299 | 0.345 | 0.319 | 0.312 | 0.332 | 0.387 | 0.173 |
+| 2.0 | -0.292 | -0.252 | -0.292 | -0.263 | -0.258 | -0.280 | -0.354 | -0.156 |
+| 2.1 | -0.252 | -0.264 | -0.298 | -0.255 | -0.241 | -0.277 | -0.317 | -0.164 |
+| 2.2 | 0.330 | 0.301 | 0.347 | 0.320 | 0.320 | 0.332 | 0.379 | 0.163 |
+| 3.0 | -0.264 | -0.258 | -0.275 | -0.242 | -0.263 | -0.256 | -0.350 | -0.139 |
+| 3.1 | -0.250 | -0.238 | -0.311 | -0.264 | -0.250 | -0.292 | -0.331 | -0.142 |
+| 3.2 | -0.239 | -0.213 | -0.230 | -0.164 | -0.163 | -0.192 | -0.261 | -0.183 |
+| 3.3 | 0.323 | 0.280 | 0.341 | 0.307 | 0.294 | 0.320 | 0.365 | 0.151 |
+| 4.0 | -0.292 | -0.266 | -0.278 | -0.254 | -0.268 | -0.258 | -0.351 | -0.134 |
+| 4.1 | -0.261 | -0.233 | -0.283 | -0.255 | -0.249 | -0.274 | -0.325 | -0.159 |
+| 4.2 | -0.213 | -0.208 | -0.264 | -0.209 | -0.179 | -0.235 | -0.280 | -0.147 |
+| 4.3 | -0.114 | -0.116 | -0.134 | -0.031 | -0.056 | -0.067 | -0.158 | -0.090 |
+| 4.4 | 0.299 | 0.261 | 0.319 | 0.286 | 0.269 | 0.301 | 0.346 | 0.146 |
+| 5.0 | -0.238 | -0.221 | -0.218 | -0.198 | -0.185 | -0.217 | -0.285 | -0.099 |
+| 5.1 | -0.227 | -0.178 | -0.224 | -0.183 | -0.201 | -0.205 | -0.267 | -0.034 |
+| 5.2 | -0.223 | -0.232 | -0.298 | -0.230 | -0.220 | -0.264 | -0.321 | -0.134 |
+| 5.3 | -0.204 | -0.148 | -0.181 | -0.114 | -0.113 | -0.143 | -0.211 | -0.127 |
+| 5.4 | -0.084 | -0.027 | -0.035 | 0.096 | 0.056 | 0.055 | -0.058 | 0.003 |
+| 5.5 | 0.302 | 0.244 | 0.301 | 0.269 | 0.245 | 0.285 | 0.318 | 0.125 |
+| 6.0 | -0.213 | -0.186 | -0.170 | -0.165 | -0.149 | -0.182 | -0.251 | -0.080 |
+| 6.1 | -0.156 | -0.134 | -0.183 | -0.127 | -0.165 | -0.156 | -0.223 | 0.031 |
+| 6.2 | -0.234 | -0.239 | -0.292 | -0.225 | -0.214 | -0.261 | -0.328 | -0.154 |
+| 6.3 | -0.158 | -0.128 | -0.199 | -0.167 | -0.136 | -0.198 | -0.213 | -0.015 |
+| 6.4 | -0.109 | -0.041 | -0.062 | 0.039 | 0.039 | 0.008 | -0.086 | -0.083 |
+| 6.5 | -0.013 | 0.030 | -0.001 | 0.169 | 0.125 | 0.129 | 0.030 | 0.080 |
+| 6.6 | 0.265 | 0.204 | 0.261 | 0.220 | 0.190 | 0.235 | 0.260 | 0.080 |
+
+the lower the probability that outliers (ambiguous observations) from the same class, potentially forming a decision leaf in a tree, are drawn. Indeed, the correlation coefficients move upward. The negative ones become closer to zero or even turn positive. For example, for the overall best BR, 2.0, 3.2, and 4.3 increase from -0.292, -0.239, and -0.114 to -0.191, -0.041, and 0.038, respectively. Similarly, the positive values rise even higher. For instance, 2.2, 3.3, and 4.4 increase from 0.330, 0.323, and 0.299 to 0.456, 0.493, and 0.454, respectively.
+
+The second way to create predictors with a higher correlation to the target is to introduce features that represent interactions between existing attributes $kJ$ , where $k \in \{1, 2, \dots, 10\}$ and $l \in \{0, \dots, k\}$ for each $k$ . More specifically, for all pairs of distinct features, we perform division, subtraction, multiplication, and addition (the first two in both directions). Additionally, each attribute is multiplied by itself and added to itself, creating two additional features. In this way, 12620 new attributes are created. The features most positively correlated with the target are $9.2/2.0$ (9.2 divided by 2.0), $10.2/3.0$ , and $10.2/4.0$ . The respective correlation coefficients are 0.607, 0.595, and 0.595.
+
+**Bootstrap rate prediction.** To further assess how well the above set of attributes describes the problem, we used them (along with base $kJ$ statistics) to build a binary classifier predicting whether the optimal BR across all RF configurations are $\leq 1$ or $> 1$ for a given dataset. As in the main experiments, we tested all 18 RF configurations and 10 BR values. Due to the limited number of observations—one corresponding to one of 36 datasets—we performed Leave-Two-Out Cross-Validation in all possible variants, yielding 320 train-validation splits. Given the high dimensionality
+
+{8}------------------------------------------------
+
+432 (12685 features), the initial results were poor. To address this, we reduced the number of input
+433 features to the $k$ highest correlated with the target, with $k$ ranging from 1 to 10, based on the
+434 absolute value of the Spearman rank-order coefficient, calculated separately for each run on the
+435 training instances. The best classification accuracy, averaged over all 320 runs, equaled 81.88% and
+436 was achieved by RF(nt\_200) with BR = 0.4, using seven attributes.
+
+437 Differences in classification accuracies between different BRs are sometimes marginal. Therefore,
+438 another experiment was conducted, this time focusing only on observations with undisputed labels.
+439 We assumed these are datasets for which the corresponding $p$ -value in Table 1 is at most 0.01. A total
+440 of 24 observations met this condition. The remaining experimental configuration was the same as
+441 in the previous experiment. Leave-Two-Out Cross-Validation was performed on all possible 143
+442 train-validation splits. The highest accuracy, 88.81%, was achieved by RF(nf\_all) with BR = 0.8,
+443 using only three features.
+
+444 In both of the above experiments, the number of training instances was low: 36 and 24, respectively.
+445 We believe that a simple increase in these numbers may lead to further improvements in
+446 performance. Additionally, both datasets were well-balanced, with the majority class constituting
+447 55.56% and 54.17%, respectively. Thus, we conclude that the proposed attributes, which enabled
+448 us to achieve accuracies of 81.88% and 88.81%, can be considered as effective descriptors of the
+449 analyzed problem.
+
+450
+
+451
+
+## 452 6 CONCLUSIONS AND FUTURE WORK
+
+453
+
+454
+
+455 In this paper, we analyze the BR hyperparameter in RF. To the best of our knowledge, this work
+456 is the first to shed light on what the optimal BR value depends on and to demonstrate that it is
+457 often greater than 1, thus exceeds the standard values within the $(0, 1]$ range. We also show that the
+458 optimal BR value is largely independent of the other hyperparameters of the RF. In fact, most RF
+459 configurations are highly correlated in terms of the BR curve, which makes the optimal BR value
+460 more of a property of the dataset.
+
+461 Our main conclusion stating that $BR > 1$ often yields superior results and is worth considering
+462 contradicts the findings of the baseline reference paper (Martínez-Muñoz & Suárez, 2010). We
+463 identify two main reasons for this. First, the authors of (Martínez-Muñoz & Suárez, 2010) stopped
+464 their analysis at $BR = 1.2$ and did not explore higher values. Second, they most likely tested only
+465 one RF configuration. In fact, they did not provide any details regarding the RF hyperparameters,
+466 other than stating that the ensemble was composed of 200 unpruned CART trees (Breiman et al.,
+467 1984).
+
+468 Prediction of the optimal BR value is a complex task, highly dependent on the local class structure.
+469 In this work, we propose to calculate $k_l$ statistics, which reflect the number of observations from
+470 the same class as the instances considered in their neighborhood and use them to calculate the
+471 correlations with the optimal BR value. While this approach works generally well, we believe that it
+472 can still be improved through describing the local class structure in a different, possibly more precise
+473 way.
+
+474 Considering nearest neighbors assumes that the analyzed observation is located at the center of the
+475 decision regions and that these regions form a hypercube, meaning all decision hyperplanes are
+476 equally distant from the analyzed sample. This is a simplification, as in real-world scenarios, the
+477 range of features corresponding to a decision subspace is usually unequal, and no point lies exactly
+478 at the center of all feature ranges. Therefore, analyzing an instance's neighborhood by sampling
+479 each feature range to reflect the different decision subspaces to which a particular instance may
+480 belong may be a viable approach.
+
+481 Another research direction worth exploring is to extend $k_l$ to more detailed statistics that specify the
+482 number of neighbors from each individual class. $k_l$ can be interpreted as the number of instances
+483 for which, among the $k$ nearest neighbors, $k - l$ observations belong to classes other than the one
+484 under consideration. We believe that the distribution of these classes may be useful in predicting
+485 the optimal BR. The more uniform the distribution (with no dominant class), the easier it is for an
+ambiguous example to outvote the correct class in a majority or soft voting scheme.
+
+{9}------------------------------------------------
+
+486 Finally, we examined three well-established ML libraries: scikit-learn, Weka, and H2O.ai. In all of
+487 them, values of the BR hyperparameter greater than one are disabled in their RF implementations.
+488 Based on our findings, we recommend that the developers of ML libraries consider making this
+489 feature available.
+
+## 490 REFERENCES
+
+- 493 Md Nasim Adnan. Improving the Random Forest Algorithm by Randomly Varying the Size of the
+494 Bootstrap Samples. In *Proceedings of the 2014 IEEE 15th International Conference on Informa-*
+495 *tion Reuse and Integration, IEEE IRI 2014*, pp. 303–308, 08 2014.
+- 496 Simon Bernard, Laurent Heutte, and Sébastien Adam. Influence of Hyperparameters on Random
+497 Forest Accuracy. In *Multiple Classifier Systems*, pp. 171–180. Springer Berlin Heidelberg, 2009.
+- 498 Gérard Biau, Luc Devroye, and Gábor Lugosi. Consistency of Random Forests and Other Averaging
+499 Classifiers. *Journal of Machine Learning Research*, 9(66):2015–2033, 2008.
+- 500 Leo Breiman. Arcing Classifiers. *The Annals of Statistics*, 26(3):801–824, 1998.
+- 501 Leo Breiman. Random Forests. *Machine Learning*, 45:5–32, 2001.
+- 502 Leo Breiman, Jerome Friedman, Charles J. Stone, and Richard A. Olshen. *Classification and Re-*
+503 *gression Trees*. Taylor & Francis, 1984.
+- 504 Misha Denil, David Matheson, and Nando Freitas. Consistency of Online Random Forests. In
+505 *Proceedings of the 30th International Conference on Machine Learning*, volume 28, pp. 1256–
+506 1264. PMLR, 2013.
+- 507 Durox, Roxane and Scornet, Erwan. Impact of subsampling and tree depth on random forests.
+508 *ESAIM: PS*, 22:96–128, 2018.
+- 509 Benjamin A Goldstein, Eric C Polley, and Farren B. S. Briggs. Random Forests for Genetic Associ-
+510 ation Studies. *Statistical Applications in Genetics and Molecular Biology*, 10(1), 2011.
+- 511 Hemant Ishwaran and Udaya B. Kogalur. Consistency of random survival forests. *Statistics &*
+512 *Probability Letters*, 80(13):1056–1064, 2010.
+- 513 Markelle Kelly, Rachel Longjohn, and Kolby Nottingham. The UCI Machine Learning Repository.
+514 , 2023. Accessed: 2024-07-11.
+- 515 Gonzalo Martínez-Muñoz and Alberto Suárez. Out-of-bag estimation of the optimal sample size in
+516 bagging. *Pattern Recognition*, 43(1):143–152, 2010.
+- 517 Thais Mayumi Oshiro, Pedro Santoro Perez, and José Augusto Baranauskas. How Many Trees in
+518 a Random Forest? In *Machine Learning and Data Mining in Pattern Recognition*, pp. 154–168.
+519 Springer Berlin Heidelberg, 2012.
+- 520 Philipp Probst and Anne-Laure Boulesteix. To Tune or Not to Tune the Number of Trees in Random
+521 Forest. *Journal of Machine Learning Research*, 18(181):1–18, 2018.
+- 522 Philipp Probst, Marvin N. Wright, and Anne-Laure Boulesteix. Hyperparameters and tuning strate-
+523 gies for random forest. *WIREs Data Mining and Knowledge Discovery*, 9, 2019.
+- 524 Erwan Scornet. Tuning parameters in random forests. *ESAIM: Procs*, 60:144–162, 2017.
+- 525 Ningyuan Zhu, Chaoyang Zhu, Liang Zhou, Yayun Zhu, and Xiaojuan Zhang. Optimization of the
+526 Random Forest Hyperparameters for Power Industrial Control Systems Intrusion Detection Using
+527 an Improved Grid Search Algorithm. *Applied Sciences*, 12(20), 2022.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/dGMJ93qpfq.txt b/papers/dGMJ93qpfq.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c47f1a506cab54809440241b6993a4b89200e71d
--- /dev/null
+++ b/papers/dGMJ93qpfq.txt
@@ -0,0 +1,416 @@
+**Primary Area:** unsupervised, self-supervised, semi-supervised, and supervised representation learning
+
+
+
+{0}------------------------------------------------
+
+# A PATCH LEVEL PERSPECTIVE OF PROMPT TUNING
+
+**Anonymous authors**
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Prompt tuning is an efficient way to adapt large foundation models. It introduces learnable prompts with the input data tokens, offering a practical alternative to full model finetuning. However, when prompts are trained on base/target tasks, they often overfit, leading to reduced performance on novel, unseen tasks. To address this limitation, various techniques leverage global image semantics to improve accuracy on unseen tasks while maintaining performance on base tasks. However, they often overlook the rich fine-grained local information that could be crucial for capturing finer semantics and improving generalisation. In this work, we propose a modular approach to prompt tuning that leverages local semantics by incorporating patch-level information, representing the first integration of such semantics in this context. Specifically, we integrate patch-level information across vision, text, and predictions through three consistency mechanisms: 1) Patch-based consistency loss that aligns patches from the prompted input image with those from the same image processed by a frozen model, while also enforcing inter-view consistency by applying the loss across different views, capturing fine-grained regional dependencies and improving vision representation quality; 2) Text prompt consistency loss, where view-specific text prompts are tailored and regularised to maintain coherence across views; 3) Vision features for each view, enriched with patch-level information, are used to generate predictions based on view-tailored text features. These predictions are then regularised across views, complementing the earlier consistency mechanisms and contributing to a cohesive overall framework. Our approach outperforms existing methods across multiple benchmarks, including base-to-novel generalisation, domain generalisation, and cross-dataset evaluation. These results underscore the potential of integrating fine-grained details for more robust and adaptable prompts, marking a step forward in foundation model tuning.
+
+## 1 INTRODUCTION
+
+Foundation models, such as CLIP (Radford et al., 2021), have demonstrated impressive zero-shot performance across a wide range of tasks, showcasing their adaptability and potential for general applications. However, when it comes to task-specific performance, these models often fall short, compared to specialised models. Fine-tuning foundation models to obtain task-specific models can address this gap, but it is computationally expensive, time-consuming, and impractical when we have only limited data. To overcome these limitations, prompt tuning has emerged as an efficient alternative for adapting large foundation models like CLIP (Zhou et al., 2021). This method introduces learnable prompts to make minor adjustments, while keeping the rest of the model frozen, drastically reducing the computational overhead (Zhou et al., 2021; 2022; Zhu et al., 2022; Yao et al., 2023; Khattak et al., 2022; Derakhshani et al., 2022; Roy & Etemad, 2023; Zhang et al., 2023).
+
+Despite its efficiency, prompt tuning tends to overfit on base classification task which includes a subset of base classes, and diminishes generalisation to novel, unseen tasks. Models fine-tuned with prompts can underperform on unseen tasks, compared to CLIP’s original zero-shot capabilities (Zhou et al., 2022). This overfitting is due to a loss of generalisation, where the model becomes too tailored to the specific training data, limiting its broader applicability. To address this issue, various strategies have been proposed, such as generating text prompts conditioned on image features (Zhou et al., 2022; Zang et al., 2022), treating prompt learning as a Bayesian inference problem (Derakhshani et al., 2022), aligning prompt updates with gradients from non-prompted predictions (Zhu et al., 2022), and applying consistency-based regularisation to the model’s output features and logits (Khattak
+
+{1}------------------------------------------------
+
+054 et al., 2023; Roy & Etemad, 2023). Among these, multi-modal frameworks that regularise output
+ 055 features and logits with zero-shot CLIP, using $\ell_1$ -norm or cosine similarity (Khattak et al., 2023; Roy
+ 056 & Etemad, 2023), have shown notable success in improving generalisation.
+
+057 Existing methods, such as PromptSRC and CoPrompt, focus primarily on global text and vision fea-
+ 058 tures, overlooking the rich local information in image patches. Self-supervised frameworks (Yun et al.,
+ 059 2022; Li et al., 2022; Atito et al., 2022) incorporate patches but primarily optimize patch-level losses
+ 060 without addressing cross-modality consistency. Adapter based methods, such as CoPrompt (Roy &
+ 061 Etemad, 2023), also fail to capture rich patch-level details for vision feature generation. In contrast,
+ 062 our approach integrates patch-level features across multiple components, leveraging inter-view and
+ 063 intra-patch-level consistency to address finer-grained variability beyond global consistency. By using
+ 064 patches for both vision feature, text and logit regularization and conditioning text prompts, our
+ 065 method improves feature generation and class predictions, enhancing generalization.
+
+066 Specifically, we introduce a novel patch-level consistency loss that enforces both intra-view and
+ 067 inter-view consistency, aligning patch representations across different views. While prior works focus
+ 068 on global consistency, we apply intra-view regularisation to the prompted patch features from the
+ 069 anchor view with zero-shot anchor patches. In addition to promote further consistency and to design
+ 070 a non-trivial regularisation, we enforce inter-view consistency which maintains patch consistency
+ 071 across different views of an image by adding an extra guidance for generalisable prompts. An extra
+ 072 augmented view is generated and patch consistency loss is applied with most similar zero-shot anchor
+ 073 patches. Here, both the anchor and augmented prompted patch features are projected through a
+ 074 convolutional layer to obtain better feature representations. This combined intra-view and inter-view
+ 075 consistency ensures robust prompt tuning and significantly enhances generalisation.
+
+076 In addition to regularizing the vision branch, we also focus on the text branch by leveraging local
+ 077 information and inter-view variations. To achieve this, we generate view-tailored text prompts based
+ 078 on view-specific clustered patch features. Unlike CoCoop (Zhou et al., 2022), which relies on global
+ 079 semantics for text prompt generation, our approach incorporates local patch features for a more
+ 080 refined prompt. Finally, view-specific text features are generated from each of the view-tailored
+ 081 prompts. To further regularize the view-tailored text prompts, we apply an $\ell_1$ -loss between the
+ 082 anchor-view and augmented-view text features, with a stop-gradient applied to the anchor-view
+ 083 output. This ensures inter-view consistency in the text branch and promotes the generalizability of
+ 084 the learned text prompts.
+
+085 Lastly, patch-level information is integrated with vision features by averaging projected patch tokens
+ 086 and combining them with class token features to produce enhanced vision outputs. These outputs are
+ 087 used to compute logits via a dot product with view-specific text features, further regularized with
+ 088 $\mathcal{KL}$ -Divergence between anchor and augmented view logits, applying a stop-gradient to the anchor
+ 089 view.
+
+090 Our Patch-Aware Prompting (PAP) framework achieves superior performance over previous methods
+ 091 across diverse tasks, including base-to-novel generalization, domain generalization, and cross-dataset
+ 092 evaluation. By seamlessly integrating patch-level information and addressing both intra-view and inter-
+ 093 view variations, PAP enhances generalization and robustness in prompt tuning. While PAP includes
+ 094 multiple components, each is specifically designed to address distinct challenges in leveraging patch-
+ 095 level information, with their collective effectiveness validated through extensive ablation studies.
+ 096 This ensures a reliable and efficient pipeline for adapting foundation models to downstream tasks.
+
+###### 098 2 RELATED WORK
+
+099
+ 100 Foundation models based on image-text alignment have demonstrated strong zero-shot performance,
+ 101 but finetuning them is computationally expensive and often leads to reduced generalisation (Radford
+ 102 et al., 2021; Yao et al., 2021; Jia et al., 2021; Zhai et al., 2021; Yuan et al., 2021). As a result, many
+ 103 applications leverage these models as feature extractors with task-specific components (Vidit et al.,
+ 104 2023; Yu et al., 2023; Lin et al., 2023; Yi et al., 2023; Yun et al., 2023; Bousellham et al., 2023).
+ 105 Prompt learning offers an efficient alternative by adapting vision-language models with task-specific
+ 106 prompts while keeping the base model frozen, thus avoiding the challenges of full finetuning (Zhou
+ 107 et al., 2021). However, prompts trained on base classes tend to generalise poorly to unseen classes.
+ To address this, several methods apply regularisation techniques—such as loss constraints, input
+
+{2}------------------------------------------------
+
+conditioning, or different strategies/components (Zhou et al., 2022; Khattak et al., 2023; Roy & Etemad, 2023; Derakhshani et al., 2022)—to improve generalisation and ensure better adaptation across both base and novel classes.
+
+CoCoop (Zhou et al., 2022), UniVL (Zang et al., 2022), and MaPLe (Khattak et al., 2022) regularise prompts by conditioning inputs with global information. CoCoop uses vision features to condition text prompts, UniVL jointly learns vision and text prompts via a small neural network, and MaPLe synchronises vision and text prompts across layers. In contrast, our method conditions text prompts at the input layer using rich patch information and regularises output features with a loss function. PromptSRC (Khattak et al., 2023) and CoPrompt (Roy & Etemad, 2023) focus on feature and prediction regularisation with zero-shot CLIP knowledge. PromptSRC regularises global embeddings and logits while aggregating prompts across epochs, whereas CoPrompt enhances feature learning with an adapter (Gao et al., 2021). Our approach emphasises finer patch-level feature regularisation and inter-view consistency. Independently developed, Long et al. (2024) uses clustered patch tokens for text prompts but lacks inter-view consistency and patch integration into predictions, underperforming compared to PromptSRC. Prograd (Zhu et al., 2022) and Bayesian Prompt (Derakhshani et al., 2022) propose different strategies for prompt regularisation. Prograd (Zhu et al., 2022) updates prompts only when their gradients align with zero-shot knowledge, while ProDA (Lu et al., 2022) enforces a Gaussian distribution on prompts to reduce bias. Bayesian Prompt (Derakhshani et al., 2022) views prompt tuning through a Bayesian lens to improve generalisation.
+
+In contrast to these regularisation methods, recent studies focus on improving base class performance (Zhang et al., 2023) or distilling knowledge from a larger teacher model (Li et al., 2024). DePT (Zhang et al., 2023) decouples the learning of base and novel classes by adding a classification head specifically for base classes, improving base class performance while maintaining results on novel classes. PromptKD (Li et al., 2024) distills a larger CLIP-L/14 model into a smaller CLIP-B/16 model, enhancing overall performance. CasPL (Wu et al. (2024), utilizing the larger CLIP-L/14 model for distilling adaptable prompts, follows a two-stage process: learning adaptable prompts via unsupervised learning and training boosting prompts using prior prompt-tuning methods. Orthogonally, MetaPrompt (Park et al., 2024) applies meta-learning for prompt tuning by learning a regulariser. Unlike these methods, we maintain the existing training pipeline, avoid distilling from larger models, and focus on improving performance through loss functions and by exploiting fine-grained details.
+
+Our Patch-Aware Prompting (PAP) differs from existing regularisation techniques by incorporating patch-level information at multiple stages. We regularise vision embeddings at the patch level across both similar and different views for more effective regularisation. Additionally, we use patch information to generate view-specific text prompts, which are further regularised to maintain consistency across views. Finally, we enhance the vision embeddings with patch-level information while also regularising logits at the inter-view level. This design allows our model to perform competitively across several evaluation benchmarks.
+
+## 3 METHODOLOGY
+
+We propose a novel prompt tuning framework that leverages rich, local contextual information to maintain the generalisability of CLIP to novel tasks, while improving performance on base tasks. Our framework is a modular component that can be applied to previous global prompt consistency methods (Khattak et al., 2023; Roy & Etemad, 2023; Zhang et al., 2023). By incorporating patch-level information, we design components that further regularize the prompt learning process. Unlike earlier approaches that rely on global feature embeddings (Khattak et al., 2023; Roy & Etemad, 2023) or architectural modifications (Zhou et al., 2022; Zhu et al., 2022) to enhance generalisability, our method focuses on local information. Fig. 1 depicts the overall architecture of the proposed Patch-Aware Prompting framework.
+
+First, we introduce a novel vision patch regularisation loss. This loss regularizes the patch outputs generated by our framework with zero-shot predictions from CLIP (Radford et al., 2021), ensuring consistency at the patch level. To handle inter-view variance among different crops typically sampled during training, we add another view called the augmented view of the image and apply a patch loss using zero-shot predictions from the anchor view. This ensures consistent representation with CLIP, both within similar views and across different views of an image. To maintain inter-view consistency at the textual level and incorporate rich local context, we generate view-specific text prompts for both
+
+{3}------------------------------------------------
+
+
+
+Figure 1: Patch-Aware Prompting (PAP) Framework diagram. The diagram is divided into three main parts: (A) Vision, (B) Text, and (C) Predictions. (A) Vision: Shows an 'Anchor View' and an 'Aug. View' of a cat. Each is processed by an 'Image Encoder' to produce vision features (V\_vn, P\_vn) and (V\_aug, P\_aug). Patch information is integrated via 'Voronoi chart' and 'B\_aug' components. (B) Text: Shows a 'View-tailored text' prompt 'A photo of a cat' being processed by a 'Text Encoder' to produce text features (T\_vn, T\_aug). (C) Predictions: Shows the vision and text features being combined to produce logits (lgt\_vn, lgt\_aug). The diagram also includes 'Our Losses' section with 'Patch Loss', 'Text Cons. Loss', and 'Pred Cons. Loss' components.
+
+Figure 1: Patch-Aware Prompting (PAP) Framework: Patch information from anchor and augmented views is integrated into (A)vision, (B)text branches and (C)predictions. View-tailored text prompts are conditioned on patch clusters, with intra-view and inter-view losses applied to vision patches and inter-view consistency losses applied to text prompts and patch enhanced predictions.
+
+the anchor and augmented views. This process differs from previous frameworks that rely on global image features (Zhou et al., 2021; Zang et al., 2022) by utilising patches that contain fine-grained details. We use the Voronoi algorithm (Voronoi, 1908) to cluster patch features, creating biases that guide the text prompt initialization. We further regularise these prompts using a text loss that ensures consistency between the text features generated from the anchor and the augmented prompts. This alignment across view-specific prompts improves generalisability.
+
+Lastly, we combine the patch-level information to generate enhanced vision features. The final vision feature is a combination of the class token embedding and the average of the patch token embeddings. This ensures that patch-level information is included, providing a comprehensive representation of the image. We then compute the logits by taking the dot product of the enhanced vision and text output features. To maintain consistency not only at the feature level but also in class predictions across views, we regularize the logits using a $\mathcal{KL}$ -divergence loss between the predictions from anchor and augmented views. We provide further details of our architecture in the following sections along with preliminaries.
+
+### 3.1 PRELIMINARIES
+
+Let $f$ and $g$ represent the image and text encoders of CLIP, respectively. The input image $\mathbf{X} \in \mathbb{R}^{CH \times H \times W}$ is divided into $M$ patch tokens after the projection layer. The vision transformer encoder receives the input $\mathbf{X}_{in} = \{e_{cls}, e_1, \dots, e_M\}$ , consisting of the class token $e_{cls}$ and the patch tokens. After passing through the vision encoder $f$ , the class and patch features are $\tilde{\mathbf{V}} \in \mathbb{R}^d$ and $\tilde{\mathbf{P}} \in \mathbb{R}^{M \times d}$ . The class label $c_K$ , from the set $\{1, \dots, C\}$ , is wrapped in the text template "a photo of a class label". The input to the text encoder, after embedding and adding [SOS] and [EOS] tokens, is $\mathbf{Y}_{in} = \{y_{[SOS]}, y_1, \dots, y_{c_K}, y_{[EOS]}\}$ , where $c_k$ and $\{y_i\}_{i=1}^L$ are the embeddings for the class label and text template. The zero-shot text features for class label $k$ are $\tilde{\mathbf{T}}_k \in \mathbb{R}^d$ , with $\tilde{\mathbf{T}} = \{\tilde{\mathbf{T}}_k\}_{k=1}^K$ . The zero-shot logits are calculated as $lgt = \text{sim}(\tilde{\mathbf{T}}, \tilde{\mathbf{V}})/\tau$ , where $\tau$ is the temperature and $\text{sim}()$ denotes the cosine similarity. The prediction for class label $k$ is given by: $\frac{\exp(\text{sim}(\tilde{\mathbf{T}}_k, \tilde{\mathbf{V}})/\tau)}{\sum_{c=1}^K \exp(\text{sim}(\tilde{\mathbf{T}}_c, \tilde{\mathbf{V}})/\tau)}$ .
+
+Prompt learning involves adding learnable prompts to either the text or image encoder (Zhou et al., 2022; 2021; Roy & Etemad, 2023; Khattak et al., 2023). Let $G_t = \{g_1^1, g_2^1, \dots, g_n^1\}$ and $G_v = \{g_1^2, g_2^2, \dots, g_n^2\}$ represent the text and vision prompts, where $nt$ and $nv$ denote the number of text and vision prompts, respectively. The inputs to the vision and text encoders with these trainable prompts are $\mathbf{X}_{in}^p = \{G_v, e_{cls}, e_1, \dots, e_M\}$ and $\mathbf{Y}_{in}^p = \{y_{[SOS]}, G_t, c_k, y_{[EOS]}\}$ . In deep prompting, additional prompts are introduced at each transformer layer, replacing the previous layer's prompts. The vision-prompted class and patch features, after passing through the vision encoder, are $\tilde{\mathbf{V}} \in \mathbb{R}^d$ and $\tilde{\mathbf{P}} \in \mathbb{R}^{M \times d}$ , and the text-prompted features $\tilde{\mathbf{T}}_k \in \mathbb{R}^d$ are generated by the text encoder. The
+
+{4}------------------------------------------------
+
+training is supervised using the cross-entropy loss:
+
+$$\mathcal{L}_{ce} = -\log \frac{\exp(\text{sim}(T_k, V))/\tau}{\sum_{c=1}^C \exp(\text{sim}(T_c, V))/\tau}. \quad (1)$$
+
+Additionally, PromptSRC (Khattak et al., 2023) defines global-level losses on features and logits:
+
+$$\mathcal{L}_{\text{SCL-image}} = \sum_{i=1}^d |\tilde{V} - V|, \quad \mathcal{L}_{\text{SCL-text}} = \sum_{i=1}^d |\tilde{T} - T|. \quad (2)$$
+
+$$\mathcal{L}_{\text{SCL-logits}} = \mathcal{K}\mathcal{L}\text{-Div}(\text{sim}(\tilde{T}, \tilde{V}), \text{sim}(T, V)). \quad (3)$$
+
+The final loss is a combination of the above loss functions:
+
+$$\mathcal{L}_{\text{global}} = \mathcal{L}_{\text{CE}} + \mathcal{L}_{\text{SCL-text}} + \mathcal{L}_{\text{SCL-image}} + \mathcal{L}_{\text{SCL-logits}}. \quad (4)$$
+
+### 3.2 PATCHES FOR PROMPT TUNING
+
+We incorporate patch information in multiple ways in both the text and vision branches of our model. Our framework generates two views: a main view, called the anchor view $\mathbf{X}_{\text{an}}$ , and an augmented view $\mathbf{X}_{\text{aug}}$ . Let $\mathbf{V}_{\text{an}} \in \mathbf{R}^d$ and $\mathbf{P}_{\text{an}} \in \mathbf{R}^{M \times d}$ represent the zero-shot class and patch features for the anchor view, and let $\tilde{\mathbf{V}}_{\text{aug}} \in \mathbf{R}^d$ and $\tilde{\mathbf{P}}_{\text{aug}} \in \mathbf{R}^{M \times d}$ represent the class and patch features for the augmented view. The prompted class and patch features for the anchor view are $\mathbf{V}_{\text{an}} \in \mathbf{R}^d$ and $\mathbf{P}_{\text{an}} \in \mathbf{R}^{M \times d}$ , respectively, while $\mathbf{V}_{\text{aug}} \in \mathbf{R}^d$ and $\mathbf{P}_{\text{aug}} \in \mathbf{R}^{M \times d}$ correspond to the augmented view. We further project these prompted patch features through a convolution projection block to obtain final patch features: $\tilde{\mathbf{P}}_{\text{an}} = \text{ConvProj}(\mathbf{P}_{\text{an}})$ and $\tilde{\mathbf{P}}_{\text{aug}} = \text{ConvProj}(\mathbf{P}_{\text{aug}})$ . This convolutional projection block consists of two convolutional layers with a kernel size of $3 \times 3$ .
+
+**Patch Consistency Loss:** Consistency-guided methods for prompt tuning typically focus on global feature consistency (Khattak et al., 2023; Roy & Etemad, 2023). In contrast, we propose a patch-level consistency loss that directs the learning trajectory towards better generalization, guided by the patch information. We start by introducing a simple loss to ensure consistency between patches from the prompted and zero-shot outputs for the same view. For the anchor view, we define an intra-view patch consistency loss:
+
+$$\mathcal{L}_{\text{intra-view}} = \sum_{i=1}^M (1 - \text{sim}(\tilde{\mathbf{P}}_{\text{an}}^i - \tilde{\mathbf{P}}_{\text{an}}^i)), \quad (5)$$
+
+which keeps the patches aligned with the original CLIP model, helping prevent catastrophic forgetting.
+
+During training, prompt-tuning models crop random image portions. Our goal is to preserve patch relationships across crops for better regularization. CoPrompt (Roy & Etemad, 2023) enforces global inter-view consistency but ignores patch-level details. FILIP (Yao et al., 2021) focuses on image-text alignment but not patch consistency across crops. To address this, we introduce the augmented view $\mathbf{X}_{\text{aug}}$ to ensure patch-level consistency with the anchor view $\mathbf{X}_{\text{an}}$ . From $\mathbf{X}_{\text{aug}}$ patches, $\tilde{\mathbf{P}}_{\text{aug}}^i (i \in \{1, \dots, M\})$ , we identify the closest zero-shot patch in $\mathbf{X}_{\text{an}}$ . The closest patch is determined by
+
+$$\text{crossview\_feat}(\tilde{\mathbf{P}}_{\text{aug}}^i) = \tilde{\mathbf{P}}_{\text{an}}^j, \quad j = \arg \max_{k \in \{1, \dots, M\}} \text{sim}(\tilde{\mathbf{P}}_{\text{aug}}^i, \tilde{\mathbf{P}}_{\text{an}}^k), \quad (6)$$
+
+where the closest zero-shot anchor patch $\tilde{\mathbf{P}}_{\text{an}}^j (j \in \{1, \dots, M\})$ corresponds to the zero-shot augmented patch $\tilde{\mathbf{P}}_{\text{aug}}^i$ . Using zero-shot outputs to calculate similarity prevents the model from finding an easier learning path, such as having all prompted patches match closely with a single target patch.
+
+The final inter-view patch consistency loss is defined as:
+
+$$\mathcal{L}_{\text{inter-view}} = \sum_{i=1}^M (1 - \text{sim}(\tilde{\mathbf{P}}_{\text{aug}}^i, \text{crossview\_feat}(\tilde{\mathbf{P}}_{\text{aug}}^i))), \quad (7)$$
+
+which promotes the consistency between the prompted patches of the augmented view $\tilde{\mathbf{P}}_{\text{aug}}^i$ and the closest zero-shot anchor patches $\tilde{\mathbf{P}}_{\text{an}}^i$ . Our total patch consistency loss is the sum of both the inter-view and intra-view consistency losses:
+
+$$\mathcal{L}_{\text{patch-con}} = \mathcal{L}_{\text{intra-view}} + \mathcal{L}_{\text{inter-view}}. \quad (8)$$
+
+{5}------------------------------------------------
+
+**View-tailored text prompts:** Regularizing text prompts with global vision semantics is crucial for strong performance on novel tasks across domains (Khattak et al., 2023; Roy & Etemad, 2023). We enhance this by incorporating rich patch-level details. Unique text prompts are generated for both the anchor and augmented views. Using class tokens to generate prompts, as in Zhou et al. (2022), creates overly similar prompts due to shared information in the tokens and fails to capture patch-level details. To address this, we cluster patches as cues for patch-level semantic reasoning in the prompts. Unlike the quantized bias in Bhardwaj et al. (2022), we derive prompts from patch-level details for more flexible and expressive representations. Instead of a single bias vector for all prompt vectors $G_t = \{g_t^1, g_t^2, \dots, g_t^{nt}\}$ , we generate individual bias vectors $B = \{b^1, b^2, \dots, b^{nt}\}$ . These are derived by clustering the vision zero-shot patch features $\bar{P}$ using the Voronoi algorithm (Voronoi, 1908) to create $nt$ clusters, each serving as a bias vector for a prompt vector:
+
+$$\{b^1, b^2, \dots, b^{nt}\} = \text{Voronoi\_Clustering}(\bar{P}). \quad (9)$$
+
+These bias vectors are then added to the prompt vectors to generate the final prompt vectors $\hat{G}$ :
+
+$$\hat{G} = \{\hat{g}^1, \hat{g}^2, \dots, \hat{g}^{nt}\}; \quad \hat{g}^i = g^i + b^i. \quad (10)$$
+
+This approach provides better prompt regularization at the input level, allowing the finer details of the input image to guide the prompt learning process. Let $B_{an} = \{b_{an}^1, b_{an}^2, \dots, b_{an}^{nt}\}$ and $B_{aug} = \{b_{aug}^1, b_{aug}^2, \dots, b_{aug}^{nt}\}$ be the bias vectors generated from the anchor and augmented view patches, respectively. These bias vectors are added to the prompt vectors to produce view-tailored prompt vectors $\hat{G}_{an}$ and $\hat{G}_{aug}$ , corresponding to the anchor and augmented views. These prompts are then concatenated with the class label, [EOS], and [SOS] tokens, and passed through the CLIP text encoder. The output text features are $T_{an}$ and $T_{aug}$ , corresponding to the view-tailored text prompts for the anchor and augmented views. We further project these text features using a text adapter (Gao et al., 2021), which consists of two linear layers, to obtain $\hat{T}_{an} = \text{TextAdapter}(T_{an})$ and $\hat{T}_{aug} = \text{TextAdapter}(T_{aug})$ . This projection aligns the text features with the enhanced vision features explained further. To regularize the output features, we develop a loss function that encourages similarity between the view-tailored outputs:
+
+$$\mathcal{L}_{\text{view-tailor}} = |\text{stop\_grad}(\hat{T}_{an}) - \hat{T}_{aug}| \quad (11)$$
+
+This promotes inter-view regularization in the text space, complementing the regularization introduced in the vision space, which fosters better generalization. Our view-tailored loss, defined in Equation 11, is an $\ell 1$ -loss, where a stop-gradient operation is applied on $\hat{T}_{an}$ to encourage the augmented view text prompt to align more closely with the anchor text prompt.
+
+**Improved vision features and logits regularisation:** After regularizing the text and vision branches using finer details from patches, we propose leveraging this information to enhance the vision features. The class embeddings from the vision encoder, typically used to generate class probabilities, focus on a single dominant semantic object. However, patches contain local information that can improve the overall feature representation. To achieve this, we propose averaging the patch projections to obtain aggregated patch-level information, which is then added to the class-specific vision features to generate the final vision features $\hat{V}$ :
+
+$$\hat{V} = V + \alpha * \text{Avg}(\bar{P}), \quad (12)$$
+
+where $\alpha$ is a scaling factor for the aggregated patch features. The final logits corresponding to the prompted inputs are computed by taking the dot product of the vision and text output features. These logits are further regularized using $\mathcal{KL}$ -Divergence between the logits of the anchor and augmented views, which is defined as follows:
+
+$$\mathcal{L}_{\text{inter-logits}} = \mathcal{KL}\text{-Div}(\text{stop\_grad}(\text{softmax}(\text{sim}(\hat{T}_{an}, \hat{V}_{an})))), \text{softmax}(\text{sim}(\hat{T}_{aug}, \hat{V}_{aug}))). \quad (13)$$
+
+This regularization reduces inter-view variance at the logit level, leading to more generalized features. Similar to the view-tailored loss on text embeddings, we apply a stop-gradient operation to the anchor logits. The final loss is the sum of all the introduced patch-level losses:
+
+$$\mathcal{L}_{\text{final}} = \mathcal{L}_{\text{global}} + \lambda_p * \mathcal{L}_{\text{patch-con}} + \lambda_t * \mathcal{L}_{\text{view-tailor}} + \lambda_l * \mathcal{L}_{\text{inter-logits}}, \quad (14)$$
+
+which includes a global loss applied to both the anchor and augmented views, with $\lambda_p, \lambda_t, \lambda_l$ acting as scaling factors for the patch, view-tailored text, and inter-view logit losses, respectively.
+
+{6}------------------------------------------------
+
+Table 1: **Comparison with SOTA methods on base-to-novel tasks.** Best novel, base, HM accuracies are underlined; bold indicates improvements over the method with our components. \* denotes our reproduction with official code and settings.
+
+| (a) Average | | | (b) ImageNet | | | (c) Caltech101 | | | (d) OxfordPets | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|
+| Base | Novel | HM | Base | Novel | HM | Base | Novel | HM | Base | Novel | HM |
+| CLIP | 69.34 74.22 | 71.70 | CLIP | 72.43 68.14 | 70.22 | CLIP | 96.84 94.00 | 95.40 | CLIP | 91.17 97.26 | 94.12 |
+| CoOp | 82.69 63.22 | 71.66 | CoOp | 76.47 67.88 | 71.92 | CoOp | 98.00 89.81 | 93.73 | CoOp | 93.67 95.29 | 94.47 |
+| Co-CoOp | 80.47 71.69 | 75.83 | Co-CoOp | 75.98 70.43 | 73.10 | Co-CoOp | 97.96 93.81 | 95.84 | Co-CoOp | 95.20 97.69 | 96.43 |
+| KgCoOp | 80.73 73.60 | 77.00 | KgCoOp | 75.83 69.96 | 72.78 | KgCoOp | 97.72 94.39 | 96.03 | KgCoOp | 94.65 97.76 | 96.18 |
+| MaPLe | 82.28 75.14 | 78.55 | MaPLe | 76.66 70.54 | 73.47 | MaPLe | 97.74 94.36 | 96.02 | MaPLe | 95.43 97.76 | 96.58 |
+| CoPrompt* | 83.66 76.34 | 79.84 | CoPrompt | 77.67 71.62 | 74.33 | CoPrompt | 98.27 94.90 | 96.55 | CoPrompt | 95.03 96.86 | 95.93 |
+| PromptSRC | 84.26 76.10 | 79.97 | PromptSRC | 77.60 70.73 | 74.01 | PromptSRC | 98.10 94.03 | 96.02 | PromptSRC | 95.53 97.30 | 96.30 |
+| → + Ours | 85.07 77.41 81.05 | | → + Ours | 78.00 70.96 74.33 | | → + Ours | 98.50 94.46 96.35 | | → + Ours | 95.70 97.80 96.73 | |
+| DePT* | 85.15 75.73 | 80.16 | DePT | 78.20 70.27 | 74.02 | DePT | 98.60 93.93 | 96.20 | DePT | 95.46 97.16 | 96.30 |
+| → + Ours | 85.65 77.29 81.25 | | → + Ours | 78.26 70.90 74.39 | | → + Ours | 98.63 94.30 96.41 | | → + Ours | 95.70 97.83 96.75 | |
+| (e) StanfordCars | | | (f) Flowers102 | | | (g) Food101 | | | (h) FGVCaircraft | | |
+| Base | Novel | HM | Base | Novel | HM | Base | Novel | HM | Base | Novel | HM |
+| CLIP | 63.37 74.89 | 68.65 | CLIP | 72.08 77.80 | 74.83 | CLIP | 90.10 91.22 | 90.66 | CLIP | 27.19 36.29 | 31.09 |
+| CoOp | 78.12 60.40 | 68.13 | CoOp | 97.60 59.67 | 74.06 | CoOp | 88.33 82.26 | 85.19 | CoOp | 40.44 22.20 | 28.75 |
+| Co-CoOp | 70.49 73.59 | 72.01 | Co-CoOp | 94.87 71.75 | 81.71 | Co-CoOp | 90.70 91.29 | 90.99 | Co-CoOp | 33.41 23.71 | 27.74 |
+| KgCoOp | 71.76 75.04 | 73.36 | KgCoOp | 95.00 74.73 | 83.65 | KgCoOp | 90.50 91.70 | 91.09 | KgCoOp | 36.21 33.55 | 34.83 |
+| MaPLe | 72.94 74.00 | 73.47 | MaPLe | 95.92 72.46 | 82.56 | MaPLe | 90.71 92.05 | 91.38 | MaPLe | 37.44 35.61 | 36.50 |
+| CoPrompt | 76.97 74.40 | 75.66 | CoPrompt | 97.27 76.60 | 85.71 | CoPrompt | 90.16 91.53 | 90.83 | CoPrompt | 40.20 39.33 | 39.76 |
+| PromptSRC | 78.27 74.97 | 76.58 | PromptSRC | 98.07 76.56 | 85.95 | PromptSRC | 90.67 91.53 | 91.10 | PromptSRC | 42.73 37.87 | 40.15 |
+| → + Ours | 80.03 75.30 77.59 | | → + Ours | 98.33 77.40 86.61 | | → + Ours | 90.83 92.06 91.44 | | → + Ours | 44.46 38.60 41.10 | |
+| DePT | 80.80 74.76 | 77.66 | DePT | 98.60 76.80 | 86.34 | DePT | 90.80 91.53 | 91.16 | DePT | 45.70 36.73 | 40.73 |
+| → + Ours | 81.53 75.23 78.25 | | → + Ours | 98.63 77.40 86.73 | | → + Ours | 90.86 91.93 91.39 | | → + Ours | 46.60 38.50 42.16 | |
+| (i) SUN397 | | | (j) DTD | | | (k) EuroSAT | | | (l) UCF101 | | |
+| Base | Novel | HM | Base | Novel | HM | Base | Novel | HM | Base | Novel | HM |
+| CLIP | 69.36 75.35 | 72.23 | CLIP | 53.24 59.90 | 56.37 | CLIP | 56.48 64.05 | 60.03 | CLIP | 70.53 77.50 | 73.85 |
+| CoOp | 80.60 65.89 | 72.51 | CoOp | 79.44 41.18 | 54.24 | CoOp | 92.19 54.74 | 68.69 | CoOp | 84.69 56.05 | 67.46 |
+| Co-CoOp | 79.74 76.86 | 78.27 | Co-CoOp | 77.01 56.00 | 64.85 | Co-CoOp | 87.49 60.04 | 71.21 | Co-CoOp | 82.33 73.45 | 77.64 |
+| KgCoOp | 80.29 76.53 | 78.36 | KgCoOp | 77.55 54.99 | 64.35 | KgCoOp | 85.64 64.34 | 73.48 | KgCoOp | 82.89 76.67 | 79.65 |
+| MaPLe | 80.82 78.70 | 79.75 | MaPLe | 80.36 59.18 | 68.16 | MaPLe | 94.07 73.23 | 82.35 | MaPLe | 83.00 78.66 | 80.77 |
+| CoPrompt | 82.33 79.50 | 80.89 | CoPrompt | 82.93 62.80 | 71.47 | CoPrompt | 93.20 73.96 | 82.40 | CoPrompt | 86.26 78.63 | 83.07 |
+| PromptSRC | 82.67 78.47 | 80.52 | PromptSRC | 83.37 62.97 | 71.75 | PromptSRC | 92.90 73.90 | 82.32 | PromptSRC | 87.10 78.80 | 82.74 |
+| → + Ours | 83.23 79.10 81.11 | | → + Ours | 84.00 64.63 73.05 | | → + Ours | 94.46 81.20 87.32 | | → + Ours | 87.93 80.06 83.81 | |
+| DePT | 83.27 78.97 | 81.06 | DePT | 84.03 60.16 | 70.11 | DePT | 93.33 75.43 | 83.41 | DePT | 87.93 77.73 | 82.69 |
+| → + Ours | 83.40 79.10 81.19 | | → + Ours | 85.06 64.33 73.25 | | → + Ours | 95.23 81.26 87.69 | | → + Ours | 88.33 79.36 83.60 | |
+
+## 4 EXPERIMENTS
+
+The evaluation is done on several different tasks including base-to-novel generalization, cross-dataset evaluation and domain generalisation, with CLIP-B/16 as the frozen backbone. The protocol followed is similar to previous works like CoOp (Zhou et al., 2022), PromptSRC (Khattak et al., 2023), CoPrompt (Roy & Etemad, 2023). For base to novel generalisation, cross dataset evaluation, we use 11 datasets namely ImageNet (Deng et al., 2009), Caltech101 (Fei-Fei et al., 2004), Oxford-Pets (Parkhi et al., 2012), StanfordCars (Krause et al., 2013), Flowers102 (Nilsback & Zisserman, 2008), Food101 (Bossard et al., 2014), FGVCaircraft (Maji et al., 2013), SUN397 (Xiao et al., 2010), UCF101 (Soomro et al., 2012), DTD (Cimpoi et al., 2014), EuroSAT (Helber et al., 2019). For domain generalisation, we evaluate on the ImageNet (Deng et al., 2009), ImageNet-A (Hendrycks et al., 2021b), ImageNet-R (Hendrycks et al., 2021a), ImageNet-Sketch (Wang et al., 2019), ImageNetV2 (Recht et al., 2019) datasets. For training we use CLIP with ViT-B/16, we set the learning rate to 0.0025 and train for a maximum of 20 epochs on base-to-novel generalisation, while maximum of 5 epochs on cross-dataset generalisation and domain generalisation. We set $\lambda_p, \lambda_t, \lambda_l$ to 1.0, 0.1, 1.0 respectively as default but modify it for individual dataset when required. The global loss scaling factors mostly follow PromptSRC. Further details are provided in supplementary. All the ablations are conducted with our model based on PromptSRC.
+
+### 4.1 BASE TO NOVEL GENERALIZATION
+
+We evaluate our approach when combined with PromptSRC and DePT on the main task of base-to-novel generalization. The comparison with previous SOTA methods, including PromptSRC (Khattak et al., 2023), CoPrompt (Roy & Etemad, 2023), and DePT (Zhang et al., 2023), is shown in Table 1
+
+{7}------------------------------------------------
+
+Table 2: Performance on cross-dataset evaluation. Best accuracies are underlined; bold indicates improvements over the method with our components. \* denotes our reproduction with official code
+
+| Source
ImNet | Target | | | | | | | | | | Ave. |
+|-|-|-|-|-|-|-|-|-|-|-|-|
+| | Caltech | Pets | Cars | Flowers | Food | Aircraft | SUN397 | DTD | EuroSAT | UCF | |
+| CoOp | 71.51 | 93.70 | 89.14 | 64.51 | 68.71 | 85.30 | 18.47 | 64.15 | 41.92 | 46.39 | 66.55 63.88 |
+| Co-CoOp | 71.02 | 94.43 | 90.14 | 65.32 | 71.88 | 86.06 | 22.94 | 67.36 | 45.73 | 45.37 | 68.21 65.74 |
+| MaPLe | 70.72 | 93.53 | 90.49 | 65.57 | 72.23 | 86.20 | 24.74 | 67.01 | 46.49 | 48.06 | 68.69 66.30 |
+| Bayesian Prompt | 70.93 | 93.67 | 90.63 | 65.00 | 70.90 | 86.30 | 24.93 | 67.47 | 46.10 | 45.87 | 68.67 65.95 |
+| PromptP* | 70.43 | 93.60 | 90.00 | 64.80 | 70.77 | 85.80 | 23.53 | 67.30 | 43.77 | 44.50 | 67.83 65.19 |
+| PromptSRC | 71.27 | 93.60 | 90.25 | 65.70 | 70.25 | 86.15 | 23.90 | 67.10 | 46.87 | 45.50 | 68.75 65.81 |
+| → + Ours | 72.00 | 94.03 | 90.40 | 66.03 | 71.70 | 86.66 | 24.46 | 67.50 | 47.33 | 46.83 | 69.60 66.45 |
+| DePT | 71.60 | 93.80 | 90.13 | 66.00 | 70.93 | 86.27 | 24.30 | 67.23 | 46.60 | 45.83 | 69.10 66.02 |
+| → + Ours | 72.03 | 94.03 | 90.50 | 66.00 | 71.80 | 86.63 | 24.76 | 67.60 | 47.46 | 46.73 | 69.83 66.53 |
+
+
+
+Figure 2: Performance Comparison for Base, Novel, and HM metrics across different methods. The figure contains three radar charts: Base Performance Comparison, Novel Performance Comparison, and HM Performance Comparison. Each chart compares eight methods (CoOp, Co-CoOp, MaPLe, Bayesian Prompt, PromptP\*, PromptSRC, DePT, and Ours) across ten target datasets (StanfordCars, OxfordIIIT, Caltech101, Flowers102, Food101, FGVC Aircraft, SUN397, DTD, EuroSAT, UCF101). The 'Ours' method (represented by a red line) consistently shows higher performance across all datasets and metrics compared to the other methods.
+
+Figure 2: Performance Comparison for Base, Novel, and HM metrics across different methods.
+
+and Figure 2. Our method consistently performs better across various datasets on novel, base, and harmonic mean (HM) when combined with both PromptSRC and DePT. On average, when our method is combined with PromptSRC, it outperforms all SOTA methods, including CoPrompt and PromptSRC, in base, novel, and HM. While we trail slightly on base classes when combined with DePT, which is mainly designed to improve base class performance, our approach impressively achieves better results across all settings when paired with DePT. Notably, when paired with PromptSRC, our method improves upon PromptSRC by 0.89%, 1.31%, and 1.08% on base, novel, and HM, respectively. Compared to CoPrompt, we see improvements of 1.34%, 0.85%, and 1.08% on base, novel, and HM. When compared with DePT, there is only a marginal decrease of 0.08% on base classes, but an improvement of 1.68% and 0.89% on novel and HM, respectively. Additionally, with DePT, our method surpasses all others on base and HM, while trailing our combination with PromptSRC by only 0.12% on novel. Compared to DePT alone, we show a notable improvement of 0.5%, 1.56%, and 1.09% on base, novel, and HM, respectively.
+
+### 4.2 CROSS-DATASET EVALUATION
+
+The evaluation on cross datasets follows PromptSRC (Khattak et al., 2023). We train on ImageNet in a few-shot manner and evaluate on diverse datasets. In Table 2, the model is fine-tuned on the source dataset (ImageNet) and evaluated on 10 target datasets in a zero-shot setting. Our method combined with PromptSRC shows strong performance across most datasets, achieving the highest average accuracy of 66.45%, outperforming DePT by 0.43% and PromptSRC by 0.64%.
+
+When combined with DePT, our method further improves the average accuracy to 66.53%, surpassing DePT alone by 0.51% and maintaining the highest performance across several datasets, including Aircraft (24.76%), SUN397 (67.60%), and DTD (47.46%). Notably, the combination with DePT also matches or exceeds the performance of PromptSRC in challenging datasets such as DTD and UCF101, highlighting its strong generalization capability. Compared to MaPLe, which achieves an average of 66.30%, our method consistently performs better, especially on datasets like Cars (66.03%) and DTD (47.46%). Overall, our method, when combined with both PromptSRC and DePT, demonstrates robust improvements, reflecting its superior generalization across diverse domains.
+
+{8}------------------------------------------------
+
+### 4.3 DOMAIN GENERALIZATION
+
+The results for domain generalization are shown in Table 3. The ImageNet dataset is used as the source for fine-tuning, and the model is evaluated on four ImageNet variants. In this evaluation, the proposed method combined with PromptSRC demonstrates strong performance compared to other leading approaches. It achieves an average performance that is 0.31% higher than the base PromptSRC, with a notable improvement of 0.75% on ImageNetV2 and a small gap of 0.10% on ImageNetR. Similarly, when combined with DePT, the method shows further gains, achieving an average performance that surpasses the base DePT by 0.53%, with improvements of 0.78% on ImageNetV2 and 0.14% on ImageNetR. Compared to previous SOTA, our method outperforms by 0.36%, demonstrating better generalization across varying ImageNet distributions.
+
+Table 3: Domain generalization performance (best in bold).
+
+| | Source | Target | | | | |
+|-|-|-|-|-|-|-|
+| | ImNet | ImNetV2 | ImNetS | ImNetA | ImNetR | Ave. |
+| CLIP | 66.73 | 60.83 | 46.15 | 47.77 | 73.96 | 57.17 |
+| UPT | 72.63 | 64.35 | 48.66 | 50.66 | 76.24 | 59.98 |
+| CoOp | 71.51 | 64.20 | 47.99 | 49.71 | 75.21 | 59.28 |
+| CoCoOp | 71.02 | 64.07 | 48.75 | 50.63 | 76.18 | 59.90 |
+| ProGrad | 72.24 | 64.73 | 47.61 | 49.39 | 74.58 | 59.07 |
+| KgCoOp | 71.20 | 64.10 | 48.97 | 50.69 | 76.70 | 60.11 |
+| MaPLe | 70.72 | 64.07 | 49.15 | 50.90 | 76.98 | 60.26 |
+| Bayesian Prompt | 70.93 | 64.23 | 49.20 | 51.33 | 77.00 | 60.44 |
+| PromptSRC | 71.27 | 64.35 | 49.55 | 50.90 | 77.80 | 60.65 |
+| CoPrompt | 70.80 | 64.25 | 49.43 | 50.50 | 77.51 | 60.42 |
+| Ours + PromptSRC | 72.00 | 65.10 | 50.00 | 51.03 | 77.70 | 60.96 |
+| Ours + DePT | 72.03 | 65.16 | 50.03 | 51.16 | 77.70 | 61.01 |
+
+Table 4: Different Components of our framework
+
+| P.Loss | T.Text | V.Feat | Base | Novel | HM |
+|-|-|-|-|-|-|
+| ✓ | ✓ | ✓ | 84.55 | 75.43 | 79.89 |
+| ✓ | ✓ | ✓ | 84.53 | 76.03 | 80.17 |
+| ✓ | ✓ | ✓ | 84.60 | 75.79 | 80.09 |
+| ✓ | ✓ | ✓ | 84.70 | 76.07 | 80.10 |
+| ✓ | ✓ | ✓ | 85.07 | 77.41 | 81.05 |
+
+Table 5: Different Losses
+
+| $\lambda_p$ | $\lambda_t$ | $\lambda_l$ | Base | Novel | HM |
+|-|-|-|-|-|-|
+| ✓ | ✓ | ✓ | 83.40 | 76.90 | 79.98 |
+| ✓ | ✓ | ✓ | 84.51 | 76.27 | 80.25 |
+| ✓ | ✓ | ✓ | 84.67 | 76.04 | 80.20 |
+| ✓ | ✓ | ✓ | 84.67 | 76.24 | 80.20 |
+| ✓ | ✓ | ✓ | 85.07 | 77.41 | 81.05 |
+
+Table 6: Patch Loss Comparison
+
+| Intra | Inter | Base | Novel | HM |
+|-|-|-|-|-|
+| ✓ | ✓ | 84.49 | 76.02 | 80.06 |
+| ✓ | ✓ | 84.53 | 75.71 | 80.03 |
+| ✓ | ✓ | 84.31 | 75.89 | 80.01 |
+| ✓ | ✓ | 85.07 | 77.41 | 81.05 |
+
+### 4.4 ABLATIONS
+
+**Effect of different components introduced:** We studied the effects of different components we introduced, mainly patch loss, view-tailored text, and enhanced vision features—on performance, as shown in Table 4. Each component improves performance, particularly on novel tasks. However, combining enhanced vision features, patch loss, and view-tailored text improves base, novel, and HM performance. We also evaluated the effect of different conditioning inputs to generate view-tailored text prompts, as shown in Table 7, and found that initializing prompts using patch clusters works best. CoOp (Zhou et al., 2022), which uses only the class token, performs poorly compared to both our method and attention-based conditioning. Cross-attention from text prompts to patches performs slightly worse than our method but still better than CoOp, highlighting the importance of patch-level conditioning.
+
+We also studied different clustering techniques in Table 8. KMeans performed comparably to our Voronoi-based clustering on base classes but dropped significantly on novel classes, while EM was inferior to both. Voronoi clustering generates more generalizable clusters, improving performance across base and novel classes. In Table 9, we examined the effects of convolution projection and the use of adapters. We found that a text adapter is required when using convolution projection on patches, while using adapters on either text or vision alone improves performance. Our default setup, which includes both text adapters and convolution projection, performs best.
+
+We analyzed the effects of adding small crops (scale 0.05 to 0.4) and varying the number of large crops (scale 0.05 to 1) in Table 10. Using two large crops without small crops provided the best performance, while adding small crops or more large crops led to a slight decline. In Table 12, simple augmentations for both anchor and augment views performed best on novel classes, while complex augmentations slightly decreased overall performance. The combination of simple anchor and complex augmentations remained competitive but slightly underperformed on both base and novel classes.
+
+**Effect of different losses:** We study the effects of different losses introduced in our framework, as shown in Table 5. We find that each of the losses improves performance compared to cases where no
+
+{9}------------------------------------------------
+
+losses are applied. Our default case, where all losses are applied, performs the best. This demonstrates that regularization is necessary at both the feature level and the logit level to maintain the performance of our framework. Additionally, we evaluate the individual effects of intra- and inter-view patch losses in Table 6, while keeping the rest of the losses constant during the experiments. Applying either intra- or inter-view patch loss alone results in a drop in performance, particularly on novel classes. This indicates that utilizing both intra- and inter-view losses boosts base accuracy while enhancing generalization to novel classes.
+
+Table 7: Comparison of Input Conditioning Techniques
+
+| Method | Base | Novel | HM |
+|-|-|-|-|
+| CoCoop | 84.30 | 75.00 | 79.45 |
+| Attention | 84.32 | 76.44 | 80.24 |
+| Ours | 85.07 | 77.41 | 81.05 |
+
+Table 8: Comparison of Clustering Techniques
+
+| Method | Base | Novel | HM |
+|-|-|-|-|
+| KMeans | 84.36 | 74.97 | 79.51 |
+| EM | 84.28 | 74.37 | 79.22 |
+| Voronoi | 85.07 | 77.41 | 81.05 |
+
+Table 9: Comparison of Projection & Adapter
+
+| Text | Vision | Base | Novel | HM |
+|-|-|-|-|-|
+| ✗ | ✗ | 83.24 | 75.31 | 79.08 |
+| ✓ | ✗ | 84.40 | 75.52 | 80.02 |
+| ✗ | Adapter | 84.25 | 75.69 | 80.00 |
+| ✓ | ComProj | 84.36 | 76.07 | 80.09 |
+| ✓ | Adapter | 84.21 | 75.18 | 79.61 |
+| ✓ | ComProj | 85.07 | 77.41 | 81.05 |
+
+Table 10: Comparison of Crops
+
+| L | S | Base | Novel | HM |
+|-|-|-|-|-|
+| 1 | 0 | 84.27 | 75.58 | 79.68 |
+| 2 | 1 | 84.36 | 74.80 | 79.29 |
+| 2 | 10 | 84.51 | 74.10 | 78.96 |
+| 3 | 0 | 84.50 | 75.97 | 80.00 |
+| 2 | 0 | 85.07 | 77.41 | 81.05 |
+
+Table 11: Addition to Competing Methods
+
+| Method | Base | Novel | HM |
+|-|-|-|-|
+| Cocoop | 80.47 | 71.69 | 75.83 |
+| Cocoop + Our | 81.47 | 72.43 | 76.68 |
+| CoPrompt | 83.66 | 76.34 | 79.84 |
+| CoPrompt + Our | 84.26 | 77.40 | 80.68 |
+
+Table 12: Comparison of Augmentation
+
+| Anchor | Augment | Base | Novel | HM |
+|-|-|-|-|-|
+| Simple | Simple | 85.07 | 77.41 | 81.06 |
+| Simple | Complex | 84.46 | 76.31 | 80.18 |
+| Complex | Simple | 84.38 | 76.14 | 80.05 |
+| Complex | Complex | 85.71 | 74.87 | 79.04 |
+
+**Applicability to different methods:** We apply our framework to both CoCoop (Zhou et al., 2022) and CoPrompt (Roy & Etemad, 2023), as shown in Table 11. Our method improves CoCoop by 1.00% on base, 0.74% on novel, and 0.85% on HM. Similarly, it improves CoPrompt by 0.60% on base, 1.06% on novel, and 0.84% on HM. These improvements highlight the effectiveness of incorporating patch-level information for enhancing performance.
+
+### 4.5 RUNTIME & MEMORY CONSUMPTION
+
+Table 13 compares the learnable parameters, GPU memory consumption, and training time for various methods trained on Food101 for 10 epochs. While our method introduces a slight increase in learnable parameters—4.89M for PromptSRC and 5.12M for DePT, this increase remains minimal when compared to the default CLIP model. The use of view/image-tailored prompts, similar to CoCoop, and having multiple views results in a modest rise in GPU memory usage (2.42G) and a training time of 13 min 47 sec. However, unlike CoCoop and other baseline methods, our approach achieves significantly superior performance across the board. The trade-off in computational resources is well-justified by the substantial performance improvements, demonstrating that our method balances resource use with impressive gains in performance, setting a new benchmark.
+
+Table 13: Comparison of Total and Learnable Parameters for Different Methods
+
+| Model | Total P. | Learnable P. | G.Mem | Train. Time |
+|-|-|-|-|-|
+| CLIP(ViT-B/16) | 149.62M | | 1.35G | |
+| CoCoop | 153.15M | 3.53M | 1.24G | 13:07 Min |
+| CoPrompt | 154.62M | 4.74M | 1.84G | 06:20 Min |
+| PromptSRC | 150.08M | 0.46M | 2.07G | 06:06 Min |
+| → + Ours | 154.51M | 4.89M | 2.42G | 13:47 Min |
+| DePT | 150.36M | 0.74M | 2.07G | 06:03 Min |
+| → + Ours | 154.74M | 5.12M | 2.42G | 13:47 Min |
+
+## 5 CONCLUSION
+
+We propose a novel prompting framework for vision-language models that incorporates patch-level information across multiple components, improving both task-specific performance and generalization to novel scenarios. By utilizing patch-level loss for intra- and inter-view consistency, generating regularized view-specific text prompts, and maintaining inter-view consistency of logits, our method addresses the overfitting challenges typical of traditional prompt-tuning approaches. Extensive experiments on tasks such as base-to-novel generalization, domain adaptation, and cross-dataset evaluation demonstrate superior performance, surpassing prior methods. Additionally, ablation studies confirm the effectiveness of each component and explore alternative designs. We believe this approach will significantly advance the tuning of foundation models across diverse applications.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/dw9VUsSHGB.txt b/papers/dw9VUsSHGB.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6f4335711a83d34af666a15876097dfa8d655cad
--- /dev/null
+++ b/papers/dw9VUsSHGB.txt
@@ -0,0 +1,368 @@
+**Primary Area:** applications to computer vision, audio, language, and other modalities
+
+
+
+{0}------------------------------------------------
+
+# REPOGRAPH: ENHANCING AI SOFTWARE ENGINEERING WITH REPOSITORY-LEVEL CODE GRAPH
+
+Siruo Ouyang1\*, Wenhao Yu2, Kaixin Ma2, Zilin Xiao3, Zhihan Zhang4, Mengzhao Jia4, Jiawei Han1, Hongming Zhang2, Dong Yu2
+
+1 University of Illinois Urbana-Champaign, 2 Tencent AI Seattle Lab
+
+3 Rice University, 4 University of Notre Dame
+siruo2@illinois.edu
+
+## ABSTRACT
+
+Large Language Models (LLMs) excel in code generation yet struggle with modern AI software engineering tasks. Unlike traditional function-level or file-level coding tasks, AI software engineering requires not only basic coding proficiency but also advanced skills in managing and interacting with code repositories. However, existing methods often overlook the need for repository-level code understanding, which is crucial for accurately grasping the broader context and developing effective solutions. On this basis, we present REPOGRAPH, a plug-in module that manages a repository-level structure for modern AI software engineering solutions. REPOGRAPH offers the desired guidance and serves as a repository-wide navigation for AI software engineers. We evaluate REPOGRAPH on the SWE-bench by plugging it into four different methods of two lines of approaches, where REPOGRAPH substantially boosts the performance of all systems, leading to a *new state-of-the-art* among open-source frameworks. Our analyses also demonstrate the extensibility and flexibility of REPOGRAPH by testing on another repo-level coding benchmark, CrossCodeEval. Our code is available at
+
+## 1 INTRODUCTION
+
+Recent advancements in large language models (LLMs) have showcased their powerful capabilities across various natural language processing tasks (OpenAI, 2023; Anil et al., 2023; Dubey et al., 2024), and now, coding-specific LLMs are emerging to tackle complex software engineering challenges (Hou et al., 2023; Fan et al., 2023), such as Code-Llama (Rozière et al., 2023) and StarCoder (Li et al., 2023a). These coding-specific LLMs are capable of assisting users with various software engineering tasks, even achieving human-level performance in many function-level coding tasks, such as program synthesis (Chen et al., 2021; Austin et al., 2021), code annotation (Yao et al., 2019), bug fixing (Tufano et al., 2019), and code translation (Rozière et al., 2020).
+
+Real-world software engineering often extends beyond single function or self-contained code files. Applications are typically built as repositories containing multiple interdependent files, modules, and libraries (Bairi et al., 2024). These complex structures require a holistic understanding of the entire codebase to perform tasks such as code completion (Shrivastava et al., 2023; Ding et al., 2023), feature addition (Liang et al., 2024), or issue resolving (Jimenez et al., 2024). Recent benchmarks like SWE-Bench (Jimenez et al., 2024) have been proposed to evaluate LLMs on real-world GitHub issues. It requires LLMs to modify the repository to resolve the issue, either by fixing a bug or introducing a new feature. This task is particularly challenging because it requires navigating complex code bases, understanding intricate dependencies between code files, and ensuring that changes integrate seamlessly without introducing new issues, which highlights the difficulties in scaling from function-level to repository-level understanding, as expounded in Figure 1.
+
+A key step in addressing repository-level tasks is to understand the structure of a repository and identify related code. To achieve this, retrieval-augmented generation (RAG) and its variants (Xiao et al.,
+
+\*Work done during internship at Tencent AI Seattle Lab.
+
+{1}------------------------------------------------
+
+
+
+**(a) Function-level Coding Problem**
+
+**Input text:** Write a python function to find the first repeated character in a given string.
+
+```
+
+1. def first_repeated_char(str1):
+2. for index, c in enumerate(str1):
+3. if str1[index+1].count(c) > 1: return c
+4. return "None"
+
+```
+
+**(b) Repository-level Coding Problem**
+
+**Issue:** modeling's "separability\_matrix" does not compute separability correctly for CompoundModels...
+
+**Code repository:**
+
+- astropy
+ - core.py
+ - fitting.py
+- coordinates
+ - earth.py
+- ...
+
+**(i) Understand intricate dependencies**
+
+**Generated patch:**
+
+```
+
+diff --git a/astropy/modeling/
+separable.py
+--- a/astropy/modeling/separable.py
++++ b/astropy/modeling/separable.py
+@@ -242,7 +242,7 @@ def _cstack(left,
+right):...
+
+```
+
+**(ii) Navigate complex codebases**
+
+**Unit test:**
+
+| test_coord_matrix | |
+|-|-|
+| test_cdot | ✓ |
+| test_with_oper | ✗ |
+
+**(iii) Resolve without introducing new issues**
+
+Figure 1: Illustration of (a) a function-level coding problem and (b) a repository-level coding problem.
+
+Figure 1: The illustration of (a) a function-level coding problem from HumanEval (Chen et al., 2021) and (b) a repository-level coding problem from SWE-Bench (Jimenez et al., 2024).
+
+2023; Zhang et al., 2023; Phan et al., 2024; Wu et al., 2024) have been leveraged, in a procedural manner, to retrieve relevant code files across the repository first, providing context for LLMs for further edition. However, indexing at file-level can only identify semantically similar but not genuinely related code snippets. Instead of using RAG, recent approaches like Agentless (Xia et al., 2024) construct a skeletal format for each file, and directly prompt LLMs to identify relevant files and code lines. However, this method still treats code repositories as flat documents (Zhang et al., 2024), which suffers from limitations of repository structure such as the intricate inter-dependencies across files. An alternative approach is to design agent frameworks (Yang et al., 2024; Wang et al., 2024), which enables LLMs to interact with repositories using actions. While LLM agents can freely determine the next action based on current observations, without the grasp of global repository structures, they tend to focus narrowly on specific files, resulting in local optimums. Addressing these limitations requires going beyond semantic matching and developing techniques that enable a deeper understanding of the codebase structure. This will allow LLMs to leverage fine-grained context across multiple files and function calls, facilitating more informed, repository-wide decision-making for coding tasks.
+
+Motivated by this, we propose REPOGRAPH, a plug-in module designed to help LLMs-based AI programmers leverage the code structure of an entire repository. REPOGRAPH is a graph structure and operates at the line level, offering a more fine-grained approach compared to previous file-level browsing methods. Each node in the graph represents a line of code, and edges represent the dependencies of code definitions and references. REPOGRAPH is constructed via code line parsing and encodes the structured representation of the entire repository. Sub-graph retrieval algorithms are then used to extract ego-graphs, which represent the relationships of a central node (in our case, specific keywords). These ego-graphs can be smoothly integrated with both procedural and agent frameworks, offering key clues that provide a more comprehensive context for LLMs to solve real-world software engineering problems.
+
+To assess REPOGRAPH's effectiveness and versatility as a plug-in module, we integrate it with four existing software engineering frameworks and evaluate its performance using SWE-bench, a recent benchmark for AI software engineering. Experiment results show that REPOGRAPH boosts the success rate of existing methods for both agent and procedural frameworks by achieving an average relative improvement of 32.8%. We also test REPOGRAPH on CrossCodeEval to verify its transferability to general coding tasks that require repository-level code understanding. Additionally, we systematically analyze different sub-graph retrieval algorithms and integration methods. Together with error analyses, we hope to shed light on future works targeting modern AI software engineering.
+
+## 2 RELATED WORKS
+
+### 2.1 LLM-BASED METHODS FOR AI SOFTWARE ENGINEERING
+
+Recently, there has been a significant increase in research focused on AI-driven software engineering, which can be broadly categorized into two primary approaches: (i) LLM agent-based frameworks and (ii) SWE-featured procedural frameworks. While this field has advanced rapidly, with most methods being released as proprietary solutions for industry applications (Cognition, 2024), our related work section will concentrate specifically on open-source frameworks.
+
+{2}------------------------------------------------
+
+**LLM agent-based framework** equips large language models (LLMs) with a set of predefined tools, allowing agents to iteratively and autonomously perform actions, observe feedback, and plan future steps (Yang et al., 2024; Zhang et al., 2024; Wang et al., 2024; Cognition, 2024; Ouyang et al., 2024; Tang et al., 2025). While the exact set of tools may vary across different agent frameworks, they typically include capabilities such as opening, writing, or creating files, searching for code lines, running tests, and executing shell commands. To solve a problem, agent-based approaches involve multiple actions, with each subsequent turn depending on the actions taken in previous ones and the feedback received from the environment. For example, SWE-agent (Yang et al., 2024) facilitates interactions with the execution environment by designing a special agent-computer interface (ACI). There are various actions, including “search and navigation”, “file viewer and editor”, and “context management”. Another work, AutoCodeRover (Zhang et al., 2024), further offers fine-grained searching methods for LLM agents in better contexts without an execution process. Specifically, it supports class and function-level code search. OpenDevin (Wang et al., 2024), initiated after Devin (Cognition, 2024), is a community-driven platform that integrates widely used agent systems and benchmarks. The action space design of OpenDevin is highly flexible, requiring LLM agents to generate code on the fly.
+
+**SWE-featured procedural frameworks** typically follow a two-step *Localize/Search-Edit* approach, as seen in existing literature (Zhang et al., 2023; Wu et al., 2024; Liang et al., 2024; Xia et al., 2024). The *localize* step focuses on identifying relevant code snippets, while the *edit* step involves completing or revising the code. Some works introduce additional steps to further enhance performance, such as the *Search-Expand-Edit* approach (Phan et al., 2024). Retrieval (Lewis et al., 2020) is a popular technique used for localization, allowing models to search for relevant code snippets from large repositories by treating issue descriptions as queries and code snippets as indexed data. Some approaches use a sliding window to ensure completeness (Zhang et al., 2023). Besides, Agentless (Xia et al., 2024) is a recently developed method that uses LLMs to directly identify relevant elements for editing within code repositories. It first recursively traverses the repository structure to generate a format that aligns files and folders vertically, with indents for sub-directories. This structure and the issue description are then input into the LLM, which performs a hierarchical search to identify the top-ranked suspicious files requiring further inspection or modification.
+
+### 2.2 REPOSITORY-LEVEL CODING CAPABILITY
+
+The evaluation of coding capabilities in AI systems has traditionally focused on function-level or line-level assessments (Lu et al., 2021; Chen et al., 2021; Austin et al., 2021), where individual code snippets or isolated functions are the primary units of analysis. Unlike previous studies, SWE-bench (Jimenez et al., 2024) highlights the trend of repository-level coding, driven by recent advances of coding-specific LLMs (Guo et al., 2024; Li et al., 2023b). It reflects the growing user demand to understand and contribute to entire projects rather than isolated functions (Ouyang et al., 2023), as well as solving real-world problems in an end-to-end and automatic manner.
+
+Table 1: Comparison between our approach REPOGRAPH and existing methods for representing the repository on various aspects. \*RepoUnderstander (Ma et al., 2024) and CodexGraph (Liu et al., 2024) are concurrent works to ours.
+
+| Model | Line-level | File-level | Repo-level |
+|-|-|-|-|
+| DraCo | ✓ | ✓ | X |
+| Aider | X | X | X |
+| RepoUnderstander* | X | ✓ | ✓ |
+| CodexGraph* | X | ✓ | ✓ |
+| REPOGRAPH | ✓ | ✓ | ✓ |
+
+Long before the LLM era, the software engineering community has been studying the navigation of code repositories, including using eye-tracking data (Busjahn et al., 2015) and exploring interconnections (Begel et al., 2010). Then pre-trained code LLMs incorporate repository-level information such as file dependencies. But tasks at the repository level often involve more intricate call relationships within their context. Recent works like RepoCoder (Zhang et al., 2023) and RepoFuse (Liang et al., 2024) have started integrating RAG modules to harness additional information from repositories. Building on this, subsequent research has focused on embedding repository-level context into their methodologies. For instance, DraCo (Cheng et al., 2024) introduces importing relationships between files, CodePlan maintains the code changes by LLMs with incremental dependency analysis, while Aider (Gauthier, 2024) employs PageRank (Page, 1999) to identify the most significant contextual elements. RepoUnderstander (Ma et al., 2024) and CodexGraph (Liu et al., 2024) model
+
+{3}------------------------------------------------
+
+
+
+**(a) RepoGraph Construction**
+
+**Code Repo**
+
+- astropy
+ - modeling
+ - core.py
+ - fitting.py
+ - coordinates
+ - earth.py
+ - context.py
+ - logger.py
+
+**Code snippet**
+
+```
+
+Class Model:
+ def __init__(self, ...):
+ self._default_input...
+ def prepare_inputs(...):
+ input = self._validate_input_units()
+ inputs = len(inputs)
+ def hide_invert(...):
+
+```
+
+**REPOGRAPH**
+
+- reference node → invokes → class
+- definition node → contains → function
+
+**Node information**
+
+- name: Model
+- frame: /astropy/modeling/core.py
+- kind: def
+- category: class
+- line: 523
+- methods: prepare\_inputs, ...
+
+**(b) Integration with Procedural Frameworks**
+
+**Issue Description**
+
+Modeling's "separability matrix" does not compute separability correctly for nested CompoundModels. Consider the following model: ...
+
+**search term identification** → **search\_reporaph(separability\_matrix)** → **localization** → **core modules**
+
+**correct generated patch** → **edition** → **search\_reporaph(model)** → **Model**
+
+**perform in each step of procedural framework** → **add to action space for agent decision-making**
+
+**search\_reporaph(param)**
+
+**Initialization** → **Planning** → **Observation** → **Action** → **search\_dgraph(param)**
+
+**Planning**: Use search\_reporaph to find the dependencies for "separability\_matrix"
+
+**Action**: search\_reporaph(param)
+
+**Observation**: (name: Model, frame: /astropy/modeling/core.py, kind: def, category: class, ...)
+
+**(c) Integration with Agent Frameworks**
+
+Figure 2: An in-depth illustration of (a) the construction, (b) the integration with procedural frameworks, and (c) the integration with agent frameworks of REPOGRAPH. (a) shows a code repo structure, a code snippet, and a REPOGRAPH node. (b) shows the integration with procedural frameworks like search term identification, localization, and planning. (c) shows the integration with agent frameworks like search\_reporaph(param) and search\_dgraph(param).
+
+Figure 2: An in-depth illustration of (a) the construction, (b) the integration with procedural frameworks, and (c) the integration with agent frameworks of REPOGRAPH. Given a code repository, we first utilize AST to construct $\mathcal{G} = \{\mathcal{V}, \mathcal{E}\}$ , where $\mathcal{G}$ consists of “reference” and “definition” node, $\mathcal{E}$ includes “invoke” and “contain” relations (files and code lines shown in corresponding color). The constructed REPOGRAPH are then used in procedural frameworks by adding sub-retrieval results into each step, and agent frameworks by adding graph retrieval as an additional action “search\_reporaph”. A simplified version can be found in Figure 10.
+
+code files as a knowledge graph. Despite similarities in representation, methods vary in how they retrieve information from these structures and utilize it for downstream tasks. Table 1 summarizes the differences between these methods and REPOGRAPH. REPOGRAPH surpasses previous approaches by effectively integrating context at the line, file, and repository levels.
+
+## 3 REPOGRAPH
+
+This section introduces REPOGRAPH, a novel plug-in module that can be seamlessly integrated into existing research workflows for both agent-based and procedural frameworks. The primary goal of REPOGRAPH is to provide a structured way to analyze and interact with complex codebases, enabling detailed tracing of code dependencies, execution flow, and structural relationships across the repository. In the following sections, we will provide a detailed description of REPOGRAPH’s construction, its underlying representation, and its utility across various scenarios. The overall architecture is depicted in Figure 2, highlighting its key components and operational flow.
+
+### 3.1 CONSTRUCTION
+
+Given a repository-level coding task, the first step is to carefully examine the repository structure so that the necessary information can be collected. The input for REPOGRAPH construction is a repository, i.e., a collection of its folders and files, while the output is a structured graph, where each node is a code line, and each edge represents the dependencies in between. REPOGRAPH enables tracing back to the root cause of the current issue and gathering dependent code context to help solve the problem. The construction process of REPOGRAPH could be divided into three key steps.
+
+**Step 1: Code line parsing.** We first traverse the entire repository using a top-down approach to identify all code files as candidates for next-step parsing. This is accomplished by filtering based on file extensions, retaining only those with relevant code file suffixes (e.g., .py) while excluding other file types (e.g., .git or requirements.txt), which might be noisy and irrelevant for coding tasks. For each code file, we utilize tree-sitter1 to parse the code, leveraging its Abstract Syntax Tree (AST) framework. The AST provides a tree-based representation of the abstract syntactic structure of the source code, enabling the identification of key elements such as functions, classes, variables, types, and other definitions. While recognizing these definitions is crucial, tracing their usage and references throughout the code is equally important. Tree-sitter facilitates this by capturing the definitions
+
+1
+
+{4}------------------------------------------------
+
+and tracking where they are utilized or referenced within the codebase. For example, in figure 2, we not only identify definitions like `class Model` and its inherent methods but also references like `self._validate_input_units()`. After processing each line of code with a tree-sitter, we selectively retain lines that involve function calls and dependency relations, discarding extraneous information. Our focus is primarily on the *functions* and *classes*, as these represent the core structural components of the code. By concentrating on these elements and their interrelationships, REPOGRAPH optimizes the analysis process by excluding less significant details, such as individual variables, which tend to be redundant and less relevant for further processing.
+
+**Step 2: Project-dependent relation filtering.** After the previous parsing step, we obtain code lines with calling and dependency relations. However, not all relations are useful for fixing issues. Specifically, many default and built-in function/class calls could distract from the project-related ones. Therefore, we additionally introduce a filtering process that excludes the repository-independent relations. Two types of such relations exist: (i) *global relation* refers to Python standard and built-in functions and classes. (ii) *local relation* are introduced by third-party libraries, which are specific to the current code file. For global relations, we maintain a comprehensive list of methods from standard and built-in libraries, excluding any identified relations from this list. The list is empirically constructed by gathering methods of the builtins library and default methods such as “list” and “tuple”. For example, in figure 2, `line_inputs = len(input)` is excluded since “len” is a default method. For local relations, we parse import statements in the code to identify third-party methods that are included, and exclude them accordingly. A detailed illustration of this step can be found in Figure 11.
+
+**Step 3: Graph organization.** At this stage, we construct REPOGRAPH using code lines as the fundamental building units. The graph can be represented as $\mathcal{G} = \{\mathcal{V}, \mathcal{E}\}$ , where $\mathcal{V}$ represents the set of nodes, with each node corresponding to a line of code, and $\mathcal{E}$ represents the set of edges, capturing the relationships between these code lines. Each node in $\mathcal{V}$ contains attributes to represent its meta-information, such as `line_number`, `file_name`, `directory`, etc. Additionally, we classify each code line as either a “definition” (def) or a “reference” (ref) to a particular module. A “def” node corresponds to the line where a function, class, or variable is initially defined, while a “ref” node indicates a code line where this entity is referenced or invoked elsewhere in the code. Similar to soft links to “def” nodes, “ref” nodes also represent other variations of invoking methods. For example, in Figure 2, the class definition “`class Model`” would be a “def” node, while any subsequent usages of `Model` would be “ref” nodes. Each “def” node may have multiple “ref” nodes associated with it, as a single function or class can be referenced in various places throughout the code. We define two types of edges: $\mathcal{E}_{invoke}$ and $\mathcal{E}_{contain}$ . The triple $(\mathcal{V}_1, \mathcal{E}_{contain}, \mathcal{V}_2)$ denotes that $\mathcal{V}_1$ (e.g., a function definition) contains another module $\mathcal{V}_2$ (e.g., an internal function or class). The edge $\mathcal{E}_{contain}$ typically connects a “def” node to its internal components. In contrast, $\mathcal{E}_{invoke}$ represents an invocation relationship, usually connecting a “def” node to a “ref” node, where the reference node includes a dependency on the definition.
+
+### 3.2 UTILITY
+
+The constructed REPOGRAPH serves as a structured representation of the current repository and facilitates better-related information collection and aggregation. For information collection based on REPOGRAPH, specifically, we use one search term each time for subgraph retrieval. Search terms are the key functions or classes that are determined by current states. For example, “separability\_matrix” is the initial search term in Figure 2(c). We retrieve the $k$ -hop ego-graphs (Hu et al., 2024) with the search term in the center. The ego-graph is crucial for solving the problem because it focuses on the immediate relationships (Jin et al., 2024) around the search term, capturing the relevant dependencies and interactions within the repository, which is key to understanding the functional context. Additionally, the retrieved content explicitly contains information at both the method and line levels and implicitly expresses the grouping at the file level.
+
+This process is abstracted via `search_repograph()` as illustrated in the middle of Figure 2. The retrieved $k$ -hop ego-graph will be flattened for further processing. We also tried other variants for integration later in Section 5.2 and their performance in Table 4. We narrate how REPOGRAPH could be plugged in with existing representative research lines in the following.
+
+{5}------------------------------------------------
+
+**Integration with procedural framework.** In a procedural framework, LLMs are usually prompted in “localization” and “editing” stages with the given repository context and issue description. In this case, we use *search\_repograph()* before both stages, leveraging our REPOGRAPH to assist in making more informed decisions at each step. For example, in Figure 2, we first include the subgraph of “*separability\_matrix*” for localization, and then use the localized result “*Model*” to search in the edition stage. To implement the strategy, we flatten the context of retrieved ego-graphs and append it as part of the prompt. As a result, the LLM generation is conditioned on both retrieved ego-graphs and the context provided by baseline methods, helping the model preserve nuances.
+
+**Integration with agent framework.** A significant difference in existing agent frameworks is the action space design, as expounded in Section 2. To leverage the power of REPOGRAPH, we put *search\_repograph()* as an additional action in the action space. The agent decides when and where to use this action. The search term is also determined by the agent accordingly. The returned subgraph will be flattened and used as an observation for the next state.
+
+## 4 EXPERIMENTS
+
+### 4.1 SETUP
+
+We evaluated REPOGRAPH as a plug-in component, i.e., integrated into existing baseline models of the two aforementioned research lines to assess its performance. We use the same baseline settings and configurations when incorporating REPOGRAPH to ensure a fair comparison.
+
+**Dataset.** We test REPOGRAPH in SWE-bench-Lite2. Each problem in the dataset requires submitting a patch to solve the underlying issue described in the input issue description. The goal is to generate a patch that accurately revises the relevant portions of the codebase within the repository, ensuring that all test scripts included in the dataset are successfully executed.
+
+**Baselines.** We integrate REPOGRAPH with representative methods from both aforementioned research lines. (i) For procedural frameworks, we evaluate the widely used traditional method, RAG (Lewis et al., 2020), as well as Agentless (Xia et al., 2024), an open-source state-of-the-art approach in this direction. For RAG, we follow its initial setting and use BM25 for file-level retrieval. After that, we append the context of REPOGRAPH after the code files as part of the prompt. Agentless first performs a hierarchical localization in terms of “file-class/function-edits” and then conducts repair based on localization. The context of REPOGRAPH is inserted in every step of Agentless. (ii) For agent frameworks, we consider SWE-agent (Yang et al., 2024) and AutoCodeRover (Zhang et al., 2024). For both frameworks, we add an additional action “search\_repograph” for the LLM agent as described in Section 3. All the choices in the two research lines incorporate GPT-4 and GPT-4o-based methods to ensure generalization. Detailed implementations and prompts used can be found in Appendix A.
+
+**Evaluation metrics.** We evaluate all methods across two key dimensions: Accuracy and Average Cost. (i) For accuracy, we report the *resolve rate* and *patch application rate*. The resolve rate represents the percentage of issues successfully resolved across all data points. An issue is considered resolved if the submitted patch passes all test scripts. To assess the patch application rate, we attempt to apply the generated patches to the repository using the *patch* program, counting only successful applications toward this metric. (ii) To evaluate cost efficiency, we report two metrics: *average cost* and *average tokens*, which refer to the inference cost and the number of input/output tokens used when querying the LLMs, respectively.
+
+**Configurations.** We use the same GPT version as in the baselines in the experiments. We used GPT-4o (2024-05-13) and GPT-4-Turbo (gpt-4-1106-preview) from OpenAI for evaluation and analyses in our experiments. All evaluation processes are performed in a containerized Docker environment3, ensuring stability and reproducibility, made possible through contributions from the open-source community. Plug-ins with procedural frameworks usually take around 2-3 hours to finish. For agent frameworks, the inference time is larger, up to around 10 hours.
+
+2Current leaderboard could be found at
+
+3
+
+5
+
+{6}------------------------------------------------
+
+Table 2: Results of REPOGRAPH with open-source baselines in two research lines, including procedural and agent frameworks. Numbers of accuracy-related metrics are directly taken from the leaderboard, while the cost-related ones are computed from the corresponding trajectories5.
+
+| Methods | LLM | Accuracy | | | Avg. Cost | |
+|-|-|-|-|-|-|-|
+| | | resolve | # samples | patch apply | \$ cost | # tokens |
+| Procedural frameworks | | | | | | |
+| RAG | GPT-4 | 2.67 | 8 | 29.33 | \$0.13 | 11,736 |
+| +REPOGRAPH | GPT-4 | 5.33 +2.66 | 16 +8 | 47.67 +18.34 | \$0.17 | 15,439 |
+| Agentless | GPT-4o | 27.33 | 82 | 97.33 | \$0.34 | 42,376 |
+| +REPOGRAPH | GPT-4o | 29.67 +2.34 | 89 +7 | 98.00 +0.67 | \$0.39 | 47,323 |
+| Agent frameworks | | | | | | |
+| AutoCodeRover | GPT-4 | 19.00 | 57 | 83.00 | \$0.45 | 38,663 |
+| +REPOGRAPH | GPT-4 | 21.33 +2.33 | 64 +7 | 86.67 +3.67 | \$0.58 | 45,112 |
+| SWE-agent | GPT-4o | 18.33 | 55 | 87.00 | \$2.53 | 498,346 |
+| +REPOGRAPH | GPT-4o | 20.33 +2.00 | 61 +6 | 90.33 +3.33 | \$2.69 | 518,792 |
+
+### 4.2 EXPERIMENT RESULTS
+
+Table 2 presents the main evaluation results of all baseline methods and the corresponding performance with REPOGRAPH (+REPOGRAPH) as a plug-in in the SWE-bench-Lite test set. We also report the number of correct samples for each method. The performance increase is marked by $\tau_{num}$ . We also tested other (open-source) LLMs using Claude-3.5-Sonnet (claude-3-5-sonnet-20240620) (Anthropic, 2024) from Anthropic in Appendix C. Based on the results, we have the following key observations:
+
+**(i) REPOGRAPH brings consistent performance gain for all combinations of frameworks and LLM model bases.** Specifically, REPOGRAPH achieves an absolute improvement of +2.66 and +2.34 in terms of the resolve rate for RAG and Agentless, respectively, which is 99.63% and 8.56% of relative improvement. The notable improvement demonstrates the effectiveness of our REPOGRAPH in adapting to various scenarios by inducing relevant code context and performing precise code editings. Additionally, our best performance so far by plugging in Agentless, 29.67, achieves the *state-of-the-art* performance on the benchmark6 among all open-source methods.
+
+**(ii) Performance gain brought by REPOGRAPH is slightly larger on procedural frameworks than agent ones.** With procedural frameworks, REPOGRAPH correctly fixes more issues than agent ones. This could be due to two primary reasons. Firstly, we observed that mature procedural frameworks tend to achieve better baseline performance than agent-based frameworks on SWE-bench. The initial definitive nature of procedural frameworks, with their well-defined running flow and structure, allows them to leverage plug-ins more effectively. Another reason is that this deterministic behavior reduces the complexity that arises from dynamic decision-making, a key characteristic of agent-based systems, thereby enabling a smoother integration of performance improvements.
+
+**(iii) Performance gain brought by REPOGRAPH does not rely on more costs.** We also compute and report each method’s average cost and token consumption. By introducing REPOGRAPH, we manage to reduce the costs associated with managing the entire repository while achieving comparable or even superior performance. As shown in Table 2, the additional token cost introduced by RepoGraph is justified given the significant performance improvement it enables, particularly when compared to the substantially higher costs incurred by previous methods like SWE-agent. This indicates REPOGRAPH ’s performance gains are not mainly due to increased token usage.
+
+**(iv) Average costs are generally larger on agent frameworks with REPOGRAPH.** This phenomenon is especially obvious with SWE-agent, as it allows the agent to freely determine the next action based on the current observation. We also found that the integration with agent frameworks usually leads to larger cost increases, as exemplified by +0.13\$ and +0.18\$ with AutoCodeRover and SWE-agent, respectively. The reason lies in the large exploration space in agent frameworks. The agents might call the *search\_repograph()* action many times, which leads to the explosion of
+
+6. We kindly request that reviewers refrain from intentionally checking submitter information on the leaderboard to maintain the integrity of the double-blind review process.
+
+{7}------------------------------------------------
+
+prompt contexts. We encourage users to be mindful of cost and to adopt a more granular approach to cost control when integrating REPOGRAPH into the agent framework in the future.
+
+## 5 ANALYSIS
+
+This section presents a detailed analysis to demonstrate that the additional context provided by REPOGRAPH is beneficial for the task. We begin by analyzing localization accuracy in comparison to the gold-standard patch. Next, we explore various REPOGRAPH configurations, focusing on how the additional context can be effectively integrated into the existing system. Finally, we perform an in-depth error analysis, highlighting aspects where REPOGRAPH can be further improved. For more analyses including resolve rate in various aspects and action distributions of agent frameworks, please refer to Appendices C.
+
+### 5.1 LOCALIZATION COVERAGE
+
+A crucial step in issue resolution is accurately identifying the correct locations within the code that require modification. Proper localization is essential, as it forms the foundation for generating an effective and accurate patch. Without this step, the quality of the fix may be compromised, leading to incomplete or incorrect solutions. We compute the percentage of problems where the edit locations match the ground truth patch in three granularity. Namely, file-level, function-level, and line-level. We report that a patch contains the correct location if it edits a *superset* of all locations in the ground truth patch.
+
+Table 3: Percentage of problems for accurate edition localizations with respect to file, function, and line levels. All the numbers are computed from the corresponding generated patches.
+
+| Methods | LLM | file | function | line |
+|-|-|-|-|-|
+| RAG | GPT-4 | 47.3 | 23.3 | 12.7 |
+| +REPOGRAPH | GPT-4 | 51.7 $\pm$ 4.4 | 25.3 $\pm$ 2.0 | 14.3 $\pm$ 1.6 |
+| Agentless | GPT-4o | 68.7 | 51.0 | 34.3 |
+| +REPOGRAPH | GPT-4o | 74.3 $\pm$ 5.6 | 54.0 $\pm$ 3.0 | 36.7 $\pm$ 2.4 |
+| Agent frameworks | | | | |
+| AutoCodeRover | GPT-4 | 62.3 | 42.3 | 29.0 |
+| +REPOGRAPH | GPT-4 | 69.0 $\pm$ 4.7 | 45.7 $\pm$ 3.4 | 31.7 $\pm$ 2.7 |
+| SWE-agent | GPT-4o | 61.7 | 46.3 | 32.3 |
+| +REPOGRAPH | GPT-4o | 67.3 $\pm$ 5.6 | 49.3 $\pm$ 3.0 | 35.0 $\pm$ 2.7 |
+
+Table 3 presents the results of our analysis. We observed that integrating REPOGRAPH with all baseline methods significantly improves file-level accuracy, whereas the enhancement of accuracy in line-level is comparatively modest. This result aligns with our expectations, as file-level localization is the most coarse-grained, making it inherently easier to improve. In contrast, line-level localization, being the most fine-grained, poses a greater challenge due to its need for more precise identification of code segments. Additionally, we found that although line-level accuracy improvements are more pronounced for agent frameworks, their overall resolve rate is lower than that of procedural frameworks, as shown in Table 2. This discrepancy can be attributed to the fact that localization, while necessary for generating a final patch, is insufficient. The success of the final revision still heavily relies on the underlying capabilities of LLMs. Agent frameworks, designed to operate in a trial-and-error fashion, are particularly susceptible to error accumulation. As these frameworks iteratively refine their patches, small inaccuracies in earlier localization steps can propagate and magnify throughout the process, ultimately reducing the overall resolve rate. Procedural frameworks, on the other hand, follow a more structured and deterministic approach to localization and patch generation. They typically localize and fix issues in a single, more direct step, which can help mitigate the compounding of errors.
+
+### 5.2 INVESTIGATION OF REPOGRAPH VARIANTS
+
+In this section, we investigate the efficacy of various combinations of sub-graph retrieval and integration techniques as outlined in Section 3. We explore two sub-graph retrieval variants and two integration methods. Specifically, for sub-graph retrieval, we index $k$ -hop ego-graphs where $k$ is set to 1 and 2. We limit our exploration to $k$ values up to 2 due to the extensive context required for integration and the potential introduction of noise or irrelevant nodes for $k \geq 3$ . For the integration methods, we employ two distinct approaches: (i) directly flattening the textual sub-graph by explic-
+
+{8}------------------------------------------------
+
+Table 4: The number of nodes, edges, and tokens of REPOGRAPH and its variants. For different retrieval and integration variants, we report the average number on the test set. “summ.” refers to the summarized version by LLMs of the retrieved ego-graph.
+
+| Metrics | REPOGRAPH | 1-hop + flatten | 1-hop + summ. | 2-hop + flatten | 2-hop + summ. |
+|-|-|-|-|-|-|
+| # Nodes | 1419.3 | 11.6 | 11.6 | 54.5 | 54.5 |
+| # Edges | 26392.1 | 37.1 | 37.1 | 89.9 | 89.9 |
+| # tokens | - | 2310.7 | 717.5 | 10505.3 | 1229.2 |
+| resolve rate | - | 29.67 | 28.33 | 26.00 | 28.67 |
+
+itly detailing the relationships between the search term and its neighboring nodes, and (ii) leveraging an LLM first to summarize the sub-graph in terms of the core modules and salient dependencies, before proceeding with further processing. Detailed implementations of these variants and prompts used can be found in Appendix B.1.
+
+We begin by presenting some statistics for REPOGRAPH and its various configurations. Performance evaluations are conducted on Agentless with REPOGRAPH integrated as a plug-in module. Table 4 reports the number of nodes and edges within the (sub)-graphs. Notably, the average number of nodes and edges for REPOGRAPH across the SWE-bench dataset is quite substantial, featuring over 1,000 nodes and 25,000 edges. This highlights the comprehensive nature of the constructed structure. For the different variants, when $k = 1$ , the information within REPOGRAPH is concentrated around the search term, resulting in an average of 11.6 nodes and 37.1 edges. As $k$ increases to 2, the retrieved ego-graph expands exponentially, reaching an average of 54.5 nodes and 89.9 edges. Moreover, directly flattening the retrieved ego-graph often significantly increases the token count, frequently reaching several thousand tokens. However, utilizing an LLM as an additional summarizer greatly reduces the token count, typically around a thousand.
+
+Table 4 presents the resolve rates for four variants of our method. Notably, while the 2-hop variant incorporates additional information, directly flattening this information results in the poorest performance, with a resolve rate of 26.00%, even lower than the original baseline. In contrast, incorporating summarization via the LLM significantly alleviates context length constraints and enhances information organization, thereby improving performance. For the 1-hop variant, however, we observed that adding summarization actually degrades performance, reducing the resolving rate to 28.33%. We hypothesize that this occurs because the flat 1-hop ego-graph already contains comprehensive information that fits within the LLM’s context window; thus, summarization may introduce inevitable information loss.
+
+### 5.3 TRANSFERABILITY TEST
+
+To demonstrate the representational power of REPOGRAPH for repositories and its transferability to tasks requiring an understanding of repository structures, we conducted experiments using the CrossCodeEval benchmark (Ding et al., 2023). CrossCodeEval is a multilingual code completion benchmark that is derived from real-world repositories. It is designed to emphasize numerous cross-file dependencies. We focus on problems using *Python* as the evaluation programming language, leading to 2,665 samples. For evaluation metrics, we follow the settings in the original paper and measure performance with code match and identifier match metrics, assessing accuracy with exact match (EM), edit similarity (ES), and F1 scores. In our experiments, the search terms are determined to be the function within which the current line is to be completed.
+
+Table 5 demonstrates the results on CrossCodeEval using GPT-4o and Deepseek-Coder as the backbone language model. The original LLMs struggle with repository-level tasks, evidenced by an EM score of only 10.8 for code matching and 16.7 for identifier matching. These results indicate significant limitations in handling code structure and variable usage in a broader repository context.
+
+Table 5: Results on the subset of CrossCodeEval with GPT-4o and Deepseek-Coder-V2-Lite-Instruct as the backbone LLMs.
+
+| Methods | Code Match | | Identifier Match | |
+|-|-|-|-|-|
+| | EM | ES | EM | F1 |
+| Deepseek-Coder | 10.2 | 57.3 | 16.6 | 49.1 |
+| +REPOGRAPH | 19.7 | 67.8 | 29.3 | 58.9 |
+| GPT-4o | 10.5 | 59.6 | 16.8 | 47.9 |
+| +REPOGRAPH | 28.7 | 68.9 | 36.0 | 61.3 |
+
+{9}------------------------------------------------
+
+
+
+Figure 3: Venn diagram and error distribution bars for REPOGRAPH and baselines on SWE-Bench-Lite. (a) Procedural framework: Agentless (5 unique), RepoGraph (12 unique), Overlap (77). Error distribution for RepoGraph: Incorrect localization (3), Regressive fix (1), Contextual misalignment (1). (b) Agent framework: SWE-agent (16 unique), RepoGraph (22 unique), Overlap (39). Error distribution for RepoGraph: Incorrect localization (7), Regressive fix (4), Contextual misalignment (5). Legend: Incorrect localization (pink), Regressive fix (yellow), Contextual misalignment (blue).
+
+Figure 3: Venn diagram of REPOGRAPH and baselines on (a) procedural framework and (b) agent framework on SWE-Bench-Lite. We also plot the error distribution of failing cases against counterparts, e.g., detailed error distribution of 12 cases REPOGRAPH succeeds while Agentless fails.
+
+However, with the integration of the REPOGRAPH method, there is a substantial improvement across all metrics with both LLMs. Particularly, we find that the improvement brought by REPOGRAPH is more pronounced when integrated with GPT-4o. A potential reason is that GPT-4o is better at interpreting the additional context information provided for better code reasoning. These improvements suggest that incorporating repository-level knowledge, as facilitated by REPOGRAPH, greatly enhances the model’s ability to understand and generate more contextually accurate and semantically consistent code.
+
+### 5.4 ERROR ANALYSIS
+
+We want to compare REPOGRAPH with the corresponding baselines to see the distribution of resolved cases and analyze the error reasons for unresolved cases. We plot a Venn diagram for representative methods in both procedural and agent frameworks in Figure 3, respectively. We manually examined all the unique error cases and defined three error categories. (i) **Incorrect localization** refers to the failure in accurately identifying code snippets, (ii) **contextual misalignment** happens when the generated patch fails to align with the broader context of the codebase, and (iii) **regressive fix** introduces new issues in resolving the original issues. More examples are in Appendix D.
+
+We found that the improvement in agent frameworks is more complementary than procedural frameworks, with larger uniquely resolved cases of 22 compared with 12 in procedural frameworks. Together, they make even larger performance of 31.33% and 22.33%. The reason could also be attributed to the determinism of procedural frameworks. As a plug-in module, REPOGRAPH tends to make modifications on existing deterministic processes, resulting in larger overlaps in resolved issues compared with baselines. Agent frameworks, on the other hand, have quite different action distributions with REPOGRAPH as a plug-in (please refer to Appendix A.2). Therefore, the uniquely resolved cases are more compared with procedural frameworks. For error distributions, contextual misalignment is the most prevalent error type, followed by incorrect localization and regressive fixes for all methods, suggesting that while localization is often correct, the applied solutions may regress or fail to integrate contextually. The phenomenon also echoes the conclusion obtained in Section 5.1. This is intuitive as all the existing methods focus on providing a more comprehensive and desired context for LLMs to solve the task, which fundamentally depends on the power of backbone LLMs. We also found that when integrated with REPOGRAPH, the proportion of all three error types decreases (specifically for “incorrect localization”), indicating that REPOGRAPH is specifically useful in aggregating the related contexts of the current to-be-fixed issue.
+
+## 6 CONCLUSION AND DISCUSSION
+
+This paper introduces REPOGRAPH, a plug-in module for modern AI software engineering. REPOGRAPH operates at the code-line level and offers desired navigation through code bases by incorporating and aggregating information at the line level, file level, and repository level through subgraph retrieval of ego-graphs. Extensive experiments on real-world SWE tasks show that REPOGRAPH significantly boosts the performance of both procedural and agent frameworks. In addition, REPOGRAPH is proved to be smoothly and effectively transferred to other tasks that require repository-level understanding. Future work could further investigate the generalizability of REPOGRAPH across different programming languages, frameworks, and developer environments. Real-time execution and feedback could also be explored to further enhance REPOGRAPH towards a dynamic version for better AI software engineering abilities.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/ec9hJPn59o.txt b/papers/ec9hJPn59o.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fd791c3922b739b18ddf26259efc9f09cab1b38a
--- /dev/null
+++ b/papers/ec9hJPn59o.txt
@@ -0,0 +1,350 @@
+**Primary Area:** unsupervised, self-supervised, semi-supervised, and supervised representation learning
+
+
+
+{0}------------------------------------------------
+
+# BIENHANCER: BI-LEVEL FEATURE ENHANCEMENT IN THE DARK
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+The remarkable achievements of high-level vision tasks (e.g., object detection, semantic segmentation) under favorable lighting conditions highlight the persistent challenges faced in low-light vision. Previous studies have mainly focused on enhancing low-light images to create visual-friendly representations, often neglecting the differences between machine vision and human vision. This oversight has led to limited performance improvements for high-level tasks. Furthermore, many approaches rely on synthetic paired datasets for training, which can result in limited generalization to real-world images with diverse illumination levels. To address these issues, we propose a new module called BiEnhancer, which is designed to enhance the representation of low-light images by optimizing the loss function of high-level tasks to improve performance. BiEnhancer decomposes low-light images into low-level and high-level components and performs feature enhancement. Then, it adopts an attentional feature fusion strategy and a pixel-wise iterative estimation strategy to effectively enhance and restore the details and semantic information of low-light images and improve the machine-readable representation ability of low-light images. As a versatile plug-in module, BiEnhancer supports end-to-end joint training with diverse high-level tasks. Extensive experimental results demonstrate that the BiEnhancer framework outperforms state-of-the-art methods in both speed and accuracy.
+
+## 1 INTRODUCTION
+
+Computer vision has achieved remarkable success in processing high-quality images and videos. Existing backbone networks (Gao et al., 2019) (Dosovitskiy, 2020) (Liu et al., 2021b) (Chen et al., 2023), object detectors (Ren et al., 2016) (Redmon, 2016) (Redmon, 2018) (Meng et al., 2021) (Zhang et al., 2022) (Wang et al., 2024) (Zhao et al., 2024), and semantic segmentation models (Long et al., 2015) (Qin et al., 2020) perform well on benchmark datasets. However, although existing low-light image enhancement (LIE) methods (Zhang et al., 2019) (Wang et al., 2023) (Jin et al., 2023) have shown significant improvements in converting low-light images into visual-friendly representations, high-level vision tasks such as object detection and semantic segmentation still face challenges under low-light conditions. Simply combining LIE models and high-level vision tasks may not necessarily lead to improved performance.
+
+There are two methods for combining LIE models with high-level vision tasks: end-to-end training and Non end-to-end training. End-to-end training entails removing the loss function of the LIE model (Hashmi et al., 2023). Low-light images processed by the LIE model are fed into the high-level framework’s backbone network, and both models optimize synchronously using the high-level model’s loss function. Non end-to-end training first trains the LIE model on paired data with its own loss function, then sends enhanced images to the high-level model for fine-tuning. The comparison in Figure 1 reveals the inferior performance of simple model combinations (Non end-to-end training) in terms of both detection accuracy and efficiency.
+
+This work explores the underlying reasons for the low performance observed in a Non end-to-end training of LIE methods with high-level vision tasks: 1) The different loss functions employed by LIE and high-level vision models lead to optimization conflicts between them, resulting in the performance of the entire combination being less than expected. End-to-End training can better coordinate the two parts and achieve global optimality. For example, the loss functions of Sparse
+
+{1}------------------------------------------------
+
+054
+055
+056
+057
+058
+059
+060
+061
+062
+063
+064
+065
+066
+067
+068
+069
+070
+071
+072
+073
+074
+075
+076
+077
+078
+079
+080
+081
+082
+083
+084
+085
+086
+087
+088
+089
+090
+091
+092
+093
+094
+095
+096
+097
+098
+099
+100
+101
+102
+103
+104
+105
+106
+107
+
+
+
+| Benchmark | Training Condition | AP50 (%) | mAP (%) |
+|-|-|-|-|
+| RetinaNet | end-to-end | 72.6 | 44.1 |
+| | Non end-to-end | 71.9 | 43.5 |
+| Sparse R-CNN | end-to-end | 77.8 | 48.8 |
+| | Non end-to-end | 75.7 | 47.4 |
+
+Bar chart showing performance comparison of Zero-DCE when trained end-to-end or Non end-to-end with RetinaNet and Spark R-CNN as benchmarks on the ExDark dataset. The chart displays AP50 and mAP for both models under two training conditions.
+
+Figure 1: Performance comparison of Zero-DCE when trained end-to-end or Non end-to-end with RetinaNet and Spark R-CNN as benchmarks on the ExDark dataset.
+
+R-CNN (Sun et al., 2021), including L1 Loss, GIoU Loss (Rezatofighi et al., 2019), and Focal Loss, prioritize improving prediction accuracy. On the other hand, the loss functions of Zero-DCE (Guo et al., 2020), including Spatial Consistency Loss, Exposure Control Loss, Color Constancy Loss, and Illumination Smoothness Loss, focus on enhancing image brightness and contrast to improve image clarity under low-light conditions. However, this enhancement may compromise the semantic information crucial for accurate detection. 2) Current LIE methods (Liu et al., 2021a) (Ma et al., 2022) often emphasize low-level features at the expense of enhancing high-level features rich in semantic information (see in Figure 4. In the ground truth (GT), there are four boats. However, Zero-DCE only identifies two of them. On the contrary, there is no person in GT, but Zero-DCE misidentifies some objects as a person). Although restoring low-level features can improve local details, due to the lack of basic semantic context essential for accurately understanding images, restoring low-level features may ultimately reduce the machine readability of the entire image.
+
+To address two issues, we propose BiEnhancer, a multifunctional plug-in module. Unlike traditional LIE methods (Guo & Hu, 2023) (Cui et al., 2021), , it doesn’t rely on a specific loss function and can train end-to-end with high-level vision task models. BiEnhancer uses a feature aggregation enhancement strategy and an attentional bi-level feature fusion strategy inspired by cross attention (Vaswani, 2017). It also employs a pixel-wise iterative estimation strategy. These strategies enhance robustness and improve performance and efficiency of tasks. Experimental results show BiEnhancer outperforms existing state-of-the-art methods and improves results in low-light vision tasks, e.g., +0.5 mAP and +0.5 FPS in dark object detection on ExDark, +0.9 mAP in face detection on DARK FACE, and +0.3 mIoU and +0.5 FPS in nighttime semantic segmentation on ACDC with an A5000 GPU.
+
+Our main contributions can be summarized as follows:
+
+- (i) We propose BiEnhancer, a novel module that can improve the extraction of low-level features and enhance the semantic quality of high-level features to boost high-level vision tasks under low-light conditions
+- (ii) We introduce the attentional bi-level feature fusion strategy to effectively fusing low-level and high-level features.
+- (iii) Our proposed pixel-wise iterative estimation strategy can rapidly iterate low-light images to obtain more machine-readable and feature-enhanced representations.
+
+## 2 RELATED WORK
+
+### 2.1 LOW-LIGHT ENHANCEMENT
+
+Most LIE methods (Lore et al., 2017) (Moran et al., 2020) are designed to transform low-light images into visual-friendly representation by increasing brightness, restoring color, completing details, reducing noise, etc. Traditional LIE methods (Ibrahim & Kong, 2007) (Lee et al., 2013) mainly rely on histogram equalization (Pizer et al., 1987) and Retinex theory (Land & McCann, 1971), but
+
+{2}------------------------------------------------
+
+often face challenges such as increased noise, color distortion, and slow processing speed. Recently, deep learning has made significant progress in LIE, and LIE methods can be categorized into supervised learning, unsupervised learning, semi-supervised learning, and zero-reference learning according to different learning strategies (Li et al., 2021). Supervised learning is mainstream, although it performs well, it often lacks generalization ability in real low-light conditions due to the use of synthetic training data. To address these issues, unsupervised EnlightenGAN (Jiang et al., 2021) applied GAN (Goodfellow et al., 2014) technology for the first time in low-light fields. This approach enables training using unpaired data while employing discriminators to handle different lighting conditions, albeit with a somewhat unstable training process. To combine the advantages of supervised and unsupervised learning, semi-supervised DRBN (Yang et al., 2020) is proposed, which performs unsupervised band reassembly after supervised recursive band learning, but it is difficult to construct cross-domain information relationships. To compensate for these shortcomings, Guo et al. (2020) propose zero-reference learning, which only enhances learning from test images, but faces the challenge of designing non-reference loss functions.
+
+### 2.2 LOW-LIGHT ENHANCEMENT FOR DOWNSTREAM VISUAL TASKS
+
+Research on object detection under sub-optimal lighting conditions (including low light conditions) has resulted in several YOLOv3-based methods (Liu et al., 2022) (Kalwar et al., 2023) to improve detection performance. However, these methods often struggle with adaptability to other models. Cui et al. (2021) introduced MAET to improve object detection performance under low-light conditions by analyzing intrinsic lighting patterns. Their subsequent work, IAT (Cui et al., 2022), employed the Transformer architecture to estimate global image signal processing (ISP) parameters for improving object detection and semantic segmentation performance. However, this might come at the cost of slower detection speeds. Based on the contrastive learning strategy, Xue et al. (2022) designed a joint unified framework with a cascaded architecture that can enhance the visual and machine perception capabilities of nighttime semantic segmentation. Ma et al. (2022) established a cascaded illumination learning process (SCI) with weight sharing to enhance the visual quality of low light images and improve performance in tasks such as low-light face detection and nighttime semantic segmentation. Hashmi et al. (2023) proposed a FeatEnhancer network with no loss function, which aggregates and generates multi-level features to enhance the performance of advanced visual tasks. Our work also adheres to this spirit, and the proposed BiEnhancer performs better and faster in advanced visual tasks.
+
+## 3 METHODS
+
+
+
+Figure 2: The overview of the framework of BiEnhancer. The diagram illustrates the BiEnhancer architecture for low-light image enhancement. An 'Input Image' is processed through two parallel paths: a Feature Attention Module (FAM) and a Hierarchical Feature Enhancement Module (HFEM). The FAM path generates features \$F\_i \in R^{H \times W \times C\_i}\$, which are then processed by a Block Feature Fusion Module (BFFM). The HFEM path generates features \$F\_h \in R^{H \times W \times C\_h}\$, which are also processed by BFFM. The outputs of both BFFM blocks are combined via a Feature Enhancement Module (IEM) to produce the 'Enhanced Image' \$I\_e \in R^{H \times W \times C\_i}\$. The enhanced image is then used for 'High-level Vision Task'. A detailed view of the BFFM block shows it takes \$F\_i \in R^{H \times W \times C\_i}\$ and \$F\_h \in R^{H \times W \times C\_h}\$ as input, processes them through a 'Fuse Block' and a 'Split' block, and then combines them via 'Channel-wise Concatenation' and 'Element-wise Multiplication' to produce the final feature map \$F\_f \in R^{H \times W \times C\_i}\$. A legend defines the symbols: Channel-wise Concatenation (+), Element-wise Multiplication (⊗), Skip Connection (red arrow), and High-level line (green arrow).
+
+Figure 2: The overview of the framework of BiEnhancer.
+
+{3}------------------------------------------------
+
+### 3.1 OVERVIEW OF BiENHANCER
+
+This paper introduces BiEnhancer, a versatile and robust plug-in module specifically designed to enhance machine readability under low-light conditions for vision tasks such as object detection, face detection, and semantic segmentation. BiEnhancer decouples low-light images into low-level and high-level features, enhances them, and effectively fuses them while preserving details and strengthening their semantic description. Finally, the enhanced low-light representation is obtained through pixel-level iterative evaluation. An overview of the framework of BiEnhancer is presented in Figure 2.
+
+### 3.2 FEATURE EXTRACTION AND ENHANCEMENT
+
+In this section, we take a low-light RGB image $I \in \mathbb{R}^{W \times H \times 3}$ as input. An reflection convolutional operator **RefConv** (an regular convolutional operator with reflection padding) is employed on $I$ to generate a low-resolution image $I_l \in \mathbb{R}^{\frac{H}{2} \times \frac{W}{2} \times 3}$ . Then, the Feature Aggregation Module (FAM) is utilized to transform $I$ and $I_l$ into low-level features $F_l \in \mathbb{R}^{W \times H \times C}$ and high-level features $f_h \in \mathbb{R}^{\frac{H}{2} \times \frac{W}{2} \times C}$ . Subsequently, the High-level Feature Enhancement Module (HFEM) processes to generate richer high-level features $F_f \in \mathbb{R}^{\frac{H}{2} \times \frac{W}{2} \times C}$ .
+
+**Feature Extraction** Inspired by DenseNet (Huang et al., 2017), we design a fully convolutional inter-scale Feature Aggregation Module (FAM) for aggregating features and capturing crucial spatial and channel information. We apply four convolution blocks to the RGB image $I$ to generate the aggregated high-level features $F_h \in \mathbb{R}^{W \times H \times C}$ . In each convolution block, the input is the sum obtained by concatenating the output of the previous block and the original image $I$ . Each convolution block is accompanied by a SiLU activation function. In fact, BiEnhancer only uses the SiLU activation function. The process of obtaining $f_h$ , by processing $I_h$ with FAM is similar to the above, and the structure of FAM is shown in Figure 3(a).
+
+
+
+Figure 3: Details of FAM, RepConvN, DWConv and HFEM. The diagram shows four modules: (a) FAM, (b) RepConvN, (c) DWConv, and (d) HFEM. FAM (a) shows a sequence of Conv k=3, s=1, SiLU, and Cat blocks with skip connections. RepConvN (b) shows a Conv k=3, s=1 block followed by a BatchNorm and a skip connection. DWConv (c) shows a Pointwise Conv k=3, s=1, Depthwise Conv k=3, s=1, and a skip connection. HFEM (d) shows a sequence of RepConvN and DWConv blocks with skip connections. A legend indicates that a circle with a plus sign represents element-wise addition and a red arrow represents a skip connection.
+
+Figure 3: Details of FAM, RepConvN, DWConv and HFEM.
+
+**Feature Enhancement** High-level features embody rich semantic detail and serve as crucial elements for downstream visual tasks. To extract this semantic information, we were motivated by U-net (Ronneberger et al., 2015) and designed the high-level feature enhancement module (HFEM). In HFEM, we utilize depthwise separable convolution (DW Conv) (Chollet, 2017) and simplified reparameterization convolution (RepConvN) (Ding et al., 2021) bolocks as the basic operation unit. The structures of the RepConvN and DWConv blocks are shown in Figure 3(b) and 3(c). We start with two RepConvN blocks to convert low-channel features $f_h$ into a high-channel features, followed by two DWConv blocks reduce the channels and obtain the final high-level feature $F_h \in \mathbb{R}^{\frac{H}{2} \times \frac{W}{2} \times C}$ . In HFEM, in order to obtain more comprehensive semantic information, we also used two skip connections (SC). The structure of HFEM is shown in Figure 3(d).
+
+{4}------------------------------------------------
+
+### 3.3 FEATURE FUSION
+
+Single low-level or high-level features are difficult to effectively improve vision task performance, while fusion features can better reflect the complexity of visual information (as shown in Tables 5). In Bi-level Feature Fusion Module (BFFM), we propose an efficient feature alignment and attentional fusion scheme to enhance the ability of module to represent low-level details and high-level semantics. As shown in Figure 2, to maintain the lightweight BiEnhancer, we perform feature alignment at the low-resolution scale by using a reflection convolutional operator **RefConv** ( $K=9$ , $S=8$ ) to down-sampling the low-level features $F_l \in \mathbb{R}^{H \times W \times C}$ and another regular convolutional operator **Conv** ( $K=3$ , $S=1$ ) to increase the number of channels for $I_h$ . Then, we split the down-sampled low-level features $F_l \in \mathbb{R}^{\frac{H}{8} \times \frac{W}{8} \times C}$ , $F_i \in \mathbb{R}^{\frac{H}{8} \times \frac{W}{8} \times C}$ and the high-level features $F_h \in \mathbb{R}^{\frac{H}{8} \times \frac{W}{8} \times C}$ into $N$ blocks along the channel dimension $C$ . It can be written as:
+
+$$F_l^n = F_l[:, :, (n-1)\frac{C}{N} : n\frac{C}{N}]; F_i^n = F_i[:, :, (n-1)\frac{C}{N} : n\frac{C}{N}]; F_h^n = F_h[:, :, (n-1)\frac{C}{N} : n\frac{C}{N}] \quad (1)$$
+
+where $n \in 1, 2, \dots, N$ and $N$ is the number of fusion blocks. In a single fusion block, $F_l^n \in \mathbb{R}^{H \times W \times 1 \times 1 \times \frac{C}{N}}$ and $F_h^n \in \mathbb{R}^{H \times W \times 1 \times 1 \times \frac{C}{N}}$ are concatenated along the third dimension $L$ to obtain $F_a^n \in \mathbb{R}^{H \times W \times 2 \times 1 \times \frac{C}{N}}$ . The three features $F_l^n \in \mathbb{R}^{H \times W \times 1 \times 1 \times \frac{C}{N}}$ , $F_i^n$ and $F_h^n$ are multiplied with $F_a^n$ separated and then summed up along the last dimension $T$ to obtain the attentional weights $W_{al}^n \in \mathbb{R}^{H \times W \times 2 \times 1 \times 1}$ , $W_{ai}^n \in \mathbb{R}^{H \times W \times 2 \times 1 \times 1}$ and $W_{ah}^n \in \mathbb{R}^{H \times W \times 2 \times 1 \times 1}$ . It can be written as:
+
+$$W_{al}^n = \sum_{t=1}^T (F_a^n \cdot F_l^n \cdot s); \quad W_{ai}^n = \sum_{t=1}^T (F_a^n \cdot F_i^n \cdot s); \quad W_{ah}^n = \sum_{t=1}^T (F_a^n \cdot F_h^n \cdot s) \quad (2)$$
+
+where $\sum_{t=1}^T$ , $\cdot$ , and $s$ denote the summing operation along the last dimension $T$ , the element-wise multiplication operation, and the scale factors ( $N^{-0.5}$ ). Then, we concatenate $W_{al}^n$ , $W_{ai}^n$ and $W_{ah}^n$ along the last dimension to obtain the total attentional weights of a fuse block $W_f^n \in \mathbb{R}^{H \times W \times 2 \times 1 \times \frac{C}{N}}$ . Due to the limitation of the above concatenation calculation, it is necessary to ensure that $\frac{C}{N}$ is equals to 3. Therefore, in this paper, we set $C$ to 24 and $N$ to 8. The process can be written as:
+
+$$W_f^n = \text{Cat}([W_{al}^n, W_{ai}^n, W_{ah}^n], \text{dim} = T); \quad \overline{W_f^n} = \frac{\exp(W_f^n)}{\sum_{t=1}^T \exp(W_f^n)} \quad (3)$$
+
+where $\text{Cat}([], \text{dim}=T)$ represents the concatenation operation along the last dimension $T$ , and $\overline{W_f^n}$ is the normalized form of $W_f^n$ . Then, we sum up all $\overline{W_f^n}$ along the dimension $L$ to obtain $\overline{W_f} \in \mathbb{R}^{\frac{H}{8} \times \frac{W}{8} \times C}$ . Finally, we use the bilinear interpolation operator **BiUp** to upsample $\overline{W_f}$ to obtain $W_f \in \mathbb{R}^{H \times W \times C}$ , and then add the original low-level features $F_l \in \mathbb{R}^{W \times H \times C}$ to get the fused feature representation $F_f \in \mathbb{R}^{H \times W \times C}$ .
+
+### 3.4 ITERATIVE ESTIMATION
+
+Inspired by the denoising process of DDPM (Ho et al., 2020), we design the Iterative Estimation Module (IEM) to further optimize and enhance the feature representation of low-light images. First, bilinear interpolation operator **BiUp** is utilized to up-sample $F_h$ by a factor of 8 to attain the original resolution size. Subsequently, the up-sampled $F_h$ is added to the fused feature representation $F_f$ in the channel dimension. Next, reflection convolution operator **RefConv** is employed to operate on the added feature representations $F_a \in \mathbb{R}^{H \times W \times 2C}$ , obtaining all parameters for iterative evaluation. We set $F_a$ to $2*N$ (twice the number of fusion blocks) parameters $F_n$ , that are of the same size as the low-light image $I$ . Then, $\bar{F}_n$ is used to iteratively evaluate $I$ and transform it into a feature-enhanced
+
+{5}------------------------------------------------
+
+representation $F_e$ that is more machine-readable for high-level vision tasks. The iterative estimation process can be written as:
+
+$$I_{n+1} = I_n (1 + \bar{F}_{2n-1} + \bar{F}_{2n} I_n) \quad (4)$$
+
+Here, $n \in 1, 2, \dots, N$ , and $N$ is the number of iterations. $I_1$ is the low-light RGB image $I$ , and $I_{N+1}$ is the feature enhancement representation $F_e$ .
+
+## 4 EXPERIMENTS
+
+We evaluate the effectiveness of BiEnhancer through extensive experiments on several high-level tasks in low-light vision, including generic object detection, face detection, and semantic segmentation. This section compares the proposed method with powerful baselines, existing LIE methods, and state-of-the-art methods in these high-level tasks. We conducted ablation experiments on different BiEnhancer blocks to assess their effectiveness. The key statistical data of datasets is summarized in Table 1.
+
+| Datasets | Task | Cls | Train | Val |
+|-|-|-|-|-|
+| ExDark | Object detection | 12 | 4800 | 2563 |
+| DARK FACE | Face detection | 1 | 5400 | 600 |
+| ACDC Nighttime | Semantic segmentation | 19 | 400 | 106 |
+
+Table 1: Statistics of the datasets used to report results on three different downstream vision tasks. **Cls** is the number of classes, whereas **Train** and **Val** denote number of training and validation samples for each dataset, respectively.
+
+### 4.1 DARK OBJECT DETECTION ON EXDARK
+
+**Details** For dark object detection, we used the exclusively dark (ExDark)1 dataset (see in Table 1) in our experiments using RetinaNet (Lin, 2017), a typical detector, and Sparse R-CNN, an advanced detector as detection frameworks. Both detectors were initialized with pre-trained weights from COCO dataset and fine-tuned on the ExDark dataset using multiscale training (shorter sides 320 to 520, longer side 608). RetinaNet was trained with a 1xschedule in mmdetection2 (12 epochs using the SGD optimizer with an initial learning rate of 0.01, and batch size of 8). The Sparse R-CNN was trained with a 1xschedule in mmdetection (12 epochs using the ADAMW optimizer (Loshchilov et al., 2017) with an initial learning rate initial learning rate of 0.000025, weight decay of 0.0001, and batch size of 8).
+
+We compared our BiEnhancer with several leading LIE methods, including SCI, MBLLEN (Lv et al., 2018), RAUS, PaiLIE (Fu et al., 2023), Retinexformer (Cai et al., 2023), Zero-DCE, Zero-DCE++, and state-of-the-art dark object detection method, FeatEnhancer. For each object detection framework, we maintained the identical settings and employed the same end-to-end joint training approach, where the low-light image is propagated to the detector after passing through the enhancement network, without any LIE loss function.
+
+**Results** Table 2 lists the results of LIE methods, FeatEnhancer, and our proposed BiEnhancer on two object detection frameworks. Clearly, our BiEnhancer consistently offers enhanced detection precision and faster test speeds, outperforming previous approaches. Specifically, on the Sparse R-CNN framework, our BiEnhancer outperforms FeatEnhancer’s AP50 by 1.1%, reaching a score of 78.9, and its mAP is also superior by 0.5%. Furthermore, on the RetinaNet framework, our BiEnhancer shows more efficacy than FeatEnhancer (+0.2 AP50 and +0.6 mAP). Concurrently, when using an A5000 GPU on both detection platforms, BiEnhancer proves swifter than all current advanced LIE methods, achieving a speed advantage of 0.5 FPS over FeatEnhancer on Sparse R-CNN. In addition, Figure 4 shows four detection examples from our method and two best competitors using Sparse R-CNN as the detector. These results indicate that despite poor visual quality, our BiEnhancer enhances and integrates beneficial features for detecting dark objects, producing industry-leading results.
+
+1
+
+2
+
+{6}------------------------------------------------
+
+
+
+Figure 4: Visual comparison of Bienhancer with SCI, Zero-DCE, and FeatEnhancer on the Dark Face dataset. The figure shows a 4x4 grid of images. The first column is labeled 'GT' (Ground Truth), the second 'Zero-DCE', the third 'FeatEnhancer', and the fourth 'BiEnhancer(Ours)'. Each row shows a different scene, with BiEnhancer consistently showing better visibility and detail recovery compared to the other methods.
+
+Figure 4: Visual comparison of Bienhancer with SCI, Zero-DCE, and FeatEnhancer on the Dark Face dataset.
+
+
+
+Figure 5: Visual comparison of Bienhancer with the two previous best competitors on the ACDC nighttime dataset. The figure shows a 4x4 grid of images. The first column is labeled 'Input', the second 'GT', the third 'Xue et. al', and the fourth 'BiEnhancer(Ours)'. Each row shows a different nighttime scene, with BiEnhancer consistently showing better visibility and detail recovery compared to the other methods.
+
+Figure 5: Visual comparison of Bienhancer with the two previous best competitors on the ACDC nighttime dataset
+
+| Methods | Sparse R-CNN | | | RetinaNet | |
+|-|-|-|-|-|-|
+| | AP50 | mAP | FPS | AP50 | mAP |
+| Baseline | 76.3 | 47.8 | 46.8 | 71.0 | 42.5 |
+| RUAS | 67.3 | 40.9 | 38.4 | 73.3 | 44.7 |
+| Retinexformer | 73.6 | 45.6 | 14.3 | 73.5 | 44.5 |
+| MBLLEN* | 76.4 | 47.4 | 16.5 | 71.2 | 42.5 |
+| SCI | 76.5 | 48.1 | 31.3 | 72.5 | 44.0 |
+| PairLIE* | 77.0 | 48.2 | 26.7 | 71.8 | 43.5 |
+| Zero-DCE++ | 77.4 | 48.6 | 38.5 | 73.4 | 44.5 |
+| Zero-DCE | 77.8 | 48.8 | 39.6 | 72.6 | 44.1 |
+| FeatEnhancer | 77.8 | 48.8 | 36.4 | 73.6 | 44.6 |
+| BiEnhancer (Ours) | 78.9 | 49.3 | 40.1 | 73.8 | 45.2 |
+
+Table 2: Performance comparison on Exdark dataset. The best and second-best results are marked in red and blue respectively. Note that here MBLLEN\* and PairLIE\* denote training with a skip connection (SC).
+
+### 4.2 FACE DETECTION ON DARK FACE
+
+**Details** DARK FACE is a challenging face detection dataset released for the UG2 competition. For dark object detection, we utilized the DARK FACE dataset3 (see Table 1) in our experiments with RetinaNet and Sparse R-CNN detection frameworks. For experiments on DARK FACE (see in Table 3), images are resized to a resolution of 1080×720 for both methods. To emulate our previous findings on Dark Object Detection experiments, we utilize the identical RetinaNet and Sparse R-CNN objects detection frameworks, maintaining the same prescribed experimental conditions. For Sparse R-CNN, the batch size has been adjusted to 4.
+
+**Results** The performance of BiEnhancer, FeatEnhancer, and seven other LIE methods in combination with RetinaNet and Sparse R-CNN is summarized in Table 3. Similarly, our BiEnhancer has significantly improved the detection accuracy and speed on both Sparse R-CNN and RetinaNet compared to FeatEnhancer. On Sparse R-CNN, both AP50 (+1.2) and mAP (+0.9) are higher than those of FeatEnhancer. On RetinaNet, AP50 (+1.4) and mAP (+0.3) are also higher than those of FeatEnhancer.
+
+3
+
+{7}------------------------------------------------
+
+| Methods | Sparse R-CNN | | RetinaNet | |
+|-|-|-|-|-|
+| | AP50 | mAP | AP50 | mAP |
+| Baseline | 52.5 | 21.6 | 32.6 | 12.3 |
+| RUAS | 51.5 | 21.1 | 36.8 | 14.1 |
+| MBLLEN* | 54.2 | 22.3 | 32.4 | 12.4 |
+| SCI | 54.3 | 22.4 | 37.0 | 14.1 |
+| Retinexformer | 56.6 | 22.9 | 36.8 | 13.9 |
+| PairLIE* | 56.3 | 23.3 | 34.6 | 13.0 |
+| Zero-DCE++ | 57.7 | 23.9 | 36.3 | 13.9 |
+| Zero-DCE | 58.8 | 24.4 | 37.1 | 14.0 |
+| FeatEnHancer | 58.5 | 24.4 | 36.4 | 13.8 |
+| BiEnhancer (Ours) | 60.0 | 25.5 | 38.5 | 14.4 |
+
+Table 3: Performance comparison on the Dark Face dataset. The best and second-best results are marked in red and blue respectively. Note that here MBLLEN\* and PairLIE\* denote training with a skip connection (SC).
+
+### 4.3 NIGHTTIME SEMANTIC SEGMENTATION ON ACDC
+
+**Details** We utilize nighttime images from the ACDC dataset 4 (see in Table 1) to report semantic segmentation results under low-light conditions. DeepLab-V3 (Chen, 2017) and SegFormer (Xie et al., 2021) was adopted as the segmentation baseline from mmsegmentation 5 for straightforward comparison with concurrent works. The module is initialized with pretrained weights from Cityscapes and fine-tuned on the ACDC nighttime dataset, while images are resized to a resolution of 1920x1080. DeepLab-V3 is trained with a 40k schedule in mmsegmentation (40000 iterations using the SGD optimizer, an initial learning rate of 0.001, weight decay of 0.0005, and a batch size of 4), and the crop size is set to (512, 1024). SegFormer is trained with a 20k schedule in mmsegmentation (20000 iterations using the ADAMW optimizer with an initial learning rate of 0.00005, weight decay of 0.01, and a batch size of 8), and the crop size is set to (1024, 1024).
+
+**Results** Table 4 summarizes the performance of BiEnhancer, FeatEnHancer, and seven other LIE methods in combination with SegFormer and DeepLab-V3. Our BiEnhancer has brought significant baseline improvements. On DeepLab-V3, the mIoU is 53.1, which is 0.3 higher than the previous best result. On SegFormer, the mIoU is 54.4, also 0.2 higher than the previous best result. In addition, our BiEnhancer shows a segmentation speed of 4.5 FPS on the A5000 GPU while maintaining excellent segmentation accuracy. It is significantly improved by 0.5 FPS compared to FeatEnHancer. At present, we have made a qualitative comparison with the previous best competitor in Figure 5. Obviously, our BiEnhancer can generate more accurate segmentation for both larger and smaller objects. These results confirm the effectiveness of BiEnhancer as a general-purpose module to achieve state-of-the-art results in nighttime semantic segmentation.
+
+### 4.4 ABLATION STUDIES
+
+In this section, we conduct ablation studies on the key design components of the proposed BiEnhancer when integrated with Sparse R-CNN for dark object detection on the ExDark dataset and DeepLab-V3 for nighttime semantic segmentation on the ACDC dataset. As shown in Table 5, we emphasize the evaluation results of dark object detection and nighttime semantic segmentation obtained by removing individual critical elements within the BiEnhancer framework.
+
+**Scale of High-level Features** As shown in Table 6, varying the configuration of the inaugural two halved convolutional modular units on Image I resulted in different resolution levels for high-level features $F_h$ . Despite a marginal increase in object detection speed (+0.2 FPS), it’s noteworthy that 8X down-sampling provides optimal results when considering BiEnhancer as a whole.
+
+4
+
+5
+
+{8}------------------------------------------------
+
+| Methods | DeepLab-V3 | | SegFormer |
+|-|-|-|-|
+| | mIoU | FPS | mIoU |
+| Baseline | 50.0 | 5.2 | 52.8 |
+| RUAS | 49.8 | 4.3 | 52.5 |
+| SCI | 50.8 | 3.4 | 52.9 |
+| Xue et al. | 52.3 | 4.6 | 52.9 |
+| PairLIE* | 52.5 | 2.9 | 53.8 |
+| MBLLEN* | 52.6 | 2.4 | 53.3 |
+| Zero-DCE++ | 52.6 | 4.3 | 53.5 |
+| Zero-DCE | 52.7 | 4.3 | 54.1 |
+| FeatEnhancer | 52.8 | 4.0 | 54.2 |
+| FFNet(Ours) | 53.1 | 4.5 | 54.4 |
+
+Table 4: Performance comparison on ACDC nighttime dataset. The best and second-best results are marked in red and blue respectively. Note that here MBLLEN\* and PairLIE\* denote training with a skip connection (SC).
+
+| FAM | HFEM | BFFM | IEM | Exdark mAP | ACDC mIoU |
+|-|-|-|-|-|-|
+| | | | | 47.8 | 50.0 |
+| ✓ | ✓ | ✓ | ✓ | 48.0 | 50.7 |
+| ✓ | | ✓ | ✓ | 48.7 | 52.3 |
+| ✓ | ✓ | | ✓ | 48.6 | 51.8 |
+| ✓ | ✓ | ✓ | | 48.5 | 51.4 |
+| ✓ | ✓ | ✓ | ✓ | 49.3 | 53.1 |
+
+Table 5: Effectiveness of BiEnhancer.
+
+| Scale | ExDark | | ACDC | |
+|-|-|-|-|-|
+| | mAP | FPS | mIoU | FPS |
+| 2 | 48.6 | 30.5 | 52.3 | 3.5 |
+| 4 | 48.9 | 37.5 | 52.5 | 4.1 |
+| 8 | 49.3 | 40.1 | 53.1 | 4.5 |
+| 16 | 48.6 | 30.5 | 52.2 | 4.7 |
+
+Table 6: Various combinations of the scale of high-level features. Here, 4 means the high-level features is $F_h \in \mathbb{R}^{\frac{H}{4} \times \frac{W}{4} \times C}$ .
+
+| N | C | ExDark | | ACDC | |
+|-|-|-|-|-|-|
+| | | mAP | FPS | mIoU | FPS |
+| 2 | 6 | 48.0 | 44.2 | 50.3 | 4.8 |
+| 4 | 12 | 48.4 | 37.5 | 52.5 | 4.7 |
+| 8 | 24 | 49.3 | 40.1 | 53.1 | 4.5 |
+| 16 | 48 | 48.9 | 30.5 | 52.9 | 4.2 |
+
+Table 7: Various combinations of the number of fusion blocks.
+
+**Number of Fusion Blocks in BFFM** As shown in Table 7, variable N (number of fusion blocks in the proposed BFFM model) has a significant impact. Increasing N improves set accuracy and test speed, but when N exceeds 8, object detection and semantic segmentation speeds slow down. Marginal accuracy improvement doesn't justify the performance degradation. Optimal number of fusion blocks is 8.
+
+## 5 CONCLUSION
+
+This paper presents a new multifunctional plug-in module called BiEnhancer, which is designed to enhance the fused bi-level features crucial for low-light vision tasks. Our feature aggregation and enhancement scheme is aligned with the vision backbone network, producing robust semantic representations. BiEnhancer does not require pre-training on synthetic datasets nor rely on enhancement loss functions, making it a plug-and-play solution. Extensive experiments across three different vision tasks demonstrate that our method consistently outperforms baseline models, LIE models, and leading approaches for specific tasks.
+
+{9}------------------------------------------------
+
+## REFERENCES
+
+- Yuanhao Cai, Hao Bian, Jing Lin, Haoqian Wang, Radu Timofte, and Yulun Zhang. Retinexformer: One-stage retinex-based transformer for low-light image enhancement. In *Proceedings of the IEEE/CVF International Conference on Computer Vision*, pp. 12504–12513, 2023.
+- Liang-Chieh Chen. Rethinking atrous convolution for semantic image segmentation. *arXiv preprint arXiv:1706.05587*, 2017.
+- Xinghao Chen, Siwei Li, Yijing Yang, and Yunhe Wang. Deco: Query-based end-to-end object detection with convnets. *arXiv preprint arXiv:2312.13735*, 2023.
+- François Chollet. Xception: Deep learning with depthwise separable convolutions. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 1251–1258, 2017.
+- Ziteng Cui, Guo-Jun Qi, Lin Gu, Shaodi You, Zenghui Zhang, and Tatsuya Harada. Multitask act with orthogonal tangent regularity for dark object detection. In *Proceedings of the IEEE/CVF international conference on computer vision*, pp. 2553–2562, 2021.
+- Ziteng Cui, Kunchang Li, Lin Gu, Shenghan Su, Peng Gao, Zhengkai Jiang, Yu Qiao, and Tatsuya Harada. You only need 90k parameters to adapt light: a light weight transformer for image enhancement and exposure correction. *arXiv preprint arXiv:2205.14871*, 2022.
+- Xiaohan Ding, Xiangyu Zhang, Ningning Ma, Jungong Han, Guiguang Ding, and Jian Sun. Repvgg: Making vgg-style convnets great again. In *Proceedings of the IEEE/CVF conference on computer vision and pattern recognition*, pp. 13733–13742, 2021.
+- Alexey Dosovitskiy. An image is worth 16x16 words: Transformers for image recognition at scale. *arXiv preprint arXiv:2010.11929*, 2020.
+- Zhenqi Fu, Yan Yang, Xiaotong Tu, Yue Huang, Xinghao Ding, and Kai-Kuang Ma. Learning a simple low-light image enhancer from paired low-light instances. In *Proceedings of the IEEE/CVF conference on computer vision and pattern recognition*, pp. 22252–22261, 2023.
+- Shang-Hua Gao, Ming-Ming Cheng, Kai Zhao, Xin-Yu Zhang, Ming-Hsuan Yang, and Philip Torr. Res2net: A new multi-scale backbone architecture. *IEEE transactions on pattern analysis and machine intelligence*, 43(2):652–662, 2019.
+- Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. *Advances in neural information processing systems*, 27, 2014.
+- Chunle Guo, Chongyi Li, Jichang Guo, Chen Change Loy, Junhui Hou, Sam Kwong, and Runmin Cong. Zero-reference deep curve estimation for low-light image enhancement. In *Proceedings of the IEEE/CVF conference on computer vision and pattern recognition*, pp. 1780–1789, 2020.
+- Xiaojie Guo and Qiming Hu. Low-light image enhancement via breaking down the darkness. *International Journal of Computer Vision*, 131(1):48–66, 2023.
+- Khurram Azeem Hashmi, Goutham Kallempudi, Didier Stricker, and Muhammad Zeshan Afzal. Featenhancer: Enhancing hierarchical features for object detection and beyond under low-light vision. In *Proceedings of the IEEE/CVF International Conference on Computer Vision*, pp. 6725–6735, 2023.
+- Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. *Advances in neural information processing systems*, 33:6840–6851, 2020.
+- Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In *Proceedings of the IEEE conference on computer vision and pattern recognition*, pp. 4700–4708, 2017.
+- Haidi Ibrahim and Nicholas Sia Pik Kong. Brightness preserving dynamic histogram equalization for image contrast enhancement. *IEEE Transactions on Consumer Electronics*, 53(4):1752–1758, 2007.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/fXb9BbuyAD.txt b/papers/fXb9BbuyAD.txt
new file mode 100644
index 0000000000000000000000000000000000000000..125003f01991f50a3759b9addcffb602bdbb3236
--- /dev/null
+++ b/papers/fXb9BbuyAD.txt
@@ -0,0 +1,284 @@
+**Primary Area:** reinforcement learning
+
+
+
+{0}------------------------------------------------
+
+# ENABLING REALTIME REINFORCEMENT LEARNING AT SCALE WITH STAGGERED ASYNCHRONOUS INFERENCE
+
+Matthew Riemer\*1,2,3, Gopesh Subbaraj\*1,2, Glen Berseth1,2, Irina Rish1,2
+
+1Mila, 2Université de Montréal, and 3IBM Research
+
+## ABSTRACT
+
+Realtime environments change even as agents perform action inference and learning, thus requiring high interaction frequencies to effectively minimize regret. However, recent advances in machine learning involve larger neural networks with longer inference times, raising questions about their applicability in realtime systems where reaction time is crucial. We present an analysis of lower bounds on regret in realtime reinforcement learning (RL) environments to show that minimizing long-term regret is generally impossible within the typical sequential interaction and learning paradigm, but often becomes possible when sufficient asynchronous compute is available. We propose novel algorithms for staggering asynchronous inference processes to ensure that actions are taken at consistent time intervals, and demonstrate that use of models with high action inference times is only constrained by the environment’s effective stochasticity over the inference horizon, and not by action frequency. Our analysis shows that the number of inference processes needed scales linearly with increasing inference times while enabling use of models that are multiple orders of magnitude larger than existing approaches when learning from a realtime simulation of Game Boy games such as Pokémon and Tetris.
+
+## 1 INTRODUCTION
+
+An often ignored discrepancy between the discrete-time RL framework and the real-world is the fact that the world continues to evolve even while agents are computing their actions. As a result, agents are limited in the types of problems that they can solve because the speed at which they can compute actions dictates a particular stochastic or deterministic time discretization rate. Agents that take infrequent actions require some lower-level program to manage behavior between actions, often through simple policies like remaining still or repeating the last action. Ideally, intelligent agents would exert more control over their environment, but this conflicts with the trend of using larger models, which have high action inference and learning times. Consequently, as typically deployed with sequential interaction, large models, which are often found to be essential for complex tasks, increasingly rely on low-level automation, reducing their control over realtime environments. This paper examines this discrepancy and explores alternative asynchronous interaction paradigms, enabling large models to act quickly and maintain greater control in high-frequency environments.
+
+Figure 1a shows the standard sequential interaction paradigm of RL. In this setup, the agent receives a state from the environment, learns from the state transition, and then infers an action. Each process must be completed before the agent can process a new state, limiting the action frequency and increasing reliance on low-level automation as the model size grows. In contrast, Figure 1b illustrates the asynchronous multi-process interaction paradigm we propose. Our key insight is that even models with high inference times can act at every step using sufficiently many staggered inference processes. Similarly, sufficiently many asynchronous learning processes can maintain rapid updates without blocking progress, despite high learning times. This work formalizes and empirically tests the benefits and limitations of this approach, making the following contributions:
+
+1. We formalize how the choice of a particular time discretization induces a new learning problem and how that problem relates to the original problem in Definition 1.
+
+\*Equal contribution. Direct correspondences to {matthew.riemer, gopeshh.subbaraj}@mila.quebec.
+
+{1}------------------------------------------------
+
+
+
+Figure 1: Frameworks for Environment Interaction in RL. (a) Sequential Interaction and Learning: A robot agent interacts with a globe environment. The agent sends an 'Action' to the environment, which returns 'State, Reward'. The agent also sends 'Parameters' to a 'Learning' block, which in turn sends 'Inference' back to the agent. (b) Asynchronous Multi-process Interaction and Learning: A robot agent interacts with a globe environment through multiple parallel processes. Each process has its own 'Learning' block. The agent sends 'Action' to the environment, which returns 'State, Reward'. The agent also sends 'Parameters' to multiple 'Inference' blocks, which in turn send 'Inference' back to the agent. The frequencies of the learning, inference, and environment processes are denoted by \$\tau\_L\$, \$\tau\_\theta\$, and \$\tau\_M\$ respectively.
+
+Figure 1: **Frameworks for Environment Interaction in RL.** a) The typical sequential interaction paradigm where both learning and action inference block the environment from moving forward. b) The more realistic setting considered in this work where the environment, the agent’s inference process, and agent’s learning process all proceed at their own rate and interact asynchronously. Multiple self-loops are depicted to denote multiple asynchronous processes. $\tau_M$ denotes the frequency of the environment, $\tau_\theta$ denotes the frequency of each inference process, and $\tau_L$ denotes the frequency of each learning process. Sequential interaction and learning has a frequency of $\tau_M + \tau_\theta + \tau_L$ .
+
+2. We derive worst-case lower bounds on regret for solving the new problem rather than the original in Theorem 1, leading us to conclude in Remark 1 that typical sequential interaction (Figure 1a) scales poorly with model size.
+3. We propose novel methods for staggering asynchronous inference in Algorithms 1 and 2, addressing the poor scaling properties of sequential interaction (Remark 2).
+4. We conduct comprehensive experiments to verify our theory, demonstrating the use of models that are orders of magnitude larger for realtime games like Pokémon and Tetris.
+
+## 2 REGRET DECOMPOSITION IN REALTIME REINFORCEMENT LEARNING
+
+**Background - Sequential Interaction:** Most RL research focuses on agents interacting sequentially with a Markov Decision Process (MDP) [71; 94] $\mathcal{M}_{\text{seq}} = \langle \mathcal{S}, \mathcal{A}, p, r \rangle$ , where $\mathcal{S}$ is a set of states, $\mathcal{A}$ is a set of actions, $r(s, a)$ is a reward function with outputs bounded by $r_{\max}$ , and $p(s'|s, a)$ is a state transition probability function. Agents take actions based on a policy $\pi_\theta(a|s)$ that maps states to action probabilities parameterized by $\theta$ . An unrealistic implicit assumption of this setting is that the time between decisions is fixed and only depends on the MDP. It is also unrealistically assumed that the environment can be paused while the policy generates an action $a$ from state $s$ .
+
+**Asynchronous Interaction Environments:** The standard MDP formalism lacks a crucial element for realtime settings where the environment cannot be "paused," and the agent interacts with it asynchronously, as described by Travnik et al. [102]. In this case, it is necessary to define the environment’s behavior when the agent has not selected an action. We believe the most general solution is to use a preset default behavior if there is no available action $a_t$ by the agent $\pi$ at time-step $t$ . This behavior follows $a \sim \beta(s)$ , where $a \in \mathcal{A}_\beta$ is possibly from a different action space than $\mathcal{A}$ , requiring $p$ and $r$ to be defined over $\mathcal{A} \cup \mathcal{A}_\beta$ . Now we can define an asynchronous MDP $\mathcal{M}_{\text{async}} = \langle \mathcal{S}, \mathcal{A}, p, r, \beta \rangle$ as an extension of a sequential MDP $\mathcal{M}_{\text{seq}}$ with the addition of the default behavior policy $\beta$ . Note that $\beta$ does not need to be non-Markovian, because the state space should be defined to include any intermediate computations needed to generate the actions of $\beta$ . Defining the default behavior as a policy is no more than a useful interpretation of what happens and is equivalent to saying the environment follows a Markov chain $p^\beta(s'|s)$ when no action is available where $p^\beta(s'|s) := \sum_{a \in \mathcal{A}_\beta} p(s'|s, a)\beta(a|s)$ with expected reward $r^\beta(s) := \sum_{a \in \mathcal{A}_\beta} \beta(a|s)r(s, a)$ .
+
+**Time Discretization Rates:** The real environment evolves in continuous time, so we must define time discretization rates to describe each component of the agent-environment interface in discrete steps. We treat the environment step time as a random variable $T_M$ with sampled values $\tau_M \sim T_M$ and expected value $\bar{\tau}_M := \mathbb{E}[T_M]$ . Similarly, the inference time of the policy for a single action1 is another random variable $T_\theta$ with sampled values $\tau_\theta \sim T_\theta$ and expected value $\bar{\tau}_\theta := \mathbb{E}[T_\theta]$ .2 We can
+
+1See Appendix B.5 for a comparison with *action chunking* methods that produce multiple actions at a time.
+
+2While policies in general could have adaptive computation times based on the state, this is relatively uncommon in the literature and will be left to future work for simplicity of the discourse.
+
+{2}------------------------------------------------
+
+now introduce yet another random variable $T_{\mathcal{T}}$ with sampled values $\tau_{\mathcal{T}} \sim T_{\mathcal{T}}$ and expected value $\bar{\tau}_{\mathcal{T}} := \mathbb{E}[T_{\mathcal{T}}]$ that is of particular importance to our work, representing the time elapsed between actions taken by the agent $\pi_\theta$ (rather than $\beta$ ) in $\mathcal{M}_{\text{async}}$ . This has been called a variety of names in the literature including the interaction time, the action cycle time, and the inverse of the interaction frequency. What is very important to note for our purposes is that $T_{\mathcal{T}}$ need not be equal to $T_{\mathcal{M}}$ nor $T_\theta$ , with the precise relation between these variables depending on the particular method of agent deployment. Establishing these three random variables now allows us to define the decision problem induced by these choices related to the agent-environment boundary (see Figure 2 for an illustration).
+
+**Definition 1 (Induced Delayed Semi-MDP)** Any choice of random variables $T_{\mathcal{M}}$ , $T_{\mathcal{T}}$ , and $T_\theta$ applied to an asynchronous MDP $\mathcal{M}_{\text{async}}$ induces a delayed semi-MDP $\mathcal{M}_{\text{delay}} := \langle \mathcal{S}, \mathcal{A}, p, r, \beta, T_{\mathcal{M}}, T_{\mathcal{T}}, T_\theta \rangle$ where the semi-MDP decision making steps $\tilde{t}$ associated with the actual decisions of the agent $\pi$ happen after $\lceil \tau_{\mathcal{T}}/\tau_{\mathcal{M}} \rceil$ steps $t$ in the ground asynchronous MDP $\mathcal{M}_{\text{async}}$ . The semi-MDP is delayed with respect to $\mathcal{M}_{\text{async}}$ because semi-MDP actions $\tilde{a}_{\tilde{t}} \in \mathcal{A}$ generated by $\pi$ are equivalent to actions that are delayed by $\lceil \tau_\theta/\tau_{\mathcal{M}} \rceil$ in $\mathcal{M}_{\text{async}}$ such that $\pi_\theta(\tilde{a}_{\tilde{t}}|s_{\tilde{t}}) = \pi_\theta(a_{t+\lceil \tau_\theta/\tau_{\mathcal{M}} \rceil}|s_t)$ where $s_{\tilde{t}} = s_t$ . If $\lceil \tau_\theta/\tau_{\mathcal{M}} \rceil > 1$ the transition dynamics are $p^\beta$ and reward dynamics are $r^\beta$ for $\lceil \tau_\theta/\tau_{\mathcal{M}} \rceil - 1$ steps in $\mathcal{M}_{\text{async}}$ until $a_{t+\lceil \tau_\theta/\tau_{\mathcal{M}} \rceil}$ is applied.
+
+In general, the optimal policy and optimal reward rate will not be the same for $\mathcal{M}_{\text{async}}$ and $\mathcal{M}_{\text{delay}}$ , with $\mathcal{M}_{\text{delay}}$ incurring additional suboptimality because of the coarse nature of the decision problem. That said, we have direct control over $T_{\mathcal{T}}$ and $T_\theta$ , so it is of interest to understand how our design decisions relate to the sub-optimality experienced. Chiefly, we are interested in understanding under what scenarios the optimal reward rate of $\mathcal{M}_{\text{async}}$ can still be achieved even when $\bar{\tau}_\theta \gg \bar{\tau}_{\mathcal{M}}$ . To do this, we focus on worst case lower bounds on regret i.e. the unavoidable regret incurred because of the interaction defined by $\mathcal{M}_{\text{delay}}$ in the worst case scenario where $\beta$ is always a suboptimal choice. The realtime regret $\Delta_{\text{realtime}}(\tau)$ is the accumulated suboptimality in $\tau$ seconds relative to following the optimal policy at every discrete steps $t$ occurring after $\tau_{\mathcal{M}}$ seconds in $\mathcal{M}_{\text{async}}$ .
+
+
+
+Figure 2: Induced Delayed Semi-MDP. The diagram shows two horizontal timelines. The top timeline is labeled 'MDP' and has discrete points marked with 'beta' (blue) and 'pi' (purple). The bottom timeline is labeled 'Delayed Semi-MDP' and has discrete points marked with 'pi' (purple). Vertical dashed lines connect the 'pi' points on the top timeline to the 'pi' points on the bottom timeline, showing a delay. A vertical double-headed arrow on the right is labeled 'State', indicating the state space. A horizontal arrow at the top is labeled 'Time'.
+
+Figure 2: **Induced Delayed Semi-MDP.** We illustrate the semi-MDP described in Definition 1 following the style of Figure 1 from Sutton et al. [95]. $\mathcal{M}_{\text{async}}$ is depicted in purple and $\mathcal{M}_{\text{delay}}$ is depicted in blue. Actions are delayed by the inference time of the policy $\pi$ and the default policy $\beta$ is followed between selections.
+
+**Theorem 1 (Realtime Regret Decomposition)** The accumulated realtime regret $\Delta_{\text{realtime}}(\tau)$ over time $\tau$ of a delayed semi-MDP $\mathcal{M}_{\text{delay}}$ relative to the oracle policy in the underlying asynchronous MDP $\mathcal{M}_{\text{async}}$ can be decomposed into three independent terms.
+
+$$\Delta_{\text{realtime}}(\tau) = \Delta_{\text{learn}}(\tau) + \Delta_{\text{inaction}}(\tau) + \Delta_{\text{delay}}(\tau) \quad (1)$$
+
+$\Delta_{\text{learn}}(\tau)$ is the regret experienced even in sequential environments as a result of learning and exploration. The lower bound in the worst case is:3
+
+$$\Delta_{\text{learn}}(\tau) \in \Omega(\sqrt{\tau/\bar{\tau}_{\mathcal{T}}}) \quad (2)$$
+
+$\Delta_{\text{inaction}}(\tau)$ expresses the regret as a result of following $\beta$ rather than optimal actions in $\mathcal{M}_{\text{async}}$ . The lower bound and upper bound in the worst case is:
+
+$$\Delta_{\text{inaction}}(\tau) \in \Theta((\tau/\bar{\tau}_{\mathcal{T}}) \times (\bar{\tau}_{\mathcal{T}} - \bar{\tau}_{\mathcal{M}})/\bar{\tau}_{\mathcal{M}}) \quad (3)$$
+
+$\Delta_{\text{delay}}(\tau)$ expresses the regret as a result of the delay of actions by $\pi$ in the underlying asynchronous $\mathcal{M}_{\text{async}}$ . The lower bound in the worst case is:
+
+$$\Delta_{\text{delay}}(\tau) \in \Omega((\tau/\bar{\tau}_{\mathcal{T}}) \times \mathbb{E}[1 - (p_{\min\max})^{\lceil \tau_\theta/\tau_{\mathcal{M}} \rceil}]) \quad (4)$$
+
+{3}------------------------------------------------
+
+where $p_{\minimax} := \min_{s \in \mathcal{S}, a \in \mathcal{A}} \max_{s' \in \mathcal{S}} p(s'|s, a)$ is a measure of environment stochasticity4 and $\lceil \tau_\theta / \tau_M \rceil$ is the number of environment steps elapsed during action inference.
+
+See Appendix B for a formal proof of Theorem 1 and our other findings. We believe this work is the first to formally state the regret decomposition in Equation 1. Note though that previous studies on real-world RL have highlighted the challenges of learning from limited samples, realtime inference, and managing system delays in scaling methods to realtime settings [19]. Equation 2 extends known lower bounds on learning time [31], using the notation from Definition 1 to explicitly connect with continuous time. Notably, this bound depends on $\bar{\tau}_T$ (not $\bar{\tau}_\theta$ ) and assumes learning can keep pace with the environment to learn from every interaction. Equation 3 provides a novel regret bound, formalizing the known suboptimality of interacting with realtime environments at a slower pace [102; 28; 73; 107; 106; 21]. This result highlights limitations of the sequential interaction paradigm.
+
+**Remark 1 (Inaction of Sequential Interaction)** When $\pi$ and $\mathcal{M}_{\text{async}}$ interact sequentially, $\tau_T = \tau_\theta$ such that in the worst case $\Delta_{\text{inaction}}(\tau) \in \Omega(\tau/\bar{\tau}_\theta \times (\bar{\tau}_\theta - \bar{\tau}_M)/\bar{\tau}_M)$ . This implies that even as $\tau \rightarrow \infty$ , in the worst case $\Delta_{\text{realtime}}(\tau)/\tau \in \Omega(\Delta_{\text{inaction}}(\tau)/\tau) \in \Omega((\bar{\tau}_\theta - \bar{\tau}_M)/\bar{\tau}_M \bar{\tau}_\theta)$ .
+
+This means a realtime framework with sequential interaction cannot ensure that regret will eventually dissipate. Thus, we explore asynchronous alternatives in the next section. Finally, Equation 4 highlights the key limitation in minimizing regret using asynchronous compute. Previous work established that suboptimality from delay in MDPs relates to the stochasticity in the underlying undelayed MDP [17; 64], focusing on communication delays inherent to the environment. Our focus, however, is on delays caused by the agent’s computations, which we can control. Thus, the emphasis on regret associated with the decision that leads to a particular value of $\tau_\theta$ is novel. Since this term is the only part of regret that depends on $\tau_\theta$ , it helps identify which environments are manageable when $\tau_\theta \gg \tau_M$ . In deterministic environments, there is no regret due to $\tau_\theta$ as $p_{\minimax} = 1$ , but in stochastic environments, the degree and temporal horizon of stochasticity determine what values of $\tau_\theta$ are tolerable. For simplicity, we present a looser bound here; a tighter bound is available in Appendix B. In summary, stochasticity with respect to actual rewards is what really matters.
+
+## 3 ASYNCHRONOUS INTERACTION & LEARNING METHODS
+
+Figure 3 highlights key differences between the standard sequential RL framework and the asynchronous multi-process framework we propose. In the sequential framework, interaction and learning delay each other. In contrast, in the asynchronous framework that we propose, actions and learning can occur at every step with enough processes. However, actions are delayed and reflect past states, which may limit performance in some environments. Note that staggering processes to maintain regular intervals is essential. For example, if all inference processes took a deterministic amount of time with no offset between them, all additional actions in the environment would be overwritten with no benefit from increasing compute. Meanwhile, with staggering we can experience linear speedups.
+
+### 3.1 BACKGROUND: STAGGERED ASYNCHRONOUS LEARNING
+
+**Parallel vs. Asynchronous Updates:** Learning from a transition, i.e., computing gradients, usually takes longer than inference. Thus, performing learning in separate processes is crucial to avoid blocking inference [106], especially for models with a large number of parameters. For this use case, one might be tempted to consider parallel learning processes to increase the effective batch size without increasing wall-clock time per batch as this avoids wasted computation. Indeed, parallel updates are better for training large language models when final performance and compute efficiency are most important. In contrast, asynchronous learning can produce updates even faster than learning from a single transition, making the model more responsive to exploration. However, lock-free asynchronous approaches risk overwriting updates, potentially wasting computation that does not contribute to final performance. That said, our focus is on maximizing responsiveness in large models, not necessarily compute efficiency, and overwritten updates are not wasted with respect to regret.
+
+3Known algorithms achieve regret upper bounds within a logarithmic factor of this lower bound [68].
+
+4When the environment is deterministic, $p_{\minimax} = 1$ and $\Delta_{\text{delay}}(\tau) = 0$ . When the environment is uniformly random, $p_{\minimax} = 1/|\mathcal{S}|$ and as $|\mathcal{S}| \rightarrow \infty$ , $\Delta_{\text{delay}}(\tau) \in \Omega(\tau)$ .
+
+{4}------------------------------------------------
+
+
+
+Figure 3: Realtime Interaction Frequency. A diagram showing four horizontal timelines representing different interaction models. The top timeline, labeled 'Environment', has purple ticks at regular intervals. The second timeline, 'Sequential Inference and Learning', shows a red line for inference and a blue line for learning, with ticks aligned to the environment. The third timeline, 'Staggered Asynchronous Inference', shows multiple staggered blue lines for inference. The bottom timeline, 'Staggered Asynchronous Learning', shows multiple staggered red lines for learning. The diagram illustrates that even with staggered processes, interaction frequency can be maintained.
+
+Figure 3: **Realtime Interaction Frequency.** We illustrate the comparative interaction frequency of methods that sequence learning and inference and those that maintain multiple staggered asynchronous processes. Even when inference times are greater than the environment step time, it is possible to use asynchronous compute to eliminate inaction and learn from every step.
+
+**Round-Robin Asynchronous Learning:** Langford et al. [50] laid the foundation for addressing asynchronous update staggering for large neural network models using variants of stochastic gradient descent (SGD). They showed that applying updates in a delayed, orderly fashion avoids wasted compute on overwritten gradients. Their approach demonstrated convergence for delayed SGD, with linear scaling limited only by the time taken to update parameters relative to computing gradients. This method allows significant linear scaling with minimal compute waste for large models and the delay in the updates will not be a persistent source of regret in Theorem 1. While not our novel contribution, this strategy is underexplored. We investigate its scaling properties in our experiments.
+
+### 3.2 OUR NOVELTY: STAGGERED ASYNCHRONOUS INFERENCE
+
+In Remark 1 we highlighted that $\bar{\tau}_I$ is fundamentally limited by $\bar{\tau}_\theta$ for sequential interaction, which results in persistent regret even as time goes on when $\bar{\tau}_\theta > \bar{\tau}_M$ . We will now highlight two novel algorithms for staggering inference processes that can lead to a reduction in $\bar{\tau}_I$ when the number of inference processes $N_I$ are increased. Algorithm 1 is capable of scaling the expected interaction time with the number of processes by $\bar{\tau}_I \leq \min(\tau_\theta^{\max}/N_I, \bar{\tau}_M)$ where $\tau_\theta^{\max}$ is the maximum encountered value of $\tau_\theta$ . Meanwhile, Algorithm 2 is capable of scaling the expected interaction time with the number of processes by $\bar{\tau}_I = \min(\bar{\tau}_\theta/N_I, \bar{\tau}_M)$ . Both algorithms can eliminate inaction.5
+
+**Remark 2 (Inaction of Asynchronous Interaction)** For any $\bar{\tau}_\theta$ when $\pi$ and $\mathcal{M}_{\text{async}}$ interact asynchronously with staggering algorithms 1 or 2, there is a value of the number of inference processes $N_I^*$ such that for all $N_I \geq N_I^*$ , $\Delta_{\text{inaction}}(\tau)/\tau \rightarrow 0$ as time goes to $\tau \rightarrow \infty$ .
+
+Algorithm 1 always ensures each process waits for the current estimate of $\tau_\theta^{\max}$ amount of seconds before an action is taken by that process to preserve the spacing between actions. Adjustments are made to the waiting time in each process considering $\text{dist}(x, y)$ , the distance process $x$ is behind process $y$ in the cycle of processes, until the estimate converges to the true $\tau_\theta^{\max}$ value. The benefit of this algorithm is that the spacing between actions stays very consistent with no variance once the maximum value estimate has stabilized. This makes $\mathcal{M}_{\text{delay}}$ easier to learn from. The downside is that the amount of necessary compute to eliminate inaction may be relatively high.
+
+On the other hand, Algorithm 2 stops all waiting in all processes as time goes on, so that the expected interaction time of each process is $\bar{\tau}_\theta$ . An estimate of $\bar{\tau}_\theta$ is maintained and when the estimate changes after an action is taken, processes wait for an amount of time designed to adjust the average spacing between processes to $\bar{\tau}_\theta/N_I$ . The law of large numbers ensures that the estimate converges to $\bar{\tau}_\theta$ in the limit as $\tau \rightarrow \infty$ and that the waiting time diminishes to zero. Algorithm 2 has a strictly smaller compute requirement than Algorithm 1, but experiences variance in $T_I$ driven by the variance in $T_\theta$ , which makes $\mathcal{M}_{\text{delay}}$ harder to learn from. The compute advantage becomes more significant for
+
+5Appendix B.6 describes how this can lead to achieving sublinear regret in deterministic environments.
+
+{5}------------------------------------------------
+
+distributions that have variance in $T_\theta$ such that $\tau_\theta^{\max} - \bar{\tau}_\theta$ is large. In our experiments, we consider Algorithm 1 because we found the variance in $T_\theta$ is small for the models and hardware we consider.
+
+#### --- **Algorithm 1** Maximum Time Inference Staggering ---
+
+**Initialize:** $\hat{\tau}_\theta^{\max} = 0$ and $\text{delay}[\text{processnum}] = 0 \forall \text{processnum} \in [1, \dots, N_{\mathcal{I}}]$
+
+**Run:** $\text{INFERENCE}[\text{processnum}] \forall \text{processnum} \in [1, \dots, N_{\mathcal{I}}]$
+
+**function** $\text{INFERENCE}(\text{processnum})$
+
+**while** alive **do**
+
+$\text{sleep}(\text{delay}[\text{processnum}])$
+
+ ▷ Sleep for any delays accumulated by other processes
+
+$\text{delay}[\text{processnum}] \leftarrow 0$
+
+$a, \tau_\theta \sim \pi_\theta(s_t)$
+
+ ▷ Have the policy sample an action and inference time
+
+**if** $\tau_\theta \geq \tau_\theta^{\max}$ **then**
+
+$\delta\tau \leftarrow \tau_\theta - \hat{\tau}_\theta^{\max}$
+
+ ▷ Other processes sleep for the difference with the maximum
+
+**for** $\text{num} \neq \text{processnum} \in [1, \dots, N_{\mathcal{I}}]$ **do**
+
+$\text{delay}[\text{num}] \leftarrow \text{delay}[\text{num}] + \text{dist}(\text{num}, \text{processnum}) \times \delta\tau / N_{\mathcal{I}}$
+
+$\tau_\theta^{\max} \leftarrow \tau_\theta$
+
+ ▷ Set new global maximum
+
+**else**
+
+$\text{sleep}(\hat{\tau}_\theta^{\max} - \tau_\theta)$
+
+ ▷ Sleep for the remaining time
+
+$a_{t+\lceil \tau_\theta^{\max} / \tau_{\mathcal{M}} \rceil} \leftarrow a$
+
+ ▷ Register action in environment
+
+---
+
+**Hardware Optimization:** In this paper, our focus is on the possibility of achieving speedups when adequate hardware is available to facilitate it. As such, we focus on what can be achieved with an ideal set of hardware rather than the most efficient way to utilize a given constrained set of hardware. In our experiments, we run each process on its own dedicated CPU such that resource constraints like memory capacity, and memory bandwidth do not present significant issues. However, if, for example, we aimed to implement multiple simultaneous processes on a single GPU, we would have to consider tradeoffs between memory capacity, memory bandwidth, and latency that will jointly serve to limit the possible speedups. We leave analysis of these practical tradeoffs to future work.
+
+## 4 RELATED WORK
+
+**Realtime interaction:** Previous work such as Travnik et al. [102] has considered the asynchronous nature of realtime environments. However, we are not aware of any prior paper that has formalized the connection between asynchronous and sequential versions of the same environment as we have. Travnik et al. [102] highlight the reaction time benefit of acting before you learn, and Ramstedt & Pal [73] highlight the reaction time benefit of interacting based on a one-step lag. Meanwhile, the interaction frequency of both of these approaches are limited by sequential interaction paradigm and thus the drawback highlighted in Remark 1 also applies to them.
+
+**Designing the interaction rate:** Farrahi & Mahmood [21] examined how the choice of $\tau_{\mathcal{I}}$ affects the learning performance of deep RL algorithms in robotics. They found that low $\tau_{\mathcal{I}}$ complicates credit assignment, while high $\tau_{\mathcal{I}}$ complicates learning reactive policies. Karimi et al. [36] proposed a policy that executes multi-step actions with a learned $\tau_{\mathcal{I}}$ within the options framework, which may aid in slow problems where credit assignment is challenging. However, this approach does not address the action delay issue we focus on and may worsen it by committing to multiple actions based on a delayed state. Our policy, defined in the semi-MDP framework (Definition 1), relies on a low-level policy $\beta$ , similar to the options framework [95]. The key difference is that $\beta$ cannot be modified, preventing intra-option learning and thus making it impossible to improve $\beta$ even when it is sub-optimal. Thus we would rather minimize the use of $\beta$ i.e. minimize inaction.
+
+**Reinforcement learning with delays:** Reinforcement learning in environments with delayed states, observations, and actions is well-studied. Typically, delays are treated as communication delays inherent to the environment [103; 9]. In contrast, we focus on delays resulting from our computations, which are under our control and part of agent design. Our formulation of delay as part of regret is novel due to this unique focus. Common methods address delay by augmenting the state space with all actions taken since the delayed state or observation [8; 37; 63], but this is infeasible for us since these actions are not available when computation begins. Instead, our approach aligns more with
+
+{6}------------------------------------------------
+
+methods addressing delay without state augmentation [89; 9; 16; 2; 35]. However, these methods are limited by the environment’s stochasticity [17; 64], as highlighted by Equation 4 of Theorem 1.
+
+**Asynchronous learning:** Most work on asynchronous RL involves multiple environment simulators learned from asynchronously or in parallel [62; 20; 90]. We explore a more challenging real-world setup with a single environment, limiting exploration opportunities. Unlike typical asynchronous setups where each process interacts sequentially with the environment and then learn from that interaction [62], our setting benefits from making interaction and learning asynchronous (Remark 2). Indeed, our paper introduces the concept of staggering asynchronous interaction, which is an innovation with benefits unique to the non-pausing environment setting we explore. Similarly to ours, some prior work has considered asynchronous learning to avoid blocking inference [106], focusing on model-based learning [28; 29; 27; 107] and auxiliary value functions [96; 14]. The novelty of our approach is in its use of multiple asynchronous staggered inference processes instead of a single process, a critical contribution for deploying large models (see Remark 1 and Remark 2).
+
+## 5 EMPIRICAL RESULTS
+
+To show that our proposed method does indeed provide practical benefits for minimizing regret per second with large neural networks in realtime environments, we perform a suite of experiments to validate the theoretical claims made in the previous sections. Our experiments include:
+
+- **Question 1:** an evaluation of the speed of progress through a realtime game strategy game where constant learning is necessary to move forward when action inference times are large.
+- **Question 2:** an evaluation of episodic reward in games where reaction time must be fast to demonstrate that asynchronous interaction can maintain performance with models that are multiple orders of magnitude larger than those using sequential interaction.
+- **Question 3:** an evaluation of the scaling properties of Algorithms 1 and 2 to demonstrate that the needed number of processes to eliminate inaction, $N_L^*$ , scales linearly with increasing inference times $\bar{\tau}_\theta$ and parameter counts $|\theta|$ .
+- **Question 4:** an evaluation of the scaling properties of round-robin asynchronous learning [50] to demonstrate that the number of processes needed to learn from every transition also scales linearly with increasing learning times and parameter counts $|\theta|$ .
+
+**Implementation Details:** For our experiments, we implemented the Deep Q-Network (DQN) learning algorithm [61] within our asynchronous multi-process framework, using a discount factor of $\gamma = 0.99$ , a batch size of 16, and an Adam learning rate of 0.001 for the sparse reward Game Boy games (with 0.00001 used for the comparatively dense reward Atari games). A shared experience replay buffer stores the 1 million most recent environment transitions. For preprocessing, we downsampled monochromatic Game Boy images to 84x84x1, similar to the preprocessing that is standard for Atari [61]. Following the scaling procedure previously established by [13] and [91], we used a 15-layer ResNet model [20] while scaling the number of filters by a factor $k$ to grow the network. The model sizes correspond to: $k = 1$ (1M parameters), $k = 7$ (10M), $k = 29$ (100M), and $k = 98$ (1B). Models were deployed on multi-process CPUs using Pytorch multiprocessing library on Intel Gold 6148 Skylake cores at 2.4GHz, with one core per process and multiple machines for models using $> 40$ processes. See Appendix A for further detail regarding our experimental setup and a discussion of limitations. As large models are known to be difficult to optimize in an online RL context, we also tried training common 1M models with an equivalent amount of added delay as the larger models to perform a sanity check. Our initial experiments indicated performance was similar.
+
+**Realtime Environment Simulation:** To run a comprehensive set of scaling experiments that would not be feasible with real-world deployment, we need a simulation of a realistic realtime scenario. Towards this end, we considered two games from the Game Boy that are made available for simulation as RL environments through the Gymnasium Retro project [65]. We implemented a realtime version of the Game Boy where it is run at 59.7275 frames per second such that $\tau_{\mathcal{M}} = 1/59.7275$ and with "noop" actions executed as the default behavior $\beta$ . This exactly mimics the way that humans would interact with the Game Boy as a handheld console [104] and matches the setting in which humans compete over speed runs for these games. We also leveraged three Atari environments [7] run at 60 frames per second with "noop" actions executed as $\beta$ to mimic the way that humans interact with the Atari console in the real-world. These are ideal settings for addressing our core empirical questions.
+
+{7}------------------------------------------------
+
+
+
+Figure 4: Realtime Pokémon Performance. (a) Battles won in Pokémon Blue over time for |θ| = 100M. (b) Wild Pokémon caught in Pokémon Blue over time for |θ| = 100M. Both plots show four methods: Asynchronous Inference and Learning (blue dashed line), Sequential Inference and Learning (black dashed line), Sequential Learning and Inference (grey dashed line), and Asynchronous Inference and Parallel Learning (red dashed line). In both cases, the asynchronous inference and learning method shows superior performance, winning more battles and catching more Pokémon over time.
+
+Figure 4: **Realtime Pokémon Performance.** **a)** Battles won in Pokémon Blue over time for $|\theta| = 100M$ . **b)** Wild Pokémon caught in Pokémon Blue over time for $|\theta| = 100M$ . The parallel learning baseline considers an effective batch size that is $33\times$ larger, incurring $33\times$ fewer updates.
+
+### 5.1 FASTER PROGRESS THROUGH A REALTIME GAME WITH CONSTANT NOVELTY
+
+**Pokémon Blue:** Pokémon Blue is a valuable environment for our study due to its long play through time and constant novelty over many hours of play. Acting quickly is not a necessity to complete this game as it lets the agent dictate the pace of play, but better players are still differentiated based on their speed of completing the game. Indeed, the game has a large community of “speed runners” aiming to complete milestones in record times, with even the fastest milestones taking multiple hours [93]. It is an interesting domain for our study because acting quickly is only beneficial to the extent that the agent displays competent behavior, so action throughput alone will not lead to better results when the quality of play correspondingly suffers. Because Pokémon Blue is known as a challenging exploration problem that perhaps even exceeds the scope of previous deep RL achievements [30], we divided the game into two settings based on expert human play: 295 battle encounters (Figure 9a) and 93 catching encounters (Figure 9b). Agents are deployed in these settings and must complete each encounter (by winning a battle or catching a Pokémon) before progressing.
+
+**Question 1:** *Can asynchronous approaches achieve faster progress in a realtime strategy game where constant learning is necessary to move forward even when action inference times are large?*
+
+**Figure 4:** For Pokémon Blue we leverage $N_T = N_T^*$ and enough learning threads to learn every 5 environment steps. We did not find benefit from learning every step given that the underlying game is not responsive to every action taken at the frame level. For all models, the exploration rate is annealed from 1.0 to 0.05 over the course of the first 100,000 steps of learning. We compare to the standard RL interaction paradigm where inference and learning are performed sequentially [94] and when the order is flipped for realtime settings [102]. Our results in Figures 4a and 4b showcase that asynchronous inference and learning combine for superior scaling of realtime performance as models grow. See Appendix A for results for the 1M and 10M models. The improvement over sequential interaction corresponds with our expectations given Remarks 1 and 2.
+
+
+
+Figure 5: Realtime Tetris Performance vs. |θ|. The plot shows Episodic Reward Rate on a logarithmic y-axis (10^0 to 10^2) against |θ| on a logarithmic x-axis (10^5 to 10^9). Four methods are compared: Asynchronous Interaction (black dashed line with circles), Sequential Interaction (purple dashed line with circles), Random Policy (blue dashed line), and All Noops (yellow dashed line). Asynchronous interaction maintains a high reward rate across all model sizes, while sequential interaction and the other two baselines show significantly lower performance.
+
+Figure 5: **Realtime Tetris Performance vs. $|\theta|$ .** The average episodic return over 2,000 episodes of learning. We compare models with a single inference process to those that perform staggered asynchronous inference following Algorithm 1.
+
+### 5.2 MAINTAINING PERFORMANCE IN GAMES THAT PRIORITIZE REACTION TIME
+
+**Tetris:** We also explore the game Tetris (Figure 9c) that presents a different kind of challenge for our agents where even more of a premium is put on reaction time. In Tetris, the player will lose the game if they wait indefinitely and do not act in time. While a slow policy can eventually win in Pokémon, despite taking longer than necessary, a policy that does not act timely cannot progress in Tetris as new pieces must be moved correctly before they fall on existing pieces.
+
+**Question 2:** *Can asynchronous interaction help for games that prioritize reaction time as $|\theta|$ grows?*
+
+{8}------------------------------------------------
+
+**Figure 5:** To aid with exploration and jump-start learning, a single episode of human play is provided to each agent to learn from. The agent continues to learn from a total of 2,000 episodes with an exploration rate of 0.05. We see that sequential interaction scales quite poorly for games that prioritize a high frequency of actions and cannot surpass random performance for $|\theta| \geq 1\text{M}$ as we would expect based on Remark 1. Meanwhile, staggered asynchronous inference following Algorithm 1 can achieve a much higher reward rate for $|\theta| > 1\text{B}$ as we would anticipate based on Remark 2.
+
+**Figure 6:** We also provide supplemental results for three Atari games with 2,000 training episodes in the same setting (see Figure 10), demonstrating superior performance as $|\theta|$ scales up. Here we additionally compare to a deeper ResNet architecture with 30 convolutional layers rather than 15. The deeper architecture brings up inference times at the same number of total parameters and thus leads to an even bigger gap between staggered asynchronous and sequential approaches. We find that the ability for performance to be maintained with asynchronous methods as the model size grows depends on the game. For example, Boxing includes a very stochastic opponent policy, making it very hard to maintain human-level performance in the presence of delay, while the Krull environment is predictable enough for agents to surpass human performance even when delay is significant. In Figure 14 we see a similar overall trend while using Rainbow learning [26] rather than DQN learning.
+
+### 5.3 COMPUTATIONAL SCALING OF ASYNCHRONOUS INTERACTION AND LEARNING
+
+**Question 3:** How does $N_{\mathcal{L}}^*$ from Remark 2 scale with $\bar{\tau}_\theta$ and the number of parameters $|\theta|$ ?
+
+**Figure 7:** We measure $N_{\mathcal{L}}^*$ for Algorithms 1 and 2 when the Game Boy is run at the standard frequency using an $\epsilon$ -greedy DQN policy at $\epsilon = 0$ and $\epsilon = 0.5$ . Figure 7a shows that $N_{\mathcal{L}}^*$ scales roughly linearly with $\bar{\tau}_\theta$ in all cases, as expected for effective staggering (Remark 2). Figure 7b also demonstrates that $N_{\mathcal{L}}^*$ scales roughly linearly with $|\theta|$ . When $\epsilon = 0$ , the variance in $T_\theta$ is very small and Algorithms 1 and 2 thus perform the same. When $\epsilon = 0.5$ , the variance in $T_\theta$ is high because sampling random actions is very fast, showcasing predictably superior performance for Algorithm 2. The performance of Algorithm 1 is unaffected by stochasticity in $T_\theta$ , but the values of $\bar{\tau}_\theta$ are.
+
+**Notation for Asynchronous Learning:** We also would like to consider the compute scaling properties of round-robin asynchronous learning [50]. We now assume that the time to learn from an environment transition can be treated as a random variable $T_{\mathcal{L}}$ with sampled values $\tau_{\mathcal{L}} \sim T_{\mathcal{L}}$ and expected value $\bar{\tau}_{\mathcal{L}} := \mathbb{E}[T_{\mathcal{L}}]$ . $N_{\mathcal{L}}^*$ will denote the number of learning processes such that all $N_{\mathcal{L}} \geq N_{\mathcal{L}}^*$ include at least one transition learned from for each environment transition.
+
+**Question 4:** How does $N_{\mathcal{L}}^*$ scale with $\bar{\tau}_{\mathcal{L}}$ and the number of parameters $|\theta|$ ?
+
+**Figure 8:** In Figure 8a we demonstrate that $N_{\mathcal{L}}^*$ grows approximately linearly with $\bar{\tau}_{\mathcal{L}}$ . This scaling is in line with what we would expect for the round-robin algorithm with large networks [50]. Additionally, our results in Figure 8b appear to also showcase linear scaling of $N_{\mathcal{L}}^* \geq 1$ with $|\theta|$ . We plot three different batch sizes per learning process in each figure to highlight the tradeoff between efficiency in achieving a particular amortized learning throughput and the number of changes made to
+
+
+
+Figure 6: Realtime Atari Performance vs. |θ|. The figure consists of three line plots labeled (a) Boxing, (b) Krull, and (c) Name This Game. Each plot shows Episodic Reward Rate on the y-axis against |θ| on a logarithmic x-axis (10^5 to 10^6). The legend indicates: Asynchronous Interaction: 1xDeep (blue dashed line with circles), Asynchronous Interaction: 2xDeep (black dashed line with circles), Sequential Interaction: 1xDeep (purple dashed line with circles), Sequential Interaction: 2xDeep (green dashed line with circles), Human Performance (blue horizontal line), and All Noops (yellow horizontal line). In (a) Boxing, performance is low for all models. In (b) Krull, asynchronous models maintain higher performance than sequential models as |θ| increases. In (c) Name This Game, asynchronous models show a significant performance advantage over sequential models at larger |θ| values.
+
+**Figure 6: Realtime Atari Performance vs. $|\theta|$ .** The average episodic return over 2,000 simulated learning episodes. We compare models with a single inference process to those that perform staggered asynchronous inference following Algorithm 1 in **a)** Boxing, **b)** Krull, and **c)** Name This Game (see Figure 10). Human performance was reported by [61]. Small confidence intervals may be hard to see.
+
+{9}------------------------------------------------
+
+
+
+Figure 7 consists of two log-log plots. Plot (a) shows the scaling behavior of the inference compute requirement $N_T^*$ (y-axis, ranging from $10^0$ to $10^4$ ) versus the expected action inference time $\bar{\tau}_\theta$ (x-axis, ranging from $10^{-3}$ to $10^4$ ). Plot (b) shows the scaling behavior of $N_T^*$ (y-axis, ranging from $10^0$ to $10^4$ ) versus the model size $|\theta|$ (x-axis, ranging from $10^5$ to $10^9$ ). Both plots compare four algorithms: Alg 1: $\varepsilon = 0$ (orange line with circles), Alg 1: $\varepsilon = 0.5$ (blue line with squares), Alg 2: $\varepsilon = 0$ (green line with triangles), and Alg 2: $\varepsilon = 0.5$ (black line with diamonds). In both cases, all algorithms show a linear increase on the log-log scale, indicating a power-law relationship.
+
+Figure 7: Scaling behavior of inference compute requirement N\_T^\* vs. expected action inference time and model size.
+
+Figure 7: **a)** We plot the scaling behavior of the inference compute requirement $N_T^*$ as the expected action inference time $\bar{\tau}_\theta$ increases for ResNet policies across CPUs in the Game Boy environment. **b)** We plot the scaling behavior of $N_T^*$ instead as a function of the model size $|\theta|$ .
+
+
+
+Figure 8 consists of two log-log plots. Plot (a) shows the scaling behavior of the learning compute requirement $N_C^*$ (y-axis, ranging from $10^4$ to $5 \times 10^4$ ) versus the expected transition learning time $\bar{\tau}_C$ (x-axis, ranging from $10^{-1}$ to $10^2$ ). Plot (b) shows the scaling behavior of $N_C^*$ (y-axis, ranging from $10^4$ to $5 \times 10^4$ ) versus the model size $|\theta|$ (x-axis, ranging from $10^6$ to $10^9$ ). Both plots compare three batch sizes: Batch Size of 8 (purple line with circles), Batch Size of 16 (blue line with squares), and Batch Size of 32 (dark blue line with triangles). In both cases, all batch sizes show a linear increase on the log-log scale, with larger batch sizes resulting in higher compute requirements.
+
+Figure 8: Scaling behavior of learning compute requirement N\_C^\* vs. expected transition learning time and model size.
+
+Figure 8: **a)** We plot the scaling behavior of the learning compute requirement $N_C^* \geq 1$ as the expected transition learning time $\bar{\tau}_C$ increases for ResNet policies across CPUs in the Game Boy environment. **b)** We plot the scaling behavior of $N_C^*$ instead as a function of the model size $|\theta|$ .
+
+the parameters in the inference process. Higher batch sizes result in longer and increasingly parallel updates with better amortized learning throughput using the same number of processes and fewer changes to the parameters used for inference (as highlighted by $\bar{\tau}_C$ ). Meanwhile, smaller batch size result in shorter and increasingly sequential updates that lead to worse amortized learning throughput using the same number of processes and more changes to the parameters used for inference.
+
+## 6 DISCUSSION
+
+**Implications for Software:** One difficulty in deploying RL environments within realtime settings is limitations in current APIs such as OpenAI gym [10]. In realtime settings, the environment needs to run in its own separate process so that it is not blocked by the agent (just like the real world). We hope that the contribution of our code and environments can thus help jump-start the community’s ability to conduct research on this important setting. A new paradigm of agent-environment interaction is needed where 1 process is used for the environment with $N_T$ processes dedicated for inference and $N_C$ processes dedicated for learning, depending on specific resource constraints.
+
+**Implications for Hardware:** Our paper demonstrates the benefits of asynchronous computation within realtime settings and thus advances in hardware that enable this will serve to amplify the impact of our findings. Memory bandwidth is a primary bottleneck in allowing for asynchronous computation with current hardware. So any improvements i.e. in GPU memory bandwidth, in bandwidth across nodes, or the number of GPUs or CPUs per node will make the scalability of asynchronous approaches increasingly viable. Taking a longer-term perspective, hardware architectures that move beyond the von Neumann separation of memory and compute, such as so called “neuromorphic” computing, will also serve to enable larger scale asynchronous computation like we see in the brain.
+
+**Bigger Models:** In this paper, we have taken a deeper look at RL in realtime settings and the viability of increasing the neural network model size in these environments. Our theoretical analysis of regret bounds has demonstrated the downfall of models that implement a single action inference process as model sizes grow (Remark 1) and we have proposed staggering algorithms that address this limitation for environments that are sufficiently deterministic (Remark 2). Our empirical results playing realtime games corroborate these findings and demonstrate the ability to perform well with models that are orders of magnitude larger. While conventional wisdom often leads researchers to think that smaller models are necessary for realtime settings, our work indicates that this is not necessarily the case and takes a step towards making realtime foundation model deployment realistic.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/gVnJFY8nCM.txt b/papers/gVnJFY8nCM.txt
new file mode 100644
index 0000000000000000000000000000000000000000..463874abaff6b04986d4f226fc830b53204f0e39
--- /dev/null
+++ b/papers/gVnJFY8nCM.txt
@@ -0,0 +1,303 @@
+**Primary Area:** applications to robotics, autonomy, planning
+
+
+
+{0}------------------------------------------------
+
+# RESIDUAL-MPPI: ONLINE POLICY CUSTOMIZATION FOR CONTINUOUS CONTROL
+
+Pengcheng Wang1\*, Chenran Li1\*, Catherine Weaver1, Kenta Kawamoto3, Masayoshi Tomizuka1,
+Chen Tang2†, and Wei Zhan1
+
+1Department of Mechanical Engineering, University of California, Berkeley.
+
+2Department of Computer Science, University of Texas at Austin.
+
+3Sony Research Inc., Japan.
+
+## ABSTRACT
+
+Policies developed through Reinforcement Learning (RL) and Imitation Learning (IL) have shown great potential in continuous control tasks, but real-world applications often require adapting trained policies to unforeseen requirements. While fine-tuning can address such needs, it typically requires additional data and access to the original training metrics and parameters. In contrast, an online planning algorithm, if capable of meeting the additional requirements, can eliminate the necessity for extensive training phases and customize the policy without knowledge of the original training scheme or task. In this work, we propose a generic online planning algorithm for customizing continuous-control policies at the execution time, which we call *Residual-MPPI*. It can customize a given prior policy on new performance metrics in few-shot and even zero-shot online settings, given access to the prior action distribution alone. Through our experiments, we demonstrate that the proposed Residual-MPPI algorithm can accomplish the few-shot/zero-shot online policy customization task effectively, including customizing the champion-level racing agent, Gran Turismo Sophy (GT Sophy) 1.0, in the challenging car racing scenario, Gran Turismo Sport (GTS) environment. Code for MuJoCo experiments is included in the supplementary and will be open-sourced upon acceptance. Demo videos and code are available on our website: .
+
+## 1 INTRODUCTION
+
+Policy learning algorithms such as Reinforcement Learning (RL) and Imitation Learning (IL) have been widely employed to synthesize parameterized control policies for a wide range of real-world motion planning and decision-making problems (Tang et al., 2024), such as navigation (Mirowski et al., 2016; Francis et al., 2020), manipulation (Andrychowicz et al., 2020; Zhang et al., 2018; Mandelekar et al., 2021; Rajeswaran et al., 2017) and locomotion (Peng & Van De Panne, 2017a;b; Gangapurwala et al., 2022). In practice, real-world applications often impose additional requirements on the trained policies beyond those established during training, which can include novel goals (Rhinehart et al., 2018), specific behavior preferences (Ziegler et al., 2019), and stringent safety criteria (Lu et al., 2023). Retraining a new policy network whenever a new additional objective is encountered is both expensive and inefficient, as it may demand extensive training efforts. To enable flexible deployment, it is thereby crucial to develop sample-efficient algorithms for synthesizing new policies that meet additional objectives while preserving the characteristics of the original policy (Lu et al., 2023; Harmel et al., 2023).
+
+Recently, Li et al. (2024) introduced a new problem setting termed *policy customization*, which provides a principled approach to address the aforementioned challenge. In policy customization, the objective is to develop a new policy given a prior policy, ensuring that the new policy: 1) retains the
+
+\*Equal Contribution †Corresponding Author
+
+{1}------------------------------------------------
+
+
+
+Figure 1: Overview of the proposed algorithm. The diagram shows a racing game environment with a car on a track. A blue arrow labeled 'Online Customization' points from the initial state to a customized state. Below this, a dashed box contains the 'Residual-MPPI' process. It starts with a 'Prior Policy' (represented by a red curve), which is processed by an 'Action Sampler' (represented by a blue cloud). The output is then evaluated by 'Action Evaluation' (represented by a green box with a flame icon and the formula S^{w\_t}(U^T) = \log p(U^T) + r\_T(a\_t, u\_t)). The final output is a 'Customized Policy' (represented by a blue curve).
+
+Figure 1: Overview of the proposed algorithm. In each planning loop, we utilize the prior policy to generate samples and then evaluate them through both the log likelihood of the prior policy and an add-on reward to obtain the customized actions. More details are in Sec. 3. In the experiments, we demonstrate that Residual-MPPI can accomplish the online policy customization task effectively, even in a challenging GTS environment with the champion-level racing agent, GT Sophy 1.0.
+
+properties of the prior policy, and 2) fulfills additional requirements specified by a given downstream task. As an initial solution, the authors proposed the Residual Q-learning (RQL) framework. For discrete action spaces, RQL can leverage maximum-entropy Monte Carlo Tree Search (Xiao et al., 2019) to customize the policy *online*, meaning at the inference time without training. In contrast, for continuous action spaces, RQL offers a solution based on Soft Actor-Critic (SAC) (Haarnoja et al., 2018) to train a customized policy leveraging the prior policy before the real execution. While SAC-based RQL is more sample-efficient than training a new policy from scratch, the additional training steps that are required may still be expensive and time-consuming.
+
+In this work, we propose *online policy customization for continuous action spaces* that eliminates the need for additional policy training. We leverage Model Predictive Path Integral (MPPI) (Williams et al., 2017), a sampling-based model predictive control (MPC) algorithm. Specifically, we propose *Residual-MPPI*, which integrates RQL into the MPPI framework, resulting in an online planning algorithm that customizes the prior policy at the execution time. The policy performance can be further enhanced by iteratively collecting data online to update the dynamics model. Our experiments in MuJoCo demonstrate that our method can effectively achieve zero-shot policy customization with a provided offline trained dynamics model. Furthermore, to investigate the scalability of our algorithm in complex environments, we evaluate Residual-MPPI in the challenging racing game, Gran Turismo Sport (GTS), in which we successfully customize the driving strategy of the champion-level racing agent, GT Sophy 1.0 (Wurman et al., 2022), to adhere to additional constraints.
+
+## 2 PRELIMINARIES
+
+In this section, we provide a concise introduction to two techniques that are used in our proposed algorithm: RQL and MPPI, to establish the foundations for the main technical results.
+
+### 2.1 POLICY CUSTOMIZATION AND RESIDUAL Q-LEARNING
+
+We consider a discrete-time MDP problem defined by a tuple $\mathcal{M} = (\mathcal{X}, \mathcal{U}, r, p)$ , where $\mathcal{X} \subseteq \mathcal{R}^n$ is a continuous state space, $\mathcal{U} \subseteq \mathcal{R}^m$ is a continuous action space, $r : \mathcal{X} \times \mathcal{U} \rightarrow \mathbb{R}$ is the reward function, and $p : \mathcal{X} \times \mathcal{U} \times \mathcal{X} \rightarrow [0, \infty)$ is the state transition probability density function. The prior policy $\pi : \mathcal{X} \rightarrow \mathcal{U}$ is trained as an optimal maximum-entropy policy to solve this MDP problem.
+
+Meanwhile, the add-on task is specified by an add-on reward function $r_R : \mathcal{X} \times \mathcal{U} \rightarrow \mathbb{R}$ . The full task becomes a new MDP defined by a tuple $\tilde{\mathcal{M}} = (\mathcal{X}, \mathcal{U}, \omega r + r_R, p)$ , where the reward is defined as a weighted sum of the basic reward $r$ and the add-on reward $r_R$ . The policy customization task is to find a policy that solves this new MDP. Li et al. (2024) proposed the residual Q-learning framework to solve the policy customization task. Given the prior policy $\pi$ , RQL is able to find this customized policy without knowledge of the prior reward $r$ , which ensures broader applicability across different prior policies obtained through various methods, including those solely imitating demonstrations.
+
+{2}------------------------------------------------
+
+In particular, as shown in their appendix (Li et al., 2024), when we have access to the prior policy $\pi$ , finding the maximum-entropy policy solving the full MDP problem $\hat{\mathcal{M}} = (\mathcal{X}, \mathcal{U}, \omega r + r_R, p)$ is equivalent to solving an augmented MDP problem $\mathcal{M}^{\text{aug}} = (\mathcal{X}, \mathcal{U}, \omega' \log \pi(\mathbf{u}|\mathbf{x}) + r_R, p)$ , where $\omega'$ is a hyper-parameter that balances the optimality between original and add-on tasks.
+
+### 2.2 MODEL PREDICTIVE PATH INTEGRAL
+
+Model Predictive Path Integral (MPPI) (Williams et al., 2017) is a sampling-based model predictive control (MPC) algorithm, which approximates the optimal solution of an (infinite-horizon) MDP through receding-horizon planning. MPPI evaluates the control inputs $U = (u_0, u_1, \dots, u_{T-1})$ with an accumulated reward function $S_{\mathbf{x}_0}(U)$ defined by a reward function $r$ and a terminal value estimator $\phi$ :
+
+$$S_{\mathbf{x}_0}(U) = \sum_{t=0}^{T-1} r(\mathbf{x}_t, \mathbf{u}_t) + \phi(\mathbf{x}_T), \quad (1)$$
+
+where the intermediate state $\mathbf{x}_t$ is calculated by recursively applying the transition dynamics on $\mathbf{x}_0$ .
+
+By applying an additive noise sequence $\mathcal{E} = (\epsilon_0, \epsilon_1, \dots, \epsilon_{T-1})$ to a nominal control input sequence $\tilde{U}$ , MPPI obtains a disturbed control input sequence as $U = \tilde{U} + \mathcal{E}$ for subsequent optimization, where $\mathcal{E}$ follows a multivariate Gaussian distribution with its probability density function defined as $p(\mathcal{E}) = \prod_{t=0}^{T-1} ((2\pi)^m |\Sigma|)^{-\frac{1}{2}} \exp(-\frac{1}{2} \epsilon_t^T \Sigma^{-1} \epsilon_t)$ , where $m$ is the dimension of the action space.
+
+As shown by Williams et al. (2017), the optimal action distribution that solves the MDP is
+
+$$q^*(U) = \frac{1}{\eta} \exp\left(\frac{1}{\lambda} S_{\mathbf{x}_0}(U)\right) p(\mathcal{E}), \quad (2)$$
+
+where $\eta$ is the normalizing constant and $\lambda$ is a positive scalar variable. MPPI approximates this distribution by assigning an importance sampling weight $\omega(\mathcal{E}^k)$ to each noise sequence $\mathcal{E}^k$ to update the nominal control input sequence:
+
+$$\mathbf{u}_t = \hat{\mathbf{u}}_t + \sum_{k=1}^K \omega(\mathcal{E}^k) \epsilon_t^k, \quad (3)$$
+
+where $K$ is the number of samples, and $\omega(\mathcal{E}^k)$ could be calculated as
+
+$$\omega(\mathcal{E}^k) = \frac{1}{\mu} \left( S_{\mathbf{x}_0}(\tilde{U} + \mathcal{E}^k) - \frac{\lambda}{2} \sum_{t=0}^{T-1} \hat{\mathbf{u}}_t^T \Sigma^{-1} (\hat{\mathbf{u}}_t + 2\epsilon_t^k) \right), \quad (4)$$
+
+where $\mu$ is the normalizing constant.
+
+## 3 METHOD
+
+Our objective is to address the policy customization challenge under the online setting for continuous control. We aim to leverage a pre-trained prior policy $\pi$ with a dynamics model $F$ , to approximate the optimal solution to the augmented MDP problem $\mathcal{M}^{\text{aug}}$ , in an online manner. To address this problem, we propose a novel algorithm, *Residual Model Predictive Path Integral* (Residual-MPPI), which is broadly applicable to any maximum-entropy prior policy with a dynamics model. The proposed algorithm is summarized in Algorithm 1 and Figure 1. In this section, we first establish the theoretical foundation of our approach by verifying the maximum-entropy property of MPPI. We then refine the MPPI method with the derived formulation to approximate the solution of the $\mathcal{M}^{\text{aug}}$ . Lastly, we discuss the dynamics learning and fine-tuning method used in implementation.
+
+### 3.1 RESIDUAL-MPPI
+
+MPPI is a widely used sampling-based MPC algorithm that has demonstrated promising results in various continuous control tasks. To achieve online policy customization, i.e., solving the augmented MDP $\mathcal{M}^{\text{aug}}$ efficiently during online execution, we utilize MPPI as the foundation of our algorithm.
+
+{3}------------------------------------------------
+
+#### **Algorithm 1** Residual-MPPI
+
+---
+
+**Input:** Current state $\mathbf{x}_0$ ; **Output:** Action Sequence $\hat{U} = (\hat{\mathbf{u}}_0, \hat{\mathbf{u}}_1, \dots, \hat{\mathbf{u}}_{T-1})$ .
+
+**Require:** System dynamics $F$ ; Number of samples $K$ ; Planning horizon $T$ ; Prior policy $\pi$ ; Disturbance covariance matrix $\Sigma$ ; Add-on reward $r_R$ ; Temperature scalar $\lambda$ ; Discounted factor $\gamma$
+
+- 1: **for** $t = 0, \dots, T - 1$ **do** ▷ Initialize the action sequence from the prior policy
+- 2: $\hat{\mathbf{u}}_t \leftarrow \arg \max \pi(\mathbf{u}_t | \mathbf{x}_t)$
+- 3: $\mathbf{x}_{t+1} \leftarrow F(\mathbf{x}_t, \hat{\mathbf{u}}_t)$
+- 4: **end for**
+- 5: **for** $k = 1, \dots, K$ **do** ▷ Evaluate the sampled action sequence
+- 6: Sample noise $\mathcal{E}^k = \{\epsilon_0^k, \epsilon_1^k, \dots, \epsilon_{T-1}^k\}$
+- 7: **for** $t = 0, \dots, T - 1$ **do**
+- 8: $\mathbf{x}_{t+1} \leftarrow F(\mathbf{x}_t, \hat{\mathbf{u}}_t + \epsilon_t^k)$
+- 9: $S(\mathcal{E}^k) += \gamma^t \times (r_R(\mathbf{x}_t, \hat{\mathbf{u}}_t + \epsilon_t^k) + \omega' \log \pi(\hat{\mathbf{u}}_t + \epsilon_t^k | \mathbf{x}_t)) - \lambda \hat{\mathbf{u}}_t^T \Sigma^{-1} \epsilon_t^k$
+- 10: **end for**
+- 11: **end for**
+- 12: $\beta = \min_k S(\mathcal{E}^k)$ ▷ Update the action sequence
+- 13: $\eta \leftarrow \sum_{k=1}^K \exp(\frac{1}{\lambda} (S(\mathcal{E}^k) - \beta))$
+- 14: **for** $k = 1, \dots, K$ **do**
+- 15: $\omega(\mathcal{E}^k) \leftarrow \frac{1}{\lambda} \exp(\frac{1}{\lambda} (S(\mathcal{E}^k) - \beta))$
+- 16: **end for**
+- 17: **for** $t = 0, \dots, T - 1$ **do**
+- 18: $\hat{\mathbf{u}}_t += \sum_{k=1}^K \omega(\mathcal{E}^k) \epsilon_t^k$
+- 19: **end for**
+- 20: **return** $\hat{U}$
+
+---
+
+As shown in Sec. 2.1, RQL requires the planning algorithm, MPPI, to comply with the principle of maximum entropy. Note that this has been shown in Bhardwaj et al. (2020), where this result established the foundation for their Q-learning algorithm integrating MPPI and model-free soft Q-learning. In Residual-MPPI, this result serves as a preliminary step to ensure that MPPI can be employed as an online planner to solve the augmented MDP $\mathcal{M}^{\text{aug}}$ in policy customization. To better serve our purpose, we provide a self-contained and concise notation of this observation in Proposition 1. Its step-by-step breakdown proof can be found in Appendix A.
+
+**Proposition 1.** *Given an MDP defined by $\mathcal{M} = (\mathcal{X}, \mathcal{U}, r, p)$ , with a deterministic state transition $p$ defined with respect to a dynamics model $F$ and a discount factor $\gamma = 1$ , the distribution of the action sequence $q^*(U)$ at state $\mathbf{x}_0$ in horizon $T$ , where each action $\mathbf{u}_t, t = 0, \dots, T - 1$ is sequentially sampled from the maximum-entropy policy (Haarnoja et al., 2017) with an entropy weight $\alpha$ is*
+
+$$q^*(U) = \frac{1}{Z_{\mathbf{x}_0}} \exp \left( \frac{1}{\alpha} \left( \sum_{t=0}^{T-1} r(\mathbf{x}_t, \mathbf{u}_t) + V^*(\mathbf{x}_T) \right) \right), \quad (5)$$
+
+where $V^*$ is the soft value function (Haarnoja et al., 2017) and $\mathbf{x}_t$ is defined recursively from $\mathbf{x}_0$ and $U$ through the dynamics model $F$ as $\mathbf{x}_{t+1} = F(\mathbf{x}_t, \mathbf{u}_t), t = 0, \dots, T - 1$ .
+
+If we have $\lambda = \alpha$ and let $V^*$ be the terminal value estimator, the distribution in equation 5 is equivalent to the one in equation 2, that is the optimal distribution that MPPI tries to approximate, but under the condition that the $p(\mathcal{E})$ is a Gaussian distribution with infinite variance, i.e. a uniform distribution. It suggests that MPPI can well approximate the maximum-entropy optimal policy with a discount factor $\gamma$ close to 1 and a large noise variance. We can then derive Residual-MPPI straightforwardly by defining the evaluation function $S_{\mathbf{x}_0}(U)$ in MPPI as
+
+$$S_{\mathbf{x}_0}^{\text{aug}}(U) = \sum_{t=0}^{T-1} \gamma^t \cdot (r_R(\mathbf{x}_t, \mathbf{u}_t) + \omega' \log \pi(\mathbf{u}_t | \mathbf{x}_t)), \quad (6)$$
+
+to solve the $\mathcal{M}^{\text{aug}}$ , therefore approximates the optimal customized policy online.
+
+The performance and sample efficiency of MPPI depends on the approach to initialize the nominal input sequence $\hat{U}$ . In policy customization, the prior policy serves as a natural source for initializing the nominal control inputs. As shown at line 1 in Algorithm 1, by recursively applying the
+
+{4}------------------------------------------------
+
+prior policy, we could initialize a nominal trajectory with a tunable exploration noise to construct a Gaussian prior distribution for sampling. During experiments, we found that including the nominal action sequence as a candidate evaluation sequence can effectively increase sampling stability.
+
+### 3.2 DYNAMICS LEARNING AND FINE-TUNING
+
+In scenarios where an effective dynamics model is unavailable in a prior, it is necessary to develop a learned dynamics model. To this end, we established a dynamics training pipeline utilizing the prior policy for data collection. In our implementation, we employed three main techniques to enhance the model’s capacity for accurately predicting environmental states, as follows. The pseudocode of the complete Residual-MPPI deployment pipeline can be found in Algorithm 2 in Appendix B.
+
+**Multi-step Error:** The prediction errors of the imperfect dynamics model accumulate over time steps. In the worst case, compounding multi-step errors can grow exponentially (Venkatraman et al., 2015). To ensure the accuracy of the dynamics over the long term, we use a multi-step error $\sum_{t=0}^T \gamma^t (s_t - \hat{s}_t)^2$ as the loss for training, where $s_t$ and $\hat{s}_t$ are the ground-truth and prediction.
+
+**Exploration Noise:** The prior policy’s behavior sticks around the optimal behavior to the prior task, which means the roll-out samples collected using the prior policy concentrated to a limited region in the state space. It limits the generalization performance of the dynamics model under the policy customization setting. Therefore, during the sampling process, we add Gaussian exploration noises to the prior policy actions to enhance sample diversity.
+
+**Fine-tuning with Online Data:** Since the residual-MPPI planner solves the customized task objective, its behavior is different from the prior. Thus, the planner may encounter states not contained in the dynamics training dataset collected by prior policy, on which the learned dynamics could be inaccurate. In this case, we can iteratively collect data with Residual-MPPI and update the dynamics model using the in-distribution data. We refer to the variant with online dynamics fine-tuning as *few-shot Residual-MPPI* and the variant without fine-tuning as *zero-shot Residual-MPPI*.
+
+## 4 MUJOCo EXPERIMENTS
+
+In this section, we evaluate the performance of the proposed algorithms in different environments selected from MuJoCo (Todorov et al., 2012). In Sec. 4.1, we provide the configurations of our experiments, including the settings of policy customization tasks in different environments, baselines, and evaluation metrics. In Sec. 4.2, we present and analyze the experimental results. Please refer to the appendices for detailed experiment configurations, implementations, and visualizations.
+
+### 4.1 EXPERIMENT SETUP
+
+**Environments.** In each environment, we design the add-on rewards to illustrate a customized specifications such as behavior preference or additional task objectives in the practical application scenarios. In HalfCheetah and Swimmer, we apply an add-on penalty on the angle of a certain joint, which is a common issue in deployment if the corresponding motor is broken; In Hopper, we apply an extra reward on height; In Ant, we apply an add-on reward for moving along the y-axis. The configurations of environments and training parameters can be found in Appendix C.
+
+**Baselines.** In our experiments, we compare the performance of the proposed residual-MPPI algorithm against seven baselines, including the prior policy, four alternative MPPI variants, and two RL-based baselines. Note that except for Greedy-MPPI, the remaining MPPI baselines have access to the underlying reward or value function of the prior policy. These baselines show that Residual-MPPI is still the ideal choice, even with privileged access to additional reward or value information.
+
+- **Prior Policy:** We utilize SAC to train the prior policy on the basic task for policy customization. At test time, we evaluate its performance on the overall task without customization, which serves as a baseline to show the effectiveness of policy customization.
+- **Greedy-MPPI:** Firstly, we introduce Greedy-MPPI, which samples the action sequences from the prior policy but only optimizes the control actions for the add-on reward $r_R$ , i.e., removing the $\log \pi$ reward term of the proposed Residual-MPPI. Through comparison with Greedy-MPPI, we aim to show the necessity and effect of including $\log \pi$ as a reward in Residual-MPPI.
+
+{5}------------------------------------------------
+
+- **Full-MPPI:** Next, we apply the MPPI with no prior on the MDP of the full task (i.e., $\omega_T + r_R$ ). We aim to compare Residual-MPPI against it to validate that our proposed algorithm can effectively leverage the prior policy to boost online planning.
+- **Guided-MPPI:** Furthermore, we introduce Guided-MPPI, which samples the control actions from the prior policy and also has privileged access to the full reward information, i.e., $\omega_T + r_R$ . By comparing it against Guided-MPPI, we aim to show the advantages and the necessity of Residual-MPPI even with granted access to the prior reward.
+- **Valued-MPPI:** While it is not compatible with our problem setting, we further consider the case where the value function of the prior policy is accessible. We construct a variant of Guided-MPPI with this value function as a terminal value estimator like Argenson & Dulac-Arnold (2020).
+- **Residual-SAC:** We also include the Residual-SAC as a RL-based baseline to set an upper bound performance of the policy customization task without knowing the prior reward. We used the final checkpoint (4M steps) as well as checkpoints with an equivalent amount of data to dynamics training (200K steps) to illustrate the superior sample efficiency of Residual-MPPI.
+- **Fulltask-SAC:** Finally, we report the SAC policy trained on the full task as a reference to set an upper bound for the policy customization task’s performance.
+
+**Metric.** We aim to validate a policy’s performance with total reward, i.e., $\omega_T + r_R$ . When the add-on task contradicts the basic task, the optimal policy may trade off its performance on the basic task to maximize the total reward. Therefore, we further measure the basic and add-on rewards separately to monitor the trade-off achieved by the customized policy, i.e., how well the performance on the basic task is maintained and how much the policy is optimized toward the add-on task.
+
+### 4.2 RESULTS AND DISCUSSIONS
+
+The experimental results, summarized in Table 1, demonstrate the effectiveness of Residual-MPPI for online policy customization. The ablation results of the planning parameters in MuJoCo and visualization can be found in Appendix F.2 and Appendix E.1. Also, we conduct experiments upon the same MuJoCo environments with IL prior policies, whose results are summarized in Table 10 in Appendix F.1. Across the tested environments, the customized policies achieve significant improvements over the prior policies in meeting the objectives of the add-on tasks while maintaining a similar level of performance in terms of the basic task objectives. In particular, we observe three key advantages of Residual-MPPI over baseline approaches.
+
+*First, Residual-MPPI demonstrates significantly higher sample-efficiency over the RL-based baselines.* While Fulltask-SAC and Residual-SAC achieve better performance than planning-based approaches through extensive online exploration (4M steps), our focus is on online policy customization. Thus, we consider their performance as upper bounds in our online setting. With a substantially smaller dataset for dynamics model training (2K steps), Residual-MPPI achieves total rewards comparable to Residual-SAC in the HalfCheetah, Hopper, and Ant environments. In contrast, Residual-SAC performs significantly worse when trained on the same limited amount of data. *Second, Residual-MPPI can strike a better trade-off between the basic and add-on rewards than Greedy-MPPI.* Greedy-MPPI optimizes the objective of a biased MDP $\mathcal{M}^{\text{add}} = (\mathcal{X}, \mathcal{U}, r_R, \mathbf{p})$ . It relies solely on sampling from the prior policy to heuristically regularize the optimized action sequences to remain close to the prior policy. While this heuristic approach helps maintain performance on the basic task objective, it is prone to suboptimality in tasks where the add-on reward is sparse or orthogonal to the basic reward. For example, in the Ant environment, the agent is rewarded for making progress along the x-axis in the basic task, while the add-on reward encourages progress along the y-axis. Since these reward terms are orthogonal, exclusively optimizing for progress along the y-axis compromises the progress along the x-axis, leading to a noticeable performance gap for Greedy-MPPI. This limitation is further amplified in the more complex racing task, as we will demonstrate in the next section.
+
+*Finally, Residual-MPPI outperforms MPPI variants that have privileged access to the prior policy’s reward or value functions.* Despite having full reward knowledge, Full-MPPI fails to complete the task. Without sampling control actions from the prior policy, Full-MPPI suffers from poor sample efficiency and achieves subpar performance. Guided-MPPI can achieve better performance, given its access to action samples from the prior policy. However, it still underperforms Residual-MPPI
+
+{6}------------------------------------------------
+
+Table 1: Experimental Results of Zero-shot Residual-MPPI in MuJoCo
+
+| Env. | Policy | Full Task | Basic Task | Add-on Task | |
+|-|-|-|-|-|-|
+| | | Total Reward | Basic Reward | $ \hat{\theta} $ | Add-on Reward |
+| Half Cheetah | Prior Policy | $1000.7 \pm 88.8$ | $2449.8 \pm 52.3$ | $0.14 \pm 0.00$ | $-1449.1 \pm 45.3$ |
+| | Greedy-MPPI | | $2180.9 \pm 87.3$ | | |
+| | Full-MPPI | $-3595.1 \pm 322.7$ | $-1167.3 \pm 144.0$ | $0.24 \pm 0.03$ | $-2427.7 \pm 320.3$ |
+| | Guided-MPPI | $1849.6 \pm 151.0$ | $2154.6 \pm 95.7$ | $0.03 \pm 0.01$ | $-305.0 \pm 58.7$ |
+| | Valued-MPPI | $1760.7 \pm 478.8$ | | $0.04 \pm 0.02$ | $-441.0 \pm 222.5$ |
+| | Residual-MPPI | | $2178.6 \pm 71.9$ | | |
+| | Residual-SAC (200K) | $-265.0 \pm 919.0$ | $455.4 \pm 678.6$ | $0.07 \pm 0.03$ | $720.4 \pm 251.8$ |
+| | Residual-SAC (4M) | $2184.5 \pm 29.7$ | $2233.7 \pm 29.3$ | $0.00 \pm 0.00$ | $-49.2 \pm 1.7$ |
+| | Fulltask-SAC | $2149.9 \pm 28.6$ | $2214.5 \pm 27.2$ | $0.01 \pm 0.00$ | $-64.5 \pm 2.4$ |
+| Env | Policy | Total Reward | Basic Reward | $ \hat{\theta} $ | Add-on Reward |
+| Swimmer | Prior Policy | $-245.2 \pm 5.6$ | $345.8 \pm 3.2$ | $0.59 \pm 0.01$ | $-591.0 \pm 5.8$ |
+| | Greedy-MPPI | | $275.8 \pm 3.1$ | | |
+| | Full-MPPI | $-1686.6 \pm 106.7$ | $14.1 \pm 6.3$ | $1.70 \pm 0.11$ | $-1700.7 \pm 106.2$ |
+| | Guided-MPPI | $-149.0 \pm 5.6$ | $292.9 \pm 3.8$ | $0.44 \pm 0.01$ | $-441.9 \pm 7.2$ |
+| | Valued-MPPI | $-205.8 \pm 6.3$ | | $0.54 \pm 0.01$ | $-540.9 \pm 6.3$ |
+| | Residual-MPPI | | $275.8 \pm 3.4$ | | |
+| | Residual-SAC (200K) | $-209.0 \pm 67.6$ | $2.1 \pm 15.5$ | $0.21 \pm 0.07$ | $-221.1 \pm 72.7$ |
+| | Residual-SAC (4M) | $-10.5 \pm 24.1$ | $-1.5 \pm 16.9$ | $0.01 \pm 0.02$ | $-9.0 \pm 16.6$ |
+| | Fulltask-SAC | $-4.2 \pm 17.1$ | $2.1 \pm 17.6$ | $0.01 \pm 0.00$ | $-6.3 \pm 3.0$ |
+| Env. | Policy | Total Reward | Basic Reward | $\bar{z}$ | Add-on Reward |
+| Hopper | Prior Policy | $7252.7 \pm 49.2$ | $3574.5 \pm 9.7$ | $1.37 \pm 0.00$ | $3678.2 \pm 48.3$ |
+| | Greedy-MPPI | | $3553.0 \pm 58.4$ | | |
+| | Full-MPPI | $20.5 \pm 3.0$ | $3.6 \pm 0.7$ | $1.24 \pm 0.00$ | $16.9 \pm 2.4$ |
+| | Guided-MPPI | $6121.3 \pm 1590.1$ | $3067.8 \pm 679.0$ | $1.35 \pm 0.03$ | $3053.4 \pm 917.7$ |
+| | Valued-MPPI | $7243.9 \pm 75.7$ | | $1.37 \pm 0.01$ | $3681.2 \pm 74.6$ |
+| | Residual-MPPI | | $3547.6 \pm 78.0$ | | |
+| | Residual-SAC (200K) | $3543.1 \pm 478.9$ | $1019.8 \pm 94.3$ | $1.27 \pm 0.01$ | $2523.2 \pm 405.5$ |
+| | Residual-SAC (4M) | $7682.5 \pm 178.2$ | $2310.4 \pm 106.8$ | $1.54 \pm 0.01$ | $5372.0 \pm 75.8$ |
+| | Fulltask-SAC | $7825.3 \pm 36.9$ | $2934.5 \pm 27.6$ | $1.49 \pm 0.00$ | $4890.8 \pm 39.6$ |
+| Env | Policy | Total Reward | Basic Reward | $\bar{v}_y$ | Add-on Reward |
+| Ant | Prior Policy | $6333.7 \pm 753.9$ | $6177.1 \pm 703.7$ | $0.16 \pm 0.22$ | $156.6 \pm 200.5$ |
+| | Greedy-MPPI | $6104.2 \pm 1532.0$ | $5092.8 \pm 1305.2$ | | |
+| | Full-MPPI | $-2767.7 \pm 154.0$ | $-2764.4 \pm 114.2$ | $-0.00 \pm 0.11$ | $-3.3 \pm 108.0$ |
+| | Guided-MPPI | $5160.9 \pm 1963.0$ | $4999.8 \pm 1887.9$ | $0.16 \pm 0.22$ | $161.2 \pm 217.7$ |
+| | Valued-MPPI | $6437.0 \pm 1021.9$ | | $0.21 \pm 0.20$ | $206.3 \pm 196.3$ |
+| | Residual-MPPI | | $5984.8 \pm 541.5$ | | |
+| | Residual-SAC (200K) | $-1175.5 \pm 157.3$ | $-1178.3 \pm 156.4$ | $0.00 \pm 0.00$ | $2.7 \pm 3.9$ |
+| | Residual-SAC (4M) | $6962.9 \pm 342.9$ | $5710.2 \pm 252.0$ | $1.25 \pm 0.13$ | $1252.7 \pm 127.3$ |
+| | Fulltask-SAC | $7408.6 \pm 312.0$ | $3100.3 \pm 184.4$ | $4.31 \pm 0.21$ | $4308.3 \pm 209.2$ |
+
+The evaluation results are in the form of mean $\pm$ std over the 500 running episodes. The total reward is calculated on full task, whose reward is $\omega r + r_R$ .
+
+across all tasks, as it is constrained by its limited ability to reason the long-term effects of actions within its finite planning horizons. Conversely, Residual-MPPI implicitly incorporates the original task reward through the prior policy log-likelihood. The $\log \pi$ term also serves as a proxy of the prior policy’s Q-function, informing the planner of the impact of the action sequences beyond the planning horizon. While Valued-MPPI addresses long-term impacts by incorporating the prior Q-function, it struggles to fully align with the complete task reward. Valued-MPPI considers the long-term impact by incorporating the prior Q-function but fails to match the full task reward setting, resulting in better performance on the basic task but suboptimum on the full task.
+
+{7}------------------------------------------------
+
+
+
+Figure 2: In-game screen shots of Policy Behavior on Different Road Sections. The figure shows two rows of four screenshots each, labeled Case 1 and Case 2. Each row compares four policies: GT Sophy 1.0, Zero-shot MPPI, Few-shot MPPI, and Residual-SAC. To the right of the screenshots is a map of the racing track with a blue line indicating the path and a small inset showing a close-up of a road section.
+
+Figure 2: In-game screen shots of Policy Behavior on Different Road Sections
+
+## 5 CUSTOMIZING CHAMPION-LEVEL AUTONOMOUS RACING POLICY
+
+With the effective results in standard benchmark environments, we are further interested in whether the proposed algorithm can be applied to effectively customize an advanced policy for a more sophisticated continuous control task. Gran Turismo Sport (GTS), a realistic racing simulator that simulates high-fidelity racing dynamics, complex environments at an independent, fixed frequency with realistic latency as in real-world control systems, serves as an ideal test bed. GT Sophy 1.0 (Wurman et al., 2022), a DRL-based racing policy, has been shown to outperform the world’s best drivers among the global GTS player community. To further investigate the scalability of our algorithm and its robustness when dealing with complex environments and advanced policies, we carried out further experiments on GT Sophy 1.0 in the GTS environment.
+
+### 5.1 EXPERIMENT SETUP
+
+Though GT Sophy 1.0 is a highly advanced system with superhuman racing skills, it tends to exhibit too aggressive route selection as the well-trained policy has the ability to keep stable on the simulated grass. However, in real-world racing, such behaviors would be considered dangerous and fragile because of the time-varying physical properties of real grass surfaces and tires. Therefore, we establish the task as customizing the policy to a safer route selection. Formally, the customization goal is to help the GT Sophy 1.0 drive *on course* while maintaining its superior racing performance. This kind of customization objective could potentially be used to foster robust sim-to-real transfer of agile control policies for many related problem domains.
+
+We adopt a simple MLP architecture to design a dynamics model and train it using the techniques introduced in Sec. 3.2. The configurations of the environments and implementation details can be found in Appendix D. As the pre-trained GT Sophy 1.0 policy is constructed with complex rewards and regulations, we adopt the average lap time and number of off-course steps as the metrics. In addition to zero-shot Residual-MPPI, we also evaluate a few-shot version of our algorithm, in which we iteratively update the dynamics with the customized planner’s trajectories to further improve the performance. We also consider Residual-SAC (Li et al., 2024) as another baseline to validate the advantage of online Residual-MPPI against RL-based solutions in the challenging racing problem. Notably, we are only given access to the policy network of GT Sophy 1.0, which prevents us from evaluating Valued-MPPI, as it requires access to the critic function. Therefore, we only include Greedy-MPPI and Guided-MPPI as MPPI variants for comparison in the GTS environment.
+
+### 5.2 RESULTS AND DISCUSSIONS
+
+The experimental results, summarized in Table 2, demonstrate that Residual-MPPI significantly enhances the safety of GT Sophy 1.0 by reducing its off-course steps, albeit with a marginal increase in lap time. Further improvements are observed after employing data gathered during the customization process to fine-tune the dynamics under a few-shot setting. This few-shot version of Residual-MPPI outperforms the zero-shot version in terms of lap time and off-course steps.
+
+The ablation results of the planning parameters and visualization in GTS can be found in Appendix F.3 and Appendix E.2, which clearly demonstrates the effectiveness of the proposed method by greatly reducing the off-course steps. In the detailed route selection visualization, it can be observed that Few-shot MPPI chose a safer and faster racing line compared to Zero-shot MPPI with
+
+{8}------------------------------------------------
+
+Table 2: Experimental Results of Residual-MPPI in GTS
+
+| Policy | GT Sophy 1.0 | Zero-shot MPPI | Few-shot MPPI | Residual-SAC (80K laps) |
+|-|-|-|-|-|
+| Lap Time | $117.77 \pm 0.08$ | $123.34 \pm 0.22$ | $122.93 \pm 0.14$ | $130.00 \pm 0.13$ |
+| Off-course Steps | $93.13 \pm 1.98$ | $9.03 \pm 3.33$ | $4.43 \pm 2.39$ | $0.87 \pm 0.78$ |
+| Policy | Full-MPPI | Guided-MPPI | Greedy-MPPI | Residual-SAC (2K laps) |
+| Lap Time | *Failed | *Failed | *Failed | *Failed |
+| Off-course Steps | *Failed | *Failed | *Failed | *Failed |
+
+The evaluation results are in the form of mean $\pm$ std over 30 laps. \*Failed baseline is not able to finish a complete lap. Valued-MPPI is not available since we only have access to the policy network of GT Sophy 1.0.
+
+
+
+Figure 3: Guided-MPPI and Greedy-MPPI Results in GTS. (a) In-game screenshots of Greedy-MPPI showing a car going off-track at the first corner. (b) In-game screenshots of Guided-MPPI showing a car going off-track at the first corner. To the right, a plot shows the trajectories of four policies: GT-Sophy (red), Few-shot MPPI (green), Guided-MPPI (blue), and Greedy-MPPI (purple). The Greedy-MPPI trajectory (purple) goes off-track at the first corner, while the others stay on course.
+
+Figure 3: Guided-MPPI and Greedy-MPPI Results in GTS. (a) In-game screenshots of Greedy-MPPI; (b) In-game screenshots of Guided-MPPI. Red parts indicate off-course behaviors. Both baselines cannot drive the vehicle effectively, completely going off track at the first corner.
+
+more accurate dynamics. Though the customized policies can not eliminate all the off-course steps, it is worth noting that these violations are minor (i.e., slightly touching the course boundaries) compared to GT Sophy 1.0, making the customized policies safe enough to stay on course.
+
+**Residual-SAC**, compared with the Residual-MPPI, yields a very conservative customized policy. As shown in Figure 2, it is obvious that the Residual-SAC policy behaves sub-optimally and overly yields to the on-course constraints. It is worth noting that over 80,000 laps of roll-outs are collected to achieve the current performance of Residual-SAC. In contrast, the data used to train GTS dynamics for Residual-MPPI, along with the online data for dynamics model fine-tuning, amounted to only approximately 2,000 and 100 laps, respectively. As discussed in safe RL and curriculum learning methods (Mo et al., 2021; Anzalone et al., 2022), when training with constraints, it is easy for RL to yield to an overly conservative behavior. At the checkpoint with 2k laps of training data, Residual-SAC could not finish a lap yet, which highlights the outstanding data-efficiency of Residual-MPPI.
+
+**Guided-MPPI**, however, cannot finish the track stably, as shown in figure 3. Similar to what we have analyzed in the MuJoCo experiments, Guided-MPPI suffers from its limited ability to account for the long-term impacts of actions given the finite planning horizon. This limitation leads to more severe consequences in complex tasks that require long-term, high-level decision-making, such as route selection during racing, which leads to failure in GTS.
+
+**Greedy-MPPI**, as mentioned above, also leads to severe failure in the complex GTS task, further emphasizing the importance of the $\log \pi$ term in Residual-MPPI’s objective function. In GTS, the Greedy-MPPI only optimizes the trajectories by not allowing the policy to be off-course, where a straightforward local optimal but undesirable solution would be just staying still. Such a trivial policy would behave better on the add-on tasks (stay on course) but not on the full task (stay on course while maintaining racing superiority). From the theoretical perspective, the significance of the $\log \pi$ term goes far beyond a simple regularization term. It is the key factor in addressing the policy customization problem, which is inherently a part of the joint optimization objective, encoding and passing the information of the original reward in a theoretically sound manner.
+
+{9}------------------------------------------------
+
+## 6 RELATED WORKS
+
+**Model-based RL.** Many works focused on combining learning-based agents with classical planning to enhance performance, especially in various model-based RL approaches. MuZero (Schrittwieser et al., 2020) employs a learned Actor as the search policy during the MCTS process and utilizes the critic as the terminal value at the leaf nodes; TD-MPC2 (Hansen et al., 2023) follows a similar approach and extends it to continuous task by utilizing MPPI as the continuous planner. RL-driven MPPI (Qu et al., 2024) chooses the distributional SACs as the prior policy and also adopts the MPPI as the planner. However, those methods mainly address the planning within the same task and have a full reward and value function, while policy customization requires jointly optimizing an add-on reward and the underlying reward of the prior policy, which is unknown in a priori. In general cases, the prior policy may not provide a critic, as is the case with algorithms like policy gradient (Shi et al., 2019). Moreover, the value function will change with the new reward, making it infeasible to be applied. Therefore, these methods are not able to solve policy customization tasks directly.
+
+**Policy Adaptation.** There have been numerous works considering on the topic of policy adaptation. Some works require an extra demonstration dataset to adapt the policy to the new task, like Ceil (Liu et al., 2023) and Prompt-DT (Xu et al., 2022). However, such expert demonstrations are unavailable in the online policy customization settings. Some works focus on adaptation via RL fine-tuning: JSRL (Uchendu et al., 2023) uses a prior policy as the guiding policy to form a curriculum for the exploration policy; AWAC (Nair et al., 2020) combines sample-efficient dynamic programming with maximum likelihood policy updates to leverage large amounts of offline data for quickly performing online fine-tuning of RL policies. However, the main objective in RL fine-tuning is to maximize the policy return on the new task. In contrast, policy customization (Li et al., 2024) aims to find a policy that can maintain the prior performance on the basic task at the same time.
+
+**Planning with Prior Policy.** Some works address a similar problem of customizing pre-trained prior policies towards additional requirements. Efficient game-theoretic planning (Li et al., 2022) uses a planner to construct human behavior within the pre-trained prediction model. Deep Imitative Model (Rhinehart et al., 2018) aims to direct an imitative policy to arbitrary goals during online usage. However, they require full reward modeling with hand-designed features, or the add-on task is in the form of specific goals. Residual-MCTS proposed in RQL (Li et al., 2024) solves the policy customization online via planning but is limited to tasks with discrete action spaces. MBOP (Argenson & Dulac-Arnold, 2020) solves the offline RL problem through planning by learning dynamics, action prior, and values from an offline dataset. LOOP (Sikchi et al., 2022) focused on learning off-policy with samples from an online planner. However, both approaches require knowledge of the basic reward function and thus cannot be directly applied to our setting.
+
+## 7 LIMITATIONS AND FUTURE WORK
+
+In this work, we propose *Residual-MPPI*, which integrates RQL into the MPPI framework, resulting in an online planning algorithm that customizes the prior policy at the execution time. By conducting experiments in MuJoCo and GTS, we show the effectiveness of our methods against the baselines. Here, we discuss some limitations of the current method, inspiring several future research directions.
+
+**Terminal Value Estimation.** Similar to most online planning methods, our algorithm also needs a sufficiently long horizon to reduce the error brought by the absence of a terminal value estimator. Though utilizing prior policy partially addresses the problem discussed in Sec. 4.2, it can not eliminate the error entirely. Techniques like JSRL (Uchendu et al., 2023) and RL-driven MPPI (Qu et al., 2024) could be incorporated in the proposed framework in the few-shot setting by using the collected data to learn a Residual Q-function online as a terminal value estimator.
+
+**Sim2Real Transferability.** Sim2real will still face several additional challenges, which mainly comes from the suboptimal prior policy and the domain gap. Prior policies without careful modeling or sufficient training could mislead the evaluation step of the proposed algorithm and result in poor planning. Also, the proposed algorithm relies on an accurate dynamics model to correctly roll out. In the future, we can introduce more advanced methods in policies and dynamics training, such as diffusion policies (Chi et al., 2023) and world models (Micheli et al., 2022), to improve the prior policies and dynamics. We look forward to further extending residual-MPPI to achieve sim-to-sim and sim-to-real for challenging agile, continuous control tasks by addressing these limitations.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/hKcDOfDxgn.txt b/papers/hKcDOfDxgn.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f2f8ec91c291e88855527461e54d2a6a0c482d4e
--- /dev/null
+++ b/papers/hKcDOfDxgn.txt
@@ -0,0 +1,383 @@
+**Primary Area:** applications to neuroscience & cognitive science
+
+
+
+{0}------------------------------------------------
+
+# BRAIN-LIKE REPLAY NATURALLY EMERGES IN REINFORCEMENT LEARNING AGENTS
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Replay is a powerful strategy to promote learning in artificial intelligence and the brain. However, the conditions to generate it and its functional advantages have not been fully recognized. In this study, we develop a modular reinforcement learning model that could generate replay. We prove that replay generated in this way helps complete the task. We also analyze the information contained in the representation and provide a mechanism for how replay makes a difference. Our design avoids complex assumptions and enables replay to emerge naturally within a task-optimized paradigm. Our model also reproduces key phenomena observed in biological agents. This research explores the structural biases in modular ANN to generate replay and its potential utility in developing efficient RL.
+
+## 1 INTRODUCTION
+
+Experience replay (Lin, 1992) is an important technique for online reinforcement learning (RL). By storing past experiences in a circular buffer and training the agent on these experiences repeatedly, experience replay improves sample efficiency and training stability (Schaul et al., 2015), and successfully improves the performance of RL algorithms (Mnih, 2013; Mnih et al., 2015). There are several works on how to design more sophisticated experience replay mechanisms, like hyperparameter tuning (Fedus et al., 2020), prioritizing replay with higher temporal difference (TD) error (Schaul et al., 2015), or developing a generative replay model (Van de Ven & Toliás, 2018). However, given the significant efficiency gap between biological and RL agents, we explore whether replay algorithms can be further improved by drawing inspiration from brain structures.
+
+In neuroscience, replay is the reactivation of a sequence of place cells that encode recently experienced locations. It has been observed in many brain areas during rest or sleep, from the hippocampus (Buzsáki, 1986; Nádasdy et al., 1999) to the neocortex, including the prefrontal cortex (Peyrache et al., 2009; Kaefer et al., 2020), visual cortex (Ji & Wilson, 2007), and motor cortex (Eichenlaub et al., 2020). Some people believe it represents the “virtual trajectory” in the brain that primarily serves two functions: memory consolidation (Foster & Wilson, 2006; O’Neill et al., 2010) and planning (Pfeiffer & Foster, 2013; Widloski & Foster, 2022). Its dynamic properties and functional diversity have attracted significant attention in neuroscience research.
+
+There are currently two focuses in this field: the emerging condition of replay and the function of replay. Many models have been proposed to explain these two aspects. Some biophysical models suggest that replay arises from the combination of past experiences and specific neuronal network connectivity rules, such as asymmetrical synaptic connections (Tsodyks et al., 1996) and short-term depression (Romani & Tsodyks, 2015). In addition to connectivity rules, task optimization provides another way to understand the emergence of replay. (Krishna et al., 2024) proved that denoising dynamics under task optimization could lead to offline reactivation of past experiences. Levenstein et al. (2024) verified that only the network trained on multi-step predictive learning with recurrent connection and head-direction input can generate offline trajectories resembling replay. These models are illustrative in that they connect conditions like circuit structures, task optimization or predictive learning to the generation of replay. However, they fail to explain the functional importance of replay in the task.
+
+On the other hand, experience replay provides good evidence that replay does have some importance and helps learning. However, this approach is not ideal for exploring the conditions under which replay emerges, as all replay of stored experiences is hard-coded and predefined. The model never
+
+{1}------------------------------------------------
+
+finds a way to organize experiences and perform efficient replay without force. The gap between these two research fields leads to the natural question of whether we could find some conditions under which a model could naturally generate adaptive replay sequences with functional importance. Identifying such conditions could provide important insights on how to design new reinforcement learning agents that quickly adapt to the environment, given the present low efficiency of RL algorithms and the unique advantage of biological agents in learning new tasks.
+
+Recently, some studies have attempted to approach this problem within the RL framework. For example, Mattar & Daw (2018) propose that a special variable called the expected value of backup (EVB) determines the replay priority of different experiences, and the replay is accompanied by Bellman updates which are essential for learning the value function and policy for the task. However, because we cannot know EVB until we perform value iteration for the whole environment, and after value iteration it seems unnecessary to use replay at all, the generating condition in there are still some hard-coded constraints in this method.
+
+In this article, we propose a model to circumvent hard-coded settings, provide some conditions as a natural explanation for the emergence of replay, and then show the functional importance of our generated replay sequences. In summary,
+
+1. Based on two straightforward conditions, we develop a model capable of generating offline replay activation.
+2. Throughout the entire learning process of the flexible navigation task, the evolution of replay spatial distribution of our model resembles that observed in real animals.
+3. Through ablation experiments, we verify the functionality of replay by showing that the exploration efficiency of our model surpasses that of models without replay.
+4. We analyze the information that replay flow carries, and explain how replay can promote efficient learning.
+
+## 2 METHODS
+
+**Conditions to generate instrumental replay** What could these conditions possibly be? The main areas where replay occurs are the prefrontal cortex (PFC) and hippocampal formation (HF), usually modeled as policy network and world model respectively due to their unique functions. Replay in these two individual areas is often observed to be coordinated ("phase-lock") when a new environment learning task is presented (Place et al., 2016). We hypothesize that communication between these two areas is crucial for the generation of instrumental replay. Therefore, we propose two conditions that could be implemented in RL agents:
+
+*Condition 1: Replay serves for reward maximization.* (1)
+
+*Condition 2: Replay is accompanied by communication between PFC and HF.*
+
+To achieve *Condition 1*, we employ the end-to-end RL framework without hard-coded design. For *Condition 2*, our RL agent has a world model and a policy model, representing HF and PFC respectively, and we add an additional information passage between these two models that is trained alongside the policy network. This setting allows the agent to adjust the information communication flow based on its influence on actions and expected rewards. Discussions about the plausibility of these settings can be found in section 4.1.
+
+**Principle of designing different modules** We preface the introduction of model structure with key biological biases that we incorporate into our design.
+
+Biologically, HF has abundant recurrent connections in its CA3 area (Le Duigou et al., 2014), which is also thought to be a major area generating replay. Thus we implement a gated recurrent unit (GRU) for HF. Besides, there are two main functions for HF. First, the HF is good at encoding the environment structure (i.e. cognitive map) which can serve as a basis for path integration and flexible navigation (Whittington et al., 2018). In our setting, the HF module learns to do this by predicting the next location (path integration) and reward, based on history (hidden state) and environmental information (input) (Figure 1A). The HF is also thought to store episodic memory (Whittington et al., 2018; Battaglia et al., 2011), and in our model, it learns to memorize past reward history.
+
+{2}------------------------------------------------
+
+
+
+Figure 1: Model structure and task setting. Panels A-C show the model architecture. Panel A: The HF GRU module (h\_t) receives input from an Encoder (processing action a\_t, value v\_t, and rewards r\_{t-k:t}) and communicates with the PFC module (theta\_t). Panel B: During movement, the PFC module is closed, and the HF module operates independently, with place cell activation (c\_t, c\_{t+1}, ...) reflecting real present locations. Panel C: During immobility, the information passage opens, and the HF module generates a replay sequence (c\_t, c\_{t+1}, ...) that is communicated to the PFC module. Panels D-F show the task setting. Panel D: The agent starts at S, moves to checkpoint C to consume a small reward (0.5), and then moves to goal G to consume a large reward (1.0). Panel E: A representative trajectory generated by the trained RL agent. Panel F: The replay event at G.
+
+Figure 1: A-C. Model structure. A The HF GRU module completes the task of path integration and episodic memory. The PFC RNN module is responsible for decision-making. The information passage between the PFC and HF only opens at rest. B. During mobility, the information passage remains closed, and the HF and PFC modules operate independently. The place cell activation reflects the real present locations. C. During immobility, the information passage opens. The HF and PFC modules start to communicate with each other. The activated place cell output constituted a replay sequence. D-F. Task setting. D. The agent should start from S, first get to checkpoint C, consume a small amount of reward (0.5), and then arrive at goal G to get a large reward (1.0). Directly moving to G will cause no rewards. E. A representative trajectory generated by the trained RL agent. First, it reaches C and gets the small reward. The replay happens at this time. F. The replay event in E.
+
+The PFC is also modeled as a recurrent network (Figure 1A) due to the recurrent nature of the real prefrontal cortex. The prefrontal cortex is thought to be the center for decision-making (Barraclough et al., 2004) and value encoding (Padoa-Schioppa & Assad, 2006), and in our task, it learns to estimate values and select actions to maximize the expected reward using the hidden state and environmental information.
+
+To handle high-dimensional visual inputs, we use an ancillary Encoder module modeled by a convolutional neural network (CNN), simulating the sensory cortex (Figure 1A). Regarding replay, we establish an information passage between HF and PFC. Because replay is only detected when the subject receives a reward and stops to consume it (Igata et al., 2021), the information passage remains closed during movement (Figure 1B) and opens when the agent receives a reward (Figure 1C). During the agent’s movement, the PFC decides the agent’s next action (i.e., up, down, left, or right) based on the input of environmental representation processed by the Encoder module. At this time, it does not communicate with the HF module. Meanwhile, the HF maintains its own dynamics for correct place cell activation and recent episodic memory (Figure 1B). When the agent receives a reward, the two modules interact for several steps and influence each other through the information passage. The reactivation of place cells in the HF is then probed and analyzed as replay.
+
+**Design of the HF Module** The update formula of the HF module can be written as:
+
+$$h_t = f_{\text{HF}}(W_{h,t}h_{t-1} + (1 - \mathbb{I}_{\text{replay}})W_{h,\text{in}}[o_t, r_{t-1}, a_{t-1}] + \mathbb{I}_{\text{replay}}W_{h,r}o_{t-1}), \quad (2)$$
+
+$$[\hat{r}_{t-k:t}, \hat{G}(s = 1 : m)_t] = \sigma(W_{h,\text{out}}h_t). \quad (3)$$
+
+$h$ is the hidden state of HF. Input consists of $o_t$ , $r_{t-1}$ , and $a_{t-1}$ , which are the current partially observable state, the previous reward and the previous action, respectively. $W_{h,r}$ , $W_{h,\text{in}}$ , and
+
+{3}------------------------------------------------
+
+$W_{h,out}$ are trainable parameters of neural networks. $\theta$ is the hidden state of the PFC. $\mathbb{I}_{\text{replay}}$ indicates the beginning of the rest period when replay and communication happens and input stops. $f_{\text{HF}}$ is the activation function for the HF module. The HF module then anticipates a Gaussian distribution peaked at the next location as well as rewards for recent steps $\hat{r}_{t-k:t}$ . $m = 5 \times 5$ is the number of locations in this grid world. $k = 10$ is the length of the reward history the agent needs to remember.
+
+The loss for structural learning can be written as the cross-entropy between the softmax output, $\hat{G}(s)$ , and the real distribution, $G(s)$ : $\mathcal{L}_{\text{pred-loc},t} = -\sum_{s=1}^m \hat{G}(s) \log G(s)$ . To equip the HF module with the reward structure of the environment, it predicts the reward of the next step, $r_t$ , with the loss written as $\mathcal{L}_{\text{pred-r},t} = |\hat{r}_t - r_t|$ . The loss of memorizing rewards is calculated as the L1 difference between the remembered rewards and the actual rewards: $\mathcal{L}_{\text{memory-r},t} = \sum_{i=1}^k |\hat{r}_{t-i} - r_{t-i}|$ .
+
+**Design of the PFC Module** The update formula of PFC could be written as
+
+$$\theta_t = f_{\text{PFC}}(W_{\theta}\theta_{t-1} + (1 - \mathbb{I}_{\text{replay}})W_{\theta,\text{in}}[o_t, r_{t-1}, a_{t-1}] + \mathbb{I}_{\text{replay}}W_{\theta,t}h_{t-1}) \quad (4)$$
+
+$$[a_t, v_t] = W_{\theta,\text{out}}\theta_t. \quad (5)$$
+
+$\theta$ is the hidden state of the PFC module. Input $[o_t, r_{t-1}, a_{t-1}]$ and the indicator $\mathbb{I}_{\text{replay}}$ are the same as in Equation 2. $W_{\theta}$ , $W_{\theta,r}$ , $W_{\theta,\text{in}}$ , and $W_{\theta,\text{out}}$ are trainable parameters of neural networks. $f_{\text{PFC}}$ is an activation function. The state value $v_t$ is also estimated by the PFC for training purposes. We can see that replay is optimized because it changes the hidden state $\theta_t$ of the PFC and thus affects the expected reward.
+
+**Training and Test Paradigm** We first pre-train the world model HF and the Encoder using random trajectories. Then the weights of the Encoder and HF are frozen, and we start training the PFC module by proximal policy optimization (PPO) to maximize the reward. We conduct the following analysis with all model weights fixed.
+
+The reward settings during pre-training and training are the same. The reward is randomly chosen from one of the nine locations in the center of the room, and the location is reset at a probability = 0.1 so that memorizing reward locations is helpful to finish the task. However, in the test stage, the reward is the same as in the biological experiment.
+
+## 3 RESULTS
+
+### 3.1 BIOLOGICALLY SIMILAR REPLAY SEQUENCES EMERGE AFTER TRAINING
+
+**Task setting** We use the animal experiment from (Igata et al., 2021) as a reference, in which a rodent was trying to navigate to a dynamically changing reward location in an open area (Figure 1D). First, the animal learned to run from the starting point S to checkpoint 1 (C1) to get a small reward, and then run from C1 to G to get a large reward. Violation of the order would cause no return at all (Figure 1D). When the stage of pre-learning was finished, the small reward was relocated to checkpoint 2 (C2, Figure 2B), requiring the animal to learn a new optimal path (S-C2-G). This was the beginning of the learning stage. Initially, the animal continued to take the path S-C1-G followed by G-C2-G after failing to receive a reward at G. It then realized the existence of a shortcut (S-C2) and gradually settled on it. The aim was to investigate changes in the relative amount of replay sequences representing different parts of the room (“replay distribution” in this paper) during the learning stage when the animal was trying to adapt to the change of reward location. They found that the amount of replay of the original trajectory (S-C1, C1-G) decayed rapidly, while the shortcut (S-C2) increased even before the agent adopted it (Figure 2C). This result could be evidence that replay supports flexible navigation by exploring possible paths and strengthening better ones.
+
+**Simulation result** We create a similar simulation environment as in (Igata et al., 2021). The animal is replaced by an RL agent moving in a $5 \times 5$ open arena. As in the animal experiment, we put the small reward at C1 and then relocate it to C2. Without adjusting the network parameters, and simply by modifying the hidden states of the RNNs, the RL agent successfully identifies the optimal path to the new checkpoint. (Figure 3A).
+
+{4}------------------------------------------------
+
+
+
+Figure 2 consists of five panels (A-E) illustrating the performance and replay distribution of an RL agent. Panel A is a line graph showing 'Step Count' (y-axis, -5 to 5) versus 'C2 checking times' (x-axis, 0 to 4). It compares '\*\*\*' (\*\*\*, p < 0.001) and 'n.s.' (not significant) conditions. Panel B is a grid world map showing four paths: S (Start) to C1 (Checkpoint 1) to G (Goal) via C2 (Checkpoint 2), and S to C2 to G via C1. Panel C is a line graph showing 'Proportion' (y-axis, 0 to 0.8) versus 'Pre', 'Learning', and 'Post' phases for different segments (S-C1, S-C2, C1-G, C2-G). Panel D is a density plot showing 'Density' (y-axis, 0.0 to 0.4) versus 'Distance' (x-axis, 0 to 6) for 'original' (blue), 'no pretrain' (red), and 'random' (green) conditions. Panel E is a line graph showing 'Proportion' (y-axis, 0 to 1.0) versus 'C2 checking times' (x-axis, 0 to 4) for the same segments as in Panel C.
+
+Figure 2: Performance and replay distribution analysis for the RL agent. Panel A shows step count vs. C2 checking times. Panel B shows a grid world map with paths. Panel C shows replay proportion for different segments. Panel D shows distance distribution between steps. Panel E shows replay distribution by checking times.
+
+Figure 2: A. Performance for the RL agent in the test period. B. Legends for C and E. Different colors represent different parts of the room. C. Change of replay distribution for different segments in the animal data, adapted from (Igata et al., 2021). D. Distribution of distances between adjacent replay steps. E. Change of replay distribution generated by the RL agent.
+
+The locations of C1 and C2 are the same as in the original experiment (Figure 2B). We first measure the distribution of distances of adjacent replay steps (Figure 2D). Compared with the random level or the model without pretraining, the optimized model shows a significant tendency to generate adjacent replay steps. Therefore, it tends to generate continuous trajectories rather than random skipping points.
+
+We attribute each replay trajectory to one of the four paths in Figure 2B and then calculate the relative fraction of the four paths at each time step, as the “replay distribution” (See subsection A.1 for calculation details). The change in replay distribution of the RL agent (Figure 2E) closely mirrors that of the rodent (Figure 2C) in two important aspects. First, the amount of replay of C2-G increases and then drops down. Second, the amount of replay of S-C2 increases. Recalling that the animal first took path S-C1-G-C2-G and then S-C2-G. This trend possibly reflects the animal’s focus from “finding a plausible path” to “finding an optimal path”. These results prove that the conditions proposed in 1 are sufficient to generate replay.
+
+### 3.2 ABLATION STUDY DEMONSTRATES THAT REPLAY HELPS LEARNING
+
+To prove replay is functionally important, first, we replace the signal in the information passage to be random noise or an all-zero vector. Because the information exchange between HF and PFC is bidirectional, we carry out this replacement in both directions respectively and find that the performance is only impaired when the information from HF to PFC is replaced by meaningless signals. The information in the reverse direction is of no use (Figure 3A). This interesting finding echoes some neuroscientific discoveries that brain wave in HF leads that in PFC in the task encoding stage when phase lock between these two brain areas happens (Jadhav et al., 2016; Spellman et al., 2015).
+
+Second, we replace the multi-step information exchange process with one-step information emission and retrain the RL part, i.e. the PFC network and information passage (Figure 3C, left). We measure the number of exploration steps it takes to get to the reward at the time when it’s relocated but the agent continues to follow the old path S-C1 and fails to find it. The original model demonstrates a significantly lower number of exploration steps and higher exploration efficiency compared to the ablation models (Figure 3C, right). This suggests that multi-step information emission is superior to single-step emission. We further mask varying numbers of replay steps from the final decision
+
+{5}------------------------------------------------
+
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+
+
+
+**A. Total reward for different replay replacements**
+
+| Condition | Total reward |
+|-|-|
+| Set to random (original) | ~45 |
+| Set to random (toHFPC) | ~5 |
+| Set to zero (original) | ~45 |
+| Set to zero (toHFPC) | ~5 |
+
+**B. Total reward vs. number of masked steps**
+
+| Number of masked steps | Total reward |
+|-|-|
+| 0 | ~45 |
+| 1 | ~35 |
+| 2 | ~25 |
+| 3 | ~15 |
+| 4 | ~5 |
+
+**C. Step count for origin vs. no replay**
+
+| Condition | Step count |
+|-|-|
+| origin | ~17.5 |
+| no replay | ~20.0 |
+
+**D. Total reward for origin vs. shuffle**
+
+| Condition | Total reward |
+|-|-|
+| origin | ~40 |
+| shuffle | ~40 |
+
+Figure 3: Performance and reward analysis during replay. A. Bar chart of total reward for 'Set to random' and 'Set to zero' conditions. B. Bar chart of total reward vs. number of masked replay steps. C. Diagram of HF to PFC replay and a bar chart of step count. D. Bar chart of total reward for origin vs. shuffle conditions.
+
+Figure 3: **A.** The total reward decreases when the signal from HF to PFC is replaced by random noise (left) or all-zero vectors (right). **B.** The different number of replay steps is masked (right), and the performance decreases monotonically as we mask more steps (left). **C.** The number of steps it takes to find the new reward increases when the multi-step information emission is replaced by one step. **D.** The performance is impaired only a little when the order of information is shuffled.
+
+point and replace them with random noise (Figure 3B, right). Performance decreases monotonically as more replay steps are masked (Figure 3B, left). This proves that the information is incrementally unrolled as a sequence during replay. When we shuffle the order of the messages sent during replay, the performance is only slightly affected (Figure 3D), suggesting that the information may be sent in the form of independent packages rather than a whole sequence.
+
+### 3.3 INFORMATION FLOW DURING REPLAY ENTAILS INFORMATION ABOUT CONTEXT AND ACTION PLAN
+
+Thanks to the gray-box nature of AI, we can now extract the hidden states of each module and analyze the information inside. We assume that, the PFC initially has no idea that the reward location has switched from C1 to C2, but it changes its context encoding and gets to know this through replay. To test this, we train a Gaussian Naïve Bayes decoder to predict the reward location from the PFC’s hidden states, and observe a gradual increase in decoding accuracy as the agent first encounters the new reward location, which remains high with repeated encounters (Figure 4A, middle). The analysis on HF hidden states has the same result (Figure 4A, left). This shows that replay helps identify the new context quickly. Additionally, another decoder trained on the messages sent from HF to PFC achieves high accuracy in predicting reward location. These results suggest that HF-PFC information emission helps update memory.
+
+We also train a Ridge Classifier to predict actions from PFC hidden states, and find that decoding errors decrease significantly as the agent gets to the new checkpoint repeatedly. This shows that replay helps form future direction intentions (Figure 4B). It’s important to note that the weights are fixed during the entire test period, so the model learns how to use replay to update memory and form plans to complete the flexible navigation task.
+
+In the end, we investigate how replay guides the update of hidden states in the PFC using a “stop and scan” paradigm. When replay ends, we pause the real-time clock and allow the agent to explore the map randomly for 100 steps, recording the PFC’s value output as its estimation of every location. Finally, we plot the values of different locations in the whole map (Figure 4C). As predicted, the high-value area shifts from S-C1-G to S-C2-G after the change of reward location (Figure 4E, left and right are for S-C and C-G respectively). We then convolve the value map with a Difference of Gaussian (DoG) filter. The filter has a positive peak at C2 and a negative peak at C1, which could
+
+{6}------------------------------------------------
+
+
+
+Figure 4 consists of five panels (A-E). Panel A shows 'Accuracy' for 'HF', 'PFC', and 'Passage' across three stages: 'start', 'replay' (steps 1st and 2nd), and 'end'. Panel B shows 'Error' for 't+1' (red), 't+2' (orange), 't+3' (yellow), and 't+4' (brown) across the same stages. Panel C shows value maps for 'C1', '1st C2', '2nd C2', '3rd C2', and '4th C2'. Panels D and E show 'Advantage' (C2 to C1 and S-C2 to S-C1) across 'C2 checking times' (0 to 4), with significance markers (\*\*\*, n.s.).
+
+Figure 4: Decoding accuracy and error for reward location and information passage. Panel A shows accuracy for HF, PFC, and Passage across start, replay (steps 1-4), and end stages. Panel B shows decoding error for correct future actions. Panel C shows value maps for checkpoints C1 and C2. Panels D and E show value advantages over C2 checking times.
+
+Figure 4: A. Decoding accuracy for the reward location by activities in HF (left), PFC (middle), and information passage (right), respectively. The X-axis is composed of three parts: the initial stage before replay, steps 1-4 during replay, and the output stage after replay. B. Decoding error for correct future actions from PFC activities after replay. Red, orange, yellow, and brown denote the first, second, third, and fourth future action following replay. In A-C, darker colors represent the agent’s first getting the relocated reward, while lighter colors represent the second time. C. Value map produced through the “stop and scan” method. The C1 map represents the value before the checkpoint change, and the subsequent value maps are when the agent gets to C2 repeatedly. D. Value advantages of checkpoint 2 over checkpoint 1, calculated by convolving the value map with a Difference of Gaussian (DoG) filter. E. Left, value advantage calculated as the value of the path S-C2 minus the value of S-C1. Right, the value of the path C2-G minus the value of the path C1-G.
+
+measure the relative advantage of the area around C1 to C2. The result that the advantage changes from negative to positive confirms the conclusion above (Figure 4D).
+
+### 3.4 MANIFOLD ANALYSIS REVEALS THAT REPLAY FLOW BRIDGING BETWEEN CONTEXTS
+
+To better visualize the dynamic changes in PFC activities, we perform a 3-dimensional principal component analysis (PCA) on PFC hidden states during the whole trajectory (Figure 5A). Each trajectory is composed of three stages: moving from the starting point to the checkpoint, getting the reward and generating replay, and moving from the checkpoint to the goal. For visualization, we only pick those stages that the animal finishes in four steps. Each step has a different color shown at the bottom. We connect the centers of the data point groups of each step to form an average trajectory. We use two distinct colors to differentiate activities during replay and the real movement. For example, in the left figure, we used red to denote the PFC hidden states during movement and green to denote hidden states during replay. The red continuous dots are separated by the green dots just like how a real trajectory is separated by replay. We use gradually darker colors in each trajectory to represent the gradually increased time steps, shown at the bottom. In the left and right figures, the reward is at a known point, and we can see the PFC hidden states constitute an orbit. In the middle figure, the agent first “thinks” the reward is at C1, then changes its mind and starts to explore, and finally finds C2, and the PFC hidden states settle on the new orbit. Replay connects two low-dimensional context subspaces. The activities during random exploration when the animal cannot find the reward are too dispersive to see clearly, so we don’t show them here.
+
+Then we analyze the dimensions of different subspaces spanned by PFC hidden states. The dimension is defined as the first index of PC whose accumulated explained variance (AEV) reaches 70%. Figure 5B is a representative AEV figure of PCs of PFC hidden states during replay when the agent finds the relocated reward. The dimension of this subspace is 2. Similarly, we show the subspace dimension of PFC hidden states only during replay (Figure 5C, left), or in the whole trajectory (Fig-
+
+{7}------------------------------------------------
+
+
+
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+
+**A**
+
+Orbit C1
+
+Bridge
+
+Orbit C2
+
+**B**
+
+Accumulated Explained Variance
+
+PC index
+
+**C**
+
+Dimension
+
+C2 checking times
+
+**D**
+
+Variance
+
+C2 checking times
+
+HF
+
+PFC
+
+Figure 5: Manifold analysis reveals the context-switch process in detail. Panel A shows 3D embeddings of neural manifold trajectories for Orbit C1, Bridge, and Orbit C2. Panel B shows the accumulated explained variance for the first 10 principal components (PCs). Panel C shows the dimension of PFC activities during replay and movement. Panel D shows the mean square distance to KNN centroids for HF and PFC.
+
+Figure 5: Manifold analysis reveals the context-switch process in detail. **A.** The 3D embedding of the “neural” manifold through dimension reduction of PFC activities when the small intermediate reward stays at C1 (left), the agent meets the relocated reward at C2 for the first time (middle), and the agent meets C2 for the second time (right). The highlighted trajectory represents the neural manifold at the corresponding stage, but the other trajectories are also plotted for comparison. **B.** AEV of different PCs of PFC activities during replay when the agent first finds the new reward. **C.** Left, the dimension of the PFC activities during replay (virtual experience) when the threshold for AEV is set to 70%. Right, the dimension of PFC activities during both movement and replay. The results are the same. **D.** The mean square distance of data points to their KNN centroids calculated from hidden states in HF and PFC during movement.
+
+ure 5C, right). When the reward location changes, the all-state subspace dimension briefly increases to 3 and then drops back to 2, indicating a more complex subspace during the context switch. If we consider one “context orbit” as a 2-dimensional circle, then switching between these two orbits would produce a 3-dimensional curve. This is a rough and intuitive understanding.
+
+We also evaluate the trajectory stability during the context switch. We first perform the K-Nearest Neighbour (KNN, $K = 20$ ) algorithm on hidden states during movement to find the centroids for
+
+{8}------------------------------------------------
+
+the data points. Then we calculate the mean square distance of data points from their KNN centroids (Figure 5D) as the variance of the hidden states. The variance increases briefly during the context switch and then drops back when the agent gets to C2 for a second time. $K = 8$ gives out the same result. This shows that the first encounter of the new reward is accompanied by an unstable and dispersive trajectory. And the trajectory becomes more stable in the following time.
+
+## 4 DISCUSSION
+
+In this article, we have demonstrated that biologically similar replay can emerge from the interaction between the HF module and PFC module within a task-optimization framework. We show that replay in our model is actually a form of multi-step information emission from HF to PFC. Then we show that during replay, the context is updated both in HF and PFC, and the cognitive map and future plan are updated in PFC. Therefore we describe how replay helps learning. At last, we plot the manifold to give a more intuitive understanding. See Appendix A.3 for reproducibility results.
+
+### 4.1 PLAUSIBILITY
+
+**Conditions** Our two sufficient conditions (1) are inspired by neuroscientific research. For Condition (1), studies have shown that blocking replay impairs spatial learning (Jadhav et al., 2012; Girardeau et al., 2009; Ego-Stengel & Wilson, 2010). The presence of task-focused replay can predict the accuracy of following decisions (Ólafsdóttir et al., 2017). Replay is modulated by reward (Ambrose et al., 2016; Liu et al., 2021; Michon et al., 2019), and is associated with reward-guided updates of internal models based on past experiences (Carey et al., 2019).
+
+For condition (2), the interaction between HF and PFC during replay is supported by a lot of evidence. For example, replay is accompanied by sharp-wave ripples that synchronize the wave phases of HF and PFC (Tang et al., 2017). Replay is thought to be the substrate of the continuous memory transition from the hippocampus to the neocortex, namely memory consolidation (Kumaran et al., 2016). Recent computational models also reveal that the communication between the world model and policy network could help decision-making (Jensen et al., 2024).
+
+However, there is some evidence that does not support this hypothesis as a generating condition for replay. For example, Kaefer et al. (2020) reported PFC replay that is strongly associated with rule-switching performance but is independent of HF replay. As we do not measure PFC replay, it may be that not replay but other PFC activities in our model. Future work could design experiments to make this clear.
+
+**The segregation of HF and PFC during movement** The notion that the HF and PFC are entirely segregated during movement may seem somewhat implausible. We acknowledge that this highlights a limitation of our model’s fidelity to realistic biological settings. However, we focus on replay which occurs only at rest. During mobility, the HF and PFC could communicate with each other not by replay but by theta waves, which are thought to be mainly driven by external signals and involve only nearby place cells’ firing, rather than a global sequence. Allowing the two modules to communicate during movement might add unnecessary details less relevant to the problem we want to analyze. However, it would also be exciting to see how adding biological details could still produce the phenomena we want and how different factors interact with each other.
+
+**The difference of PFC from the striatum** Previous RL theories for animal behaviors also emphasize the striatum as the center for model-free learning. The dorsal lateral striatum (DLS) and the ventral lateral striatum (VLS) correspond to the actor and critic parts in the classical Actor-Critic algorithm. The dopamine serving as TD signal is calculated in the ventral tegmental area (VTA) and drives synaptic plasticity in the whole network (Montague, 1999). Does this role of striatum overlap with PFC? Wang et al. (2018) proposes a meta-reinforcement learning model where PFC is the inner-loop “fast” learner and the dopamine system is the “slow” learner. We think it’s also useful to consider the training process involved weight changes as a kind of dopamine learning, and later context identifying and following decision-making involved hidden state changes as PFC learning.
+
+{9}------------------------------------------------
+
+### 4.2 HOW REPLAY PROMOTES LEARNING
+
+The classical view posits that replay aids value-based reinforcement learning (Liu et al., 2021; Foster & Wilson, 2006; Mattar & Daw, 2018; Ambrose et al., 2016), and our model provides a concrete implementation supporting this view. In our model, cognitive map modulation in the PFC changes as a result of replay and then stabilizes (Figure 4). A value-modulated cognitive map in the PFC is reminiscent of value and task structure representations in the orbitofrontal cortex (OFC) (Zhou et al., 2019; Padoa-Schioppa & Assad, 2006), a part of PFC. Our work suggests these representations could combine as a value function (V function) to guide decision-making. Our PFC cognitive map is formed with the help of HF, which also aligns with previous findings (Mizrak et al., 2021).
+
+Despite those model-free components, our model should still be classified as model-based. The main difference from AI model-based methods is that they sample from the distribution learned by the world model and use these samples to improve the policy. The advantage is that it could provide gradients for the sampling process and have the gradients of the reward loss directly back-propagated to the policy network. Our method, however, doesn't design how the world model should help the policy network. The replay in our model is similar to a sampling process and maybe gradients are propagated through this process but future work needs to make this clearer. Recently Jensen et al. (2024) explores the model-based explanation of replay, but they also have an explicit design that the samples from the world model are directly taken as input to the policy network.
+
+## REFERENCES
+
+- R Ellen Ambrose, Brad E Pfeiffer, and David J Foster. Reverse replay of hippocampal place cells is uniquely modulated by changing reward. *Neuron*, 91(5):1124–1136, 2016.
+- Dominic J Barraclough, Michelle L Conroy, and Daeyeol Lee. Prefrontal cortex and decision making in a mixed-strategy game. *Nature neuroscience*, 7(4):404–410, 2004.
+- Francesco P Battaglia, Karim Benchenane, Anton Sirotta, Cyril MA Pennartz, and Sidney I Wiener. The hippocampus: hub of brain network communication for memory. *Trends in cognitive sciences*, 15(7):310–318, 2011.
+- György Buzsáki. Hippocampal sharp waves: their origin and significance. *Brain research*, 398(2):242–252, 1986.
+- Alyssa A Carey, Youki Tanaka, and Matthijs AA van Der Meer. Reward revaluation biases hippocampal replay content away from the preferred outcome. *Nature neuroscience*, 22(9):1450–1459, 2019.
+- Valérie Ego-Stengel and Matthew A Wilson. Disruption of ripple-associated hippocampal activity during rest impairs spatial learning in the rat. *Hippocampus*, 20(1):1–10, 2010.
+- Jean-Baptiste Eichenlaub, Beata Jarosiewicz, Jad Saab, Brian Franco, Jessica Kelemen, Eric Halgren, Leigh R Hochberg, and Sydney S Cash. Replay of learned neural firing sequences during rest in human motor cortex. *Cell Reports*, 31(5), 2020.
+- William Fedus, Prajit Ramachandran, Rishabh Iyer, Yoshua Bengio, Hugo Larochelle, Mark Rowland, and Will Dabney. Revisiting fundamentals of experience replay. In *International conference on machine learning*, pp. 3061–3071. PMLR, 2020.
+- David J Foster and Matthew A Wilson. Reverse replay of behavioural sequences in hippocampal place cells during the awake state. *Nature*, 440(7084):680–683, 2006.
+- Gabrielle Girardeau, Karim Benchenane, Sidney I Wiener, György Buzsáki, and Michaël B Zugaro. Selective suppression of hippocampal ripples impairs spatial memory. *Nature neuroscience*, 12(10):1222–1223, 2009.
+- Hideyoshi Igata, Yuji Ikegaya, and Takuya Sasaki. Prioritized experience replays on a hippocampal predictive map for learning. *Proceedings of the National Academy of Sciences*, 118(1):e201266118, 2021.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/iMJpmcYucq.txt b/papers/iMJpmcYucq.txt
new file mode 100644
index 0000000000000000000000000000000000000000..eb176ec864902cbd1da28aa48101b0649afbd24d
--- /dev/null
+++ b/papers/iMJpmcYucq.txt
@@ -0,0 +1,303 @@
+**Primary Area:** probabilistic methods (Bayesian methods, variational inference, sampling, UQ, etc.)
+
+
+
+{0}------------------------------------------------
+
+# STOCHASTIC VARIANCE-REDUCED GAUSSIAN VARIATIONAL INFERENCE ON THE BURES–WASSERSTEIN MANIFOLD
+
+Hoang Phuc Hau Luu, Hanlin Yu, Bernardo Williams, Marcelo Hartmann, Arto Klami
+
+Department of Computer Science
+
+University of Helsinki, Helsinki, Finland
+
+{hoang-phuc-hau.luu, hanlin.yu, bernardo.williamsmoreno, marcelo.hartmann, arto.klami}@helsinki.fi
+
+## ABSTRACT
+
+Optimization in the Bures–Wasserstein space has been gaining popularity in the machine learning community since it draws connections between variational inference and Wasserstein gradient flows. The variational inference objective function of Kullback–Leibler divergence can be written as the sum of the negative entropy and the potential energy, making forward-backward Euler the method of choice. Notably, the backward step admits a closed-form solution in this case, facilitating the practicality of the scheme. However, the forward step is not exact since the Bures–Wasserstein gradient of the potential energy involves “intractable” expectations. Recent approaches propose using the Monte Carlo method – in practice a single-sample estimator – to approximate these terms, resulting in high variance and poor performance. We propose a novel variance-reduced estimator based on the principle of control variates. We theoretically show that this estimator has a smaller variance than the Monte-Carlo estimator in scenarios of interest. We also prove that variance reduction helps improve the optimization bounds of the current analysis. We empirically demonstrate that the proposed estimator gains order-of-magnitude improvements over previous Bures–Wasserstein methods.
+
+## 1 INTRODUCTION
+
+Variational inference (VI) (Wainwright et al., 2008; Blei et al., 2017) provides a fast and scalable alternative to Markov chain Monte Carlo (MCMC), especially for inference tasks in high dimensions. The main principle of VI is to approximate a complicated distribution $\pi$ , e.g., posterior distribution in Bayesian inference, by a simpler tractable family of distributions. The approximation $\mu$ within the family is obtained by solving an optimization problem, providing a closed-form representation and e.g. efficient sampling by construction. The choice of the optimization method is heavily influenced by the assumptions made on the approximation family and the information about $\pi$ that can be obtained, ranging from classical coordinate ascent algorithms for mean-field approximations for targets with conditional conjugacy structure (Blei et al., 2017) to gradient methods using score-function approximations to avoid assumptions on the target density (Ranganath et al., 2014) or flexible approximations parameterized with neural networks (Rezende & Mohamed, 2015).
+
+We focus on Gaussian approximations (Honkela & Valpola, 2004; Opper & Archambeau, 2009; Xu & Campbell, 2022; Quiroz et al., 2023) but with a particular emphasis on the recent research line in the Wasserstein geometric viewpoint of this family (Lambert et al., 2022; Diao et al., 2023). Regarding the target $\pi$ , we assume access to second order gradients, typically computed by automatic differentiation, similar to the above works. Gaussian VI offers strong statistical guarantees at the optimal solution (Katsevich & Rigollet, 2024), offers an easy way of modelling dependencies between the variables and, thanks to the Bernstein-von Mises theorem (Van der Vaart, 2000), becomes asymptotically exact for Bayesian inference at the limit of infinite observations.
+
+Recently, there has been emerging interest in Gaussian VI with a new geometric Riemannian optimization perspective (Lambert et al., 2022; Diao et al., 2023). The family of non-degenerate Gaus-
+
+{1}------------------------------------------------
+
+
+
+The figure consists of four subplots. The left side contains three scatter plots labeled 'SVRGVI (ours)', 'SGVI', and 'BWGD'. Each plot shows optimization trajectories in a 2D space (x1, x2) with axes ranging from -20 to 10. A red ellipse represents the target distribution, a black ellipse represents the initial distribution, and grey ellipses represent intermediate steps. SVRGVI (ours) shows a stable trajectory that quickly converges to the target. SGVI and BWGD show more erratic, less stable trajectories. The right subplot is a line graph titled $D_{KL}(\mu_t || \pi)$ vs 'time elapsed (η × #iters)'. The y-axis is logarithmic, ranging from $10^{-3}$ to $10^7$ . The x-axis ranges from 0 to 600. Three lines are shown: SGVI (red), BWGD (blue), and SVRGVI (ours) (black). SVRGVI (ours) shows a rapid decrease in KL divergence, reaching a minimum around $10^{-3}$ by time 200, while SGVI and BWGD remain at a higher level around $10^1$ .
+
+Figure 1: Optimization trajectories and KL divergence plot. Left: Three scatter plots showing trajectories for SVRGVI (ours), SGVI, and BWGD. Right: A log-linear plot of D\_KL(mu\_t || pi) vs time elapsed.
+
+Figure 1: **Left:** Optimization trajectories of our method compared to SGVI (Diao et al., 2023) and BWGD (Lambert et al., 2022). The target is a 50-dimensional Gaussian distribution, visualized here via the marginal distributions of the first two coordinates. Each ellipse represents a contour of a Gaussian: the black is the initial distribution, the red is the target, and the greys are intermediate steps. Our method is dramatically more stable and finds a more accurate final approximation. **Right:** the corresponding KL divergence, confirming our method is orders of magnitude more accurate.
+
+sian distributions can be parameterized by its mean and covariance matrix, $\mu_\theta$ with $\theta = (m, \Sigma)$ , henceforth denoted as $\Theta = \mathbb{R}^d \times \mathcal{S}_{++}^d$ where $\mathcal{S}_{++}^d$ is the set of $d \times d$ symmetric, positive definite matrices. Classical VI employs conventional optimization algorithms (Paisley et al., 2012; Titsias & Lázaro-Gredilla, 2014; Kucukelbir et al., 2017) to minimize the Kullback-Leibler (KL) divergence $D_{KL}(\mu_\theta || \pi)$ over the parameter space $\Theta$ equipped with the Euclidean geometry. Lambert et al. (2022) argue that because the optimization problem is over the space distributions, it is more natural to use the geometry of this space rather than the geometry of the parameter space. The space of Gaussian distributions has a rich, meaningful and tractable geometry known as Bures–Wasserstein (BW) geometry that benefits optimization. Lambert et al. (2022) subsequently established a theoretical framework for performing VI using the BW geometry, which we adopt in this paper.
+
+Let $\pi(x) \propto \exp(-V(x))$ be the target distribution and consider the VI problem
+
+$$\hat{\pi} \in \arg \min_{\mu \in \text{BW}(\mathbb{R}^d)} D_{KL}(\mu || \pi), \quad (1)$$
+
+where $\text{BW}(\mathbb{R}^d)$ is the Bures–Wasserstein space of Gaussian distributions with non-degenerate covariance matrix. The BW space is a Riemannian manifold whose geodesic distance is the Bures–Wasserstein distance. This setting nicely interplays the theory of optimal transport, Wasserstein gradient flows, and variational inference. The optimization problem (1) can be reformulated as
+
+$$\hat{\pi} \in \arg \min_{\mu \in \text{BW}(\mathbb{R}^d)} \mathcal{F}(\mu), \quad \text{where } \mathcal{F}(\mu) := \mathcal{E}_V(\mu) + \mathcal{H}(\mu). \quad (2)$$
+
+Here, $\mathcal{E}_V(\mu) = \int V(x)d\mu(x)$ is the potential energy and $\mathcal{H}(\mu) = \int \log(\mu(x))d\mu(x)$ is the negative entropy. A conceptual and established idea to minimize a functional $\mathcal{F}$ is to perform gradient flow on $\mathcal{F}$ with respect to the geometry of $\text{BW}(\mathbb{R}^d)$ . To be implementable, the flow must be discretized. Lambert et al. (2022) use forward Euler discretization, resulting in a scheme named Bures–Wasserstein stochastic gradient descent (BWGD).
+
+Diao et al. (2023) remark that forward-backward (FB) Euler (Bauschke & Combettes, 2011) should be used instead due to the objective’s composite nature and the entropy’s non-smoothness. This method iteratively applies a forward step to the potential energy $\mathcal{E}_V$ and a backward step (proximal operator) to the negative entropy $\mathcal{H}$ . They also observe that the backward step in the BW space has a closed-form solution (Wibisono, 2018). This is crucial because this step is known to be intractable (or computationally expensive) in the full Wasserstein space (Wibisono, 2018; Salim et al., 2020; Mokrov et al., 2021; Luu et al., 2024). Although the bottleneck of the FB Euler, which is the backward step, has been resolved in this case, the forward step becomes problematic where one has to compute the Bures–Wasserstein gradient of $\mathcal{E}_V$ instead of the “friendly” Wasserstein gradient that is just $\nabla V$ . The Bures–Wasserstein gradient is not always available in closed form, i.e., at $\mu \in \text{BW}(\mathbb{R}^d)$ , it is given only implicitly by the map $x \mapsto \mathbb{E}_\mu \nabla V + (\mathbb{E}_\mu \nabla^2 V)(x - m_\mu)$ where $m_\mu$
+
+{2}------------------------------------------------
+
+is the mean of $\mu$ (Lambert et al., 2022). This is the orthogonal projection of the Wasserstein gradient onto a tangent space of the Bures–Wasserstein manifold (Chewi et al., 2024). For general $V$ , these expectations are intractable even though the underlying distribution is a Gaussian. Diao et al. (2023) proposed using the Monte Carlo (MC) method with one sample to estimate these expectations at each iteration: sample $X \sim \mu$ and use $\nabla V(X)$ and $\nabla^2 V(X)$ as unbiased estimators for $\mathbb{E}_\mu \nabla V$ and $\mathbb{E}_\mu \nabla^2 V$ , respectively. This scheme is called Stochastic Gaussian VI (SGVI).
+
+The problem with SGVI building on this principle is that the Monte Carlo estimates needed for the BW gradient are typically too noisy, particularly in high dimensions, as shown in our experiments (Sect. 5). In practice, high-variance estimators require small step sizes, leading to slow and inefficient convergence. We resolve this fundamental limitation by proposing a variance-reduced estimator with minimal computational overhead while providing robust theoretical guarantees. Fig. 1 shows the improvement over SGVI and BWGD in practice. Bures–Wasserstein geometry offers a meaningful transition from the initial distribution to the target distribution, and our method follows the path smoothly and is particularly stable around the optimum.
+
+**Contributions.** We propose a novel variance-reduced estimator for $\mathbb{E}_\mu \nabla V$ that does not use any extra samples, with minimal per-iteration computational overhead, using the control variates approach (Owen, 2013). Our idea is that the variational distribution $\mu$ should be similar to the target distribution $\pi(x) \propto \exp(-V(x))$ as $\mu$ gets closer and closer to $\pi$ , so the density of $\mu$ can be used to construct a correlated control variate for the Monte-Carlo estimator $\nabla V(X)$ . Sect. 3 presents the detailed construction and its rationale.
+
+On the theoretical side, we derive the following insights:
+
+- Thm. 1 Under a mild smoothness assumption, we prove that there is a region around the optimal solution $\hat{\pi}$ where our estimator has guaranteed smaller variance than the MC estimator.
+- Thm. 2 If $V$ is strongly convex, we prove that the proposed estimator has a smaller variance than the MC estimator at every $\mu \in \text{BW}(\mathbb{R}^d)$ whenever $\mu$ has sufficiently large (greater than a controllable threshold) variance.
+
+We further show in Thm. 3 and Thm. 4 that whenever variance reduction happens along the algorithm’s iterates, the effect will enter the convergence analysis and improve the optimization bounds derived in Diao et al. (2023). These theorems solidly back our proposed method.
+
+On the practical side, we show that reusing the Cholesky decomposition of the covariance matrix (needed to sample from a multivariate Gaussian) keeps the computational overhead of the control variable negligible. Despite being only a minimal modification to the Monte Carlo estimator, the proposed estimator achieves significant improvements in our experiments.
+
+## 2 BACKGROUND
+
+A function $f : \mathbb{R}^d \rightarrow \mathbb{R}$ is called L-smooth (or Lipschitz smooth) if $\|\nabla f(x) - \nabla f(y)\| \leq L\|x - y\|$ for all $x, y \in \mathbb{R}^d$ . If $f$ is twice continuously differentiable, we define the Laplacian operator of $f$ as $\Delta f = \sum_{i=1}^d (\partial^2 / \partial x_i^2) f$ . For a random variable $\tau$ , $\|\tau\|_\infty := \inf\{C : |\tau| \leq C \text{ almost surely}\}$ .
+
+### 2.1 BURES–WASSERSTEIN GEOMETRY
+
+We denote by $\mathcal{P}_2(\mathbb{R}^d)$ the space of probability measures $\mu$ over $\mathbb{R}^d$ with finite second-moment, i.e., $\int \|x\|^2 d\mu(x) < +\infty$ . Equipped with the Wasserstein distance
+
+$$W_2^2(\mu, \nu) = \inf_{\gamma \in \Gamma(\mu, \nu)} \int_{X \times X} \|x - y\|^2 d\gamma(x, y) \quad (3)$$
+
+where $\Gamma(\mu, \nu)$ is the set of probability measures over $X \times X$ whose marginals are $\mu$ and $\nu$ , the space $\mathcal{P}_2(\mathbb{R}^d)$ becomes the metric space called the Wasserstein space (Ambrosio et al., 2005). We call $\gamma \in \Gamma(\mu, \nu)$ a (transport) plan and any $\gamma$ that achieves the optimal value in (3) an optimal plan. A pair of random variables whose joint distribution is an optimal plan is called an optimal coupling (between $\mu$ and $\nu$ ). When $\mu$ is absolutely continuous with respect to the Lebesgue measure, Brenier theorem (Brenier, 1991) asserts that the optimal plan is unique and is given by $(I, T_\mu^\nu)_\# \mu$ where
+
+{3}------------------------------------------------
+
+$T_\mu^\nu = \nabla g$ for some convex function $g$ . We call $T_\mu^\nu$ the optimal transport map from $\mu$ to $\nu$ . Apart from being a metric space, the Wasserstein space also enjoys some nice properties of Riemannian geometry. Otto's calculus (Otto, 2001) endows the Wasserstein space with a formal Riemannian structure, facilitating gradient flows and optimization.
+
+We denote by $\text{BW}(\mathbb{R}^d)$ the space of Gaussian distributions with non-degenerate covariance matrices. The Wasserstein distance between two Gaussian distributions $p_0 = \mathcal{N}(m_0, \Sigma_0)$ and $p_1 = \mathcal{N}(m_1, \Sigma_1)$ is given in the closed-form formula $\mathcal{W}_2^2(p_0, p_1) = \|m_0 - m_1\|^2 + \mathcal{B}^2(\Sigma_0, \Sigma_1)$ where $\mathcal{B}^2(\Sigma_0, \Sigma_1) = \text{Tr}(\Sigma_0 + \Sigma_1 - 2(\Sigma_0^{\frac{1}{2}}\Sigma_1\Sigma_0^{\frac{1}{2}})^{\frac{1}{2}})$ is the Bures metric. The optimal transport map is also given in a closed form in this case: $T_{p_0}^{p_1}(x) = m_1 + \Sigma_0^{-\frac{1}{2}} \left( \Sigma_0^{\frac{1}{2}} \Sigma_1 \Sigma_0^{\frac{1}{2}} \right)^{\frac{1}{2}} \Sigma_0^{-\frac{1}{2}} (x - m_0)$ .
+
+The BW space is a geodesically convex subset of the Wasserstein space, meaning that a geodesic curve joining two Gaussians lies entirely inside the BW space. The BW space is a Riemannian manifold in its own right. Let $\mu = \mathcal{N}(m, \Sigma) \in \text{BW}(\mathbb{R}^d)$ , the tangent space of $\text{BW}(\mathbb{R}^d)$ at $\mu$ is the space of symmetric affine maps denoted as $T_\mu \text{BW}(\mathbb{R}^d) = \{x \mapsto S(x - m) + a \mid a \in \mathbb{R}^d, S \in \mathcal{S}^d\}$ where $\mathcal{S}^d$ is the space of symmetric $d \times d$ matrices. The Riemannian metric defined using the inner product of elements in this tangent space is identified as the $L^2(\mu)$ inner product restricted to this space. Given $U, V \in T_\mu \text{BW}(\mathbb{R}^d)$ , the metric is $\langle U, V \rangle_\mu := \int \langle U(x), V(x) \rangle d\mu(x)$ . This Riemannian metric induces the geodesic distance in $\text{BW}(\mathbb{R}^d)$ that is given by the Wasserstein distance. We refer to Altschuler et al. (2021) for further discussions on BW geometry.
+
+### 2.2 STOCHASTIC GAUSSIAN VI
+
+We refer to Diao et al. (2023) for a detailed discussion and relevant terminologies. We briefly explain stochastic Gaussian VI to motivate our proposed variance reduction. Recall from (2) that we aim to minimize $\mathcal{F}(\mu) = \mathcal{H}(\mu) + \mathcal{E}_V(\mu)$ over $\text{BW}(\mathbb{R}^d)$ . At the optimum of $\mathcal{F}$ , $\hat{\pi} = \mathcal{N}(\hat{m}, \hat{\Sigma})$ , first-order optimality reads (Opper & Archambeau, 2009; Lambert et al., 2022; Diao et al., 2023)
+
+$$\mathbb{E}_\pi \nabla V = 0 \quad \text{and} \quad \mathbb{E}_\pi \nabla^2 V = \hat{\Sigma}^{-1} \quad (4)$$
+
+which is derived by zeroing the Bures–Wasserstein gradient of the objective function.
+
+A natural idea to minimize $\mathcal{F}$ over $\text{BW}(\mathbb{R}^d)$ is to perform gradient flow on $\mathcal{F}$ using the BW geometry of $\text{BW}(\mathbb{R}^d)$ . When the gradient flow is applied over the entire Wasserstein space $\mathcal{P}_2(\mathbb{R}^d)$ , it corresponds to the Langevin diffusion (Jordan et al., 1998), with one of its discretizations being an MCMC method called the unadjusted Langevin algorithm (Roberts & Tweedie, 1996). When restricted to $\text{BW}(\mathbb{R}^d)$ , the gradient flow can be formulated using Riemannian geometry (Do Carmo, 1992), as $\text{BW}(\mathbb{R}^d)$ forms a true Riemannian manifold. This flow is a curve of Gaussian distributions, characterized by the time-dependent evolution of their mean and covariance matrix. Recently, Lambert et al. (2022) showed that this evolution is governed by Särkkä's ODEs developed in the context of variational Kalman filtering (Särkkä, 2007).
+
+The negative entropy $\mathcal{H}$ is convex along generalized geodesics but it is a nonsmooth functional. If $V$ is smooth, it induces the smoothness of $\mathcal{E}_V$ . Therefore, it is natural to apply forward-backward Euler that alternates between two steps: at iteration $k$ ,
+
+$$\begin{aligned} \mu_{k+\frac{1}{2}} &= (I - \eta \nabla_{\text{BW}} \mathcal{E}_V(\mu_k))_\# \mu_k && \triangleleft \text{forward step} \\ \mu_{k+1} &= \arg \min_{\mu \in \text{BW}(\mathbb{R}^d)} \left\{ \mathcal{H}(\mu) + \frac{1}{2\eta} W_2^2 \left( \mu, \mu_{k+\frac{1}{2}} \right) \right\} && \triangleleft \text{backward step} \end{aligned}$$
+
+where $\nabla_{\text{BW}}$ denotes the Bures–Wasserstein gradient. The backward step is also known as the proximal step in the optimization literature or the JKO (Jordan, Kinderlehrer, and Otto) step (with restriction in $\text{BW}(\mathbb{R}^d)$ ) in the context of Wasserstein gradient flow (Jordan et al., 1998). The backward step is intractable in the full Wasserstein space and hence requires (oftentimes expensive) numerical approximations (Mokrov et al., 2021; Luu et al., 2024). On the other hand, if restricted to $\text{BW}(\mathbb{R}^d)$ , this step admits a closed-form solution (Wibisono, 2018): let $\mu_{k+\frac{1}{2}} = \mathcal{N}(m_{k+\frac{1}{2}}, \Sigma_{k+\frac{1}{2}})$ , then $\mu_{k+1}$ is a Gaussian distribution with mean $m_{k+1} = m_{k+\frac{1}{2}}$ and variance matrix $\Sigma_{k+1} = \frac{1}{2} \left( \Sigma_{k+\frac{1}{2}} + 2\eta I + [\Sigma_{k+\frac{1}{2}}(\Sigma_{k+\frac{1}{2}} + 4\eta I)^{\frac{1}{2}}] \right)$ . This tractability of the backward is the main motivation for Diao et al. (2023) to study and develop FB Euler in this scenario. The forward step, however,
+
+{4}------------------------------------------------
+
+is not always analytically available since the BW gradient of $\mathcal{E}_V$ , at iterate $k$ ,
+
+$$\nabla_{\text{BW}} \mathcal{E}_V(\mu_k) : x \mapsto \mathbb{E}_{\mu_k} \nabla V + (\mathbb{E}_{\mu_k} \nabla^2 V)(x - m_k),$$
+
+involves intractable expectations. Diao et al. (2023) propose using Monte Carlo approximation for these expectations: sample $X_k \sim \mu_k$ and use $b_k := \nabla V(X_k)$ and $S_k := \nabla^2 V(X_k)$ as unbiased estimators for $\mathbb{E}_{\mu_k} \nabla V$ and $\mathbb{E}_{\mu_k} \nabla^2 V$ , respectively.
+
+## 3 STOCHASTIC VARIANCE-REDUCED GAUSSIAN VI
+
+We present our ideas on constructing stochastic variance-reduced estimators from first principles. We recall from Sect. 2.2 that stochastic Gaussian VI approximates, at iteration $k$ ,
+
+$$\mathbb{E}_{\mu_k} \nabla V \approx b_k := \nabla V(X_k) \quad \text{and} \quad \mathbb{E}_{\mu_k} \nabla^2 V \approx S_k := \nabla^2 V(X_k) \quad \text{where } X_k \sim \mu_k. \quad (5)$$
+
+These estimators are typically noisy. Any number of MC samples can be used, but already one is unbiased and proposed by earlier works; we also focus on the single-sample case for computational efficiency. We aim to design better unbiased estimators for either $\mathbb{E}_{\mu_k} \nabla V$ or $\mathbb{E}_{\mu_k} \nabla^2 V$ in the sense that their variances are smaller than those of $b_k$ and $S_k$ , building on the control variates approach (Owen, 2013); Also see the discussions in Defazio et al. (2014); Luu (2022).
+
+Let us first describe briefly the core idea of control variates in helping reduce the variance. Let $\theta$ be the quantity of interest and $X$ be an unbiased estimator for $\theta$ , i.e., $\mathbb{E}X = \theta$ . A *control variate* is a random variable $Y$ with a known mean so that $Y$ is correlated with $X$ . The random variable $Z = X + c(\mathbb{E}Y - Y)$ , where $c \in \mathbb{R}$ , is then an *unbiased estimator* for $\theta$ . The variance of $Z$ is
+
+$$\text{Var}Z = \text{Var}X + c^2 \text{Var}Y - 2c \text{Cov}(X, Y). \quad (6)$$
+
+If $X, Y$ are highly correlated in the sense that $2\text{Cov}(X, Y) > \text{Var}Y$ , we immediately get $\text{Var}Z < \text{Var}X$ for any $c \in (0, 1]$ . So, we achieve a reduction in variance by using $Z$ . On the other hand, if $X, Y$ are correlated ( $\text{Cov}(X, Y) > 0$ ) but not highly correlated, we can also obtain variance reduction effects whenever $c$ is positive and small enough. Furthermore, given the parabolic form with respect to $c$ in (6), one can pinpoint the optimal value of $c$ is $c^* := \text{Cov}(X, Y)/\text{Var}(Y)$ , resulting in the maximal variance reduction $\text{Var}Z = (1 - \text{Corr}(X, Y)^2)\text{Var}X < \text{Var}X$ where $\text{Corr}(X, Y)$ denotes correlation between $X$ and $Y$ .
+
+We now return to our problem and seek variance-reduced estimators of the forms
+
+$$\tilde{b}_k := \nabla V(X_k) + c(\mathbb{E}(Z_k) - Z_k) \quad \text{and} \quad \tilde{S}_k := \nabla^2 V(X_k) + d(\mathbb{E}(W_k) - W_k)$$
+
+where $c, d > 0$ and $Z_k, W_k$ are a random vector and a random matrix, respectively. Let us first focus on $\tilde{b}_k$ . As discussed, $Z_k$ should be (element-wise) highly correlated with $\nabla V(X_k)$ while $\mathbb{E}(Z_k)$ remains efficiently computable. We look for $Z_k = \nabla U(X_k)$ so that $\nabla U$ is as close to $\nabla V$ as possible. We are in the context of approximating $\pi(x)$ by the VI distribution $\mu_k = \mathcal{N}(m_k, \Sigma_k)$ , so it is natural to expect that
+
+$$-\nabla V(x) = \nabla \log \pi(x) \approx \nabla \log f(x; m_k, \Sigma_k) = -\Sigma_k^{-1}(x - m_k),$$
+
+where $f(x; m_k, \Sigma_k) \propto \exp(-\frac{1}{2}(x - m_k)^\top \Sigma_k^{-1}(x - m_k))$ is the PDF of $\mu_k$ . Therefore, we propose using $Z_k = \Sigma_k^{-1}(X_k - m_k)$ as a control variate. We have $\mathbb{E}(Z_k) = 0$ since $\mathbb{E}(X_k) = m_k$ . It is worth noting that $Z_k$ is known as the Stein/Hyvärinen score (Hyvärinen, 2005) of $\mu_k$ . The estimator $\tilde{b}_k$ then becomes $\tilde{b}_k := \nabla V(X_k) - c\Sigma_k^{-1}(X_k - m_k)$ . By applying the same reasoning to $\tilde{S}_k$ , we can immediately conclude that $W_k$ is deterministic and equals $\Sigma_k^{-1}$ . Consequently, the control variate does not affect $\tilde{S}_k$ ; we keep the standard estimator. We derive Stochastic Variance-Reduced Gaussian VI (SVRGVI) as in Alg. 1 (we will discuss more about the choice of $c_k$ in Sect. 4). Note that the only difference between Alg. 1 and the SGVI in Diao et al. (2023) is the estimator $\tilde{b}_k$ , where the difference is highlighted in [blue](#).
+
+Fig. 2 (left) demonstrates that our proposed estimator (with $c = 0.9$ ) achieves lower variance compared to the standard MC estimator, while both remain unbiased estimators of $\mathbb{E}_{\mu_k} \nabla V$ . In Fig. 2 (right), we vary $c$ from 0 to 2 and calculate the empirical variance of our estimator, revealing a parabolic pattern. Note that when $c = 0$ , the estimator reduces to the standard estimator, and for all values of $c \in (0, 2)$ , our proposed estimator consistently exhibits lower variance, with an optimal value of $c$ around 1. At this optimal $c$ , the variance is reduced roughly by a factor of 10. We provide theoretical justification for these empirical observations in Sect. 4.
+
+{5}------------------------------------------------
+
+
+
+Figure 2: Two plots illustrating the performance of the proposed estimator. The left plot is a scatter plot of gradients for Monte Carlo (grey), Variance reduction (light blue), and True gradient (navy blue). The right plot shows the empirical variance of the proposed estimator as a function of c, which is U-shaped, with a minimum at c ≈ 1.25.
+
+Figure 2: **Left:** $\pi$ is a Gaussian, VI distribution $\mu$ is in the neighborhood of $\pi$ . In this case, the true gradient, i.e., the expectation $\mathbb{E}_\mu \nabla V$ , can be computed exactly (in navy blue). Our proposed estimator with $c = 0.9$ (light blue) has a smaller variance than the Monte Carlo estimator (grey). These are 1,000 samples for each estimator, generated by drawing from $\mu$ and substituting the values into the respective estimator formulas. **Right:** The empirical variance of our proposed estimator when $c$ varies from 0 to 2. Note that $c = 0$ corresponds to the Monte Carlo estimator.
+
+**Minimal extra computational cost** Despite involving calculating the inverse of the covariance matrix, the computational overhead is small. Sampling from multivariate normal in step 1 in Alg. 1 typically requires obtaining the Cholesky factor of the covariance matrix, which is $O(d^3)$ (Rasmussen & Williams, 2006). With the Cholesky factor, obtaining the solution of the inverse of the matrix times a vector is $O(d^2)$ (Rasmussen & Williams, 2006). As such, we can reuse this obtained Cholesky factor in step 1 to compute the inverse in step 2, which implies that the estimator adds an overhead of $O(d^2)$ , which is naturally dominated by the $O(d^3)$ complexity of the original algorithm.
+
+#### --- Algorithm 1 Stochastic variance-reduced Gaussian Variational Inference (SVRGVI) ---
+
+**Input:** Target distribution $\pi(x) \propto \exp(-V(x))$ , initial distribution $\mu_0 = \mathcal{N}(m_0, \Sigma_0)$ , step size $\eta > 0$ , number of steps $N$ , sequence of control variate parameters $\{c_k\}_{k=0}^{N-1}$ where $c_k \in (0, 1], \forall k \in \{0, 1, \dots, N-1\}$
+
+**for** $k = 0$ to $N - 1$ **do**
+
+1. Draw one sample $X_k \sim \mathcal{N}(m_k, \Sigma_k)$
+
+2. Compute estimators: $\tilde{b}_k \leftarrow \nabla V(X_k) - c_k \Sigma_k^{-1}(X_k - m_k)$ and $S_k \leftarrow \nabla^2 V(X_k)$
+
+3. Update mean and covariance matrix:
+
+$$m_{k+1} \leftarrow m_k - \eta \tilde{b}_k$$
+
+$$M_{k+1} \leftarrow I - \eta S_k$$
+
+$$\Sigma_{k+\frac{1}{2}} \leftarrow M_{k+1} \Sigma_k M_{k+1}$$
+
+$$\Sigma_{k+1} = \frac{1}{2} \left( \Sigma_{k+\frac{1}{2}} + 2\eta I + \left[ \Sigma_{k+\frac{1}{2}} (\Sigma_{k+\frac{1}{2}} + 4\eta I) \right]^{\frac{1}{2}} \right)$$
+
+**end for**
+
+**Output:** $\mu_N = \mathcal{N}(m_N, \Sigma_N)$
+
+---
+
+## 4 THEORY
+
+In Sect. 3, we argued that, in the context of variational inference, as $\mu_k$ iteratively gets closer to $\pi$ , $\nabla V(X_k)$ is then (highly) correlated to $\Sigma_k^{-1}(X_k - m_k)$ , and hence we obtain a variance reduction effect. This argument leads to the construction of the control variate in Alg. 1. One might question whether this approach remains effective when the target distribution $\pi$ is significantly distant from the BW space. Because we are constrained to the BW space, the best we can do is to get closer to $\tilde{\pi}$ which is the optimal solution to the problem (1). However, $\tilde{\pi}$ might still look very different from $\pi$ . Notably, in Thm. 1, we rigorously show that within a certain neighbourhood of $\tilde{\pi}$ (to be defined later), our proposed estimator consistently reduces variance, regardless of how different $\pi$ is to a Gaussian distribution. Let us first introduce Lem. 1 to pave the way for Thm. 1 and also to discuss
+
+{6}------------------------------------------------
+
+the optimal $c$ in the control variate. In Lem. 1, we compute the variance of the proposed estimator by leveraging multidimensional Stein’s lemma (Lin et al., 2019).
+
+**Lemma 1** Assume that $V$ is continuously differentiable. Let $\mu = \mathcal{N}(m, \Sigma) \in \text{BW}(\mathbb{R}^d)$ . Then,
+
+$$\underbrace{\mathbb{E} \|\nabla V(X) - c\Sigma^{-1}(X - m) - \mathbb{E} \nabla V(X)\|^2}_{\text{variance of our estimator}} = \underbrace{\mathbb{E} \|\nabla V(X) - \mathbb{E} \nabla V(X)\|^2}_{\text{variance of the Monte-Carlo estimator}} + \underbrace{c^2 \text{Tr}(\Sigma^{-1}) - 2c \text{Tr}(\mathbb{E} \nabla^2 V(X))}_{\text{extra term}}, \text{ where } X \sim \mu.$$
+
+Proof of Lem. 1 is given in Appendix A.1. Lem. 1 compares the variance of the proposed estimator and the Monte Carlo estimator at a given $\mu \in \text{BW}(\mathbb{R}^d)$ . Recall that the first-order optimality condition (4) of $\hat{\pi}$ reads $\mathbb{E}_{\hat{\pi}} \nabla^2 V = \hat{\Sigma}^{-1}$ . Consequently, at $\hat{\pi}$ , the extra term in Lem. 1 is simplified as $c(c-2) \text{Tr}(\hat{\Sigma}^{-1})$ which is negative whenever $c \in (0, 2)$ and minimized for $c = 1$ . Therefore, at $\hat{\pi}$ , our estimator is always better than the Monte Carlo estimator for $c \in (0, 2)$ .
+
+**Remark 1** A practical merit of Lem. 1 is that it implies the optimal value for $c$ to get maximum variance reduction at $\mu$ is $c^* = \text{Tr}(\mathbb{E}_{\mu} \nabla^2 V) / \text{Tr}(\Sigma^{-1})$ . Applying this to Alg. 1, we can pick the adaptive sequence $\{c_k\}$ as $c_k^* = \frac{\text{Tr}(\mathbb{E}_{\mu_k} \nabla^2 V)}{\text{Tr}(\Sigma_k^{-1})} \approx \frac{\text{Tr}(\hat{\Sigma}_k)}{\text{Tr}(\Sigma_k^{-1})} := c_k$ . Again, this computation of $c_k$ incurs a negligible extra cost to Alg. 1. We also remark that around $\hat{\pi}$ , optimality condition (4) implies the optimal value $c^*$ indeed is around 1.
+
+In Thm. 1, we further show that when the Laplacian $\Delta V$ is smooth, the proposed estimator has a smaller variance than the Monte Carlo estimator in a region around $\hat{\pi}$ .
+
+**Theorem 1 (Variance reduction around the optimal solution)** Assume that the Laplacian $\Delta V$ is $\ell$ -smooth. For any control variate coefficient $c \in (0, 2)$ , define the region around $\hat{\pi} = \mathcal{N}(\hat{m}, \hat{\Sigma})$ :
+
+$$\mathcal{V}(\hat{\pi}, r) = \{\mu = \mathcal{N}(m, \Sigma) : 2\ell W_2(\mu, \hat{\pi}) + c |\text{Tr}(\Sigma^{-1}) - \text{Tr}(\hat{\Sigma}^{-1})| < r\}$$
+
+where $r = (2 - c) \text{Tr}(\hat{\Sigma}^{-1}) > 0$ is the region’s radius. For any $\mu \in \mathcal{V}(\hat{\pi}, r)$ , the proposed estimator has a smaller variance than the Monte Carlo estimator.
+
+Proof of Thm. 1 is given in Appendix A.2 with the main idea being that the smoothness of the Laplacian $\Delta V$ propagates the improvement of the proposed estimator at $\hat{\pi}$ to its neighbourhood. We additionally observe that, for small $c > 0$ , the region $\mathcal{V}(\hat{\pi}, r)$ effectively reduces to the Wasserstein ball $\mathcal{B}(\hat{\pi}, \ell^{-1} \text{Tr}(\hat{\Sigma}^{-1}))$ .
+
+Thm. 1 applies to arbitrary $\pi$ , only requiring a mild smoothness condition of its second derivative. In the next theorem, we show that when $\pi$ is strongly log-concave ( $\pi$ is now more similar to a Gaussian), variance reduction happens not only around $\hat{\pi}$ but also in many regions of interest.
+
+**Theorem 2 (Variance reduction at large-variance distributions)** If $V$ is $\alpha$ -strongly convex for some $\alpha > 0$ , for any control variate $c > 0$ , the proposed estimator has a smaller variance than the Monte Carlo estimator at every $\mu = \mathcal{N}(m, \Sigma)$ whenever $\text{Tr}(\Sigma^{-1}) < \frac{2\alpha d}{c}$ .
+
+Proof of Thm. 2 is given in Appendix A.3.
+
+**Remark 2** A consequence of Thm. 2 is that for strongly convex $V$ we can obtain variance reduction at each iteration in Alg. 1 by setting $c_k \in (0, 2\alpha d / \text{Tr}(\Sigma_k^{-1}))$ . We can extend this result to the case of convex but non-strongly-convex $V$ , i.e., $\alpha = 0$ . We first show that: for any Gaussian $\mathcal{N}(m, \Sigma)$ , $\text{Tr}(\mathbb{E}_{\mathcal{N}(m, \Sigma)} \nabla^2 V) > 0$ . We can then obtain variance reduction at each iteration by setting $c_k \in (0, 2 \text{Tr}(\mathbb{E}_{\mathcal{N}(m_k, \Sigma_k)} \nabla^2 V) / \text{Tr}(\Sigma_k^{-1}))$ . Note that this upper bound of $c_k$ is less explicit as the strongly convex case. However, the point is that variance reduction still happens in this case given that $c_k$ is small enough. See Appendix A.3 for the proof.
+
+We further show in Thm. 3 and Thm. 4 that whenever variance reduction happens along the algorithm’s iterates, the effect will propagate to the convergence analyses of Diao et al. (2023) and
+
+{7}------------------------------------------------
+
+improve their theoretical bounds. Therefore, combining with Thm. 1 and Thm. 2, the overall theory strongly favours SVRGVI over SGVI.
+
+Let $\mathcal{P}_k$ denote the information up to the beginning of iteration $k$ , i.e., it is the $\sigma$ -algebra given by $\mathcal{P}_k = \sigma(X_0, X_1, \dots, X_{k-1})$ for $k \in \{1, 2, \dots, N-1\}$ and $\mathcal{P}_0$ is, by convention, the trivial $\sigma$ -algebra with no information. Assuming variance reduction occurs along the algorithm's iterates, i.e., for $k = 0, 1, \dots, N-1$ , it holds
+
+$$\mathbb{E}(\|\nabla V(X_k) - c_k \Sigma_k^{-1}(X_k - m_k) - \mathbb{E}_{\mu_k} \nabla V\|^2 | \mathcal{P}_k) \leq \tau_k \mathbb{E}(\|\nabla V(X_k) - \mathbb{E}_{\mu_k} \nabla V\|^2 | \mathcal{P}_k) \quad (7)$$
+
+where $\tau_k < 1$ almost surely. We recall from Remark 2 that for convex $V$ , (7) holds such that $\tau_k < 1$ almost surely for all $k$ if $c_k$ is well-chosen, and it follows that $\mathbb{E}\tau_k < 1$ and $\|\tau_k\|_\infty \leq 1$ for all $k$ . We can further guarantee $\|\tau_k\|_\infty < 1$ for all $k$ under mild boundedness assumptions (Appendix A.4).
+
+Under condition 7, we now show the improved bounds. Similar to Diao et al. (2023), we consider log-concave and strongly-log-concave sampling, meaning that $V$ is assumed to be convex and strongly convex, respectively.
+
+**Theorem 3 (Convex case)** Suppose that $V$ is convex and $\beta$ -smooth and the step size $0 < \eta \leq \frac{1}{2\beta}$ . If variance reduction happens for $k = 0, 1, \dots, N-1$ , then,
+
+$$\mathbb{E} \min_{k=1,2,\dots,N} \mathcal{F}(\mu_k) - \mathcal{F}(\hat{\pi}) \lesssim \frac{e}{1 + \frac{C\eta^2(1-\tau_{\max,\infty})}{2}} \left( \frac{1}{2\eta N} + \frac{C\eta}{2} \right) W_2^2(\mu_0, \hat{\pi}) + 3\eta\beta d(1 + \tau_{\max,E})$$
+
+where $\tau_{\max,\infty} := \max_{i=0,N-1} \|\tau_i\|_\infty$ , $\tau_{\max,E} = \max_{i=0,N-1} \mathbb{E}\tau_i$ , $e \approx 2.718$ is the Euler's number, $C = 24\beta^3 \lambda_{\max}(\tilde{\Sigma})$ , and $\lesssim$ is asymptotically at the limit of small $\eta$ .
+
+Proof of Thm. 3 is given in Appendix A.5.
+
+**Theorem 4 (Strongly convex case)** Suppose that $V$ is $\alpha$ -strongly-convex with $\alpha > 0$ , and $0 < \eta \leq \frac{\alpha^2}{48\beta^3}$ . If variance reduction happens for $k = 0, 1, \dots, N-1$ , then
+
+$$\mathbb{E} W_2^2(\mu_N, \hat{\pi}) \lesssim \exp\left(-\frac{N(3-\tau_{\max,\infty})\eta\alpha}{4}\right) W_2^2(\mu_0, \hat{\pi}) + \frac{24(1+\tau_{\max,E})\beta\eta d}{(3-\tau_{\max,\infty})\alpha} \quad (8)$$
+
+where $\tau_{\max,\infty}$ and $\tau_{\max,E}$ are defined in Theorem 3, and $\lesssim$ is asymptotically at the limit of small $\eta$ .
+
+Proof of Thm. 4 is given in Appendix A.6.
+
+**Remark 3** We recall the corresponding bounds for SGVI in Diao et al. (2023, Thm 5.7, Thm. 5.8)
+
+- **Convex.** $\mathbb{E}(\min_{k=1,2,\dots,N} \mathcal{F}(\mu_k)) - \mathcal{F}(\hat{\pi}) \lesssim \frac{eW_2^2(\mu_0, \hat{\pi})}{2N\eta} + \frac{eC\eta}{2} W_2^2(\mu_0, \hat{\pi}) + 6\beta\eta d$ .1
+- **Strongly convex.** $\mathbb{E} W_2^2(\mu_N, \hat{\pi}) \lesssim \exp\left(-\frac{\alpha N \eta}{2}\right) W_2^2(\mu_0, \hat{\pi}) + \frac{24\beta\eta d}{\alpha}$ .
+
+Putting side-by-side, we see that Thm. 3 and Thm. 4 improve all coefficients of these bounds. In particular, the scale-down involving $d$ is expected to help in high dimensions. It is also worth noting that even when we set $\tau_{\max,\infty} = 0$ , the noise terms in the bounds of Thm. 3 and Thm. 4 would not disappear because of another source of randomness coming from $S_k$ .
+
+## 5 EXPERIMENTS
+
+We demonstrate the method in a collection of controlled problems, comparing it against the recent methods for VI in the BW manifold, namely BWGD (Lambert et al., 2022) and SGVI (Diao et al., 2023)2. We set the step size to 1 for all algorithms (for an experiment on varying step size, see
+
+1With a minor correction to the coefficients in SGVI's bound.
+
+2Our code is available at
+
+{8}------------------------------------------------
+
+
+
+Figure 3: KL divergence for Gaussian targets of varying dimensionality. The figure consists of three subplots (a, b, c) showing the KL divergence D\_KL(mu\_theta || mu^\*) on a logarithmic y-axis (from 10^-4 to 10^1) against time elapsed (n x #iters) on the x-axis (from 0 to 300). Subplot (a) is for d = 10, (b) for d = 50, and (c) for d = 200. Each subplot compares four methods: BWGD (blue line), SGVI (red line), SVRGVI (ours) (black line), and EVI (yellow dashed line). In all cases, SVRGVI (ours) shows the lowest KL divergence, indicating the best performance. The performance gap between SVRGVI and the other methods increases as the dimensionality d increases.
+
+Figure 3: KL divergence for Gaussian targets of varying dimensionality.
+
+Appendix B.7), fix the covariate coefficient $c = 0.9$ (for an experiment on the effect of $c$ , see Appendix B.6), and show results for 10 runs, with bold line showing the average performance. The comparisons are shown as convergence curves, as the per-iteration cost of all methods is almost identical. We also compare against a full-rank Gaussian approximation optimised in the Euclidean geometry (denoted as EVI), using low-variance reparameterization gradients of Roeder et al. (2017) with ADAM optimizer, and Laplace approximation that does not optimize the KL divergence but fits a Gaussian distribution at the target mode; see Appendix B for details. As the per-iteration cost of these methods is different from the BW methods, we only report the final accuracy for carefully optimized approximations to show how the BW methods compare against commonly used algorithm. The Laplace approximation is omitted for Gaussian targets as it is optimal by definition.
+
+**Gaussian targets** We randomly generate the means and covariances for a multivariate Gaussian target distribution $\pi$ , considering dimensions of $\{10, 50, 200\}$ . Fig. 3 demonstrates consistent significant improvement over SGVI and BWGD. For example, for $d = 200$ , the the difference between SVRGVI and SGVI/BWGD is 5 orders of magnitude, $10^{-2}$ versus $10^3$ . Fig. 1 shows visually the marginals for $d = 50$ , providing an interpretation of the improvement seen in KL-divergence. We also clearly outperform EVI in higher dimensions, unlike previous BW methods.
+
+**Student’s t targets** We consider a multivariate Student’s t target with a degree of freedom of 4 in 200 dimensions. Fig. 4 (a) shows that our algorithm is again clearly the best. BWGD is not stable and, on average, performs worse than even the Laplace approximation.
+
+**Bayesian logistic regression** We consider a Bayesian logistic regression with a flat prior as in Diao et al. (2023): given a set of covariates $X_i \sim \mathcal{N}(0, I_d)$ for $i = 1, 2, \dots, n$ , consider
+
+$$Y_i | X_i, \theta \sim \text{Bernoulli}(\sigma(\langle \theta, X_i \rangle)), \text{ where } \sigma \text{ is the sigmoid function.}$$
+
+The negative log posterior is $V(\theta) = \sum_{i=1}^n [\ln(1 + e^{\langle \theta, X_i \rangle}) - Y_i \langle \theta, X_i \rangle]$ . The model consists of $n = 1000$ data points $(X_i, Y_i)$ with dimension $d = 200$ . The optimal solution is unknown in this case, so we cannot plot the KL divergence along the iterations. Instead, we estimate the objective function of the problem (2), $\mathcal{F}(\mu_k)$ , by drawing samples from $\mu_k$ . We denote by $\mu_{\text{best}}$ the distribution that obtains the smallest $\mathcal{F}$ among all iterations of all algorithms, comparing against that. Fig. 4 (b) shows the proposed method is again the most accurate.
+
+We also measured the variance along iterations in Appendix B.4, showing that we achieved variance reduction empirically. We showed in Appendix B.5 that the proposed method is more efficient than minibatching (whether using i.i.d. or quasi Monte-Carlo samples).
+
+## 6 DISCUSSION
+
+Various variance reduction techniques have been broadly studied in the VI literature, but mainly for methods operating in the Euclidean parameter space. Our work resembles in nature the seminal work of Roeder et al. (2017) that demonstrated how the variance of gradient estimators for VI can be dramatically reduced by a single-line change in the algorithm: We also propose a minor
+
+{9}------------------------------------------------
+
+
+
+Figure 4: Performance of algorithms for Student's t target and Bayesian logistic regression. The figure contains two line plots. Plot (a) is titled 'D\_{KL}(p\_t || \hat{p}) (empirical)' and plot (b) is titled 'F(p\_t) - F(p\_{BWGD}) (empirical)'. Both plots show the performance of five algorithms: BWGD (blue solid line), SGVI (red solid line), SVRGVI (ours) (black solid line), Laplace (green dashed line), and EVI (yellow dashed line) over 300 time elapsed units (n x #iters). In both plots, SVRGVI (ours) shows the lowest loss, indicating the best performance, while the other algorithms show higher and more stable losses.
+
+Figure 4: Performance of algorithms for Student’s t target and Bayesian logistic regression.
+
+modification that dramatically improves the accuracy, and should always be used. A high-level similarity lies in the heuristic that the VI distribution resembles the target distribution, allowing it to be used to construct control variates. Perhaps surprisingly, Yi & Liu (2023) recently showed that the continuous-time flow of Roeder et al. (2017) for Gaussian VI in the Euclidean geometry (by reparameterizing the covariance matrix as $\Sigma = SS^\top$ ) also follows Särkkä’s ODEs. In other words, those BW methods and Roeder et al. (2017) are different discretizations of the same dynamics. Recent works (Kim et al., 2023; Domke et al., 2024) have advanced our understanding of variance reduction in Euclidean VI, demonstrating strong convergence and extending beyond traditional control variate approaches. Adopting these new techniques in the BW setting is a promising research direction.
+
+In the BW space, Diao (2023) considers variance reduction for large-sum structures based on the nested-loop idea by Johnson & Zhang (2013) to reduce the stochasticity of the minibatch sampling. In contrast, our method addresses the stochasticity arising from Gaussian sampling from the VI.
+
+Even though our experiments focused on synthetic targets, they expanded on the previous experimentation of VI optimized in the BW space. We confirm the finding of Diao et al. (2023) that BWGD and SGVI are effectively identical except for the instability of the former, but now show how their performance degrades in higher dimensions while our algorithm remains effective.
+
+With the exception of the vastly improved accuracy due to the significantly lower variance of the gradient estimators, our method retains all qualitative characteristics of the previous BW methods, both positive and negative. That is, we retain the theoretical convergence guarantees and asymptotic optimality for posterior inference, but also the cubic computational cost due to requiring the Hessian of the log-target and the limitation to Gaussian approximations by construction. As highlighted by Xu & Campbell (2022) and Quiroz et al. (2023), there are tasks for which Gaussian approximations are highly relevant due to efficiently capturing the correlations.
+
+## 7 CONCLUSION
+
+Our main result is showing that the methods learning a variational approximation by direct optimization of the approximating distribution in the Bures–Wasserstein space of Gaussians can be made practical. The previous works by Lambert et al. (2022) and Diao et al. (2023) introduced the key idea and the algorithms with strong theoretical guarantees. However, they are prone to high variance from Monte Carlo approximations, limiting the impact. Our variance reduction technique that requires only a minor modification for the SVGI algorithm completely resolves this issue, resulting in extremely stable learning.
+
+We demonstrated substantial variance reduction and showed that this reduction results in orders of magnitude improvement in final approximation accuracy, over both the previous BW methods and examples of parameter-space algorithms. This improvement comes with provable variance reduction in the neighborhood of the optimal solution and for all distributions with sufficiently large variance in the case of strong log-concave targets, and hence the proposed variance reduction technique should always be used.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/kVlfYvIqaK.txt b/papers/kVlfYvIqaK.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5dd27f559f477de57667af62829d7869da0c5a70
--- /dev/null
+++ b/papers/kVlfYvIqaK.txt
@@ -0,0 +1,285 @@
+**Primary Area:** learning on graphs and other geometries & topologies
+
+
+
+{0}------------------------------------------------
+
+# NODE-TIME CONDITIONAL PROMPT LEARNING IN DYNAMIC GRAPHS
+
+Xingtong Yu1\*, Zhenghao Liu2\*, Xinming Zhang2†, Yuan Fang1†
+
+Singapore Management University1, University of Science and Technology of China2
+ {xingtongyu, yfang}@smu.edu.sg, salzh@mail.ustc.edu.cn, xinming@ustc.edu.cn
+
+## ABSTRACT
+
+Dynamic graphs capture evolving interactions between entities, such as in social networks, online learning platforms, and crowdsourcing projects. For dynamic graph modeling, dynamic graph neural networks (DGNNs) have emerged as a mainstream technique. However, they are generally pre-trained on the link prediction task, leaving a significant gap from the objectives of downstream tasks such as node classification. To bridge the gap, prompt-based learning has gained traction on graphs, but most existing efforts focus on static graphs and neglect the evolution of dynamic graphs. In this paper, we propose DYGPROMPT, a novel pre-training and prompt learning framework for dynamic graph modeling. First, we design *dual prompts* to address the discrepancy in both task objectives and temporal variations across pre-training and downstream tasks. Second, we recognize that node and time patterns often characterize each other, and propose *dual condition-nets* to model the evolving node-time patterns in downstream tasks. Finally, we thoroughly evaluate and analyze DYGPROMPT through extensive experiments on four public datasets.
+
+## 1 INTRODUCTION
+
+Graph data are pervasive due to their ability to model complex relationships between entities in various applications, including social network analysis (Fan et al., 2019; Yu et al., 2023c), Web mining (Xu et al., 2022; Wang et al., 2023), and content recommendation systems (Qu et al., 2023; Zhang et al., 2024). In many of these applications, the graph structures evolve over time, such as users commenting on posts in a social network (Kumar et al., 2018; Iba et al., 2010), editing pages in a crowdsourcing project like Wikipedia (Kumar et al., 2015), or interacting with courses in an online learning platform (Liyanagunawardena et al., 2013). Such graphs are termed *dynamic* graphs (Barros et al., 2021; Skarding et al., 2021), in contrast to conventional *static* graphs that maintain an unchanging structure.
+
+On dynamic graphs, dynamic graph neural networks (DGNNs) (Pareja et al., 2020; Xu et al., 2020) have been widely applied. In a typical design for DGNNs, each node updates its representation by iteratively receiving and aggregating messages from its neighbors in a time-dependent manner. While DGNNs are often pre-trained on the link prediction task, the downstream application could involve a different task, such as node classification, leading to a significant gap between pre-training and task objectives. More advanced pre-training and fine-tuning strategies on dynamic graphs (Bei et al., 2024; Chen et al., 2022; Tian et al., 2021) also suffer from the same limitation. They first pre-train a model for dynamic graphs based on various task-agnostic self-supervised signals on the graph, and then update the pre-trained model weights in a fine-tuning phase based on task-specific labels pertinent to the downstream application. Likewise, the pre-training and downstream objectives can differ significantly, resulting in a notable gap between them.
+
+To bridge the gap between pre-training and downstream objectives (Liu et al., 2023a), prompt learning has first emerged in language models (Brown et al., 2020). Fundamentally, a prompt serves to reformulate the input for the downstream task to align with the pre-trained model, while freezing
+
+\*Co-first authors.
+
+†Corresponding authors.
+
+{1}------------------------------------------------
+
+
+
+Figure 1 consists of two parts. Part (a) is a diagram titled "Users' comments over time". It shows a horizontal timeline at the top with three markers: "Morning", "Noon", and "Night", with a sub-label "User specific timeline". Below the timeline, there are three columns of icons and text. The "Morning" column shows a "Professor" icon with a document and a "Student" icon with a game controller, connected by a dashed line labeled "Link prediction at morning?". The "Noon" column shows a "Divergent objective" icon with a document and a "Node classification at noon?" icon with a person silhouette, connected by a dashed line labeled "Dynamic variation". The "Night" column shows a "night" icon with a document and a "night" icon with a game controller, connected by a dashed line. A vertical blue arrow on the right is labeled "Time-specific user behavior". Part (b) is a scatter plot titled "Evolutioning node-time patterns". The x-axis is labeled "User" and ranges from 1 to 20. The y-axis is labeled "Post" and ranges from 0 to 7000. The plot shows red dots representing comments. A color bar on the right is labeled "Time Progression from Start to End" and ranges from 0 to 7000. The dots are more densely packed in the lower-left region and become more sparse towards the upper-right.
+
+Figure 1: Motivation of DyGPrompt. (a) Users' comments over time: A timeline showing a user's activity across different topics (Professor, Student, Divergent objective) at different times (Morning, Noon, Night). (b) Evolving node-time patterns: A scatter plot showing the density of comments over time for a specific user, with a color scale indicating the time progression from start to end.
+
+Figure 1: Motivation of DyGPrompt. (a) Users comment on different topics over time. (b) Evolving node-time patterns in Wikipedia, as node and time mutually characterize each other.
+
+the pre-trained weights. Given far fewer parameters in a prompt than the pre-trained model, prompt learning is parameter-efficient and effective especially in data-scarce scenarios (Yu et al., 2024a). Inspired by the success of prompts in the language domain, recent studies have explored prompt learning on graphs (Liu et al., 2023b; Sun et al., 2022b; 2023). However, these studies only focus on static graphs, neglecting the unique challenges brought by dynamic graphs. In this work, we explore **Prompt** learning for **Dynamic Graphs**, and propose a framework called **DyGPrompt**. The problem is non-trivial due to two key challenges.
+
+First, how do we design prompts to *bridge temporal variations across time, in addition to divergent task objectives*? Generally, both task objectives and the timing of pre-training and downstream tasks can be inconsistent. For example, consider a user discussion network such as Reddit.com, as illustrated in Fig. 1(a), where users and posts are represented as nodes, and an edge is formed when a user comments on a post. On this dynamic graph, a typical pre-training task involves link prediction—predicting whether a user comments on (i.e., links to) a video game post at time $t_1$ . In contrast, the downstream task could be the status classification of the user’s account, e.g., determining whether it has been suspended at time $t_2$ . While previous work on static graphs (Liu et al., 2023b; Sun et al., 2022b; 2023) employs prompts to narrow the task objective gap, the temporal gap remains unsolved. In particular, even when the downstream task also involves link prediction, the evolving graph structure introduces a temporal gap between the pre-training and downstream phases. In DyGPrompt, we introduce dual prompts, consisting of a *node prompt* and a *time prompt*. On the one hand, a *node prompt* alters the node features to reformulate task input and bridge the task gap, similar to previous work (Liu et al., 2023b; Fang et al., 2024). On the other hand, a *time prompt* adjusts the time features, capturing the temporal evolution of the dynamic graph, thereby narrowing inconsistencies that arise from varying priorities at different times.
+
+Second, how do we capture *evolving patterns across different nodes and time points, driven by the dynamic interplay between them*? Different nodes exhibit unique timelines, evolving distinctively over time as nodes and time mutually influence each other. For example, in the user discussion network, a student may comment on open source code in the morning, while commenting on video games in the evening. However, as shown in Fig. 1(a), a professor may comment on academic policies at noon, while discussing family topics at night. Therefore, node and time patterns mutually characterize each other: the behavior of the same node may be influenced by different times, while the behavior of a node at a specific time may be influenced by the characteristics of the node. Hence, the evolving node-time patterns, as shown in Fig. 1(b), may differ from the patterns observed in the pre-training data. However, previous studies neglect the fine-grained interplay between the node and time patterns downstream. Note that some works (Tan et al., 2023; Wen & Fang, 2023) have designed individual prompts or tokens tailored to each node, and a contemporary approach (Chen et al., 2024) has developed time-aware prompts. However, they do not account for the mutual characterization between nodes and time, failing to capture the fine-grained, evolving node-time patterns. In DyGPrompt, inspired by conditional prompt learning (Zhou et al., 2022), we propose a series of node and time prompts generated by *dual condition-nets*. Specifically, a *time condition-net* generates a sequence of time-conditioned node prompts for each node. These time-conditioned node prompts reflect temporal subtleties at different times for the same node, thereby better aligning
+
+{2}------------------------------------------------
+
+the node’s pattern at different times with those observed during pre-training compared to using a fixed node prompt across all time points. Likewise, a *node condition-net* generates a sequence of node-conditioned time prompts at each timestamp. The node-conditioned time prompts account for node characteristics, thereby better aligning the time patterns of different nodes with those captured by the pre-trained model compared to using a fixed time prompt for all nodes. It is worth noting that the condition-nets generate prompts conditioned on the input features rather than directly parameterizing the prompts, significantly reducing the number of learnable parameters in the downstream prompt-tuning phase.
+
+In summary, the contributions of this work are threefold. (1) We introduce DYG PROMPT for dynamic graph modeling, proposing dual prompts to narrow the gaps arising from both task and dynamic differences between pre-training and downstream phases. (2) We recognize that node and time patterns mutually characterize each other and further propose dual condition-nets to generate a series of node and time prompts, thereby adapting to downstream node-time patterns. (3) We conduct extensive experiments on four benchmark datasets, demonstrating the superior performance of DYG PROMPT in comparison to state-of-the-art approaches.
+
+## 2 RELATED WORK
+
+**Dynamic graph learning.** Real-world graph structures often evolve over time. To model such dynamic evolution, various *continuous-time* dynamic graph learning techniques have been proposed. Typically, these methods update node representations by iteratively receiving and aggregating messages from their neighbors in a time-dependent manner (Skarding et al., 2021; Duan et al., 2024). Some approaches employ dynamic random walks to depict structural changes (Nguyen et al., 2018; Wang et al., 2021), while others incorporate a time encoder to integrate temporal context with structural modeling (Xu et al., 2020; Cong et al., 2022; Rossi et al., 2020; Yu et al., 2023a). Furthermore, some researchers utilize temporal point processes to model structural evolution or node communications (Kumar et al., 2019; Trivedi et al., 2019; Wen & Fang, 2022). However, these methods are typically trained on link prediction tasks, whereas downstream applications may involve different tasks, such as node classification, creating a significant gap between training and task objectives. This gap impedes effective knowledge transfer, adversely impacting downstream task performance.
+
+**Graph pre-training.** More advanced dynamic graph pre-training methods also face similar problems. Extending from graph pre-training methods (Hu et al., 2020a;b; Jiang et al., 2023), dynamic graph pre-training captures inherent properties of dynamic graphs using various task-agnostic, self-supervised signals through strategies such as structural and temporal contrastive learning (Bei et al., 2024; Tian et al., 2021; Li et al., 2022), dynamic graph generation (Chen et al., 2022), and curvature-varying Riemannian graph neural networks (Sun et al., 2022a). They then attempt to transfer the prior knowledge to downstream tasks through fine-tuning with task-specific supervision. Nonetheless, a gap persists between the objectives of pre-training and fine-tuning (Liu et al., 2023a; 2023a; Yu et al., 2023d). While pre-training seeks to extract fundamental insights from graphs without supervision, fine-tuning is tailored to specific supervision for a given downstream task.
+
+**Graph prompt learning.** First emerging in the language domain, prompt learning effectively bridges the gap between pre-training and downstream objectives (Brown et al., 2020). With a unified template, prompts are specifically tailored for each downstream task, aligning it more closely with the pre-trained model while freezing the pre-trained weights. Prompt learning has been widely adopted on static graphs (Liu et al., 2023b; Sun et al., 2023; Fang et al., 2024; Tan et al., 2023; Yu et al., 2023d; 2025b; 2024b; 2025a;c; 2023b), yet its application in dynamic graphs remains an open question. A contemporary study, TiGPrompt (Chen et al., 2024), proposes a prompt generator to learn time-aware node prompts. However, it only considers the temporal factor in node features, overlooking that time prompts for each node can also be influenced by node features.
+
+## 3 PRELIMINARIES
+
+In this section, we present related preliminaries and introduce our scope.
+
+{3}------------------------------------------------
+
+**Dynamic graph.** Dynamic graphs are categorized into *discrete-time* dynamic graphs and *continuous-time* dynamic graphs (Skarding et al., 2021). The former consists of a series of static graph snapshots, whereas the latter is depicted as a sequence of events on a continuous timeline. In this work, we adopt the more general continuous-time definition, where a *dynamic graph* is represented by $G = (V, E, T)$ . Here, $V$ denotes the set of nodes, $E$ denotes the set of edges, and $T$ represents the time domain. In particular, each edge $(v_i, v_j, t) \in E$ indicates a specific interaction (or event) between nodes $v_i$ and $v_j$ at time $t$ . Each node is associated with a temporal feature vector $\mathbf{x}_{t,v} \in \mathbb{R}^d$ evolving over time, represented as a row in the temporal feature matrix $\mathbf{X}_t \in \mathbb{R}^{|V| \times d}$ .
+
+**Dynamic graph neural network.** A popular backbone for static graphs is message-passing graph neural networks (GNNs) (Wu et al., 2020). Formally, in the $l$ -th GNN layer, the embedding of node $v$ , represented as $\mathbf{h}_v^l$ , is calculated based on the embeddings from the preceding layer:
+
+$$\mathbf{h}_v^l = \text{Aggr}(\mathbf{h}_v^{l-1}, \{\mathbf{h}_u^{l-1} : u \in \mathcal{N}_v\}), \quad (1)$$
+
+where $\mathcal{N}_v$ denotes the set of neighboring nodes of $v$ , and $\text{Aggr}(\cdot)$ is a neighborhood aggregation function. Extending to dynamic graph neural networks (DGNNs), researchers integrate temporal contexts into neighborhood aggregation (Pareja et al., 2020; Xu et al., 2020), often utilizing a *time encoder* (TE) to map timestamps or intervals (Cong et al., 2022; Rossi et al., 2020) within a *dynamic graph encoder* (DGE). Consequently, in the $l$ -th layer of a dynamic graph encoder, the embedding of node $v$ at time $t$ , denoted by $\mathbf{h}_{t,v}^l$ , is derived as
+
+$$\mathbf{h}_{t,v}^l = \text{Aggr}(\text{Fuse}(\mathbf{h}_{t,v}^{l-1}, \text{TE}(t)), \{\text{Fuse}(\mathbf{h}_{t',u}^{l-1}, \text{TE}(t')) : (u, t') \in \mathcal{N}_v\}), \quad (2)$$
+
+where $\mathcal{N}_v$ contains the historical neighbors of $v$ , with $(u, t') \in \mathcal{N}_v$ indicating that $u$ interacts with $v$ at time $t' < t$ . $\text{Fuse}(\cdot)$ is a fusion operation that integrates structural and temporal contexts, such as concatenation (Rossi et al., 2020) or addition (Trivedi et al., 2019). For simplicity, the output node embedding from the final layer is denoted as $\mathbf{h}_{t,v}$ , which is then utilized in a loss function for optimization. Note that the time encoder maps the time domain to a vector space, $\text{TE} : T \rightarrow \mathbb{R}^d$ . A common implementation is $\text{TE}(t) = \frac{1}{\sqrt{d}}[\cos(\omega_1 t), \sin(\omega_1 t), \dots, \cos(\omega_{d/2} t), \sin(\omega_{d/2} t)]$ , where $\{\omega_1, \dots, \omega_{d/2}\}$ is a set of learnable parameters (Xu et al., 2020; Cong et al., 2022).
+
+**Scope of work.** In this work, we pre-train a DGNN with a time encoder on dynamic graphs, employing the task of temporal link prediction (Wang et al., 2021). For downstream tasks, we target two popular dynamic graph-based tasks, namely, temporal node classification and temporal link prediction1. Specifically, we focus on *data-scarce scenarios* with only limited data for downstream adaptation, as labeled data are often difficult or costly to obtain for node classification (Zhou et al., 2019; Yao et al., 2020), while nodes with sparse interactions are common in real-world link prediction tasks (Lee et al., 2019; Pan et al., 2019).
+
+## 4 PROPOSED APPROACH
+
+In this section, we present our proposed model DYGPROMPT, starting with its overall framework, followed by its key components.
+
+### 4.1 OVERALL FRAMEWORK
+
+We illustrate the overall framework of DYGPROMPT in Fig. 2, which consists of two phases: pre-training and downstream adaptation. First, given a dynamic graph in Fig. 2(a), we pre-train a DGNN based on temporal link prediction, as shown in Fig. 2(b). In particular, we employ a universal task template based on similarity calculation (Liu et al., 2023b), which unifies different graph-based tasks, such as link prediction and node classification, across the pre-training and downstream phases. Second, given a pre-trained DGNN, to enhance its adaptation to downstream tasks, we propose *dual prompts*, as shown in Fig. 2(c). The dual prompts comprise a *node prompt* and a *time prompt*, aiming to bridge the gaps caused by different task objectives and dynamic variations, respectively. Moreover, extending the dual prompts, we propose *dual condition-nets* to generate a
+
+1As dynamic graphs focus on the evolving structures within a graph, graph classification is rarely evaluated as a task (Skarding et al., 2021; Pareja et al., 2020; Xu et al., 2020; Chen et al., 2024).
+
+{4}------------------------------------------------
+
+
+
+Figure 2: Overall framework of DyGPROMPT. (a) Toy dynamic graph: A sequence of graphs at time steps t0, t1, t2, t3. A 'Time encoder' takes time steps as input. A 'Dynamic graph encoder' takes node features and time predictions. (b) Pre-training: A graph with nodes v, a, b at time t. The 'Pre-training loss (Eq. 3)' is calculated based on the similarity between nodes v and b. (c) Prompt tuning for downstream tasks: A 'Pre-trained dynamic graph encoder' and 'Pre-trained time encoder' are used. A 'Node prompt' and 'Time prompt' are generated. These are combined with node features and time features using element-wise multiplication (X) and addition (+) to produce 'Time-conditioned node prompt' and 'Node-conditioned time prompt'. These are then used for 'Node class prediction' leading to 'Loss (Eq. 11)'. A 'Frozen' block indicates that the pre-trained parameters are kept fixed.
+
+Figure 2: Overall framework of DyGPROMPT.
+
+series of time-conditioned node prompts and node-conditioned time prompts. These conditional prompts are designed to capture the evolving patterns across nodes and time points, along with their mutual characterization, in a fine-grained and parameter-efficient manner.
+
+### 4.2 PRE-TRAINING
+
+Pre-training techniques (Le-Khac et al., 2020) have been widely explored on dynamic graphs (Bei et al., 2024; Chen et al., 2022; Tian et al., 2021). In particular, the most common pre-training task is temporal link prediction (Xu et al., 2020; Rossi et al., 2020), where links are readily available without the need for manual annotations. Following these prior works, we adopt link prediction for pre-training, as illustrated in Fig. 1(b). Its simplicity underscores the effectiveness and robustness of our prompt-based learning in downstream tasks.
+
+Specifically, consider an event $(v, a, t)$ , i.e., an interaction between nodes $v$ and $a$ at time $t$ . Correspondingly, we construct a tuple $(v, a, b, t)$ such that nodes $v$ and $b$ are not linked at $t$ , serving as a contrastive signal. For each tuple, the pre-training objective is to maximize the similarity between nodes $v$ and $a$ while minimizing that between $v$ and $b$ . Similar to previous work (You et al., 2020; Yu et al., 2023d), we optimize the following pre-training loss over pre-training data, $\mathcal{D}_{\text{pre}}$ .
+
+$$\mathcal{L}_{\text{pre}}(\mathcal{D}_{\text{pre}}; \Theta) = - \sum_{(v,a,b,t) \in \mathcal{D}_{\text{pre}}} \ln \frac{\exp(\frac{\tau}{2} \text{sim}(\mathbf{h}_{t,v}, \mathbf{h}_{t,a}))}{\exp(\frac{\tau}{2} \text{sim}(\mathbf{h}_{t,v}, \mathbf{h}_{t,b}))}. \quad (3)$$
+
+In Eq. (3), $\mathbf{h}_{t,v}, \mathbf{h}_{t,a}, \mathbf{h}_{t,b}$ represent the node embeddings of $v, a, b$ at time $t$ , respectively. $\tau > 0$ is a temperature hyperparameter. $\Theta$ denotes the set of learnable parameters of the DGNN, including those of the dynamic graph encoder and the time encoder. The pre-trained parameters, $\Theta_{\text{pre}} = \arg \min_{\Theta} \mathcal{L}_{\text{pre}}(\mathcal{D}_{\text{pre}}; \Theta)$ , will be used to initialize the downstream models.
+
+### 4.3 DUAL PROMPTS
+
+To reconcile task and temporal variations across pre-training and downstream tasks, we propose *dual prompts*, comprising a node prompt and a time prompt, as shown in Fig. 2(c).
+
+**Node prompt.** In language models, a prompt is a purposely designed textual description that reformulates the input for a downstream task, aligning the task with the pre-trained model (Brown et al., 2020; Jia et al., 2021). Likewise, a prompt for static graphs adjusts downstream node features (Liu et al., 2023b; Fang et al., 2024). In line with previous graph prompt learning methods on static graphs (Liu et al., 2023b; Yu et al., 2023d; 2025b), for each downstream task, we define a learnable vector $\mathbf{p}^{\text{node}}$ as the node prompt to modify the node features at a given time via element-wise multiplication. Concretely, the input features of node $v$ at time $t$ , denoted by $\mathbf{x}_{t,v}$ , are modified as:
+
+$$\mathbf{x}_{t,v}^{\text{node}} = \mathbf{p}^{\text{node}} \odot \mathbf{x}_{t,v}, \quad (4)$$
+
+where $\odot$ is element-wise multiplication. The node prompt $\mathbf{p}^{\text{node}}$ has the same dimension as node features, altering the importance of various node feature dimensions.
+
+{5}------------------------------------------------
+
+**Time prompt.** We adopt a time encoder TE to map the continuously valued time $t$ to time features, $\tilde{\mathbf{f}}_t = \text{TE}(t)$ . However, TE is optimized based on the time periods in the pre-training data, which can be distinct from those in downstream tasks. To overcome the temporal gap, we propose a time prompt to adjust time features. Formally, for each downstream task, we define a learnable vector $\mathbf{p}^{\text{time}}$ as the *time prompt*. Then, the time feature at $t$ , denoted by $\tilde{\mathbf{f}}_t$ , is reformulated as follows.
+
+$$\tilde{\mathbf{f}}_t^{\text{time}} = \mathbf{p}^{\text{time}} \odot \tilde{\mathbf{f}}_t. \quad (5)$$
+
+### 4.4 DUAL CONDITION-NETS
+
+In dynamic graphs, the same node may exhibit distinct behaviors at different times. Meanwhile, different nodes may evolve differently over the same time interval. In other words, nodes and their temporal patterns influence and characterize each other over time, revealing fine-grained node-time patterns. To capture such interplay, we turn to conditional prompt learning (Zhou et al., 2022). Instead of learning a static prompt tailored to a specific task over the entire time span, we design *dual condition-nets*, comprising a time condition-net that generates a sequence of time-conditioned node prompts for each node and a node condition-net that generates a sequence of node-conditioned time prompts at each timestamp, as shown in Fig. 2(c). In particular, each condition-net utilizes a lightweight network to generate prompts conditioned on the input features, enabling a more parameter-efficient approach to prompt tuning compared to directly parameterizing the prompts for each node and timestamp.
+
+**Time condition-net.** To incorporate time characteristics into node prompts, a straightforward way is to employ a series of learnable vectors as prompts for each distinct timestamp. However, this approach does not scale to large time intervals with many timestamps, as it quickly increases the number of tunable parameters. Therefore, we propose a *time condition-net*, which generates a series of *time-conditioned node prompts*. Formally, the node prompt conditioned on time $t$ is given by
+
+$$\tilde{\mathbf{p}}_t^{\text{node}} = \text{TCN}(\tilde{\mathbf{f}}_t^{\text{time}}; \kappa), \quad (6)$$
+
+where TCN is the time condition-net parameterized by $\kappa$ . This can be viewed as a form of hypernetwork (Ha et al., 2022), where our condition-net TCN serves as a secondary network to generate the node prompts conditioned on the input time features. This formulation enables parameter-efficient prompt generation, especially when using a lightweight condition-net. In our implementation, we opt for a simple multi-layer perceptron (MLP) with an efficient bottleneck structure (Wu & Lee, 2018). Therefore, for a series of events occurring at times $\{t_0, t_1, \dots\}$ , the time condition-net produces their corresponding time-conditioned node prompts $\{\tilde{\mathbf{p}}_{t_0}^{\text{node}}, \tilde{\mathbf{p}}_{t_1}^{\text{node}}, \dots\}$ . Note that these conditional prompts match the dimensionality of the node features. Then, the features of node $v$ at time $t$ , which have been modified by the node prompt in Sect. 4.3, are further updated as
+
+$$\tilde{\mathbf{x}}_{t,v}^{\text{node}} = \tilde{\mathbf{p}}_t^{\text{node}} \odot \mathbf{x}_{t,v}^{\text{node}}. \quad (7)$$
+
+**Node condition-net.** Similarly, to incorporate node characteristics into time prompts, we propose a *node condition-net* to generate a series of *node-conditioned time prompts*, mirroring the time condition-net. The time prompt conditioned on the node features of $v$ at time $t$ is given by
+
+$$\tilde{\mathbf{p}}_{t,v}^{\text{time}} = \text{NCN}(\mathbf{x}_{t,v}^{\text{node}}; \phi), \quad (8)$$
+
+where NCN is the node condition-net parameterized by $\phi$ , which is also implemented as an MLP with a bottleneck structure. Consequently, at time $t$ , a series of node-conditioned time prompts $\{\tilde{\mathbf{p}}_{t,v_0}^{\text{time}}, \tilde{\mathbf{p}}_{t,v_1}^{\text{time}}, \dots\}$ is generated for all nodes, which have the same dimension as the time features. These node-specific time prompts are then applied to each node at time $t$ , as follows.
+
+$$\tilde{\mathbf{p}}_{t,v}^{\text{time}} = \tilde{\mathbf{p}}_{t,v}^{\text{time}} \odot \tilde{\mathbf{f}}_t^{\text{time}}. \quad (9)$$
+
+### 4.5 PROMPT TUNING
+
+Finally, the features adjusted by the prompts are fed into the dynamic graph encoder, DGE. The embedding of node $v$ at time $t$ is calculated as follows:
+
+$$\mathbf{h}_{t,v} = \text{DGE} \left( \text{Fuse}(\tilde{\mathbf{x}}_{t,v}^{\text{node}}, \tilde{\mathbf{p}}_{t,v}^{\text{time}}), \left\{ \text{Fuse}(\tilde{\mathbf{x}}_{t',u}^{\text{node}}, \tilde{\mathbf{p}}_{t',v}^{\text{time}}) : (u, t') \in \mathcal{N}_v \right\} \right). \quad (10)$$
+
+{6}------------------------------------------------
+
+To tune the prompts and condition-nets for a downstream task, we adopt similarity calculation as the task template (Liu et al., 2023b), consistent with the pre-training loss. Specifically, for temporal node classification, consider a labeled set $\mathcal{D}_{\text{down}} = \{(v_1, y_1, t_1), (v_2, y_2, t_2), \dots\}$ , where each $v_i$ denotes a node, and $y_i \in Y$ is the class label of $v_i$ at time $t_i$ . Then, the downstream loss is
+
+$$\mathcal{L}_{\text{down}}(\mathcal{D}_{\text{down}}; \mathbf{p}^{\text{node}}, \mathbf{p}^{\text{time}}, \kappa, \phi) = - \sum_{(v_i, y_i, t_i) \in \mathcal{D}_{\text{down}}} \ln \frac{\exp(\frac{1}{2} \text{sim}(\mathbf{h}_{t_i, v_i}, \bar{\mathbf{h}}_{t_i, y_i}))}{\sum_{y \in Y} \exp(\frac{1}{2} \text{sim}(\mathbf{h}_{t_i, v_i}, \bar{\mathbf{h}}_{t_i, y}))}, \quad (11)$$
+
+where $\bar{\mathbf{h}}_{t_i, y}$ represents class $y$ 's prototype embeddings (Liu et al., 2023b) at time $t_i$ , which is obtained by the mean embeddings of examples in class $y$ at time $t_i$ . For temporal link prediction, we utilize the same loss as the pre-training loss in Eq. (3).
+
+During prompt tuning, we only update the lightweight dual prompt vectors ( $\mathbf{p}^{\text{node}}, \mathbf{p}^{\text{time}}$ ) and the parameters of the dual condition-nets ( $\kappa, \phi$ ), whilst freezing the pre-trained DGNN weights. This parameter-efficient tuning approach is amenable to label-scarce settings, where $\mathcal{D}_{\text{down}}$ comprises only a limited number of training examples. We outline the key steps for prompt tuning in Algorithm 1 in Appendix A and assess its complexity in Appendix B.
+
+## 5 EXPERIMENTS
+
+In this section, we conduct experiments to evaluate DyGPROMPT and analyze the empirical results.
+
+### 5.1 EXPERIMENTAL SETUP
+
+**Datasets.** We utilize four benchmark datasets for evaluation: *Wikipedia*, *Reddit*, *MOOC* and *Genre*. We provide further details of the datasets in Appendix C.
+
+**Downstream tasks.** We conduct temporal node classification and temporal link prediction to evaluate the performance of DyGPROMPT. For link prediction, we perform experiments in both transductive and inductive settings, depending on whether nodes in the testing set have appeared in the pre-training or downstream tuning data. In this study, we investigate the pre-training and prompt learning on dynamic graphs, which differs from previous DGNNs (Rossi et al., 2020; Xu et al., 2020). Therefore, we adopt a new data split to accommodate the pre-training and downstream tuning steps. Specifically, given a *chronologically ordered* sequence of events (i.e., edges with timestamps), we use the first 80% for pre-training. Note that we pre-train a DGNN only once for each dataset and subsequently employ the same pre-trained model for all downstream tasks. The remaining 20% of the events are used for downstream tasks. Specifically, they are further split into 1%/1%/18% subsets, where the first 1% is reserved as the training pool for downstream prompt tuning, and the next 1% as the validation pool, with the last 18% for downstream testing.
+
+To construct a downstream task, we start by sampling 30 events (about 0.01% of the whole dataset) from the training pool, ensuring that there is at least one user per class. Then, for node classification, we take the user nodes as training instances for downstream adaptation, and their ground-truth labels are given by their labels at the time of the corresponding event. For link prediction, the downstream training pool also helps with adaptation due to its temporal proximity to the test set. Specifically, we take the sampled events as positive instances, while further sampling one negative instance for each positive instance. Specifically, for each event $(v, a, t)$ , we sample one negative instance $(v, b, t)$ such that $b$ is a node taken from the training pool that is not linked to $v$ at time $t$ . The validation sets are constructed by repeating the same process on the validation pool. Finally, the test set for node classification simply comprises all user nodes in the testing events, while the test set for link prediction is expanded to include negative instances following a similar sampling process as in training. Furthermore, for inductive link prediction, we remove instances from the test set if their nodes have appeared in the pre-training or downstream training data. We repeat this sampling process for 100 times to construct 100 tasks for node classification and link prediction.
+
+**Evaluation.** To evaluate the performance on the tasks, we employ AUC-ROC for both node classification (Xu et al., 2020; Rossi et al., 2020) and link prediction (Sun et al., 2022a; Bei et al., 2024), following prior work. For each of the 100 tasks, we repeat the experiments with five different random seeds, and report the average and standard deviation over the 500 results.
+
+{7}------------------------------------------------
+
+Table 1: AUC-ROC (%) evaluation of temporal node classification and link prediction.
+
+| Methods | Node Classification | | | | Transductive Link Prediction | | | | Inductive Link Prediction | | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | Wikipedia | Reddit | MOOC | Genre | Wikipedia | Reddit | MOOC | Genre | Wikipedia | Reddit | MOOC | Genre |
+| GCN-ROLAND | 58.86±0.13 | 48.25±0.27 | 49.93±0.34 | 46.33±0.37 | 49.61±0.12 | 50.01±0.25 | 49.82±0.34 | 49.15±0.34 | 49.60±0.27 | 49.90±0.14 | 49.16±0.28 | 47.25±0.27 |
+| GAT-ROLAND | 62.81±0.98 | 47.95±0.42 | 50.01±0.34 | 47.26±0.43 | 52.34±0.82 | 50.04±0.98 | 55.74±0.37 | 47.69±0.81 | 52.29±0.97 | 49.85±0.35 | 54.01±0.16 | 49.38±0.72 |
+| TGAT | 67.00±0.35 | 53.64±0.50 | 59.27±0.43 | 51.26±0.31 | 55.78±0.03 | 62.43±0.36 | 51.49±0.30 | 69.11±0.99 | 48.21±0.55 | 57.30±0.70 | 51.42±0.27 | 48.34±0.72 |
+| TGN | 50.61±0.16 | 49.54±0.25 | 50.33±0.47 | 50.72±0.31 | 72.48±0.19 | 67.37±0.07 | 54.60±0.80 | 86.46±0.84 | 74.38±0.29 | 69.81±0.08 | 54.62±0.77 | 87.17±0.68 |
+| TREND | 69.92±0.27 | 64.85±0.31 | 66.79±0.44 | 50.34±0.46 | 63.24±0.71 | 80.42±0.60 | 58.70±0.03 | 52.78±0.15 | 50.15±0.99 | 65.13±0.54 | 57.53±0.01 | 45.31±0.61 |
+| GRAPHMIXER | 65.43±0.21 | 60.21±0.36 | 63.72±0.98 | 50.15±0.49 | 59.73±0.35 | 61.88±0.11 | 52.42±0.38 | 60.83±0.25 | 51.34±0.84 | 57.64±0.31 | 51.16±0.59 | 56.32±0.08 |
+| DDGCL | 65.15±0.45 | 55.21±0.19 | 62.34±0.13 | 50.91±0.08 | 54.96±0.46 | 61.68±0.81 | 55.62±0.30 | 68.49±0.31 | 47.98±0.11 | 55.90±0.13 | 55.18±0.23 | 42.70±0.26 |
+| CPDG | 43.56±0.41 | 65.92±0.25 | 50.32±0.06 | 49.89±0.31 | 52.86±0.64 | 59.72±0.53 | 53.82±0.30 | 49.71±0.64 | 47.37±0.23 | 55.40±0.17 | 53.58±0.20 | 40.01±0.36 |
+| GRAPHPROMPT | 73.78±0.62 | 60.86±0.57 | 64.60±0.76 | 51.28±0.43 | 55.67±0.26 | 67.46±0.31 | 51.07±0.08 | 86.78±0.14 | 48.46±0.28 | 59.18±0.49 | 50.27±0.58 | 87.45±0.27 |
+| ProG | 60.86±0.43 | 68.60±0.45 | 63.18±0.79 | 51.46±0.38 | 92.28±0.21 | 93.32±0.06 | 58.73±0.38 | 86.24±0.27 | 89.75±0.28 | 90.69±0.08 | 56.42±0.95 | 85.43±0.16 |
+| TGAT-TIGPROMPT | 69.21±0.88 | 67.07±0.64 | 73.90±0.68 | 51.38±0.72 | 59.54±0.41 | 78.45±0.44 | 51.69±0.24 | 69.71±0.16 | 49.29±0.85 | 65.06±0.68 | 51.58±0.42 | 48.34±0.28 |
+| TGN-TIGPROMPT | 44.80±0.48 | 63.75±0.60 | 55.42±0.60 | 50.84±0.75 | 82.04±0.20 | 83.26±0.38 | 65.00±0.43 | 86.25±0.43 | 79.51±0.97 | 79.51±0.58 | 64.98±0.61 | 86.19±0.06 |
+| TGAT-DYGPROMPT | 82.09 ±0.43 | 73.50 ±0.47 | 77.78 ±0.08 | 52.03 ±0.24 | 69.88±0.18 | 90.76±0.09 | 53.92±0.97 | 72.04±0.71 | 52.58±0.23 | 75.20±0.17 | 53.29±0.87 | 50.82±0.67 |
+| TGN-DYGPROMPT | 74.47 ±0.34 | 74.00 ±0.10 | 69.06±0.89 | 51.97 ±0.16 | 94.33 ±0.12 | 96.82 ±0.06 | 70.17 ±0.75 | 87.02 ±0.60 | 92.22 ±0.19 | 95.69 ±0.08 | 69.77 ±0.08 | 87.63 ±0.97 |
+
+Results are reported in percent. The best method is bolded and the runner-up is underlined.
+
+**Baselines.** The performance of DYGPROMPT is evaluated against state-of-the-art approaches across four main categories. (1) *Conventional DGNs*: We first consider a discrete-time framework ROLAND (You et al., 2022) that adapts static GNNs to DGNs by treating the node embeddings at each GNN layer as hierarchical node states and updating them recurrently over time. We employ GCN (Kipf & Welling, 2017) and GAT (Veličković et al., 2018) for ROLAND. Additionally, we compare to continuous-time DGNs, including TGAT (Rossi et al., 2020), TGN (Xu et al., 2020), TREND (Wen & Fang, 2022), and GraphMixer (Cong et al., 2023). For a fair comparison, these conventional DGNs are pre-trained on the first 80% of the events as well, and then continually trained on the same training data in each downstream task following our split. (2) *Dynamic graph pre-training*: DDGCL (Tian et al., 2021) and CPDG (Bei et al., 2024) follow the “pre-train, fine-tune” paradigm. They first pre-train a DGN, leveraging the intrinsic attributes and dynamic patterns of graphs. Then, they fine-tune the pre-trained model for downstream tasks based on task-specific training data. (3) *Static graph prompting*: GraphPrompt (Liu et al., 2023b) and ProG (Sun et al., 2023) employ a static prompt to adapt pre-trained GNNs to downstream tasks. Specifically, we employ DGNs as the pre-trained backbones—TGAT for GraphPrompt and TGN for ProG—as these combinations perform competitively with their respective prompting approaches. (4) *Dynamic graph prompting*: TIGPrompt (Chen et al., 2024) proposes a prompt generator to generate time-aware prompts. Note that both TIGPrompt and our method DYGPROMPT can be applied to different backbones, such as TGAT and TGN. More details on these baselines are described in Appendix D, with further implementation details for the baselines and DYGPROMPT in Appendix E.
+
+### 5.2 PERFORMANCE COMPARISON WITH BASELINES
+
+We compare the performance of all methods on temporal node classification and link prediction in Table 1 and make the following observations.
+
+First, DYGPROMPT achieves outstanding performance across node classification and link prediction tasks. This observation highlights the effectiveness of our proposed dual prompts and condition-nets. To further understand the impact of specific design choices in DYGPROMPT and its robustness to various backbones, we defer a detailed investigation to the ablation studies in Sect. 5.3 and the backbone analysis in Sect. 5.4. Second, TIGPrompt, the only other dynamic graph prompt learning method, significantly lags behind DYGPROMPT when using the same backbone. While it employs time-aware prompts, it lacks fine-grained node-time characterization and is thus unable to capture complex node-time patterns, where nodes and time mutually influence each other. Third, GraphPrompt and ProG perform competitively because we employ DGNs as their backbones in pre-training, rather than static GNNs. However, they still underperform compared to DYGPROMPT, as they only use static prompts.
+
+**REMARK.** It is worth noting that the results of TGAT and TGN in our experiments are lower than those reported in their original papers. A possible reason is that, in their original setting, these methods were trained on data that immediately precede the test set chronologically. In contrast, in our experiments, to maintain consistency with the pre-training setup, we train them in two stages: first with pre-training, and then downstream training on limited task data where we sample only
+
+{8}------------------------------------------------
+
+Table 2: Ablation study reporting AUC-ROC (%), with TGAT as the backbone.
+
+| Methods | Node prompt | Time prompt | NCN | TCN | Node classification | | | Transductive Link Prediction | | | Inductive Link Prediction | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | | | | | Wikipedia | Reddit | MOOC | Wikipedia | Reddit | MOOC | Wikipedia | Reddit | MOOC |
+| VARIANT 1 | ✓ | ✗ | ✗ | ✗ | 67.00 | 53.64 | 59.27 | 55.78 | 62.43 | 51.49 | 48.21 | 57.30 | 51.42 |
+| VARIANT 2 | ✗ | ✗ | ✗ | ✗ | 72.59 | 61.82 | 63.50 | 68.12 | 88.59 | 51.24 | 51.89 | 74.84 | 51.37 |
+| VARIANT 3 | ✗ | ✓ | ✗ | ✗ | 73.22 | 62.51 | 62.59 | 66.51 | 87.06 | 51.26 | 50.28 | 69.71 | 50.50 |
+| VARIANT 4 | ✓ | ✓ | ✗ | ✗ | 72.25 | 63.11 | 62.87 | 68.36 | 90.31 | 52.17 | 52.56 | 75.13 | 51.33 |
+| VARIANT 5 | ✓ | ✗ | ✓ | ✗ | 81.40 | 73.12 | 77.15 | 69.56 | 90.10 | 52.16 | 52.57 | 75.50 | 53.31 |
+| VARIANT 6 | ✓ | ✓ | ✓ | ✓ | 80.34 | 72.59 | 76.16 | 66.62 | 87.34 | 51.22 | 49.05 | 73.16 | 52.34 |
+| DYGPROMPT | ✓ | ✓ | ✓ | ✓ | 82.09 | 73.50 | 77.78 | 69.88 | 90.76 | 53.92 | 52.58 | 75.20 | 53.29 |
+
+Table 3: AUC-ROC (%) evaluation of DYGPROMPT with different DGNN backbones.
+
+| Pre-training Backbone | Downstream Adaptation | Node classification | | | Transductive link prediction | | | Inductive link prediction | | |
+|-|-|-|-|-|-|-|-|-|-|-|
+| | | Wikipedia | Reddit | MOOC | Wikipedia | Reddit | MOOC | Wikipedia | Reddit | MOOC |
+| DYREP | - | 50.61 | 49.54 | 50.33 | 58.45 | 58.02 | 50.29 | 56.87 | 57.25 | 50.34 |
+| | DYGPROMPT | 53.52 | 50.98 | 51.62 | 91.64 | 93.84 | 72.04 | 90.28 | 93.08 | 72.27 |
+| JODIE | - | 51.37 | 49.80 | 50.53 | 62.40 | 59.81 | 50.71 | 59.59 | 61.28 | 50.57 |
+| | DYGPROMPT | 62.84 | 60.93 | 67.84 | 63.56 | 58.89 | 52.06 | 62.80 | 58.17 | 52.33 |
+| TGAT | - | 67.00 | 53.64 | 59.27 | 55.78 | 62.43 | 51.49 | 48.21 | 57.30 | 51.42 |
+| | DYGPROMPT | 82.09 | 73.50 | 77.78 | 69.88 | 90.76 | 53.92 | 52.58 | 75.20 | 53.29 |
+| TGN | - | 50.61 | 49.54 | 50.33 | 72.48 | 67.37 | 54.60 | 74.38 | 69.81 | 54.62 |
+| | DYGPROMPT | 74.47 | 74.00 | 69.06 | 94.33 | 96.82 | 70.17 | 92.22 | 95.69 | 69.77 |
+| TREND | - | 69.92 | 64.85 | 66.79 | 63.24 | 80.42 | 58.70 | 50.15 | 65.13 | 57.52 |
+| | DYGPROMPT | 70.15 | 65.24 | 67.58 | 64.35 | 79.62 | 59.45 | 51.26 | 64.88 | 59.13 |
+| GraphMixer | - | 65.43 | 60.21 | 63.72 | 59.73 | 61.88 | 52.42 | 51.34 | 57.64 | 51.16 |
+| | DYGPROMPT | 66.39 | 61.42 | 64.18 | 60.25 | 62.31 | 52.94 | 52.19 | 57.43 | 52.55 |
+
+"-" refers to fine-tuning or continually training the backbone on downstream task data without our prompt design.
+
+30 events for each task. Moreover, training data that are temporally closer to the test set are more important than earlier data in pre-training. However, due to limited data in the downstream training stage, the models converge quickly and fail to effectively learn from these crucial recent time intervals, resulting in lower performance than their original setting. In contrast, our prompt-based approach can better handle the temporal gap and adapt well to the test data.
+
+### 5.3 ABLATION STUDIES
+
+To thoroughly understand the impact of each component within DYGPROMPT, we compare DYGPROMPT with its variants that employ different prompts and condition-nets. These variants and their corresponding results, using TGAT as the backbone, are presented in Table 2 across three datasets.
+
+For node classification, both node and time prompts are beneficial, as Variant 2 (with node prompt) and Variant 3 (with time prompt) outperform Variant 1 (without these prompts). Incorporating both prompts in Variant 4 could further boost the performance. Moreover, the node condition-net is advantageous, as it integrates node characteristics into time features, since Variant 5 outperforms Variant 2. Similarly, the time condition-net is beneficial for capturing temporal subtleties at different times to enhance node feature characterization, as Variant 6 outperforms Variant 3. Lastly, DYGPROMPT achieves the best performance, demonstrating the effectiveness of dual prompts and condition-nets.
+
+For link prediction, the results generally exhibit similar patterns to those in node classification. A notable exception is the MOOC dataset, where the differences between the variants are generally smaller. A potential reason is that interactions in MOOC (online courses) are less dynamic and diverse than interactions in Reddit (a major social network) and Wikipedia (a high-traffic site), reducing the effectiveness of prompts designed to bridge the pre-training and downstream gaps. However, our full model DYGPROMPT still achieves significantly better performance than Variant 1, which does not utilize any prompts. On the other hand, in Reddit and Wikipedia, even though both pre-training and downstream tasks involve link prediction, node prompts remain useful due to the potential distributional differences in the downstream training data across tasks.
+
+{9}------------------------------------------------
+
+
+
+Figure 3: Visualization of output embedding space of nodes. The figure shows two rows of t-SNE plots for three datasets: Wikipedia, Reddit, and MOOC. The top row is labeled 'w/o prompts' and the bottom row is labeled 'DyGPrompt'. Each plot shows nodes as red (Suspended user) and blue (Active user) points. In the 'w/o prompts' row, the points are mixed together. In the 'DyGPrompt' row, the points are more clearly separated into distinct clusters. A legend at the bottom indicates that red circles represent 'Suspended user' and blue circles represent 'Active user'.
+
+Figure 3: Visualization of output embedding space of nodes.
+
+
+
+Figure 4: Sensitivity of alpha. The figure contains two line plots. The top plot shows 'Node classification AUROC (%)' on the y-axis (ranging from 60 to 75) against 'alpha' on the x-axis (values: 1, 2, 4, 8, 16, 32, 64, 128). The bottom plot shows 'Transductive link prediction AUROC (%)' on the y-axis (ranging from 60 to 95) against 'alpha' on the x-axis (values: 1, 2, 4, 8, 16, 32, 64, 128). Both plots show three data series: Wikipedia (red line with circles), Reddit (blue line with circles), and MOOC (yellow line with circles). In both cases, performance generally decreases as alpha increases, with a notable drop for Reddit in the node classification task at alpha = 128.
+
+Figure 4: Sensitivity of $\alpha$ .
+
+To further visualize the effect of our prompt design, we sample 200 suspended nodes and 200 active nodes from *Wikipedia*, *Reddit* and *MOOC*, respectively, and show the output embedding space of these nodes, calculated by Variant 1 (w/o prompts) and DYGPROMPT, in Fig. 3. We observe that with both dual prompts and dual condition-nets, node embeddings from different classes are clearly separated, demonstrating the advantages of DYGPROMPT.
+
+### 5.4 IMPACT OF BACKBONES AND HYPERPARAMETERS
+
+First, to analyze the flexibility and robustness of DYGPROMPT, we evaluate its performance on different DGNN backbones, including DYREP (Trivedi et al., 2019), JODIE (Kumar et al., 2019), TGAT, TGN, TREND, and GRAPHMIXER. The results on three datasets are reported in Table 3. We observe that regardless of the backbone utilized, DYGPROMPT surpasses the original backbone without our prompt design in almost all cases, indicating the robustness of our proposed framework.
+
+Next, we investigate the sensitivity of hyperparameters in DYGPROMPT. Particularly, we employ two MLPs with a bottleneck structure as the dual condition-nets (Wen & Fang, 2023; Wu & Lee, 2018). The perceptrons embed the input feature dimension $d$ to $\tilde{d}$ , and then restore it back to $d$ , where $\tilde{d} = d/\alpha$ . Here, $\alpha$ is a hyperparameter that scales the hidden dimension. We evaluate the impact of $\alpha$ , as illustrated in Fig. 4. We observe that for both node classification and link prediction tasks, performance generally declines as $\alpha$ increases, likely due to greater information loss from a “smaller bottleneck.” The performance when $\alpha \approx 2$ is generally competitive across different datasets. Therefore, in our experiments, we set $\alpha = 2$ .
+
+## 6 CONCLUSIONS
+
+In this paper, we explored prompt learning on dynamic graphs, aiming to narrow the gap between pre-training and downstream applications on such graphs. Our proposed approach, DYGPROMPT, employs dual prompts to overcome the divergent objectives and temporal variations across pre-training and downstream tasks. Moreover, we propose dual condition-nets to mutually characterize node and time patterns. Finally, we conducted extensive experiments on four public datasets, demonstrating that DYGPROMPT significantly outperforms various state-of-the-art baselines.
+
+## ACKNOWLEDGMENTS
+
+This research / project is supported by the Ministry of Education, Singapore, under its Academic Research Fund Tier 2 (Proposal ID: T2EP20122-0041). Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of the Ministry of Education, Singapore.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/odU59TxdiB.txt b/papers/odU59TxdiB.txt
new file mode 100644
index 0000000000000000000000000000000000000000..20674fa7ecd8325650e9195e3e9f47b9dc8d4cb7
--- /dev/null
+++ b/papers/odU59TxdiB.txt
@@ -0,0 +1,312 @@
+**Primary Area:** unsupervised, self-supervised, semi-supervised, and supervised representation learning
+
+
+
+{0}------------------------------------------------
+
+# SSLAM: ENHANCING SELF-SUPERVISED MODELS WITH AUDIO MIXTURES FOR POLYPHONIC SOUNDSCAPES
+
+Tony Alex, Sara Ahmed, Armin Mustafa, Muhammad Awais†, Philip JB Jackson†
+
+Surrey Institute for People-Centred AI, University of Surrey, Guildford, GU2 7XH, UK
+
+Centre for Vision, Speech and Signal Processing (CVSSP), University of Surrey
+
+{t.alex, sara.atito, armin.mustafa, muhammad.awais, p.jackson}@surrey.ac.uk
+
+†Equal senior contributions.
+
+## ABSTRACT
+
+Self-supervised pre-trained audio networks have seen widespread adoption in real-world systems, particularly in multi-modal large language models. These networks are often employed in a frozen state, under the assumption that the self-supervised pre-training has sufficiently equipped them to handle real-world audio. However, a critical question remains: how well do these models actually perform in real-world conditions, where audio is typically polyphonic and complex, involving multiple overlapping sound sources? Current audio self-supervised learning (SSL) methods are often benchmarked on datasets predominantly featuring monophonic audio, such as environmental sounds, and speech. As a result, the ability of SSL models to generalize to polyphonic audio, a common characteristic in natural scenarios, remains underexplored. This limitation raises concerns about the practical robustness of SSL models in more realistic audio settings. To address this gap, we introduce Self-Supervised Learning from Audio Mixtures (SSLAM), a novel direction in audio SSL research, designed to improve the model’s ability to learn from polyphonic data while maintaining strong performance on monophonic data. We thoroughly evaluate SSLAM on standard audio SSL benchmark datasets which are predominantly monophonic and conduct a comprehensive comparative analysis against state-of-the-art (SOTA) methods using a range of high-quality, publicly available polyphonic datasets. SSLAM not only improves model performance on polyphonic audio, but also maintains or exceeds performance on standard audio SSL benchmarks. Notably, it achieves up to a 3.9% improvement on the AudioSet-2M(AS-2M), reaching a mean average precision (mAP) of 50.2. For polyphonic datasets, SSLAM sets new SOTA in both linear evaluation and fine-tuning regimes with performance improvements of up to 9.1%(mAP). These results demonstrate SSLAM’s effectiveness in both polyphonic and monophonic soundscapes, significantly enhancing the performance of audio SSL models. Code and pre-trained models are available at .
+
+## 1 INTRODUCTION
+
+Self-supervised learning (SSL) has significantly advanced various domains by leveraging large volumes of unlabeled data to pre-train models effectively. In the audio domain, SSL has enabled models to achieve state-of-the-art (SOTA) performance (Gong et al., 2022; Chong et al., 2023; Huang et al., 2022a; Chen et al., 2022; Ahmed et al., 2024; Chen et al., 2022), particularly with the integration of transformer architectures (Dosovitskiy et al., 2020). Pre-trained audio models are extensively used in real-world applications, such as audio-visual segmentation (Liu et al., 2023; Park et al., 2024; Labb et al., 2024), audio captioning (Labb et al., 2024) etc. Recently, they have also been increasingly integrated into multi-modal models, particularly in multi-modal large language models (LLMs) (Zhang et al., 2023; Tang et al., 2023; Zhao et al., 2023; Panagopoulou et al., 2023). These models are often utilized in a frozen state, where a projection layer is added on top of the pre-trained
+
+{1}------------------------------------------------
+
+backbone to interface with systems like LLMs. In this setup, only the projector is trained, based on the assumption that the pre-trained audio models are capable of handling real-world polyphonic audio scenarios. However, the audio SSL methods are rarely evaluated for polyphonic scenarios.
+
+Unlike monophonic audio, which features a single sound source, polyphonic audio involves auditory environments with overlapping sounds, such as musical ensembles, multi-speaker settings, or diverse natural soundscapes, like traffic and park noises. Although the term “polyphony” is often associated with music, we use it here in a broader sense to describe any audio scene with multiple concurrent sources. Given that much real-world audio is inherently polyphonic, it is essential for audio encoder representation learning to account for this complexity. While one might argue that pre-training with AudioSet (Gemmeke et al., 2017), a dataset containing multi-label samples should be adequate, it is crucial to recognize that many of the audio files in AudioSet are not truly polyphonic (refer to detailed analysis in Appendix B.1). Instead, these files often carry multiple labels that describe different facets of a single sound event with only a proportion of dataset being actually polyphonic. For example, a recording labeled as ‘Carnatic music’, ‘Music’, ‘Musical instrument’, and ‘Classical music’ all refer to the same audio event. This labeling approach does not fully encompass the complexity and richness of authentically polyphonic audio.
+
+Given the intuitive nature of audio mixing, it would seem natural for it to serve as a standard pre-text task in SSL for audio. However, this approach remains underexplored for self-supervised pre-training. Beyond its potential as a pretext task, incorporating audio mixtures into SSL offers several key advantages. First, it establishes a flexible framework for learning invariant representations that are robust to noise and generalizable across a wide range of tasks, whether involving monophonic or polyphonic audio data. Additionally, mixing audio allows for the creation of synthetic data from existing datasets, significantly increasing the diversity of training examples. This enhanced variety fosters richer learning signals, enabling the development of stronger and more semantically meaningful representations. Despite these strengths, audio mixing in SSL is still an underutilized approach, leaving substantial room for further exploration.
+
+
+
+The diagram illustrates the proposed audio SSL pre-training pipeline. It is divided into four quadrants: (A) Masked Latent Bootstrapping (baseline), (B) Masked Latent Bootstrapping with mixed audio, (C) Source retention loss, and (D) Downstream task. In (A), a single audio input is processed by a student encoder (S) and a teacher encoder (T). The student encoder is masked, and its output is compared with the teacher's output via a self-distillation loss. In (B), two audio inputs are mixed and then processed by the student encoder (S) and teacher encoder (T). The student encoder is masked, and its output is compared with the teacher's output via a self-distillation loss. In (C), two audio inputs are processed by the student encoder (S) and teacher encoder (T). The student encoder's output is compared with the teacher's output via a source retention loss. In (D), the student encoder (S) is used for a downstream task, which is audio event tagging. The output of the student encoder is used to predict a list of sound events: Car Horn, Ambulance Siren, Bicycle Bell, ..., Motorcycle Engine, Bus Brake, Tire Screeching.
+
+Figure 1: Overview of the components in our proposed audio SSL pre-training strategy. The diagram is divided into four quadrants: (A) Masked Latent Bootstrapping (baseline), (B) Masked Latent Bootstrapping with mixed audio, (C) Source retention loss, and (D) Downstream task. Each quadrant shows the flow from audio inputs through a student encoder (S) and a teacher encoder (T) to produce a loss or a task output.
+
+Figure 1: Overview of the components in our proposed audio SSL pre-training on unlabeled data and the audio event tagging downstream task (T: Teacher encoder, S: Student encoder). (A): Masked Latent Bootstrapping (self-distillation where the teacher is the exponentially moving average of the student) with unmixed audio (baseline). (B): Masked Latent Bootstrapping with mixed audio. (C): Source retention loss to preserve the distinct characteristics of individual audio sources. (D): Overview of the audio event tagging downstream task.
+
+To address this limitation, we introduce SSLAM, a novel self-supervised pre-training strategy designed to enhance the ability of transformer-based models to learn from polyphonic data. In our approach, the student model receives mixed audio inputs, where multiple audio signals are randomly combined to form a polyphonic signal. Since this is a self-supervised learning method, we do not know in advance whether the selected audios are monophonic or polyphonic, meaning that the resulting audio can be either a mixture or even a mixture of mixtures. Concurrently, the teacher
+
+{2}------------------------------------------------
+
+model processes the same audio sources separately, averaging their features at the output of the teacher model. The student model’s output is then compared to the teacher’s aggregated features, enabling a robust learning mechanism that better adapts to polyphonic scenarios (refer to Figure 1).
+
+We evaluate the proposed SSLAM on standard audio SSL benchmark datasets, including event tagging tasks covering a range of sounds, e.g. environmental sound and speech, achieving state-of-the-art performance across all categories. Furthermore, we integrate publicly available polyphonic datasets into the evaluation pipeline to assess the model’s robustness in handling complex, real-world audio scenarios. We demonstrate substantial improvements in handling polyphonic audio, with our method consistently outperforming prior approaches in real-world polyphonic audio scenarios.
+
+In summary, our contributions include:
+
+1. The introduction of audio mixtures for the self-supervised pre-training, enabling the network to better adapt to real-world polyphonic audio environments.
+2. A novel source retention loss, which explicitly preserves the individual characteristics of each audio source within the mixture. By encouraging the network to recognize and retain the distinct features of each input, this loss function ensures the integrity of each source, even when multiple sources are combined.
+3. A comprehensive evaluation of our model on major audio SSL benchmark datasets, demonstrating SOTA performance across general audio and speech tasks compared to prior approaches.
+4. Extensive evaluation of the model’s polyphonic capabilities using several polyphonic datasets, demonstrating substantial improvements in handling real-world polyphonic audio compared to existing methods.
+
+## 2 RELATED WORK
+
+**Masked latent bootstrapping.** Several works (Baade et al., 2022; Chong et al., 2023; Niizumi et al., 2022; Baevski et al., 2022; Gong et al., 2022; Ahmed et al., 2024) have explored various strategies for **masking** specific regions of the spectrogram, with pre-training primarily focused on reconstructing the masked regions within the spectrogram space. Although this approach has shown promise, other studies have questioned whether spectrogram reconstruction is the most effective method. For instance, Chen et al. (2022) introduced the prediction of patch-level discrete labels generated by acoustic tokenizers instead of reconstructing the spectrogram. Another approach is predicting target **masked latent features** that capture higher-level, semantically meaningful information about the audio rather than focusing on low-level spectrogram reconstruction. **Bootstrapping** via EMA teacher-based self-distillation (Grill et al., 2020; Niizumi et al., 2021) is an effective exponential moving average (EMA) approach for generating target representations. Works such as Baevski et al. (2022; 2023); Fei et al. (2024); Chen et al. (2024) are based on the concept of **masked latent bootstrapping**. In particular, Baevski et al. (2022; 2023); Chen et al. (2024) generate target representations by averaging outputs from multiple layers of the teacher model within an EMA-based self-distillation framework. This approach captures both high-level and low-level information, rather than relying solely on the final layer, leading to richer representations.
+
+**Polyphonic data modeling.** Abeßer et al. (2023) analyzed supervised audio networks such as PANN Kong et al. (2020) and PaSST Koutini et al. (2021) on low-degrees polyphony (2 events) created using ESC-50 (Piczak, 2015). Salamon et al. (2017) introduced the Scape library to create polyphonic datasets, with URBAN-SED (Salamon et al., 2017) demonstrating its potential. The IDMT-DESED-FL (Johnson et al., 2021) dataset was created using DESED (Turpault et al., 2019) using Scape. SPASS is a relatively high-quality dataset created using tools such as RAVEN (Schröder, 2011), using monophonic source datasets like ESC-50 and UrbanSound8K (Arnault et al., 2020). Networks trained with SPASS outperformed those trained on AudioSet, raising the question of whether addressing polyphony requires solely the creation of more high-quality data, or if model development should also be considered. However, to the best of our knowledge, none of the widely used audio SSL models incorporate specific design choices or training objectives aimed at addressing the challenges posed by polyphonic data.
+
+{3}------------------------------------------------
+
+## 3 METHODOLOGY
+
+In this section, we outline the core components of our framework, starting with the baseline model in Section 3.1. Following, we describe the integration of audio mixtures into our SSL framework in Section 3.2, beginning with an explanation of the audio mixing strategies used to generate mixtures and pre-training the baseline model with these mixtures in Section 3.2.1. This is followed by the discussion of our proposed source retention loss, Section 3.2.2, which preserves individual source characteristics within the mixtures. Finally, we introduce our unified framework in Section 3.3, which efficiently integrates all components into a cohesive model, enabling robust learning in polyphonic as well as monophonic audio scenarios.
+
+### 3.1 BASELINE MODEL: MASKED LATENT BOOTSTRAPPING
+
+Our baseline leverages masked latent bootstrapping, an SSL paradigm that combines the concept of bootstrapping (Niizumi et al., 2021; Ahmed et al., 2024), spectrogram masking (Huang et al., 2022b; Baade et al., 2022), and the prediction of masked tokens in the feature space (Fei et al., 2024; Baevski et al., 2022; 2023). Approaches like Baevski et al. (2022; 2023); Chen et al. (2024) effectively combine these techniques, enabling the capture of rich contextual representations of audio data. We adopt this paradigm as the foundation of our method, aiming to enhance its performance in complex, polyphonic environment. Below, we outline the key steps of our baseline framework.
+
+First, the input spectrogram $S$ undergoes patchification (Gong et al., 2021), where $S$ is divided into fixed-size, non-overlapping time-frequency patches. To introduce a self-supervised objective, we employ inverse block multi-masking (Baevski et al., 2023; Chen et al., 2024) with a non-masking block size of $(5 \times 5)$ , where multiple masked versions of the spectrogram are generated by randomly dropping 80% of the patches from each version. A classification token (CLS) is then appended to each masked spectrogram, which is then passed through the student encoder. The student encoder processes these masked spectrograms and outputs an encoded representation $\hat{Z}$ , with the CLS token’s representation denoted as $\hat{Z}^{\text{CLS}}$ . Following, random tokens are inserted in place of the masked tokens in the encoded representation and fed to a light-weight CNN-based decoder to predict the representations of the masked tokens, producing the student’s patch-level outputs $\hat{Y}^{\text{patch}}$ .
+
+To guide the student model during training, we employ a momentum-based teacher encoder that processes the original, unmasked spectrogram. The teacher encoder’s outputs are averaged across all layers to generate target representations $Z$ for the student encoder.
+
+The training objective consists of two loss functions. First, a global loss ensures that the student model captures the overall structure of the audio signal as its mean square error (MSE):
+
+$$\mathcal{L}_{\text{global}} = \frac{1}{B \times n_{MC}} \sum_{i=1}^B \sum_{j=1}^{n_{MC}} \left( \hat{Z}_{\{i,j\}}^{\text{CLS}} - Z_i^{\text{CLS}} \right)^2 \quad (1)$$
+
+where $B$ is the batch size, $n_{MC}$ is the number of multi-mask copies, and $Z^{\text{CLS}}$ is the spatially pooled output of $Z$ . Second, local loss facilitates fine-grained understanding, as below:
+
+$$\mathcal{L}_{\text{local}} = \frac{1}{B \times n_{MC} \times |\mathcal{M}|} \sum_{i=1}^B \sum_{j=1}^{n_{MC}} \sum_{k \in \mathcal{M}} \left( \hat{Y}_{\{i,j,k\}}^{\text{Patch}} - Z_{\{i,k\}} \right)^2 \quad (2)$$
+
+where $\mathcal{M}$ is the set of masked tokens.
+
+### 3.2 SSLAM: SELF-SUPERVISED LEARNING FROM AUDIO MIXTURES
+
+In this work, we introduce two key innovations to enhance self-supervised learning for audio. First, the introduction of audio mixtures in the SSL setting, enabling the network to better adapt to real-world polyphonic audio environments (Section 3.2.1). To complement this, we propose a novel source retention loss that explicitly preserves the individual characteristics of each audio source within the mixture. By encouraging the network to recognize and retain the distinct features of
+
+{4}------------------------------------------------
+
+
+
+Figure 2: Illustration of novel contributions in SSLAM. The diagram shows the architecture of the model. On the left, 'Partial Mixing' is shown where two spectrograms, S1 and S2, are processed through 'Time Chunk Dropping' and 'Partial Mix' to create a 'Mixed Spectrogram (Smixed)'. The main architecture consists of a 'Linear Projection + Position Embedding' block that takes Smixed, S1, and S2 as inputs. S1 and S2 are also processed by 'Multi-inverse Masking' and 'Drop Unmixed Region' blocks. The 'Student ViT' block receives inputs from the embedding block and a 'CLS' token, and it is connected to a 'Decoder'. The 'Teacher ViT' block receives inputs from the embedding block and is connected to 'Layer Avg.' and 'Spatial Pool' blocks. Loss functions are defined: L\_global,mixed between the Student ViT and Teacher ViT, L\_local,mixed between the Layer Avg. and Spatial Pool, and L\_SRL between the Decoder and the Spatial Pool. SG denotes the stop gradient operation applied during training.
+
+Figure 2: Illustration of novel contributions in SSLAM. The left side demonstrates the partial mixing of two audio log-mel spectrograms, while the right side visualizes the proposed novel training objectives. SG denotes the stop gradient operation applied during training.
+
+each input, this loss function ensures the integrity of each source, even when multiple sources are combined (Section 3.2.2).
+
+#### 3.2.1 MASKED LATENT BOOTSTRAPPING USING AUDIO MIXTURES
+
+Building on the same architecture as our baseline model, we introduce a key modification: instead of feeding the student and teacher networks a spectrogram derived from a single audio source, we provide an audio mixture spectrogram. This adjustment introduces additional complexity to the learning process.
+
+Audio mixing can be performed either in the waveform or the spectrogram domain. Through our experiments, we found that performing the mix in the spectrogram domain yielded superior performance (refer to Appendix E.0.1). Specifically, we apply an element-wise max operation to the log-mel spectrograms of two audio signals to create an audio mixture. This technique is inspired by principles from Computational Auditory Scene Analysis (CASA), particularly the Ideal Binary Mask (IBM) (Wang, 2005), which retains the most dominant time-frequency components of overlapping signals. By using the element-wise max operation, we ensure that the most prominent time-frequency features from each source are preserved, similar to how the IBM prioritizes target-dominant regions to enhance separation and intelligibility. To formalize this, let $S_1(f, \tau)$ and $S_2(f, \tau)$ represent the log-mel-spectrograms of two audio signals, where $f$ denotes mel frequency bins and $\tau$ denotes time frames. The mixed log-mel spectrogram $S_{\text{mixed}}(f, \tau)$ is then computed using the element-wise maximum operation at each time-frequency bin, as follows:
+
+$$S_{\text{mixed}}(f, \tau) = \max(S_1(f, \tau), S_2(f, \tau)), \quad \forall f, \tau. \quad (3)$$
+
+We include sample visualizations of this approach in Appendix E.0.3. Further, additional experimental results and analysis related to this approach are provided in the Appendix E.
+
+**Mixing vs Partial Mixing.** To achieve a balance between introducing novel audio events and preserving the main audible concepts within the original signal, we implement partial audio mixing. Instead of applying mixing across the entire audio clip, only a fraction of the audio duration is mixed. For an audio clip of length $t$ , mixing is applied to 3 distinct regions, covering a total duration of $t/2$ , while the original audio is preserved in the remaining $2 \times t/4$ duration (refer to Figure 2, left). By limiting the extent of mixing, we avoid overwhelming the original content, thus preserving key audio characteristics while still benefiting from the additional variability introduced by the mixing. This strategy maintains a balance between retaining essential audio features and introducing new information, ultimately leading to enhanced performance in polyphonic audio tasks.
+
+As for the loss functions, a key modification we made when incorporating partially mixed audios into the baseline model involves the selection of teacher layers for the target representation. In the
+
+{5}------------------------------------------------
+
+baseline, the global loss function $\mathcal{L}_{\text{global}}$ and the local loss function $\mathcal{L}_{\text{local}}$ , use the average of all 12 teacher encoder layers to form the target representation. However, with the added complexity from mixing multiple audio sources, averaging over the 12 layers then spatial pooling can potentially lead to excessive information compression, limiting the model’s ability to capture meaningful global representations. To address this, we used only the final layer’s output for the global loss, denoted as $\mathcal{L}_{\text{global,mixed}}$ (refer to Table 6). For local loss $\mathcal{L}_{\text{local,mixed}}$ we used all 12 layers. It is worth to note, the optimal selection of teacher layers (top-k) may vary across modalities, as observed in Baevski et al. (2022).
+
+#### 3.2.2 SOURCE RETENTION LOSS (SRL)
+
+To improve the model’s ability to learn and retain distinct concepts from mixed audios, we introduce an additional loss function, termed Source Retention Loss (SRL). This loss encourages the model to capture the characteristics from each audio source within a mixture.
+
+The process begins by feeding the student model with the mixed audio $S_{\text{mixed}}$ , as previously described in Section 3.2.1. The student model generated representations for the mixed audio patches, which are then fed to the decoder to obtain $\tilde{Y}_{\text{patch,mixed}}$ .
+
+Next, the teacher model separately processes Audio 1 spectrogram $S_1$ and Audio 2 spectrogram $S_2$ . Note that, we discard the tokens from $S_1$ that correspond to the unmixed regions in the partially mixed audio before passing it through the teacher model, ensuring that the teacher processes only the relevant mixed segments.
+
+The target for the student model is created by averaging the representations produced by the teacher for $S_2$ and the processed portions of $S_1$ . Finally, we employ MSE as the loss function, defined as follows:
+
+$$\mathcal{L}_{\text{SRL}} = \frac{1}{B \times n_{\text{MC}} \times |\mathcal{M}|} \sum_{i=1}^B \sum_{j=1}^{n_{\text{MC}}} \sum_{k \in \mathcal{M}} \left( \tilde{Y}_{(i,j,k)}^{\text{patch,mixed}} - \left( \frac{Z_{(i,k)}^{S_2} + Z_{(i,k)}^{S_1}}{2} \right) \right)^2 \quad (4)$$
+
+This method encourages the network to learn multiple concepts at a granular level, thereby improving its performance in real-world polyphonic scenarios.
+
+### 3.3 UNIFIED LEARNING FRAMEWORK
+
+In this section, we detail how we efficiently integrate the training objectives discussed in the previous sections to construct the SSLAM framework. Our approach ensures that each objective contributes to the overall learning process without introducing unnecessary computational overhead.
+
+To recap, the methodology consists of five objectives. The global loss for unmixed audio $\mathcal{L}_{\text{global,Unmixed}}$ captures high-level representation, while the local loss for unmixed audio $\mathcal{L}_{\text{local,Unmixed}}$ focuses on fine-grained details. For mixed audio, the global loss $\mathcal{L}_{\text{global,mixed}}$ helps the model to understand the overall structures in combined sources, and the local loss $\mathcal{L}_{\text{local,mixed}}$ understands overlapping sounds at a granular level. Finally, the source retention loss $\mathcal{L}_{\text{SRL}}$ ensures that distinct characteristics of each source are preserved in the mixed audio. For clarity, Figure 2 highlights only the novel contributions of our SSLAM framework.
+
+To train the model, we first pre-train it using only unmixed audio using the $\mathcal{L}_{\text{global,Unmixed}}$ and $\mathcal{L}_{\text{local,Unmixed}}$ loss functions. This step allows the network to learn foundational representations of distinct audio events and establish robust feature extraction capabilities without the added complexity of mixed signals. We refer to this as “Stage 1”.
+
+After this, in “Stage 2”, the model is trained on a combination of partially mixed audio (half the batch) and unmixed audio (the other half), utilizing all five losses. This two-stage training approach allows the model to progressively develop the capacity to handle more complex polyphonic audio. The inclusion of all five training objectives in “Stage 2” is motivated as follows: Using unmixed audio based training objectives enhances the robustness of our approach on monophonic datasets (refer to Appendix D) while enabling the network to learn foundational representations enabling robust feature extraction capability without the added complexity of mixed signals. Incorporat-
+
+{6}------------------------------------------------
+
+ing mixed audio based training objectives exposes the model to diverse polyphonic data, thereby improving its performance on polyphonic tasks. Additionally, the source retention loss (SRL), effectively computed by leveraging the two mixed and unmixed halves of the batch, explicitly ensures that the representation of mixed audio stays true to its source components. This further enhances the network’s ability to understand polyphonic audio.
+
+Finally, these objectives are efficiently incorporated into the SSLAM framework as follows:
+
+#### --- **Algorithm 1** Efficient Incorporation of Training Objectives ---
+
+- 1: **Input:** A batch of log-mel spectrograms $B$
+ - 2: **Step 1:** Create a partially mixed batch $B_m$ by rolling and mixing $B$ along the batch dimension.
+ - 3: **Step 2:** Concatenate $B$ and $B_m$ to form a combined batch $2B$ .
+ - 4: **Step 3:** Forward $2B$ through the student and teacher networks, reducing the number of multitask clones from 16 to 8 for consistency with the baseline.
+ - 5: **Step 4:** For SRL, mask and drop unmixed regions in $B$ post-positional embedding and forward the result to the teacher.
+ - 6: **Step 5:** Compute the five training objectives using the relevant parts of the batches.
+-
+
+This process enables the seamless integration of both unmixed and partially mixed audio, along with their respective training objectives, ensuring SSLAM’s adaptability and effectiveness across both monophonic and polyphonic audio datasets.
+
+## 4 EXPERIMENTS
+
+### 4.1 DATASETS
+
+For pre-training, we utilized the AS-2M dataset without any label information. For downstream evaluation, we employed various audio SSL benchmark datasets, including AS-2M, AS-20K, ESC-50, KS1, and KS2, as well as polyphonic datasets such as SPASS, IDMT-DESED-FL, and URBAN-SED. More information about these datasets can be found in Appendix B.
+
+### 4.2 IMPLEMENTATION DETAILS
+
+**Patchification and Positional Encoding.** In the SSLAM framework, input spectrograms are divided into non-overlapping patches using a CNN layer with a kernel size of (16,16) and a stride of 16, followed by the addition of positional encoding to retain information about the order of the patches.
+
+**Encoder.** We used ViT-Base model (Dosovitskiy et al., 2020) for both the student and teacher encoders. The teacher model is an Exponential Moving Average (EMA) version of the student model. The teacher’s parameters, $\theta_t$ , are updated according to the EMA rule:
+
+$$\theta_t \leftarrow \tau\theta_t + (1 - \tau)\theta_s \quad (5)$$
+
+where $\theta_s$ represents the student model’s parameters. Initially, the momentum term $\tau$ is set low to allow greater flexibility during early training. As training progresses, $\tau$ gradually increases toward 1, ensuring more stable updates and convergence between the student and teacher models.
+
+**Decoder.** To decode the masked patches, we employ a lightweight 6-layer network comprising 2D CNN layers, LayerNorm, and GELU activation.
+
+The total number of parameters used was 93M during pre-training and 88M during fine-tuning.
+
+### 4.3 PRE-TRAINING DETAILS
+
+**Pre-Training.** For pre-training we used only the AS-2M dataset. Input waveforms were uniformly resampled to 16kHz and transformed into 128-dimensional mel-frequency bands using a 25ms Hanning window and a 10ms hop size.
+
+{7}------------------------------------------------
+
+**Stage 1:** The model was initialized from scratch and trained for 10 epochs using training objectives $\mathcal{L}_{\text{global,Unmixed}}$ and $\mathcal{L}_{\text{local,Unmixed}}$ as described in Section 3.3.
+
+**Stage 2:** The model was initialized with the pre-trained weights from Stage 1 and further trained for 5 epochs using all the training objectives outlined in Section 3.3.
+
+All pre-training experiments were conducted on $4 \times$ Nvidia 3090 GPUs, with each epoch taking 7 hours in Stage 1 and 7.5 hours in Stage 2.
+
+**Component-wise analysis of SSLAM framework.** To better understand the contribution of each component in helping the model in understanding polyphonic audio, we developed four variants of our approach, incrementally building the SSLAM framework during Stage 2 of pre-training. These variants are as follows: 1. Masked latent bootstrapping using unmixed audio (MB-UA): uses only $\mathcal{L}_{\text{global,Unmixed}}$ and $\mathcal{L}_{\text{local,Unmixed}}$ . 2. Masked latent bootstrapping using partially mixed audio (MB-PMA): uses $\mathcal{L}_{\text{global,mixed}}$ and $\mathcal{L}_{\text{local,mixed}}$ . 3. Masked latent bootstrapping using unmixed and partially mixed audio (MB-UA-PMA): uses $\mathcal{L}_{\text{global,Unmixed}}$ , $\mathcal{L}_{\text{local,Unmixed}}$ , $\mathcal{L}_{\text{global,mixed}}$ and $\mathcal{L}_{\text{local,mixed}}$ . 4. Source Retention Loss + Masked latent bootstrapping using unmixed and partially mixed audio (SSLAM): This final variant integrates the source retention loss with the other training objectives.
+
+For a fair comparison, we pre-trained all four models on the AS-2M dataset with a batch size of 48 for 5 epochs as part of Stage 2 pre-training (refer to the Appendix A for further details). We evaluate how performance varies across various polyphonic soundscape datasets (refer to Table 2), including AS-20K, and across different degrees of polyphony (refer to Table 3).
+
+**Downstream Task Training.** We conducted a comparative analysis of our approach on standard audio SSL benchmark datasets, alongside prior methods (refer to Table 1). To further assess polyphony handling, we evaluated the model on different polyphonic datasets as discussed before (refer to Table 2). All downstream tasks, except for AS-2M, were trained using $1 \times$ Nvidia 3090 GPU, while AS-2M used $1 \times$ Nvidia A100 GPU (refer to Appendix A for further details).
+
+### 4.4 EVALUATION CRITERION
+
+**Fine-tuning.** We assess the effectiveness of our proposed approach by fine-tuning, where the entire network is trained on downstream tasks with labeled data.
+
+**Linear evaluation.** We use linear evaluation (also referred to as linear probing) to better assess the quality of the representations learned through self-supervised learning. In this method, a linear classifier is trained on top of the frozen pre-trained representations, preventing the rest of the network from updating. This provides a clearer measure of the intrinsic quality of the learned features, without task-specific adaptation, making it a more reliable evaluation of SSL performance than fine-tuning. Moreover, since pre-trained networks are often used in a frozen state in real-world applications, linear evaluation offers a more practical and insightful assessment of the model’s general utility across diverse tasks.
+
+## 5 PERFORMANCE DISCUSSION
+
+**Audio SSL benchmark datasets.** Our approach demonstrated significant performance improvements across most audio SSL benchmark datasets (refer to Table 1), with a notable gain of 3.9% relative improvement over the previous state-of-the-art on AS-2M, reaching a mAP of 50.2. Among the purely monophonic datasets, such as ESC-50, KS2, and KSI, our model demonstrated comparable performance to the SOTA, which varies across different datasets. This underscores the universality and robustness of our approach, as it performs consistently across a variety of monophonic and general audio datasets.
+
+**Polyphonic audio datasets** Overall, both Table 2 and Table 3 demonstrate that incorporating partially mixed data (MB-PMA) consistently improves performance compared to the baseline MB-UA. These results highlight that our mixing strategy, by exposing the model to mixed audio, increases its access to diverse polyphonic data that AudioSet alone cannot sufficiently provide. The slight performance decrease seen in MB-UA-PMA is expected, as only half the batch is used for partially mixed data to accommodate the unmixed data. However, this design is crucial for handling both types of data within the framework and for the efficient integration of the SRL, which ultimately enables
+
+{8}------------------------------------------------
+
+Table 1: Evaluation on audio SSL benchmark datasets compared to previous methods. The pre-training datasets include AudioSet (AS), and LibriSpeech (LS). To enhance clarity, methods utilizing additional supervised training on external datasets are *grayed out*. For AS-2M and AS-20K, mean average precision (mAP) is used as the evaluation metric, while classification accuracy is reported for all other datasets. For more details about the datasets refer to Appendix B.0.1.
+
+| Model | #Param | Pre-training Data | Audio | | Speech | | |
+|-|-|-|-|-|-|-|-|
+| | | | AS-2M | AS-20K | ESC-50 | KS2 | KS1 |
+| SS-AST (Gong et al., 2022) | 89M | AS+LS | - | 31.0 | 88.8 | 98.0 | 96.0 |
+| MAE-AST (Baade et al., 2022) | 86M | AS+LS | - | 30.6 | 90.0 | 97.9 | 95.8 |
+| MaskSpec (Chong et al., 2023) | 86M | AS | 47.1 | 32.3 | 89.6 | 97.7 | - |
+| MSM-MAE (Niizumi et al., 2022) | 86M | AS | - | - | 85.6 | 87.3 | - |
+| data2vec (Baevski et al., 2022) | 94M | AS | - | 34.5 | - | - | - |
+| Audio-MAE (Huang et al., 2022a) | 86M | AS | 47.3 | 37.1 | 94.1 | 98.3 | 96.9 |
+| BEATs iter3 (Chen et al., 2022) | 90M | AS | 48.0 | 38.3 | 95.6 | 98.3 | 97.7 |
+| BEATs iter2 | 90M | AS | 48.6 | 38.9 | 98.1 | 98.1 | 98.1 |
+| ASIT (Ahmed et al., 2024) | 86M | AS | 48.0 | 38.6 | 95.3 | 98.9 | 98.2 |
+| A-JEPA (Fei et al., 2024) | 86M | AS | 48.6 | 38.4 | 96.3 | 98.5 | 97.7 |
+| EAT (Chen et al., 2024) | 88M | AS | 48.6 | 40.2 | 95.9 | 98.3 | - |
+| SSLAM (Ours) | 88M | AS | 50.2 | 40.9 | 96.2 | 98.1 | 98.8 |
+
+Table 2: Impact of individual novel contributions evaluated across various polyphonic datasets. All performances are reported in mAP. For more details about the datasets refer to Appendix B.0.2.
+
+| Model | SPASS | | | | | IDMT | URBAN | AS-20K |
+|-|-|-|-|-|-|-|-|-|
+| | Square | Park | Waterfront | Street | Market | DESED | SED | |
+| Linear Evaluation | | | | | | | | |
+| MB-UA | 60.1 | 59.7 | 55.2 | 63.7 | 62.8 | 75.8 | 71.3 | 13.9 |
+| MB-PMA (Ours) | 63.1 | 63.5 | 58.5 | 66.5 | 67.4 | 78.4 | 70.9 | 16.1 |
+| MB-UA-PMA (Ours) | 62.7 | 63.5 | 58.2 | 66.6 | 66.6 | 77.7 | 70.9 | 15.2 |
+| SSLAM (Ours) | 64.2 | 64.2 | 59.5 | 67.4 | 68.5 | 77.8 | 71.4 | 16.9 |
+| Fine-tuning | | | | | | | | |
+| MB-UA | 84.4 | 78.4 | 80.1 | 81.4 | 89.7 | 94.4 | 90.9 | 40.4 |
+| MB-PMA (Ours) | 85.1 | 80.0 | 82.0 | 82.2 | 90.8 | 94.4 | 90.9 | 40.6 |
+| MB-UA-PMA (Ours) | 85.0 | 79.7 | 82.0 | 82.2 | 90.5 | 94.4 | 90.9 | 40.7 |
+| SSLAM (Ours) | 85.6 | 80.5 | 82.6 | 82.2 | 90.2 | 94.5 | 90.9 | 40.9 |
+
+SSLAM to surpass all other models, achieving a performance improvement of up to 9.1% on SPASS (Market). The performance gap is particularly evident in the linear evaluation setting, suggesting that our contributions have enabled SSLAM to learn representations that generalize more effectively to polyphonic data compared to other approaches. Upon examining the tables individually, Table 2 shows that the proposed approach consistently outperforms the baseline across all datasets, achieving improvements of up to 9.1%, with a significant jump of 21.6% in AS-20K. In Table 3, although performance slightly decreased for lower polyphony level ({2,3}) in the linear evaluation setting, and the fine-tuning improvements were marginal, the performance gap widened as we moved to medium and higher polyphony levels, reaching up to 9.7% ({8,9}).
+
+**Additional ablations.** As we have already analyzed the relevance of each of the components of the approach previous section, here we discuss additional ablations related to our approach. All the experiments discussed in this section are evaluated on downstream task AS-20K in the fine-tuning regime. The following are our observations. We observed that top k for teacher layer averaging is 1 for global loss and 12 for local loss (refer to Table 6); in regard to the extent of spectrogram mixing, partial mixing was found to be better than full mixing (refer to Table 4); as local loss contributed the foundation of the mask latent bootstrapping approach, we investigated the effect of global loss with unmixed data, mixed data and SRL. Our experiment showed that everywhere except SRL, the global loss showed performance improvement (refer to Table 5).
+
+{9}------------------------------------------------
+
+Table 3: Evaluation on the *Degrees of polyphony* dataset: Assessing the impact of various individual contributions across different polyphony levels. $\{a,b\}$ denotes a data subset where audio files contain $a$ or $b$ distinct sound events. All performances are reported in mAP. For more details about the datasets refer to Appendix B.0.2.
+
+| Model | Unmixed Data | Partial Mixed Data | Number of Distinct sound events | | | | | | | |
+|-|-|-|-|-|-|-|-|-|-|-|
+| | | | SRL | {2,3} | {4,5} | {6,7} | {8,9} | {10,11} | {12,13} | {14+} |
+| Linear Evaluation | | | | | | | | | | |
+| MB-UA | ✓ | ✗ | ✗ | 61.5 | 69.4 | 45.8 | 53.5 | 58.3 | 61.6 | 66.7 |
+| MB-PMA (Ours) | ✗ | ✓ | ✗ | 58.6 | 70.0 | 50.7 | 57.2 | 61.3 | 64.8 | 67.6 |
+| MB-UA-PMA (Ours) | ✓ | ✓ | ✗ | 58.2 | 70.0 | 49.8 | 56.9 | 61.1 | 64.7 | 67.9 |
+| SSLAM (Ours) | ✓ | ✓ | ✓ | 60.6 | 70.6 | 53.2 | 58.7 | 63.0 | 66.1 | 69.7 |
+| Fine-tuning | | | | | | | | | | |
+| MB-UA | ✓ | ✗ | ✗ | 87.3 | 86.5 | 69.5 | 81.5 | 82.5 | 80.7 | 78.1 |
+| MB-PMA (Ours) | ✗ | ✓ | ✗ | 87.3 | 86.9 | 71.4 | 83.0 | 83.4 | 82.0 | 79.3 |
+| MB-UA-PMA (Ours) | ✓ | ✓ | ✗ | 87.2 | 86.4 | 70.3 | 82.7 | 83.4 | 81.8 | 78.8 |
+| SSLAM (Ours) | ✓ | ✓ | ✓ | 87.7 | 86.9 | 71.9 | 83.3 | 83.8 | 82.2 | 79.4 |
+
+Table 4: Comparison of partial vs. full mixing of mel-spectrograms via element wise max operation, evaluated across Stage 1 and Stage 2 of our curriculum. All models are exclusively trained with the specified data, e.g. models with tag “mixed audio” were trained solely on batches of mixed audio.
+
+| Model | mAP |
+|-|-|
+| Finetuning | |
+| Stage 1 with unmixed audio | 40.2 |
+| Stage 1 with mixed audio | 39.0 |
+| Stage 1 with mixed audio 75% of updates | 39.4 |
+| Stage 1 with partial mixed audio | 39.9 |
+| Stage 2 with unmixed audio | 40.4 |
+| Stage 2 with mixed audio 75% of updates | 40.4 |
+| Stage 2 with partial mixed audio | 40.6 |
+
+Table 5: Effect of global loss
+
+| Local loss | | | Global loss | | | AS-20K |
+|-|-|-|-|-|-|-|
+| UM | PM | SRL | UM | PM | SRL | |
+| ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | 40.4 |
+| ✓ | ✓ | ✓ | ✓ | ✗ | ✗ | 40.7 |
+| ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | 40.9 |
+| ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | 40.6 |
+
+Table 6: Top k layers
+
+| Model | mAP |
+|-|-|
+| Fine-tuning | |
+| Global:12, Local:12 | 40.5 |
+| Global:1, Local:12 | 40.6 |
+| Global:3, Local:3 | 39.3 |
+| Global:1, Local:3 | 39.4 |
+| Global:1, Local:1 | 38.8 |
+
+## 6 CONCLUSION
+
+Despite the rapid advancements in audio self-supervised learning (SSL) over recent years, the ability of audio SSL models to effectively handle polyphonic audio remains underexplored. This is a significant concern, as most real-world sounds are inherently polyphonic. In this work, we proposed the SSLAM framework, an audio SSL pre-training approach aimed at enhancing the model’s ability to handle polyphonic audio, while maintaining strong performance on monophonic data. The framework enables the model to learn from audio mixtures employing novel training objectives, including the Source Retention Loss. Additionally, we expanded the existing audio SSL benchmarks, which have predominantly focused on monophonic datasets, by incorporating diverse polyphonic datasets. Our proposed approach demonstrated state-of-the-art performance on both traditional audio SSL benchmark datasets and the newly included polyphonic datasets.
+
+## ACKNOWLEDGMENTS
+
+This research was supported by the EPSRC-BBC Prosperity Partnership ‘AI4ME: Future Personalised Object-Based Media Experiences Delivered at Scale Anywhere’ (EP/V038087/1). We also
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/qZz7PKt4bE.txt b/papers/qZz7PKt4bE.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0093f0d885c30a7b7f2bbbcd9277c4b620bb982b
--- /dev/null
+++ b/papers/qZz7PKt4bE.txt
@@ -0,0 +1,369 @@
+**Primary Area:** foundation or frontier models, including LLMs
+
+
+
+{0}------------------------------------------------
+
+# AUTOTUNE FOR TIME SERIES TRANSFORMERS USING LOW RANK ADAPTATION AND LIMITED DISCREPANCY SEARCH
+
+###### Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Transformer models have achieved remarkable results in the field of Natural Language Processing (NLP) with the introduction of breakthrough large language models like GPT and LLaMA recently. Motivated by their ability to capture long-range dependencies, researchers have successfully adapted these models to the task of time series forecasting. However, despite their potential, effectiveness of applying these pre-trained time series transformer models in the target domain is limited due to the need for hyper-parameter optimisation to match the characteristics of the target domain. This paper presents a novel algorithm that uses parameter efficient fine-tuning such as Low Rank Adaptation (LoRA) coupled with Limited Discrepancy Search (LDS) to efficiently auto fine-tune pre-trained time series transformers for a given target domain. Our approach helps in making informed design choices involving LoRA tunable hyper-parameters with strong performance-cost trade-offs that are highly transferable across different target domains. Our experiments demonstrate that autotune efficiently identifies the optimal configuration of LoRA hyper-parameters, achieving an average MASE improvement of 5.21% across all datasets and 4.76% for out-of-domain datasets compared to zero shot pre-trained models, with improvements as high as 20.59% for one of the out-of-domain datasets.
+
+## 1 INTRODUCTION
+
+Time series forecasting has always been critical for decision-making across various domains including retail, smart grids, healthcare, finance, weather, traffic control among others Peterson (2017) Hernandez et al. (2014). Traditionally, the task of time series forecasting was accomplished using classical statistical models like ARIMA followed by more modern approaches like machine learning (ML) models including Recurrent Neural Network (RNN) and Long Short-Term Memory (LSTM) models Hochreiter & Schmidhuber (1997). However, the remarkable success of LLMs in broad domains like Computer Vision (CV) and Natural Language Processing (NLP) Vaswani et al. (2017) Wen et al. (2022a) has prompted researchers to adapt these models to the task of time series forecasting Wu et al. (2022); Garza & Mergenthaler-Canseco (2023); Gruver et al. (2024b) given their ability to capture long range dependencies present in time series data. These models are pre-trained on vast amounts of data spanning a multitude of domains leveraging the general purpose representations learnt in the process. However, to excel on the domain specific downstream task it becomes important to fine-tune these models on datasets from the target domain Wen et al. (2022b). Such adaptation is generally achieved via fine-tuning, which involves updating all the parameters of the pre-trained model Jin et al. (2023); Bommasani et al. (2021); Lv et al. (2023). Given the large number of parameters that are originally trained, full fine-tuning becomes an operational challenge if we wish to adapt these models to the target domain.
+
+Recent studies have shown that this issue can be mitigated by adapting only a small percentage of the parameters in addition to the pre-trained model for each task and greatly enhance the operational efficiency of these models Hu et al. (2021b). Then, the process of fine-tuning involves taking a pre-trained model and updating only a subset of the model weights to learn the specific characteristics of the target-domain. These techniques are termed as Parameter-Efficient Fine-Tuning (PEFT). One of the popular PEFT techniques, LoRA (Low Rank Adaptation) Hu et al. (2021b) trains only selective
+
+{1}------------------------------------------------
+
+dense layers in a neural network while keeping the pre-trained weights frozen. This approach has been quite widely applied to different domains like medical imaging, video text generation and speech synthesis Balne et al. (2024) to name a few. However, its application to time series is still in its nascent stage.
+
+Further, AutoML which involves automating the process of composing and parameterizing ML algorithms to maximize a specific metric such as model accuracy on a given dataset has been widely used to improve the accuracy of traditional machine learning and deep learning models He et al. (2021). Leveraging this knowledge, autotuning of pre-trained transformers for a given target domain can potentially lead to improvement in the accuracy of transformers compared to traditional fine-tuning with fixed hyper-parameters of the fine-tuning algorithms. However, despite its popularity and widespread use, optimizing an ML pipeline poses significant challenges like slow training and large computational overheads as the search space increases Tornede et al. (2023).
+
+Therefore, with this work, we envision efficient autotuning pre-trained transformers through the integration of LoRA and AutoML with an aim to improve the performance of time series transformers in the target domain. In particular, to achieve an efficient implementation of autotuning, we adopt the classical Limited Discrepancy Search (LDS) algorithm introduced by Harvey & Ginsberg (1995) to optimize the pipeline selection process. This algorithm is essentially a depth-first search strategy that searches for new set of solutions by iteratively increasing the number of discrepancy values where the discrepancy refers to the number of variables in the current configuration that differ from their values in the initial configuration. The novel contributions of this paper include:
+
+- Distributed autotuning of LoRA configurations for pre-trained transformer models to find the optimal pipeline for the target domain. To the best of our knowledge, this is the first paper to explore the potential of autotuning time series transformer models.
+- The adoption of LDS for exploring the LoRA hyper-parameter search space in autotuning to minimize computational overhead.
+- Extensive tests across a suite of out-of-domain benchmark datasets to compare the performance of autotuned transformer models, traditional fine-tuning strategies and zero shot pre-trained transformer models.
+
+## 2 RELATED WORK
+
+There has been a rapid surge in the transformer-based time series forecasting techniques recently, particularly for long-term forecasting. We briefly introduce some of these transformers in this section. The authors in Zhou et al. (2021) propose a transformer-based model named Informer to employ a probability sparse attention mechanism to capture long-term dependencies in time series data. The ProbSparse self-attention mechanism along with the distilling operation is used to handle the challenges of quadratic time complexity and high memory usage in the vanilla Transformer architecture. Then, the authors of Autoformer Wu et al. (2021) introduced a decomposition transformer architecture replacing the attention module with an AutoCorrelation mechanism to gain progressive decomposition capacities outperforming self-attention in terms of both efficiency and accuracy. To further reduce the computational cost of transformer from quadratic to linear, FEDformer Zhou et al. (2022), a Frequency Enhanced Decomposed Transformer was introduced. It captured the important global/overall structures in time series by means of frequency domain mapping achieving linear complexity. PatchTST Nie et al. (2022) on the other hand, introduced two key components : segmentation of time series into patches serving as input tokens to the transformer along with channel-independence. Each channel contains a single univariate time series sharing the same embedding and Transformer weights across all the series for long-term multivariate time series forecasting and self-supervised representation learning. This overcomes the challenge of computation and memory usage of attention maps enabling the model to benefit from longer look-back windows. Yet another pioneering work in this area is Lag-Llama Rasul et al. (2023) inspired by the LLaMA Touvron et al. (2023) LLM. This model utilizes a simple decoder-only transformer architecture for time series forecasting by using lagged features as covariates. The main problem addressed by this work is the application of foundation model approach to time series data and investigation of the extent of the transfer achievable across a wide range of time series domains. Another line of work which treats time series as strings is LLMLime Gruver et al. (2024a). They employ careful
+
+{2}------------------------------------------------
+
+pre-processing specific to the given LLMs’ tokenizer, demonstrating that LLMs can inherently perform zero shot forecasting. This is achieved by relying on LLM’s abilities to extrapolate patterns in general sequences. Likewise, Chronos Ansari et al. (2024) employs the encoder-decoder transformer architecture from the T5 Raffel et al. (2020) LLM family requiring minimal modifications i.e, tokenization though scaling and quantization.
+
+There has been a growing interest in the research field of AutoML in the recent past fuelled by the exponential growth in the availability of computational resources Khan et al. (2021). Moreover, it assists practitioners in developing accurate and efficient predictive models without extensive domain knowledge Feurer et al. (2015) Katz et al. (2016) Jin et al. (2019). Hyperparameter optimization (HPO) acts as an important component of AutoML in searching for optimal hyper-parameters for neural network structures and the model training process. There is a strong need to adapt these pre-trained time series transformer models for specific downstream forecasting tasks for improved performance in the target domain Liang et al. (2024). Leveraging AutoML for this process of fine-tuning can help achieve this goal by automating the task of fine-tuning in a computationally feasible manner. Most commonly, PEFT techniques have been proposed in NLP and CV for fine-tuning a subset of parameters in various downstream tasks. These are mainly classified into two groups: selective and additive. Selective PEFT approaches involve fine-tuning a selective set of parameters in the model architecture as shown in Touvron et al. (2022) tuning only the attention layers. Unlike selective approaches, additive PEFT adds new weights into the model known as adapter modules and fine-tune only these, keeping the existing weights frozen. One such popular adapter is LoRA Hu et al. (2021a) which adds trainable low-rank matrices into transformer layers to approximate the weight updates. The application of LoRA in the domain of fine-tuning time series transformers remains largely unexplored due to the rapidly evolving nature of this field and hence, motivates this work. Moreover, to further optimize the search space for hyperparameter optimization in the AutoML pipeline, we adopt LDS into our framework to find the best performing model configuration.
+
+In contrast to the transformer architectures and algorithms considered in this related work, we focus on the efficient autotuning of pre-trained time series transformers for a given target domain.
+
+## 3 METHODOLOGY
+
+In this section, we first define the problem statement and then present a detailed description of the autotune design approach we adopted using LoRA and LDS.
+
+**Problem Statement:** Given a univariate time series dataset $X = (x_0, x_1, \dots, x_n)$ where $x_n \in \mathbb{R}$ is a time ordered sequence of real values and $n$ is the length of the time series and given context length $c$ where $1 < c < n$ , we used the time series $x_{1:c} = x_1, x_2, \dots, x_c$ to forecast the time series $x_{c:c+h} = x_{c+1}, x_{c+2}, \dots, x_{c+h}$ , where $h$ is the forecast horizon and $c + h = n$ .
+
+To solve the forecasting task described above, we used Chronos T5 models as the time series transformers which have been pre-trained on a large collection of publicly available time series datasets from varied domains. However, since these models are trained on a broad spectrum of time series data, their performance on a specific task which in our case is the unseen target dataset may not be optimal.
+
+**Autotune using LoRA and LDS:** We design a novel algorithm to perform automated fine-tuning of transformer models using LoRA as the parameter efficient tuning method in conjunction with LDS. This fine-tuning is achieved by using a distributed ray based framework. Figure 1 shows the architecture diagram of our approach wherein we take a pre-trained Chronos T5 model and specify a minimal subset of weights to be trained to adapt the model on the target dataset using LoRA. LoRA Hu et al. (2021a) implements this in a storage and compute-efficient manner by constraining the update ( $\Delta W$ ) to the pre-trained weight matrix $W_0 \in \mathbb{R}^{d \times k}$ by representing it with a low-rank decomposition,
+
+$$W_0 + \Delta W = W_0 + BA$$
+
+where $B \in \mathbb{R}^{d \times r}$ , $A \in \mathbb{R}^{r \times k}$ , and the rank $r \leq \min(d, k)$ . During fine-tuning, $W_0$ is frozen, while the weights of $A$ and $B$ are updated. We adapt the weight matrices corresponding to the self-attention module and the feed-forward layer modules of the transformer architecture.
+
+Algorithm 1 outlines the steps involved in our autotune approach. The algorithm starts with initialising the LoRA hyper-parameter search space. We use Limited Discrepancy Search or
+
+{3}------------------------------------------------
+
+
+
+The diagram illustrates the architecture of the proposed algorithm. It starts with a 'Time Series Transformer (pre-trained on Domain)' which feeds into a 'LoRA config space'. This space contains two example configurations: one with 'lora\_alpha: 16, lora\_dropout: 0.1, rank: 4, bias: 0' and another with 'lora\_alpha: 32, lora\_dropout: 0.2, rank: 8, bias: 0'. The 'LoRA config space' feeds into a 'Limited Discrepancy Search' block. This block starts with 'Initial LoRA config' and 'Increment discrepancy by $\delta$ ' to 'Generate next config'. A decision diamond asks 'if $\delta > \text{Max discrepancy}$ '. If 'True', it proceeds to 'generates' multiple 'Hyperparameter config' boxes (1, 2, 3, ..., n). These configs are used for 'Training' and 'Evaluation' across multiple 'Trials' (1, 2, 3, ..., n). The results are used for 'Ranking based on Mean error metric', which leads to an 'Auto Tuned model using best config' and 'Test performance'. The 'Universal Time series dataset (Target Domain)' is split into 'Train data', 'Validation data', and 'Test data', which are used for training and evaluation.
+
+Figure 1: Architecture diagram showing the workflow of our algorithm using LoRA and LDS for Hyperparameter Optimization and Ray Tune for parallelization of the tune trials. The diagram illustrates the flow from a Time Series Transformer (pre-trained on Domain) through a LoRA config space to a Limited Discrepancy Search (LDS) block. The LDS block generates multiple hyperparameter configs (1 to n) which are then used for Training and Evaluation. The results are used for Ranking based on Mean error metric, leading to an Auto Tuned model using best config and Test performance.
+
+Figure 1: Architecture diagram showing the workflow of our algorithm using LoRA and LDS for Hyperparameter Optimization and Ray Tune for parallelization of the tune trials.
+
+### Algorithm 1 Autotune algorithm using LoRA and LDS
+
+```
+
+1: Input: Model $M$ , target dataset $X$ split
+2: into $X_{\text{train}}$ , $X_{\text{val}}$ and $X_{\text{test}}$ , LoRA search
+3: space $Y = \{Y_1, \dots, Y_n\}$ , SEARCH with
+4: maximum discrepancy $\delta$ , Evaluation metric
+5: $MAE$ , number of trials $T_{\text{max}}$
+6: Output: Optimal LoRA hyper-parameters
+7: $Y_{\text{opt}}$ and Autotuned Model $M_{Y_{\text{opt}}}$
+8: 1: Define LoRA search space $Y = \{Y_1, \dots, Y_n\}$
+9: 2: Execute SEARCH : Initialize $y^0$ to default
+10: LoRA and let $y^* \leftarrow y^0$
+11: 3: for all $\theta = 1, \dots, \delta$ do
+12: 4: SEARCH( $y^*, Y, \theta, 1$ )
+13: 5: end for
+14: 6: return $y^*$
+15: 7: procedure SEARCH( $y, Y, \theta, i$ )
+16: 8: if $\theta == 0$ or $i > |Y|$ then
+17: 9: $Y_{\text{opt}}, M_{Y_{\text{opt}}} \leftarrow \text{SCORE}(y, X_{\text{train}}, X_{\text{val}}, M)$
+18: 10: return $Y_{\text{opt}}, M_{Y_{\text{opt}}}$
+19: 11: else
+20: 12: for all values $y \in D(Y[i])$ do
+21: 13: if $y[i] == y$ then
+22: 14: $z \leftarrow \text{SEARCH}(y, Y, i + 1, \theta)$
+23: 15: else
+24: 16: $y' \leftarrow y; y'[i] \leftarrow y$
+25: 17: $z \leftarrow \text{SEARCH}(y', Y, i + 1, \theta - 1)$
+26: 18: end if
+27: 19: return $z$
+28: 20: end for
+29: 21: end if
+30: 22: end procedure
+31: 23: procedure SCORE( $y, X_{\text{train}}, X_{\text{val}}, M$ )
+32: 24: $M \leftarrow \text{TrainModel}(y^*, X_{\text{train}})$
+33: 25: $\text{score} \leftarrow \text{EvaluateModel}(M, X_{\text{val}})$
+34: 26: if $\text{score} > \text{best\_score}$ then
+35: 27: $M_{Y_{\text{opt}}} \leftarrow M$
+36: 28: $Y_{\text{opt}} \leftarrow y^*$
+37: 29: $\text{best\_score} \leftarrow \text{score}$
+38: 30: end if
+39: 31: return $Y_{\text{opt}}, M_{Y_{\text{opt}}}$
+40: 32: end procedure
+
+```
+
+LDS Harvey & Ginsberg (1995) to traverse this space effectively starting from an initial configuration of LoRA hyper-parameters. Specifically, LDS takes as input a vector of variables $Y = \{Y_1, \dots, Y_n\}$ corresponding to the LoRA hyper-parameters together with their domains of values $D = \{D(Y_1), \dots, D(Y_n)\}$ representing the hyper-parameter search space to be explored and the maximum discrepancy value $\delta$ which limits the number of allowed variable-value assignment changes from the initial solution $y^0 = (y_1^0, \dots, y_n^0)$ where $y_i^0 \in D(Y_i)$ is a value in variable's $Y_i$ domain and outputs the next solution $y^*$ based on the discrepancy value. Notice that LDS requires
+
+{4}------------------------------------------------
+
+
+
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+
+Figure 2: A search tree diagram illustrating the search space traversed by LDS. The tree has three levels: A (root), B (middle), and C (leaves). The root node is a circle. It has two children, both circles, connected by dashed lines labeled a1 and a2. The left child has two children, both circles, connected by dashed lines labeled b1 and b2. The right child has two children, both circles, connected by dashed lines labeled b1 and b2. Each of the four leaf nodes is a circle. The leftmost leaf node is a blue square. The other three leaf nodes are white squares. The leftmost leaf node is connected to its parent by a dashed line labeled c1. The second leaf node is connected to its parent by a dashed line labeled c2. The third leaf node is connected to its parent by a dashed line labeled c1. The fourth leaf node is connected to its parent by a dashed line labeled c2.
+
+227
+228
+Figure 2: Example of the search space traversed by LDS with maximum discrepancy value = 1.
+
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+
+the variables to have finite domains of values, and therefore any continuous hyper-parameter needs to be discretized. In addition, LDS is required to search around a reasonably good solution which is typically given by the default LoRA hyper-parameter configuration here, hence, we set $y^0$ to the default LoRA configuration. We begin with a discrepancy value $\theta$ of 1 and conduct an iterative search that allows to change the values of at most $\theta$ hyper-parameters in the initial solution $y^0$ . We then increment $\theta$ until $\theta$ exceeds the maximum discrepancy value. Function SEARCH performs the actual exploration of the LoRA hyper-parameter search space limited by discrepancy $\theta$ . This assists in incrementally searching around the default LoRA configuration compared to random exploration. For each configuration $y^r$ returned by LDS, we fine-tune the model and evaluate it on the validation split to compute the MASE score as outlined in the SCORE function in the algorithm. At the end, we find the best configuration $y^*$ corresponding to the lowest MASE score and use it to fine-tune our model which is then evaluated on the held out test split.
+
+242
+243
+244
+245
+246
+
+For illustration, Figure 2 shows the search space explored by LDS with discrepancy value 1 (denoted by LDS(1)) for 3 dummy variables [A, B, C] with domain values $\{a_1, a_2\}$ , $\{b_1, b_2\}$ and $\{c_1, c_2\}$ , respectively. In this case, LDS(1) starts from the initial assignment of $\{a_1, b_1, c_1\}$ which corresponds to the leftmost blue leaf node and traverses the search space in a depth-first manner visiting only the blue leaf nodes.
+
+247
+248
+249
+250
+251
+
+The algorithm described above is then implemented in a distributed manner using Ray Tune Liaw et al. (2018) which provides an open source framework for distributed model training and selection. Each configuration returned by LDS corresponds to trials as shown in Figure 1 which are executed concurrently in a cluster. We use the default Ray tune scheduler which is first-in-first-out (FIFO) passing through the trial configurations without performing any early stopping.
+
+###### 252 253 254 4 EXPERIMENTAL SETUP
+
+255
+256
+257
+
+In this section, we present the datasets used in the fine-tuning experiments along with the implementation details of the proposed autotune framework.
+
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+
+**Datasets:** For our experiments, we use 10 datasets from the Monash Time Series Forecasting Repository Godahewa et al. (2021) part of the Benchmark II datasets in Ansari et al. (2024) used for zero shot evaluation. Table 1 provides the details of the datasets used for the experiments. Each dataset is a collection of series where each series is split into train, validation and test instances. The \* in the series length represents average length of the time series for 3 datasets, Weather, Australian Electricity and M5 which consists of variable length time series. The number of instances in validation and test label depend on the prediction horizon which is specific for each dataset. We use the GluonTS library to split the datasets using the same strategy as used in Ansari et al. (2024). For each dataset, the train split includes all the data points from the beginning of the time series up until the last two prediction horizon lengths, which are held out for validation and testing respectively. We use these datasets as they have not been used in the pre-training phase of the Chronos T5 models. Since these datasets are collected from a variety of application domains including energy, transport, retail, web, weather, finance, they are more closely representative of the real world application scenarios. Moreover, they assist in validating the robustness and generalisation capabilities of our approach.
+
+{5}------------------------------------------------
+
+Table 1: Datasets used for the experiments.
+
+| Dataset | Domain | Freq. | Num. Series | Series Length | Prediction Length (H) |
+|-|-|-|-|-|-|
+| Traffic | Transport | 1H | 862 | 17544 | 24 |
+| Weather | Nature | 1D | 3010 | 14296* | 30 |
+| ETT (Hourly) | Energy | 1H | 14 | 17420 | 24 |
+| ERCOT Load | Energy | 1H | 8 | 154854 | 24 |
+| Australian Electricity | Energy | 30min | 5 | 231052* | 48 |
+| Exchange Rate | Finance | 1B | 8 | 7588 | 30 |
+| FRED-MD | Economics | 1M | 107 | 728 | 12 |
+| NN5 (Daily) | Finance | 1D | 111 | 791 | 56 |
+| M5 | Retail | 1D | 30490 | 1562* | 28 |
+| ETT (15 min.) | Energy | 15min | 14 | 69680 | 24 |
+
+**Models:** We chose Chronos T5 models as our transformer architecture for demonstrating the auto-tune approach. These models, trained from scratch on time series data, are widely adopted open-source transformers that have achieved state-of-the-art (SOTA) performance in time series analysis. Chronos T5 models have been pre-trained and released in 5 sizes ranging from Tiny (16M), Mini (20M), Small (46M), Base (200M) and Large (710M) with number of model parameters in brackets. In our experiments, we focus on univariate time series forecasting as Chronos models are pre-trained for the univariate setting. We use the lightweight version of the models i.e. Mini in order to utilize minimal computational resources for demonstrating the applicability of our approach.
+
+Table 2: LoRa Hyper-paramater Search Space
+
+| Parameter Name | Range of values |
+|-|-|
+| alpha | {4, 8, 16, 32, 64} |
+| dropout | {0.0, 0.05, 0.1} |
+| rank | {2, 4, 8, 16, 32} |
+| bias | {"none", "all", "lora_only"} |
+| learning_rate | {0.0001, 0.001, 0.01} |
+| batch_size | {4, 8, 16} |
+| grad_accumulation_steps | {1, 4, 8} |
+
+**Implementation Details:** Autotune has been implemented using Ray Tune and Transformers library. It supports both encoder-decoder (seq2seq) and decoder-only (causal) models as well as parameter efficient fine-tuning (backed by the PEFT Library). Table 2 shows the search space for the LoRa hyper-parameters used in auto fine-tuning the models. We execute 10 trials selected using LDS for each dataset to find the best LoRa configuration and output the auto fine-tuned model corresponding to it. We limit the number of trials to 10 to demonstrate the robustness of our approach in a resource-constrained environment. We vary the maximum discrepancy based on the number of LoRa hyper-parameters to be tuned which in our case is equal to 8. Therefore, we experiment with maximum discrepancy values of 4 and 8 to explore the search space. A lower value of 4 involves a more focused search while 8 allows more broader exploration of the potential hyper-parameters. To ensure a comprehensive evaluation across different fine-tuning settings, we use mean absolute squared error (MASE) as the evaluation metric. Since the model produces probabilistic forecasts, the forecasted value for each datapoint is calculated as the median (0.5-quantile) of 20 samples, which is then used to calculate the metrics similar to Ansari et al. (2024). The MASE scores are averaged across 5 runs. All the experiments are performed on Macbook Pro M3 Max with 64GB RAM. We also perform full fine-tuning of the Chronos mini model described in Ansari et al. (2024) to compare the performance efficiency of our approach over fine-tuning all the model weights.
+
+{6}------------------------------------------------
+
+Table 3: MASE scores obtained using Chronos T5 mini model in Zero Shot, Full Fine-Tuning and Autotune using LoRa and LDS respectively.
+
+| Dataset | Zero Shot | Full Fine Tuning | Autotune with LoRa and LDS |
+|-|-|-|-|
+| Traffic | 0.853 ( $\pm 0.0012$ ) | 0.727 ( $\pm 0.0063$ ) | 0.746 ( $\pm 0.0173$ ) |
+| Weather | 0.859 ( $\pm 0.0032$ ) | 0.818 ( $\pm 0.0046$ ) | 0.821 ( $\pm 0.0048$ ) |
+| ETT (Hourly) | 0.795 ( $\pm 0.0111$ ) | 0.783 ( $\pm 0.0166$ ) | 0.796 ( $\pm 0.0260$ ) |
+| ERCOT Load | 0.582 ( $\pm 0.0107$ ) | 0.599 ( $\pm 0.0352$ ) | 0.565 ( $\pm 0.0381$ ) |
+| Australian Electricity | 0.965 ( $\pm 0.0406$ ) | 0.927 ( $\pm 0.0784$ ) | 0.831 ( $\pm 0.0923$ ) |
+| Exchange Rate | 2.054 ( $\pm 0.1561$ ) | 1.846 ( $\pm 0.1178$ ) | 1.631 ( $\pm 0.1963$ ) |
+| FRED-MD | 0.473 ( $\pm 0.0105$ ) | 0.510 ( $\pm 0.0151$ ) | 0.510 ( $\pm 0.0092$ ) |
+| NN5 (Daily) | 0.648 ( $\pm 0.0059$ ) | 0.603 ( $\pm 0.0032$ ) | 0.619 ( $\pm 0.0156$ ) |
+| M5 | 0.942 ( $\pm 0.0004$ ) | 0.934 ( $\pm 0.0003$ ) | 0.925 ( $\pm 0.0005$ ) |
+| ETT (15 min.) | 0.709 ( $\pm 0.0269$ ) | 0.777 ( $\pm 0.0161$ ) | 0.713 ( $\pm 0.0427$ ) |
+
+Table 4: Comparison of MASE scores obtained using Zero Shot evaluation of Chronos T5 models across different sizes with Autotune using LoRa and LDS.
+
+| Dataset | Zero Shot | | | | Autotune with LoRa and LDS |
+|-|-|-|-|-|-|
+| | Large | Base | Small | Mini | |
+| Traffic | 0.795 | 0.800 | 0.821 | 0.853 | 0.746 |
+| Weather | 0.817 | 0.815 | 0.854 | 0.859 | 0.821 |
+| ETT (Hourly) | 0.768 | 0.757 | 0.792 | 0.795 | 0.796 |
+| ERCOT Load | 0.586 | 0.501 | 0.597 | 0.582 | 0.565 |
+| Australian Electricity | 1.411 | 1.185 | 1.256 | 0.965 | 0.831 |
+| Exchange Rate | 2.214 | 2.466 | 2.015 | 2.054 | 1.631 |
+| FRED-MD | 0.516 | 0.483 | 0.473 | 0.473 | 0.510 |
+| NN5 (Daily) | 0.576 | 0.593 | 0.615 | 0.648 | 0.619 |
+| M5 | 0.946 | 0.942 | 0.936 | 0.942 | 0.925 |
+| ETT (15 min.) | 0.731 | 0.661 | 0.740 | 0.709 | 0.713 |
+
+## 5 RESULTS
+
+We present our comparative results in Table 3 which shows the performance of Chronos mini T5 model in zero shot setting along with different fine-tuning settings. We report MASE averaged over 5 runs for both zero shot and full fine-tuning setting. For our approach, we run 10 trials and report MASE corresponding to the best LoRa configuration, which is also averaged over 5 runs. We observe that the performance of our approach is better than full fine-tuning for most of the datasets except for datasets in the domain of traffic, weather and electricity where full fine-tuning overtakes by a slight margin. This can be attributed to the fact that the pre-trained Chronos T5 model has seen datasets from the aforementioned domains during the pre-training phase as mentioned in Ansari et al. (2024). However, for target domain datasets such as exchange rate and M5 which do not share any similarity with the pre-training source datasets, our approach demonstrates the best performance. This validates our claim that LoRa achieves comparable, and often superior performance while significantly reducing the number of trained parameters compared to full fine-tuning for out-of-domain target datasets. In Figure 3, we also visualize the average MASE improvement percentage achieved by our approach compared to zero shot model across 10 datasets. On an average, there is a 5.21% improvement denoted by the red dotted line in the plot. We can see that the autotuned model outperforms the zero shot model for most datasets. Moreover, it exhibits particularly strong performance on datasets that are out-of-domain for the original pre-trained model such as exchange rate with a significant MASE improvement of 20.59%.
+
+Figure 4 shows the relative performance of the different fine-tuning methods across 10 datasets. This plot visualizes the performance of each method relative to the best-performing method for each
+
+{7}------------------------------------------------
+
+
+
+| Dataset | MASE Improvement (%) |
+|-|-|
+| Traffic | 12.54% |
+| Weather | 4.42% |
+| ETT (hourly) | -0.13% |
+| ETCOT Load | 2.92% |
+| Australian Electricity | 13.89% |
+| Exchange Rate | 20.59% |
+| FRED-RD | -7.82% |
+| NINO (daily) | 4.48% |
+| MS | 1.80% |
+| ETT (15 min.) | -0.56% |
+| Avg Improvement | 5.21% |
+
+Bar chart titled 'MASE Improvement: Autotune vs Zero Shot' showing percentage improvement across datasets. The y-axis is 'MASE improvement (%)' from -5 to 20. The x-axis lists datasets: Traffic, Weather, ETT (hourly), ETCOT Load, Australian Electricity, Exchange Rate, FRED-RD, NINO (daily), MS, and ETT (15 min). A red dashed line at 5.21% indicates the average improvement.
+
+Figure 3: Percentage improvement obtained by autotuned mini model over zero shot mini model.
+
+
+
+| Dataset | Zero Shot | Full Fine Tuning | Autotune with LoRA and LDS |
+|-|-|-|-|
+| Traffic | 1.18 | 1.00 | 1.00 |
+| Weather | 1.05 | 1.00 | 1.00 |
+| ETT (hourly) | 1.00 | 1.00 | 1.00 |
+| ETCOT Load | 1.00 | 1.05 | 1.00 |
+| Australian Electricity | 1.15 | 1.10 | 1.00 |
+| Exchange Rate | 1.25 | 1.10 | 1.00 |
+| FRED-RD | 1.00 | 1.08 | 1.08 |
+| NINO (daily) | 1.08 | 1.00 | 1.00 |
+| MS | 1.00 | 1.00 | 1.00 |
+| ETT (15 min.) | 1.00 | 1.08 | 1.00 |
+
+Bar chart titled 'Relative performance of all methods across datasets' showing relative performance (1 is best) across datasets. The y-axis is 'Relative Performance (1 is best)' from 0.0 to 1.2. The x-axis lists datasets: Traffic, Weather, ETT (hourly), ETCOT Load, Australian Electricity, Exchange Rate, FRED-RD, NINO (daily), MS, and ETT (15 min). The legend indicates Zero Shot (blue), Full Fine Tuning (orange), and Autotune with LoRA and LDS (green). A red dotted line at 1.0 indicates the best performance.
+
+Figure 4: Plot showing the relative performance of all the methods across datasets.
+
+dataset. It shows how close each method is to the best performing method for each dataset. A value of 1 indicates the best performance and is represented by the red dotted line. The longer the bar exceeds 1, the worse the performance becomes. It can be clearly seen that autotune achieves the best performance for majority of the datasets indicated by the green bar coinciding with the red dotted line. However, in cases where autotuned model is not the best performing, it only misses by a slight margin.
+
+Next, we also compare the performance of our autotuned mini model against the zero shot performance of different sizes of the Chronos T5 models to highlight the potential of fine-tuned smaller models which require fewer computational resources compared to their larger counterparts. Table
+
+{8}------------------------------------------------
+
+4 shows the performance of the autotuned model in comparison to the zero shot results obtained using different sizes of the Chronos T5 models namely: Large, Base, Small and Mini. Here, we observe that our autotuned mini model outperforms the zero shot mini models for all the datasets with an exception of 2 datasets namely: FRED-MD and ETT(15min). This shows that fine-tuning using LoRA and LDS helps in efficiently adapting the model to the target domain than directly using zero shot model in 8 out of 10 datasets. Another interesting finding that is clearly evident in Figure 5 where we visualise the results from Table 4 is that our autotuned mini model even outperforms the zero shot Chronos T5 small model for 6 out of 10 datasets including Traffic, Weather, ERCOT Load, Australian Electricity, Exchange Rate and M5. Moreover, it surpasses the performance of the zero shot large model for 3 of the above 6 datasets which potentially leads to significant cost savings given the huge difference in the model sizes.
+
+
+
+| Dataset | Zero Shot Large | Zero Shot Base | Zero Shot Small | Zero Shot Mini | Autotune with LoRA and LDS |
+|-|-|-|-|-|-|
+| Traffic | 0.80 | 0.85 | 0.80 | 0.85 | 0.75 |
+| Weather | 0.80 | 0.85 | 0.80 | 0.85 | 0.80 |
+| ETT (hourly) | 0.75 | 0.80 | 0.75 | 0.80 | 0.75 |
+| ERCOT Load | 0.60 | 0.60 | 0.60 | 0.60 | 0.60 |
+| Australian Electricity | 1.40 | 1.20 | 1.30 | 1.00 | 0.85 |
+| Exchange Rate | 2.20 | 2.50 | 2.00 | 2.10 | 1.60 |
+| FRED-MD | 0.50 | 0.50 | 0.50 | 0.50 | 0.50 |
+| INC (daily) | 0.60 | 0.60 | 0.60 | 0.60 | 0.60 |
+| NO | 0.95 | 0.95 | 0.95 | 0.95 | 0.95 |
+| ETT (15 min) | 0.75 | 0.75 | 0.75 | 0.75 | 0.75 |
+
+Bar chart titled 'Zero Shot v/s AutoTune across Datasets' showing MASE Score for various datasets. The datasets are Traffic, Weather, ETT (hourly), ERCOT Load, Australian Electricity, Exchange Rate, FRED-MD, INC (daily), NO, and ETT (15 min). The legend indicates: Zero Shot Large (blue), Zero Shot Base (orange), Zero Shot Small (green), Zero Shot Mini (yellow), and Autotune with LoRA and LDS (purple).
+
+Figure 5: Plot showing the comparison of MASE scores obtained using Autotune with Zero shot models of different sizes.
+
+
+
+Two line charts comparing performance for Monash Australian Electricity and Exchange Rate datasets. The left chart shows 'Monash Australian Electricity' with a y-axis from 3000 to 5000. The right chart shows 'Exchange Rate' with a y-axis from 1.10 to 1.40. Both charts compare Actual Data (blue line), Historical Forecast (dashed line), Zero Shot Forecast (orange line), Zero Shot Forecast with LoRA and LDS (green line), and Autotuned Forecast (purple line).
+
+Figure 6: Performance comparison for Zero shot, Full fine-tuned and Autotuned models for Monash Australian Electricity and Exchange Rate datasets.
+
+Figure 6 illustrates the predictive performance of the various models on the target domain datasets : Monash Australian Electricity and Exchange Rate respectively. Here, we compare the forecasts obtained on the test split by our autotuned model with the other models, clearly highlighting the improved prediction accuracy obtained using our approach. In summary, our findings demonstrate that our approach can efficiently autotune time series transformers by searching the most optimal hyper-parameters to enhance their downstream performance in the target domain.
+
+{9}------------------------------------------------
+
+## 6 CONCLUSION AND FUTURE WORK
+
+Time series transformers efficiently capture long-range patterns and dependencies, improving the model’s ability to predict complex temporal relationships. However, their successful application to specific downstream tasks needs adaptation to the target domain datasets which can be achieved via fine-tuning. In this work, we propose autotuning time series transformers using parameter efficient fine-tuning method LoRA along with LDS as the search strategy. Our approach outperforms full fine-tuning specifically for out-of-domain datasets not seen during the model pre-training phase. Furthermore, we show that our autotuned model also beats the zero shot mini models for 80% of the benchmark datasets surpassing even the performance of the zero shot large models in some cases. Furthermore, since our autotuning approach is based on LoRA, it can be easily extended to other time series foundation models. In the future, we will also extend our autotune approach for multivariate time series datasets.
+
+## REFERENCES
+
+- Abdul Fatir Ansari, Lorenzo Stella, Caner Turkmen, Xiyuan Zhang, Pedro Mercado, Huibin Shen, Oleksandr Shchur, Syama Sundar Rangapuram, Sebastian Pineda Arango, Shubham Kapoor, et al. Chronos: Learning the language of time series. *arXiv preprint arXiv:2403.07815*, 2024.
+- Charith Chandra Sai Balne, Sreyoshi Bhaduri, Tamoghna Roy, Vinija Jain, and Aman Chadha. Parameter efficient fine tuning: A comprehensive analysis across applications. *arXiv preprint arXiv:2404.13506*, 2024.
+- Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. *arXiv preprint arXiv:2108.07258*, 2021.
+- Matthias Feurer, Aaron Klein, Katharina Eggensperger, Jost Springenberg, Manuel Blum, and Frank Hutter. Efficient and robust automated machine learning. *Advances in neural information processing systems*, 28, 2015.
+- Azul Garza and Max Mergenthaler-Canseco. Timegpt-1. *arXiv preprint arXiv:2310.03589*, 2023.
+- Rakshitha Godahewa, Christoph Bergmeir, Geoffrey I Webb, Rob J Hyndman, and Pablo Montero-Manso. Monash time series forecasting archive. *arXiv preprint arXiv:2105.06643*, 2021.
+- Nate Gruver, Marc Finzi, Shikai Qiu, and Andrew G Wilson. Large language models are zero-shot time series forecasters. *Advances in Neural Information Processing Systems*, 36, 2024a.
+- Nate Gruver, Marc Finzi, Shikai Qiu, and Andrew G Wilson. Large language models are zero-shot time series forecasters. *Advances in Neural Information Processing Systems*, 36, 2024b.
+- William D Harvey and Matthew L Ginsberg. Limited discrepancy search. In *IJCAI (1)*, pp. 607–615, 1995.
+- Xin He, Kaiyong Zhao, and Xiaowen Chu. Automl: A survey of the state-of-the-art. *Knowledge-based systems*, 212:106622, 2021.
+- Luis Hernandez, Carlos Baladron, Javier M Aguiar, Belén Carro, Antonio J Sanchez-Esguevillas, Jaime Lloret, and Joaquim Massana. A survey on electric power demand forecasting: future trends in smart grids, microgrids and smart buildings. *IEEE Communications Surveys & Tutorials*, 16 (3):1460–1495, 2014.
+- Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. *Neural Comput.*, 9(8): 1735–1780, nov 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL .
+- Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhuo Chen. Lora: Low-rank adaptation of large language models. *arXiv preprint arXiv:2106.09685*, 2021a.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/rObkvzJxTG.txt b/papers/rObkvzJxTG.txt
new file mode 100644
index 0000000000000000000000000000000000000000..639acb483713b36902a3f242ea3612d04d3e8d93
--- /dev/null
+++ b/papers/rObkvzJxTG.txt
@@ -0,0 +1,358 @@
+**Primary Area:** transfer learning, meta learning, and lifelong learning
+
+
+
+{0}------------------------------------------------
+
+# SMOOTHING THE SHIFT: TOWARDS STABLE TEST-TIME ADAPTATION UNDER COMPLEX MULTIMODAL NOISES
+
+Zirun Guo Tao Jin\*
+
+Zhejiang University
+
+zrguo.cs@gmail.com
+
+## ABSTRACT
+
+Test-Time Adaptation (TTA) aims to tackle distribution shifts using unlabeled test data without access to the source data. In the context of multimodal data, there are more complex noise patterns than unimodal data such as simultaneous corruptions for multiple modalities and missing modalities. Besides, in real-world applications, corruptions from different distribution shifts are always mixed. Existing TTA methods always fail in such multimodal scenario because the abrupt distribution shifts will destroy the prior knowledge from the source model, thus leading to performance degradation. To this end, we reveal a new challenge named *multimodal wild TTA*. To address this challenging problem, we propose two novel strategies: sample identification with interquartile range Smoothing and unimodal assistance, and Mutual information sharing (SuMi). SuMi smoothes the adaptation process by interquartile range which avoids the abrupt distribution shifts. Then, SuMi fully utilizes the unimodal features to select low-entropy samples with rich multimodal information for optimization. Furthermore, mutual information sharing is introduced to align the information, reduce the discrepancies and enhance the information utilization across different modalities. Extensive experiments on two public datasets show the effectiveness and superiority over existing methods under the complex noise patterns in multimodal data. Code is available at .
+
+## 1 INTRODUCTION
+
+Deep learning has achieved remarkable success and has been widely adopted across a variety of applications (Touvron et al., 2023; Podell et al., 2024; Yan et al., 2024; Lin et al., 2024). However, these models often struggle when faced with data distributions that differ from their training data. For example, in real-world scenarios, unexpected environmental changes and noises always occur such as weather changes and data corruption. When encountering such domain shifts, model performance can degrade rapidly (Hendrycks & Dietterich, 2019). To address this challenge, many adaptation techniques such as domain adaptation (Zhu et al., 2023) and domain generalization (Zhou et al., 2023a) have been proposed to enhance the robustness of models. One of the most challenging settings is Test-Time Adaptation (TTA) (Wang et al., 2021; Niu et al., 2022), where the model must adapt to a target domain without access to any source domain data and labels of target data. Recently, numerous promising test-time adaptation methods (Niu et al., 2023; Yang et al., 2024; Lee et al., 2024; Chen et al., 2024; Guo et al., 2024b) have shown great results.
+
+However, the majority of existing TTA methods have focused on unimodal scenarios. In comparison to unimodal tasks, multimodal tasks often face more complex noise patterns, such as simultaneous noise corruption across multiple modalities or missing modalities. In this work, we broadly categorize multimodal noise scenarios into two types (shown in Figure 1(a)): weak Out-Of-Distribution (OOD) samples, where only one modality is corrupted by noise, and strong OOD samples, where multiple modalities are corrupted by noise or missing modality issues occur. Considering a multimodal sentiment analysis system, audio corruption can arise from factors like the speaker’s accent,
+
+---
+
+\*Corresponding author
+
+{1}------------------------------------------------
+
+
+
+Figure 1 consists of four subplots. Subplot (a) shows examples of clean, weak OOD, and strong OOD data with noise patterns. Subplots (b), (c), and (d) are bar charts comparing the accuracy of various methods (Tent, SAR, SoTTA, DeYO, CEMA, SuMi (Ours)) across different OOD scenarios.
+
+**(b) Performance under four strong OOD scenarios**
+
+| Method | Both | Vmiss | Amiss | Mix |
+|-|-|-|-|-|
+| Tent | ~15 | ~10 | ~20 | ~5 |
+| SAR | ~15 | ~10 | ~20 | ~5 |
+| SoTTA | ~15 | ~10 | ~20 | ~5 |
+| DeYO | ~15 | ~10 | ~20 | ~5 |
+| CEMA | ~15 | ~10 | ~20 | ~5 |
+| SuMi (Ours) | ~45 | ~30 | ~40 | ~20 |
+
+**(c) Performance under weak OOD and strong OOD scenarios**
+
+| Method | Weak OOD | Strong OOD | Strong source |
+|-|-|-|-|
+| Tent | ~65 | ~10 | ~10 |
+| SAR | ~65 | ~10 | ~10 |
+| SoTTA | ~65 | ~10 | ~10 |
+| DeYO | ~65 | ~10 | ~10 |
+| CEMA | ~65 | ~10 | ~10 |
+| SuMi (Ours) | ~65 | ~35 | ~10 |
+
+**(d) Performance under same and mixed distribution shifts**
+
+| Method | Same distribution | Mixed distribution | Mixed source |
+|-|-|-|-|
+| Tent | ~65 | ~40 | ~40 |
+| SAR | ~65 | ~40 | ~40 |
+| SoTTA | ~65 | ~40 | ~40 |
+| DeYO | ~65 | ~40 | ~40 |
+| CEMA | ~65 | ~40 | ~40 |
+| SuMi (Ours) | ~65 | ~60 | ~40 |
+
+Figure 1: Illustration of our task and performance comparison. (a) Noise patterns of multimodal data: Clean Data, Weak OOD Data, and Strong OOD Data. (b) Performance under four strong OOD scenarios: Both, Vmiss, Amiss, and Mix. (c) Performance under weak OOD and strong OOD scenarios. (d) Performance under same and mixed distribution shifts.
+
+Figure 1: Illustration of our task where the target domain includes various domain shifts including weak OOD and strong OOD samples. The performances of existing methods degrade significantly on this challenging task, even worse than the source model. We get these results on Kinetics50-C.
+
+dialect, and background noise. Video corruption can occur due to lighting variations and diverse facial features. Furthermore, audio corruption can lead to transcription errors in text, creating text noise and leading to simultaneous domain shifts (strong OOD) across modalities. As shown in Figure 1(b) and (c), we observe the performance of existing TTA methods can degrade significantly when faced with the more complex noise patterns encountered in multimodal scenarios, especially in the case of strong OOD samples. The huge distribution gap between the source domain and the strong OOD data will damage the prior knowledge in the source model, thus leading to performance degradation. Additionally, in real-world dynamic environments where the target domain includes various types of distribution shifts (known as wild TTA), the performance of existing TTA methods always fail (Niu et al., 2023). To address the challenge in wild TTA, Niu et al. (2023) propose a sharpness-aware and reliable entropy minimization method to further stabilize TTA. However, as shown in Figure 1(d), in the context of multimodal wild TTA where the target domain includes various distribution shifts, the results are still not satisfying. A recent work READ (Yang et al., 2024) explores the reliability bias in multimodal data during test time. READ proposes that when one of the modalities is corrupted, the reliability balance across the modalities will be destroyed, which leads to a heavy performance degradation of the model. However, it only discusses the weak OOD situations and overlooks the more complex noise patterns in multimodal data. Besides, it is based on the mild TTA setting where test samples have the same distribution shift type.
+
+Based on the above observations and the limitations of existing methods, in this paper, we reveal a new challenging task named *multimodal wild TTA* where the target domain includes various types of distribution shifts including weak OOD samples and strong OOD samples. To address the challenging problem, we propose two novel strategies: sample identification with interquartile range Smoothing and unimodal assistance and Mutual information sharing (SuMi). To avoid the abrupt distribution shifts which could destroy the prior knowledge from the source model, we propose to smooth the adaptation process with interquartile range. Besides, we fully utilize the unimodal information to select low-entropy samples with rich multimodal information. Furthermore, we propose the mutual information sharing to align information between different modalities which can reduce the discrepancies across different modalities and enhance the information utilization of different modalities. Our main contributions can be summarized as follows:
+
+- We show that the complex noise patterns in multimodal data will make existing TTA methods fail. To this end, we propose a new practical and challenging task named *multimodal*
+
+{2}------------------------------------------------
+
+
+
+Figure 2: Overview of SuMi. The diagram illustrates the architecture of the SuMi model. It starts with two input modalities: Video and Audio. The Video is processed by a Video Encoder, and the Audio by an Audio Encoder. Both encoders output features that are then processed by Fusion Layers. The Fusion Layers output entropy distributions, \$Ent\_u(x^{(m)}) \in S\_u(x)\$ for the video modality and \$Ent\_a(x^{(m)}) \in S\_a(x)\$ for the audio modality. These distributions are visualized as histograms. A central part of the diagram shows a sample identification process using the Interquartile Range (IQR) method. A dashed box contains a graph of the entropy distribution with the IQR marked. The IQR is defined as \$Q\_3 - Q\_1\$, where \$Q\_1 = \frac{1}{4}IQR\$ and \$Q\_3 = \frac{3}{4}IQR\$. The sample identification process is labeled with '25%', '50%', and '75%'. The identified samples are then used for 'Unimodal Assistance', which is visualized as a 2x2 grid of areas (Area1, Area2, Area3, Area4) representing the entropy distribution. The overall optimization process is shown at the bottom right, with a formula for the loss function \$\mathcal{L}(x) = \alpha(x) \mathbb{I}(x \in \mathcal{S}\_u(x) \cap \mathcal{S}\_a(x))\$ and a formula for the weight \$\alpha(x) = \frac{1}{\max(\mathcal{S}\_u(x), \mathcal{S}\_a(x))}\$.
+
+Figure 2: The overview of SuMi.
+
+*wild TTA* where the target domain includes various types of distribution shifts including weak OOD samples and strong OOD samples.
+
+- We propose a novel method SuMi, consisting of sample identification with interquartile range smoothing and unimodal assistance, and mutual information sharing.
+- SuMi outperforms all the baselines consistently and significantly in weak, strong and mixed OOD domains. Additionally, we build two benchmarks for multimodal wild TTA.
+
+## 2 RELATED WORK
+
+Test-time adaptation aims to update the source model without source domain data and labels of the target domain data. Test-time training, such as TTT (Sun et al., 2020) and TTT+ (Liu et al., 2021) trains a source model with both supervised and self-supervised objectives in the training stage to enhance test-time adaptation. These methods depend on proxy tasks and assume that the training process is controllable, which limits the scope of applications. Therefore, fully test-time adaptation methods (Wang et al., 2021; Niu et al., 2022; Zhou et al., 2023b; Yuan et al., 2023; Gong et al., 2023a; Park et al., 2024) are proposed to adapt the model only in test-time, without intervening in the training stage. Tent (Wang et al., 2021) proposes to use entropy minimization to update the normalization layers of the model. Furthermore, EATA (Niu et al., 2022) and SAR (Niu et al., 2023) propose the sample selection criteria for entropy minimization. More recently, Lee et al. (2024) show that using entropy alone as a measure of confidence is insufficient and propose to use a combination of entropy and the proposed PLPD metric to identify samples. Chen et al. (2024) proposes a dynamic unreliable and low-informative sample exclusion method for entropy minimization.
+
+However, existing works focus on the unimodal TTA. Compared to unimodal scenarios, multimodal data face much more complex patterns of noise in real-world applications, such as simultaneous corruptions and missing modalities (Guo et al., 2024c). Shin et al. (2022) proposes a framework to generate cross-modal pseudo labels as self-training signals. Guo et al. (2024b) propose a multimodal TTA approach but focus on the multimodal regression tasks. A recent work (Yang et al., 2024) explores the multimodal TTA and proposes reliable fusion and robust adaptation to address information discrepancies in multimodal data. However, it only discusses the situations where there is only one modality corrupted. When there are multiple modalities corrupted or missing, the huge and abrupt distribution gap between the source domain and the target domain will make the method fail. Additionally, it focuses on the single domain adaptation. In contrast, we explore a more practical and challenging wild TTA where the target domain includes various types of corruption.
+
+## 3 METHODOLOGY
+
+### 3.1 PROBLEM FORMULATION
+
+Without loss of generality, we take two modalities as an example for clarity of presentation. Let $\mathcal{M}_\theta = (\phi_{u_1}, \phi_{u_2}, \mathcal{F})$ with parameter $\theta$ be the source model pre-trained on the source domain dataset $\mathcal{D}_{source} = \{(\mathbf{x}_i, y_i)\}_{i=1}^{N_s}$ where $\phi_{u_1}, \phi_{u_2}$ are the encoders of modality $u_1$ and $u_2$ , $\mathcal{F}$ is the multi-
+
+{3}------------------------------------------------
+
+modal fusion layers with prediction head, $\mathbf{x}_i = (\mathbf{x}_i^{u_1}, \mathbf{x}_i^{u_2})$ , and $N_s$ is the number of samples. TTA aims to fine-tune the source model $\mathcal{M}_\theta$ on the target domain dataset $\mathcal{D}_{target} = \{\mathbf{x}_i\}_{i=1}^{N_s}$ where the labels and the source dataset are unavailable. Existing TTA methods (Niu et al., 2023; Yang et al., 2024) update the parameter $\theta$ by minimizing the entropy of test domain data:
+
+$$\text{Ent}_\theta(\mathbf{x}) = -\mathbf{p}_\theta(\mathbf{x}) \log \mathbf{p}_\theta(\mathbf{x}) = -\sum_{i=1}^C p_\theta(\mathbf{x})_i \log p_\theta(\mathbf{x})_i \quad (1)$$
+
+where $\mathbf{p}_\theta = \text{softmax}(\mathcal{M}_\theta(\mathbf{x})) = (p_\theta(\mathbf{x})_1, p_\theta(\mathbf{x})_2, \dots, p_\theta(\mathbf{x})_C)$ is the probabilistic distribution outputted by the model $\mathcal{M}_\theta$ and $C$ is the number of classes.
+
+In this paper, we reveal a new challenging task named *multimodal wild TTA*. Specifically, we broadly categorize multimodal noise scenarios into two types: weak OOD samples, where only one modality is corrupted by noise, and strong OOD samples, where multiple modalities are corrupted by noise or missing modality issues occur. Multimodal wild TTA considers a more practical and challenging TTA setting where the target datasets contain various types of distribution shifts including both weak OOD samples and strong OOD samples. The overall architecture of SuMi is presented in Figure 2.
+
+### 3.2 SAMPLE IDENTIFICATION WITH INTERQUARTILE RANGE SMOOTHING AND UNIMODAL ASSISTANCE
+
+#### 3.2.1 INTERQUARTILE RANGE SMOOTHING
+
+Many existing TTA methods rely on selecting low-entropy samples for entropy minimization (Niu et al., 2022; Lee et al., 2024; Chen et al., 2024). However, when the target data is a mixture of various types of distribution shifts, including weak OOD samples and strong OOD samples, the performance of the model would degrade significantly. For example, in Figure 3(a), we present the performance of three different settings of the adaptation process. We can observe that directly adapting the model to the strong OOD domain will yield much poorer performance than a model adapted on weak OOD domain. The main reason is that there is a huge distribution gap between the source domain and the strong OOD domain. Therefore, a direct adaptation would destroy the prior knowledge of the source model and lead to instability. In comparison, when we first perform adaptation on the weak OOD domain before the strong OOD domain, the performance of the model will improve. This phenomenon inspires us that a smoothing adaptation process under the wild TTA and complex noise patterns of multimodal data is much better than an abrupt adaptation process.
+
+Motivated by the above observations, we propose an interquartile range smoothing method for dynamic sample identification during the adaptation process. Interquartile range (IQR) is a measure of statistical dispersion, which is the spread of the data (Dekking et al., 2006). We give a brief definition of IQR below:
+
+**Definition 1** IQR is the difference between the 75th and 25th percentiles of the data. The data is divided into four rank-ordered even parts via linear interpolation which are denoted as $Q_1$ (lower quartile), $Q_2$ (median) and $Q_3$ (upper quartile). IQR is calculated as $\text{IQR} = Q_3 - Q_1$ .
+
+IQR is often used to identify unstable samples or outliers in a dataset. Specifically, according to Tukey’s rule (Tukey et al., 1977), the stable sample set $\mathcal{X}_s$ is selected as:
+
+$$\mathcal{X}_s = \{\mathbf{x} \mid \mathbf{x} \geq Q_1 - \frac{3}{2}\text{IQR} \text{ and } \mathbf{x} \leq Q_3 + \frac{3}{2}\text{IQR}\} \quad (2)$$
+
+To smooth the adaptation process, we modify the above equation slightly and select the samples $\mathcal{H}_\theta^t(\mathbf{x})$ as:
+
+$$\begin{aligned} \mathcal{H}_\theta^t(\mathbf{x}) &= \{\mathbf{h} \mid \mathbf{h} \geq Q_1 - \frac{3}{2}f(t)\text{IQR} \text{ and } \mathbf{h} \leq Q_3 + \frac{3}{2}f(t)\text{IQR}\} \\ \mathbf{h} &= [\mathbf{h}^{u_1}, \mathbf{h}^{u_2}], \mathbf{h}^{u_1} = \phi_{u_1}(\mathbf{x}^{u_1}), \mathbf{h}^{u_2} = \phi_{u_2}(\mathbf{x}^{u_2}) \end{aligned} \quad (3)$$
+
+where $t$ is the current iteration, $\theta$ is the parameter of the model, $f(t)$ is the smoothing function, $[,]$ is the concatenation operation and $\mathbf{h}$ is the representation of the sample. For simplicity, we use the linear smoothing and set $f(t) = t/\text{iter}$ where $\text{iter}$ is the total iteration. We use the representations instead of the raw inputs because the representations are informative dense vectors that contain less
+
+{4}------------------------------------------------
+
+
+
+Figure 3 consists of three subplots. Subplot (a) is a bar chart with three bars labeled 'Weak', 'Strong', and 'Weak to Strong' on the x-axis. The y-axis ranges from 0 to 30. The 'Weak' bar is at approximately 23, the 'Strong' bar is at approximately 12, and the 'Weak to Strong' bar is at approximately 28. Subplot (b) shows four t-SNE visualizations of features during adaptation, labeled 'Iteration 0', 'Iteration 100', 'Iteration 200', and 'Iteration 300'. Each visualization shows a scatter plot of blue and orange points. Subplot (c) is a bar chart with five groups of bars on the x-axis labeled '[0,20]', '[20,40]', '[40,60]', '[60,80]', and '[80,100]'. The y-axis ranges from 0 to 60. Each group contains two bars: a blue bar for 'multimodal' and a green bar for 'video'. The legend indicates 'multimodal' (blue square) and 'video' (green square).
+
+Figure 3: (a) Bar chart showing performance for Weak, Strong, and Weak to Strong settings. (b) t-SNE visualizations of features during adaptation. (c) Bar chart showing performance for different quantiles of multimodal and unimodal entropy.
+
+Figure 3: (a) Performance of different adaptation settings on strong OOD samples. (b) t-SNE visualizations (Van der Maaten & Hinton, 2008) of features during adaptation. (c) Performance using different quantiles multimodal and unimodal entropy. Results are obtained on Kinetics50-C.
+
+noise and unrelated information than the raw inputs. At iteration $t$ , we use the selected data $\mathcal{H}_b^t(\mathbf{x})$ for adaptation. In Figure 3(b), we visualize the sample identification process using the source model. From the figure, we can observe that at first several iterations, most weak OOD samples are selected. With the increase of $t$ , the data for adaptation is also increasing, including more and more strong OOD samples. This smoothing process enables gradual adaptation to the strong OOD samples and various types of distribution shifts, avoiding the abrupt distribution gaps which could destroy the prior knowledge of the source model. Additionally, $\mathbf{h}$ is a vector. Therefore, in practice, we select $\mathbf{h}$ for adaptation if $\beta + (1 - \beta)f(t)$ percent of the values in $\mathbf{h}$ satisfy Equation 3 for stability.
+
+#### 3.2.2 UNIMODAL ASSISTANCE
+
+IQR smoothing aims to help the model preserve the prior knowledge in the source model and gradually adapt to the strong OOD samples and various types of distribution shifts. However, this process can not distinguish the high-quality samples that benefit the entropy minimization. Therefore, we introduce a novel sample identification method for multimodal data. As suggested in previous work (Niu et al., 2022; 2023; Chen et al., 2024), low-entropy samples will benefit the entropy minimization while high-entropy samples, due to its uncertainty, will adversely affect the process. However, in the context of multimodal data, apart from multimodal entropy, there is unimodal entropy we can utilize to help the adaptation. As shown in Figure 3(c), we conduct experiments using unimodal entropy and multimodal entropy. We can easily observe that the multimodal low-entropy samples will yield much better performance than high-entropy samples. However, for audio and video modality, the samples of $\langle 20, 40 \rangle$ interval yield better results than samples of $\langle 0, 20 \rangle$ . This indicates that for unimodal entropy, lower entropy does not necessarily correlate with better performance. When only one modality exhibits low entropy, it indicates that the sample does not rely on multimodal data for accurate prediction, implying it has low informative value for multimodal optimization. Conversely, a unimodal sample with slightly higher entropy shows a dependence on multimodal data for accurate prediction, indicating that it contains rich multimodal information.
+
+Inspired by the above observations, we propose a sample identification method with unimodal assistance to select low-entropy samples with rich multimodal information. Specifically, our method employs the following identification criteria:
+
+$$\mathcal{S}_\theta(\mathbf{x}) = \{\mathbf{x} \mid \text{Ent}_\theta(\mathbf{x}) \leq \gamma_m \text{ and } (\text{Ent}_\theta(\mathbf{x}^{u_1}) + \mu \text{Ent}_\theta(\mathbf{x}^{u_2})) \geq \gamma_u\} \quad (4)$$
+
+where $\gamma_m$ and $\gamma_u$ are the pre-defined threshold for multimodal and unimodal entropy and $\mu$ is a trade-off between modalities. By limiting the multimodal entropy, we can select low-entropy samples with high certainty and fewer noises. Meanwhile, by limiting the unimodal entropy, we can ensure the samples selected contain rich multimodal information, excluding low-informative samples.
+
+### 3.3 MUTUAL INFORMATION SHARING
+
+A recent study (Yang et al., 2024) reveals a challenge in multimodal TTA, known as reliability bias, which refers to the information discrepancies across different modalities. During the adaptation process, this discrepancy often leads to imbalanced utilization of each modality (Guo et al., 2024a). In strong OOD situations, missing modality cases could occur or multiple modalities could be corrupted. Therefore, the imbalanced phenomenon could be enlarged. How to balance the adaptation
+
+{5}------------------------------------------------
+
+#### **Algorithm 1** SuMi
+
+---
+
+```
+
+1: Input: Source model $\mathcal{M}_\theta = (\phi_{u_1}, \phi_{u_2}, \mathcal{F})$ , target dataset $\mathcal{D}_{target} = \{\mathbf{x}_i\}_{i=1}^{N_t}$ , adaptation iterations $T$ and a series of hyperparameters.
+2: for $t = 1$ to $T$ do
+3: $\mathbf{x} = (\mathbf{x}^{u_1}, \mathbf{x}^{u_2}) \xleftarrow{\text{Sample}} \mathcal{D}_{target}$ ;
+4: Calculate the representations $\mathbf{h} = [\mathbf{h}^{u_1}, \mathbf{h}^{u_2}]$ , $\mathbf{h}^{u_1} = \phi_{u_1}(\mathbf{x}^{u_1})$ , $\mathbf{h}^{u_2} = \phi_{u_2}(\mathbf{x}^{u_2})$ ;
+5: Calculate $Q_1$ and $Q_3$ : $Q_1 = \text{quantile}(\mathbf{h}, 0.25)$ , $Q_3 = \text{quantile}(\mathbf{h}, 0.75)$ ;
+6: Calculate IQR: $\text{IQR} = Q_3 - Q_1$ ;
+7: Select samples $\mathcal{H}_\theta^t(\mathbf{x})$ using Equation 3;
+8: Calculate entropy of multimodal outputs and unimodal outputs;
+9: Select samples $\mathcal{S}_\theta^t(\mathbf{x})$ from $\mathcal{H}_\theta^t(\mathbf{x})$ using Equation 4;
+10: Calculate the entropy in $\mathcal{S}_\theta(\mathbf{x})$ ;
+11: if $t < t_0$ then
+12: Calculate mutual information sharing loss using Equation 6;
+13: end if
+14: Calculate the loss $\mathcal{L}(\mathbf{x})$ using Equation 8;
+15: Update the affine parameters of the model $\mathcal{M}_\theta$ ;
+16: end for
+
+```
+
+---
+
+across different modalities under strong OOD domains (especially missing modality cases) is very important. To address this problem, we propose a simple yet effective method, mutual information sharing, to align information between different modalities. Concretely, for modality $u_i$ , we can obtain its probabilistic distribution as $\mathbf{p}_\theta^{u_i}(\mathbf{x}^{u_i}) = \text{softmax}(\mathcal{F}(\phi_{u_i}(\mathbf{x}^{u_i})))$ . For simplicity, we will use $\mathbf{p}^{u_i}$ to represent $\mathbf{p}_\theta^{u_i}(\mathbf{x}^{u_i})$ in the following context. We define the complementary probabilistic distribution of $\mathbf{p}^{u_i}$ as
+
+$$\mathbf{p}^{u_i'} = \left( \sum_{j=1}^M \mathbf{p}^{u_j} - \mathbf{p}^{u_i} \right) / (M - 1) \quad (5)$$
+
+where $M$ is the number of modalities. For two modalities, $\mathbf{p}^{u_1'} = \mathbf{p}^{u_2}$ and $\mathbf{p}^{u_2'} = \mathbf{p}^{u_1}$ . To improve the alignment between different modalities, we can minimize the *KL divergence* (Kullback & Leibler, 1951) between the probabilistic distribution $\mathbf{p}^{u_i}$ and its complementary distribution $\mathbf{p}^{u_i'}$ . However, if one modality is severely corrupted, minimizing the KL divergence might influence the clean modality. Therefore, we add multimodal distribution $\mathbf{p}^m = \text{softmax}(\mathcal{M}_\theta(\mathbf{x}))$ to improve the robustness and stability. Therefore, we can represent the mutual information sharing loss as:
+
+$$\begin{aligned} \mathcal{L}_{mis}(\mathbf{x}) &= D_{KL}(\mathbf{p}^{u_1} \parallel \frac{1}{2}(\mathbf{p}^{u_1'} + \mathbf{p}^m)) + D_{KL}(\mathbf{p}^{u_2} \parallel \frac{1}{2}(\mathbf{p}^{u_2'} + \mathbf{p}^m)) \\ &= \sum_{i=1}^C p_i^{u_1} \log \frac{2p_i^{u_1}}{p_i^{u_1'} + p_i^m} + \sum_{i=1}^C p_i^{u_2} \log \frac{2p_i^{u_2}}{p_i^{u_2'} + p_i^m} \end{aligned} \quad (6)$$
+
+where $C$ is the number of classes and $p_i$ is the $i$ -th value of $\mathbf{p}$ . Mutual information sharing can help the model connect and align the information between different modalities. Through mutual information sharing, when there are corrupted modalities including missing modalities, information from other modalities could be utilized to enhance the predictions.
+
+### 3.4 OVERALL OPTIMIZATION
+
+Following previous TTA methods (Niu et al., 2022; Lee et al., 2024), we add a weighting term to emphasize the contributions of samples during adaptation. Specifically, the weighting term is calculated as
+
+$$\alpha_\theta(\mathbf{x}) = \frac{1}{\exp[\text{Ent}_\theta(\mathbf{x}) - \text{Ent}_0]} \quad (7)$$
+
+where $\text{Ent}_0$ is a pre-defined normalization factor (Niu et al., 2022). In summary, we can denote the overall loss function as:
+
+$$\mathcal{L}(\mathbf{x}) = \alpha_\theta(\mathbf{x}) \mathbb{1}_{\{\mathbf{x} \in \mathcal{H}_\theta^t(\mathbf{x}), \mathbf{x} \in \mathcal{S}_\theta(\mathbf{x})\}} (\text{Ent}_\theta(\mathbf{x}) + \lambda \mathcal{L}_{mis}(\mathbf{x})) \quad (8)$$
+
+{6}------------------------------------------------
+
+Table 1: Accuracy comparison with SOTA methods on Kinetics50-C with corrupted video modality (severity level 5). We report $\text{avg}_{\pm \text{std}}$ over five random seeds. **Bold**: best results. Underline: second best results.
+
+| Source | Noise | | | Blur | | | Weather | | | | Digital | | | | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | Gauss. | Shot | Impul. | Defoc. | Glass | Motion | Zoom | Snow | Frost | Fog | Brit. | Contr. | Elastic | Pixel | JPEG | Avg. |
+| • Tent | 47.7 | 48.8 | 47.4 | 67.4 | 61.0 | 71.1 | 66.1 | 60.7 | 62.1 | 45.5 | 75.9 | 51.9 | 65.1 | 67.8 | 63.7 | 60.2 |
+| • EATA | 48.3 0.02 | 49.3 0.03 | 48.4 0.03 | 67.8 0.03 | 62.2 0.05 | 71.2 0.03 | 67.8 0.05 | 63.1 0.05 | 63.5 0.05 | 23.0 1.03 | 75.9 0.04 | 50.1 1.03 | 67.8 0.03 | 70.5 0.01 | 67.1 0.03 | 59.8 |
+| • EATA | 49.0 0.02 | 50.3 0.03 | 49.2 0.01 | 67.9 0.02 | 63.9 0.05 | 71.6 0.03 | 67.9 0.02 | 63.4 0.02 | 64.4 0.01 | 47.0 0.04 | 76.1 0.01 | 52.2 0.02 | 67.6 0.02 | 70.3 0.02 | 62.9 0.02 | 61.9 |
+| • SAR | 48.6 0.03 | 49.8 0.06 | 48.7 0.06 | 67.9 0.02 | 62.7 0.05 | 71.8 0.03 | 67.9 0.02 | 63.4 0.04 | 64.2 0.03 | 24.0 0.05 | 75.9 0.04 | 51.1 0.03 | 68.0 0.04 | 70.6 0.02 | 67.2 0.02 | 60.1 |
+| • SoTTA | 48.3 0.03 | 49.8 0.02 | 48.5 0.04 | 67.9 0.02 | 62.5 0.03 | 71.9 0.03 | 67.8 0.06 | 63.2 0.05 | 64.0 0.02 | 27.0 1.11 | 75.7 0.03 | 51.3 0.04 | 67.8 0.03 | 70.4 0.02 | 67.5 0.01 | 60.3 |
+| • DeYO | 48.6 0.03 | 49.8 0.06 | 48.7 0.06 | 68.0 0.03 | 63.0 0.03 | 71.9 0.03 | 68.1 0.05 | 63.5 0.04 | 64.4 0.04 | 21.4 1.10 | 75.9 0.04 | 50.6 0.03 | 68.6 0.04 | 70.8 0.02 | 67.5 0.03 | 60.0 |
+| • CEMA | 48.4 0.03 | 49.4 0.05 | 48.6 0.06 | 67.8 0.02 | 62.7 0.03 | 71.7 0.03 | 67.8 0.02 | 63.4 0.04 | 64.2 0.03 | 23.8 0.05 | 75.7 0.04 | 50.7 0.04 | 67.9 0.05 | 70.5 0.02 | 67.3 0.03 | 59.9 |
+| • READ | 49.9 0.03 | 50.8 0.05 | 49.9 0.05 | 67.9 0.02 | 65.1 0.03 | 72.2 | 69.2 0.09 | 64.8 0.05 | 66.7 0.03 | 56.8 0.05 | 76.2 | 54.4 0.05 | 68.9 0.05 | 70.7 0.02 | 68.9 0.02 | 63.5 |
+| • SuMi | 50.1 0.04 | 50.7 0.03 | 50.4 0.03 | 68.2 0.03 | 65.6 0.03 | 72.2 0.02 | 69.7 0.04 | 65.7 0.03 | 67.0 0.02 | 56.5 0.05 | 77.1 0.02 | 55.2 0.04 | 69.3 0.02 | 71.2 0.02 | 68.9 0.02 | 63.9 |
+
+Table 2: Accuracy comparison with SOTA methods on Kinetics50-C with corrupted audio modality and strong OOD scenarios (severity level 5).
+
+| Source | Noise | | | Weather | | | | Strong OOD | | | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | Gauss. | Traff. | Crowd | Rain | Thund. | Wind | Avg. | Both | Vmiss | Amiss | Mix | Avg. |
+| • Tent | 74.9 | 65.4 | 67.9 | 70.0 | 68.5 | 70.7 | 69.6 | 30.8 | 27.9 | 44.5 | 16.9 | 30.0 |
+| • EATA | 74.8 0.05 | 68.2 0.05 | 70.3 1.03 | 71.1 0.04 | 66.7 0.05 | 71.7 0.01 | 70.5 | 13.1 1.04 | 9.2 0.05 | 21.3 1.04 | 1.2 0.05 | 11.2 |
+| • SAR | 74.8 0.05 | 68.4 0.04 | 70.2 0.03 | 71.2 0.03 | 68.9 0.04 | 71.9 0.01 | 70.9 | 13.6 1.04 | 10.3 0.04 | 23.5 0.04 | 3.8 0.05 | 12.8 |
+| • SoTTA | 74.8 0.05 | 68.4 0.04 | 70.1 0.02 | 71.1 0.03 | 69.2 0.02 | 71.8 0.02 | 70.9 | 14.1 1.04 | 9.8 0.05 | 24.1 1.03 | 1.9 0.05 | 12.5 |
+| • DeYO | 74.8 0.05 | 68.6 0.04 | 70.3 0.04 | 71.3 0.05 | 70.4 0.03 | 72.0 0.01 | 71.2 | 14.9 1.04 | 12.1 1.03 | 27.6 0.04 | 2.1 1.05 | 14.2 |
+| • CEMA | 74.8 0.04 | 67.8 0.04 | 69.5 1.04 | 71.1 0.04 | 70.5 0.03 | 71.6 0.03 | 70.9 | 16.9 0.04 | 13.4 1.04 | 30.3 0.03 | 1.8 1.06 | 15.6 |
+| • READ | 73.9 0.05 | 69.1 1.04 | 70.3 0.02 | 71.4 0.04 | 72.8 0.05 | 71.3 0.03 | 71.6 | 31.1 1.03 | 27.5 1.05 | 44.3 0.03 | 13.7 1.03 | 29.1 |
+| • SuMi | 75.1 0.03 | 68.9 0.03 | 70.6 0.03 | 71.6 0.03 | 72.8 0.04 | 72.1 1.02 | 71.9 | 34.8 0.03 | 31.8 0.03 | 48.6 0.02 | 18.4 0.04 | 33.4 |
+
+Table 3: Accuracy comparison with SOTA methods on VGGSound-C with corrupted video modality (severity level 5).
+
+| Source | Noise | | | Blur | | | Weather | | | | Digital | | | | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | Gauss. | Shot | Impul. | Defoc. | Glass | Motion | Zoom | Snow | Frost | Fog | Brit. | Contr. | Elastic | Pixel | JPEG | Avg. |
+| • Tent | 53.0 | 52.9 | 53.0 | 57.2 | 57.3 | 58.6 | 57.5 | 56.3 | 56.5 | 55.4 | 59.2 | 53.7 | 57.2 | 56.4 | 57.3 | 56.1 |
+| • EATA | 53.0 0.01 | 52.9 0.01 | 52.9 0.01 | 57.3 0.01 | 56.3 0.01 | 57.6 0.01 | 56.8 0.01 | 55.4 0.01 | 56.0 0.01 | 56.2 0.01 | 59.3 0.01 | 53.5 0.01 | 57.3 0.01 | 56.7 0.01 | 56.8 0.01 | 55.8 |
+| • SAR | 52.9 0.01 | 53.1 0.01 | 52.9 0.01 | 56.3 0.01 | 56.2 0.02 | 57.4 0.01 | 56.7 0.01 | 55.4 0.01 | 56.0 0.01 | 56.2 0.02 | 58.2 0.01 | 53.5 0.01 | 57.4 0.01 | 56.7 0.01 | 56.8 0.01 | 55.7 |
+| • SoTTA | 52.9 0.01 | 53.2 0.01 | 52.9 0.01 | 56.6 0.02 | 56.8 0.02 | 57.9 0.02 | 57.1 0.01 | 55.7 0.01 | 56.1 0.01 | 56.3 0.01 | 59.4 | 53.8 0.02 | 57.6 0.01 | 56.2 0.01 | 56.7 0.01 | 55.9 |
+| • DeYO | 53.0 0.01 | 53.1 0.01 | 53.0 0.01 | 56.5 0.01 | 56.5 0.01 | 57.7 0.01 | 56.9 0.01 | 55.4 0.01 | 56.0 0.01 | 56.3 0.02 | 58.5 0.01 | 53.6 0.01 | 57.6 0.01 | 57.0 0.01 | 57.0 0.01 | 55.9 |
+| • CEMA | 52.8 0.01 | 52.9 0.02 | 52.9 0.01 | 56.5 0.01 | 56.4 0.01 | 57.6 0.01 | 56.8 0.02 | 55.4 0.01 | 56.2 0.01 | 56.2 0.01 | 58.4 0.01 | 53.5 0.01 | 57.8 0.01 | 56.8 0.01 | 56.9 0.01 | 55.8 |
+| • READ | 52.9 0.01 | 52.8 0.02 | 52.8 0.02 | 57.2 0.02 | 57.3 0.03 | 58.8 0.02 | 58.1 0.02 | 56.4 0.01 | 57.5 0.02 | 57.00.01 | 59.3 0.01 | 54.4 0.02 | 57.8 0.01 | 56.6 0.01 | 57.2 0.02 | 56.4 |
+| • SuMi | 54.0 0.01 | 54.0 0.01 | 53.8 0.01 | 58.2 0.02 | 58.4 0.01 | 59.4 0.02 | 58.7 0.02 | 57.5 0.01 | 58.2 0.02 | 57.6 0.01 | 59.4 0.01 | 54.8 0.02 | 59.0 0.01 | 57.5 0.01 | 58.2 0.01 | 57.3 |
+
+where $\mathbb{I}_{\lambda}(\cdot)$ is an indicator function and $\lambda$ is a trade-off between the two losses. One point worth emphasizing is that for strong OOD adaptation, we only add the mutual information sharing loss $\mathcal{L}_{mis}$ in the first $t_0$ iterations during the adaptation process. The reason is that with the increase of iteration, the IQR smoothing will include more and more strong OOD samples where multiple modalities are corrupted which could damage the information sharing and the performance of the model. For weak OOD adaptation, we add mutual information sharing loss for all the iterations. Overall, Algorithm 1 presents the outline of our method.
+
+## 4 EXPERIMENTS
+
+### 4.1 EXPERIMENTAL SETTINGS
+
+**Datasets.** We use two widely used multimodal datasets, Kinetics50 (Kay et al., 2017) and VGGSound (Chen et al., 2020) for evaluation. Following previous work (Hendrycks & Dietterich, 2019; Yang et al., 2024), we introduce 15 different types of corruptions and 6 types for audio to simulate the distribution shifts in real-world applications. Each type of corruption has five levels of severity. For strong OOD samples, we introduce four different types: Both (both modalities are corrupted), Vmiss (video modality is missing), Amiss (audio modality is missing), and Mix (one modality is missing and the other is corrupted). Details of datasets and the corruptions are presented in Appendix A. As a result, we can obtain the corrupted datasets Kinetics50-C and VGGSound-C.
+
+**Implementation Details.** For the source model, we use the pre-trained CAV-MAE (Gong et al., 2023b) following Yang et al. (2024). We use Adam optimizer with a learning rate of 1e-4/1e-5 and
+
+{7}------------------------------------------------
+
+Table 4: Accuracy comparison with SOTA methods on VGGSound-C with corrupted audio modality and strong OOD scenarios (severity level 5). We report $\text{avg}_{\pm \text{std}}$ over five random seeds. **Bold**: best results. Underline: second best results.
+
+| Source | Noise | | | Weather | | | Strong OOD | | | | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | Gauss. | Traff. | Crowd | Rain | Thund. | Wind | Avg. | Both | Vmiss | Amiss | Mix. | Avg. |
+| • Tent | 37.2 | 21.2 | 16.9 | 21.8 | 27.4 | 25.6 | 25.0 | 9.4 | 28.0 | 18.9 | 6.0 | 15.6 |
+| • EATA | 41.2±0.1 | 25.0±0.5 | 28.8±0.6 | 32.3±0.1 | 34.5±0.2 | 33.2±0.2 | 32.5 | 15.2±0.1 | 29.2±0.2 | 19.6±0.3 | 5.8±0.1 | 17.4 |
+| • SAR | 10.9 ±0.7 | 2.1 ±0.2 | 1.0 ±0.0 | 2.0 ±0.0 | 3.2 ±0.2 | 2.3 ±0.1 | 3.6 | 1.1 ±0.0 | 19.8 ±0.1 | 1.5 ±0.0 | 0.3 ±0.0 | 5.7 |
+| • SoTTA | 13.8 ±0.5 | 10.1 ±0.3 | 8.4 ±0.2 | 4.2 ±0.2 | 6.4 ±0.2 | 3.4 ±0.1 | 7.7 | 2.4 ±0.0 | 20.4 ±0.1 | 4.4 ±0.1 | 1.1 ±0.0 | 7.1 |
+| • DeYO | 7.0 ±0.5 | 1.5 ±0.1 | 2.2 ±0.1 | 3.5 ±0.2 | 6.8 ±0.2 | 4.2 ±0.1 | 4.2 | 0.6 ±0.0 | 20.8 ±0.2 | 2.8 ±0.1 | 0.4 ±0.0 | 6.2 |
+| • CEMA | 6.8 ±0.3 | 1.9 ±0.1 | 2.0 ±0.1 | 2.9 ±0.2 | 4.4 ±0.2 | 3.9 ±0.1 | 3.7 | 0.9 ±0.0 | 19.9 ±0.1 | 1.9 ±0.1 | 0.1 ±0.0 | 5.7 |
+| • READ | 27.1 ±0.6 | 22.1 ±0.4 | 19.0 ±0.2 | 21.6 ±0.3 | 23.6 ±1.4 | 21.0 ±0.5 | 22.4 | 10.1 ±0.1 | 27.9 ±0.2 | 15.3 ±0.4 | 4.5 ±0.1 | 14.5 |
+| • SuMi | 41.9±0.3 | 26.3±0.2 | 27.9±0.2 | 31.6±0.3 | 37.1±0.2 | 34.1±0.1 | 33.2 | 18.4±0.2 | 31.8±0.2 | 21.7±0.2 | 6.7±0.1 | 19.7 |
+
+
+
+Figure 4: Comparison with SOTA methods on corrupted data of different severity levels. The figure contains four bar charts: (a) Kinetics50 (weak), (b) Kinetics50 (strong), (c) VGGSound (weak), and (d) VGGSound (strong). Each chart shows accuracy for severity levels 1, 2, 3, and 4. The methods compared are Source, DeYO, EATA, SoTTA, CEMA, READ, and SuMi. SuMi consistently shows high accuracy across all severity levels and datasets.
+
+Figure 4: Comparison with SOTA methods on corrupted data of different severity levels. weak: average accuracy of 21 different types of weak OOD distribution shifts. strong: average accuracy of 4 different types of strong OOD distribution shifts.
+
+
+
+Figure 5: Comparison with SOTA methods on mixed corrupted data with ten different ratios of strong OOD samples. The figure contains four line charts: (a) Kinetics50 (sever. 5), (b) VGGSound (sever. 5), (c) Kinetics50 (mixed), and (d) VGGSound (mixed). Each chart shows accuracy for ratios of strong OOD samples from 0 to 100. The methods compared are Source, Tent, EATA, SoTTA, DeYO, CEMA, READ, and SuMi. SuMi maintains high accuracy even as the ratio of strong OOD samples increases.
+
+Figure 5: Comparison with SOTA methods on mixed corrupted data with ten different ratios of strong OOD samples. (a) and (b): severity level 5. (c) and (d): mixed severity.
+
+batch size of 16/64 for Kinetics50-C and VGGSound-C, respectively. The multimodal threshold $\gamma_m$ in Equation 4 and the normalization factor $\text{Ent}_0$ in Equation 7 are set to $0.4 \times \ln C$ following Niu et al. (2022) by default where $C$ is the number of task classes. The unimodal threshold $\gamma_u$ in Equation 4 is set to $e^{-1}$ by default. The smoothing coefficient $\beta$ is set to 0.6/0.9, the weighting term $\lambda$ is set to 5.0 and the unimodal assistance $\mu$ is set to 1.0 by default for Kinetics50-C and VGGSound-C. For strong OOD adaptation, we set the mutual information sharing term $t_0$ as $\text{iter}/2$ . Following previous work (Niu et al., 2023; Gong et al., 2023a; Chen et al., 2024; Guo et al., 2024b), we update the affine parameters of normalization layers.
+
+### 4.2 COMPARISON WITH STATE-OF-THE-ARTS
+
+We compare our method with Tent (Wang et al., 2021), EATA (Niu et al., 2022), SAR (Niu et al., 2023), SoTTA (Gong et al., 2023a), CEMA (Chen et al., 2024), DeYO (Lee et al., 2024) and READ (Yang et al., 2024).
+
+**Single Domain Results.** We report the accuracy of 21 different types of weak OOD corruptions and 4 different types of strong OOD corruptions at severity level 5 on Kinetics50 and VGGSound in Table 1, 2, 3 and 4. For weak OOD samples, SuMi outperforms existing SOTA methods on most of the distribution shifts and achieves consistent good performances. For strong OOD samples, most of the existing SOTA methods perform even worse than the source model. On both datasets, only EATA performs better than the source model slightly. On the most noisy distribution “Mix” where
+
+{8}------------------------------------------------
+
+
+
+Figure 6: Comparison with SOTA methods on mixed severity level on Kinetics50-C. The figure consists of three bar charts: (a) Video Corruptions, (b) Audio Corruptions, and (c) Strong OOD. Each chart compares five methods: Source (blue), Tent (orange), EATA (green), DeVO (red), and SuMi (purple) across various corruption types. In all cases, SuMi consistently outperforms the other methods, maintaining high performance even in strong OOD scenarios.
+
+Figure 6: Comparison with SOTA methods on mixed severity level on Kinetics50-C.
+
+one of the modality is missing and the other is corrupted, EATA also has a performance degradation, performing worse than the source model. In comparison, SuMi outperforms other methods consistently and significantly on all the four distribution scenarios, indicating its effectiveness and superiority in dealing with the complex noise patterns in multimodal data. Furthermore, we compare SuMi with SOTA methods at different severity levels and present the results in Figure 4. From the figure, we can observe that at different severity levels, most of the methods can work well on weak OOD samples while fail on strong OOD samples. However, SuMi can still perform well and achieve the best results on corrupted datasets at all the four severity levels, which demonstrates its generalization ability.
+
+**Mixed Domain Results.** In Figure 5, we present the results of different methods on datasets with ten different portions of strong OOD samples. Figure 5(a) and 5(b) presents the results at severity level 5. We can observe that all the methods can perform well when the ratio of strong OOD samples is low. However, with the ratio increasing, the performance of most of the methods degrade rapidly, performing worse than the source model. The reason is that the huge distribution gap between the source domain and strong OOD domain destroy the prior knowledge of the source model, thus leading to a degradation of the model. In comparison, SuMi smoothes the process by interquartile range smoothing and outperforms the SOTA methods consistently. From Figure 5(c) and 5(d) where mixed severity level cases are added, we can reach the same conclusion. Moreover, in Figure 6 and 10, we present the results on corrupted data with mixed severity level samples on both datasets. From the table, we can observe that on mixed severity level, SuMi can still achieve consistent improvements, outperforming other SOTA methods in most of the distribution shifts. Additionally, on strong OOD distribution shifts, other methods always fail while SuMi can still perform well. These results indicate the effectiveness of SuMi.
+
+### 4.3 ABLATION STUDY
+
+**Contributions of different components.** In Table 5, we present the results of our ablation experiments. We can observe that IQR smoothing brings the most improvements to the model. This is because IQR smoothing can bridge the gap between the source domain and strong domain, avoiding the abrupt distribution shifts which could destroy the prior knowledge from the source model. Unimodal assistance aims to select low-entropy samples with rich multimodal information for optimization and can also enhance the performance of the model. With these strategies combined, the performance of the model is further enhanced.
+
+**Exploration of unimodal assistance.** In Equation 4 and Figure 2, we divide the samples into four areas. We can consider the four areas as Area 1 (low-entropy samples with rich multimodal information), Area 2 (high-entropy samples with rich multimodal information), Area 3 (low-entropy samples with little multimodal information) and Area 4 (high-entropy samples with little multimodal information). We present the performance of these four areas on Kinetics50-C in Table 6. From the table, we can observe that selecting low-entropy samples for optimization will yield better results. Based on low-entropy samples, rich multimodal information will further help to optimize the multimodal models and achieve better results.
+
+{9}------------------------------------------------
+
+Table 5: Ablation study of different components in SuMi on corrupted data with 50% of strong OOD samples at different severity levels. IQR, UA and MIS represents IQR smoothing, unimodal assistance and mutual information sharing, respectively.
+
+| | | | Kinetics50-C | | | VGGSound-C | | |
+|-|-|-|-|-|-|-|-|-|
+| IQR | UA | MIS | severity 3 | severity 5 | mixed severity | severity 3 | severity 5 | mixed severity |
+| ✓ | | | 37.1 | 31.7 | 36.4 | 25.7 | 23.5 | 25.3 |
+| | ✓ | | 52.1 | 45.1 | 51.9 | 33.8 | 30.4 | 33.1 |
+| | | ✓ | 49.4 | 39.4 | 46.2 | 31.1 | 27.4 | 31.2 |
+| ✓ | ✓ | | 47.4 | 38.1 | 45.6 | 29.8 | 26.1 | 28.4 |
+| ✓ | | ✓ | 58.0 | 51.2 | 57.4 | 36.9 | 34.3 | 36.5 |
+| | ✓ | ✓ | 56.0 | 49.7 | 56.7 | 34.2 | 32.1 | 34.0 |
+| ✓ | ✓ | ✓ | 54.3 | 44.6 | 51.3 | 33.4 | 29.8 | 32.1 |
+| ✓ | ✓ | ✓ | 59.3 | 52.0 | 59.1 | 38.4 | 35.1 | 38.3 |
+
+
+
+Figure 7 consists of two bar charts. Chart (a) shows the impact of the trade-off coefficient $\mu$ on the performance of the model on two datasets: Kinetics50-C (blue bars) and VGGSound-C (green bars). The x-axis represents $\mu$ values from 0.8 to 1.2. For Kinetics50-C, the performance is relatively stable around 50% across all $\mu$ values. For VGGSound-C, the performance decreases as $\mu$ increases, starting around 35% at $\mu=0.8$ and dropping to around 32% at $\mu=1.2$ . Chart (b) shows the impact of the weight term $\lambda$ on the performance of the model on the same two datasets. The x-axis represents $\lambda$ values from 3 to 7. For both datasets, the performance increases as $\lambda$ increases, starting around 50% at $\lambda=3$ and reaching around 55% at $\lambda=7$ for Kinetics50-C and around 35% at $\lambda=7$ for VGGSound-C.
+
+Figure 7: Bar charts showing the impact of hyperparameters mu and lambda on Kinetics50-C and VGGSound-C datasets. (a) Impact of mu: Performance on Kinetics50-C increases with mu, while performance on VGGSound-C decreases. (b) Impact of lambda: Performance on both datasets increases with lambda.
+
+Figure 7: Ablation experiments of hyperparameters on the two datasets.
+
+Additionally, we explore the trade-off coefficient $\mu$ in Equation 4 and present the results on both datasets in Figure 7(a). From the figure, we can observe that with the increase of $\mu$ , the performance improves on Kinetics50-C and drops on VGGSound-C. This is because Kinetics50 is a video modality dominant dataset and VGGSound is an audio modality dominant dataset. From the results, we know that adding more weight to the dominant modality will yield poorer performance because unimodal assistance aims to select samples with rich multimodal information. Therefore, adding weight to the weak modality will help to utilize the multimodal features. Besides, the performances with different $\mu$ are stable, indicating the stability of the strategy.
+
+**Exploration of $\lambda$ .** To explore the mutual information sharing, we select several $\lambda$ in Equation 8 and present the results on both datasets in Figure 7(b). We can observe that increasing the weight term $\lambda$ will improve the performance slightly. Besides, the results in the table demonstrate the stability of mutual information sharing across varying values of $\lambda$ .
+
+Table 6: Performance of samples in different areas on Kinetics50-C.
+
+| | Ratios | Acc |
+|-|-|-|
+| Area 1 | 13.1% | 39.4 |
+| Area 2 | 78.5% | 27.6 |
+| Area 3 | 5.3% | 32.1 |
+| Area 4 | 3.1% | 24.3 |
+
+## 5 CONCLUSION
+
+In this paper, we propose a new practical and challenging task named multimodal wild TTA. To address this problem, we propose sample identification with interquartile range smoothing and unimodal assistance, and mutual information sharing (SuMi). SuMi bridges the gap between the source domain and strong OOD domain by smoothing the adaptation using interquartile range. Besides, SuMi leverages unimodal features to select low-entropy samples with rich multimodal information for optimization. Finally, mutual information sharing is proposed to further align the information and reduce the discrepancies across different modalities. We conduct extensive experiments on two widely used multimodal datasets where SuMi outperforms existing TTA methods significantly and consistently, indicating its effectiveness. Ablation experiments are then conducted to validate the contributions of each component.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/rkAqvDnnmO.txt b/papers/rkAqvDnnmO.txt
new file mode 100644
index 0000000000000000000000000000000000000000..521d1962a561d0d3abb50cc78f31142381631fb9
--- /dev/null
+++ b/papers/rkAqvDnnmO.txt
@@ -0,0 +1,357 @@
+**Primary Area:** applications to neuroscience & cognitive science
+
+
+
+{0}------------------------------------------------
+
+# A SIMPLE EFFICIENCY INCREMENTAL LEARNING FRAMEWORK VIA VISION-LANGUAGE MODEL WITH MULTI-ADAPTERS
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+Incremental Learning (IL) aims to learn new tasks while preserving previously acquired knowledge. Integrating the zero-shot learning capabilities of pre-trained vision-language models into IL methods has marked a significant advancement. However, these methods face three primary challenges: (1) the need for improved training efficiency; (2) reliance on a memory bank to store previous data; and (3) the necessity of a strong backbone to augment the model’s capabilities. In this paper, we propose **SimE**, a **Simple** and **Efficient** framework that employs a vision-language model with an adapter designed specifically for the IL task. We report a remarkable phenomenon: there is not always a direct positive correlation between the number of adaptive adapter connections and the model’s IL capabilities. While increasing the number of adapter connections between transformer blocks positively impacts model performance, adding more adaptive connections within transformer blocks during smaller incremental steps does not enhance, and may even degrade the model’s IL ability. Such improvements only occur at more advanced incremental stages. Extensive experimental results show that SimE surpasses traditional methods by 9.6% on TinyImageNet and outperforms other CLIP-based methods by 5.3% on CIFAR-100. Notably, SimE, with only thousands of parameters and no memory bank, outperforms ZSCL, which has 140 million parameters, and surpasses CoOP, which requires a memory bank of size 1000. Furthermore, we conduct a systematic study to enhance the utilization of the zero-shot capabilities of CLIP. We suggest that the backbone encoder in SimE should use the image encoder from CLIP pre-trained on larger datasets, such as LAION-2B, and larger model architectures, such as ViT-L/14, for IL tasks.
+
+## 1 INTRODUCTION
+
+Deep learning models have achieved significant success when fully trained on domain-specific tasks. However, in real-world scenarios, new data often come from diverse sources. Training a deep learning model on such new data typically leads to the model forgetting previously learned information—a phenomenon known as catastrophic forgetting (Goodfellow et al., 2013). To address this issue, Incremental Learning (IL) methods have been proposed, drawing inspiration from the human ability to learn continuously. These methods enable models to preserve existing knowledge while acquiring new skills (De Lange et al., 2021; Masana et al., 2022). Traditional IL approaches, which start training from scratch (Li & Hoiem, 2017; Serra et al., 2018; Rebuffi et al., 2017), fail to leverage the zero-shot learning capabilities of pre-trained vision-language models. For example, Contrastive Language-Image Pre-training (CLIP) models (Radford et al., 2021), trained on extensive datasets, exhibit strong feature extraction abilities. Consequently, integrating CLIP’s zero-shot learning capabilities into continual learning approaches has become a subject of keen interest (Thengane et al., 2022; Ding et al., 2022; Zheng et al., 2023; Zhou et al., 2022; Wang et al., 2023; Yu et al., 2024).
+
+Despite the success of recent CLIP-based IL methods, several challenges remain. For example, the CoOP framework (Zhou et al., 2022) preserves historical knowledge by utilizing a memory bank that is periodically accessed and updated during IL tasks. However, the ever-expanding volume of accumulated data can overburden the memory bank, thereby constraining CoOP’s capacity for lifelong learning. In contrast, Continual CLIP (Thengane et al., 2022) leverages a frozen pre-trained
+
+{1}------------------------------------------------
+
+
+
+Figure 1: The overall framework of SimE. The diagram is divided into four panels: A, B, C, and D. Panel A shows a vertical sequence of tasks: Task 1, Task 2, ..., Task i, ..., Task t. Panel B details the learning process for Task 1, showing three stages: Adapter (finetuning the image encoder), Prototype 1 (computing prototypes), and Test 1 (evaluating performance). Panel C shows the process for subsequent tasks i (1 < i < t), where only the prototype and classifier are updated while the image encoder remains frozen. Panel D illustrates four image encoder architectures: Single-Adapter, Dual-Adapter, Single-Frozen, and Dual-Frozen, showing how adapters and frozen components are used to extract features.
+
+Figure 1: **The overall framework of SimE.** The green represents trainable and the grey denotes frozen components. **A)** illustrates the incremental learning tasks, which include $t$ tasks. Specifically, we finetune the trainable parameters in SimE for task 1, while freezing all the parameters in SimE for the remaining tasks. **B)** The learning process for Task 1 can be divided into three stages: in the Adapter stage, the image encoder is finetuned using adapters; in the Prototype 1 stage, prototypes are computed based on the finetuned image encoder, and the classifier is updated; in the Test 1 stage, the classification performance of the model is evaluated. **C)** In the computation process for subsequent tasks $i$ ( $1 < i < t$ ), all weights are frozen, only the prototypes are computed, and the classifier is updated. **D)** depicts the architectures of various image encoders.
+
+CLIP to facilitate the model’s continual learning capability, eliminating the need for replay memory but also limiting CLIP’s zero-shot capabilities. Additionally, ZSCL (Zheng et al., 2023) employs parameter regularization through knowledge distillation to maintain the model’s performance across IL tasks. However, ZSCL is not entirely efficient for IL endeavors, as it requires a substantial number of finetuning parameters to learn new data features and demands significant GPU resources during training. Moreover, the efficacy of CLIP’s feature extraction is significantly influenced by the pre-trained datasets and the size of its backbone architecture (e.g., ViT). Despite this, there has been no systematic exploration into optimizing CLIP’s zero-shot learning potential, which also affects the performance of IL methods. Collectively, the main challenges faced by these approaches include: **(1) the need for enhanced training efficiency; (2) reliance on a memory bank to store previous data; and (3) the need for a robust backbone to enhance the model’s capabilities.**
+
+To address these challenges, we introduce **SimE** (see Fig.1), a Simple and Efficient IL framework that combines a vision-language model with an adapter designed for efficient IL tasks. The adapter (Houlsby et al., 2019; Chen et al., 2022) is a lightweight module inserted into transformer blocks, enabling finetuning of the pre-trained model using minimal parameters. During training, the pre-trained model’s parameters are frozen; we finetune only the adapter’s trainable parameters, enhancing the model’s parameter efficiency and adaptability without requiring a memory bank. We conduct a comprehensive evaluation of various backbones and pre-trained datasets to ascertain the most effective CLIP configurations for IL tasks using SimE. CLIP offers a spectrum of backbones, ranging from base to large models, as described by Radford et al. (2021), each with its own set of parameters. Additionally, the scope of pre-trained datasets is vast, as evidenced by works such as Gadre et al. (2024) and Cherti et al. (2023), which span from 400 million to 2 billion samples. Our systematic investigation delves into the influence of these disparate backbones and pre-trained datasets on the performance of CLIP in IL scenarios.
+
+{2}------------------------------------------------
+
+
+
+Figure 2: Comparison of previous and current finetuning approaches. The diagram shows four panels (A, B, C, D) illustrating different adapter configurations within a transformer block. Panel A shows the AdaptFormer approach with a single adapter module (AdaptMLP) in the skip connection. Panels B, C, and D show the Multi-Adapter approach with multiple trainable adapter modules (AdaptMLP, AdaptAttn, and AdaptAll) in different positions. Modules in green are trainable, while those in gray are frozen. A legend indicates 'Trainable' in green and 'Frozen' in gray.
+
+Figure 2: **Comparison of previous and current finetuning approaches: The previous approach, AdaptFormer (A), is contrasted with our Multi-Adapter finetuning (B, C, and D).** The modules colored in green are trainable, while those in gray are frozen. In AdaptFormer and Multi-Adapter, the AdaptMLP, AdaptAttn, and AdaptAll modules are parameterized by a bottom-up bottleneck module with trainable parameters, whereas the original MLP and Self-Attention modules remain frozen. The AdaptFormer consists of the original frozen branch coupled with AdaptMLP. In contrast, our Multi-Adapter incorporates various trainable modules alongside the frozen branch for enhanced adaptability. And $B \times$ is represented by $B$ Blocks.
+
+In SimE, by simply combining CLIP and AdaptFormer, we observe that increasing the number of adapters between transformer blocks can improve model performance. To explore better methods of adapter connections, we propose a new adapter design named Multi-Adapter (see Fig.2), which aims to increase the number of adaptive connections beyond the constraints imposed by the AdaptFormer architecture. Surprisingly, we find that within transformer blocks, increasing the number of adaptive connections in smaller incremental steps does not enhance, and may even degrade the model’s IL capabilities. This improvement only occurs in larger incremental stages. Extensive experiments across various settings demonstrate the effectiveness of SimE on IL tasks. Our contributions can be summarized as follows:
+
+- We introduce SimE, which surpasses existing baseline IL models in class-incremental learning tasks. SimE is distinguished by its efficiency in three key areas: GPU usage, the number of trainable parameters, and memory size (as illustrated in Fig.5). Furthermore, SimE achieves competitive or superior accuracy with fewer additional parameters compared to other methods leveraging pre-trained models. (as shown in Fig.4(a)).
+- We propose Multi-Adapter to explore better methods of adapter connections and observe a significant phenomenon: there is not always a direct positive correlation between the number of adaptive connections and the model’s IL capabilities. While increasing the number of adapter connections between transformer blocks positively impacts model performance, within transformer blocks, adding more adaptive connections in smaller incremental steps does not enhance, and may even degrade the model’s IL ability. Such improvement only occurs at more advanced incremental stages.
+- We conduct a systematic study to enhance the utilization of the zero-shot capabilities of CLIP under SimE, pinpointing the most suitable backbone for CIFAR-100 and TinyImageNet. We advocate for the use of CLIP models that have been pre-trained on expansive datasets, such as LAION-2B, and possess larger architectures like ViT-L/14, to facilitate IL processes via SimE.
+
+{3}------------------------------------------------
+
+## 2 RELATED WORK
+
+**Conventional Continual Learning Methods:** Traditional continual learning methods can be divided into three categories: regularization-based, architecture-based, and replay-based approaches. Regularization-based methods (Aljundi et al., 2018; Kirkpatrick et al., 2017; Li & Hoiem, 2017) mitigate forgetting by incorporating regularization terms into the loss function, encouraging the model to retain weights important for previous tasks. However, these methods may diminish the model’s ability to learn new categories effectively. Architecture-based methods (Mallya & Lazebnik, 2018; Serra et al., 2018; Wang et al., 2020) adjust the network’s structure to accommodate new tasks by expanding it or altering its configuration. While effective, these methods may not be ideal for task-agnostic continual learning and can lead to increased memory usage. Replay-based methods (Rebuffi et al., 2017; Buzega et al., 2020; Cha et al., 2021) involve storing and periodically revisiting data from previous tasks to help the model retain prior knowledge. Although useful, these methods can raise privacy concerns and may be less effective with smaller data buffers. Moreover, traditional continual learning models are typically trained from scratch, which may limit the maximum achievable performance by not leveraging pre-trained models.
+
+**Continual Learning Methods Using CLIP:** Recently, pre-trained models have been increasingly adopted in continual learning due to their powerful feature extraction capabilities (Wang et al., 2022c;b; Thengane et al., 2022). CLIP (Radford et al., 2021), renowned for its impressive zero-shot abilities, excels in feature extraction through contrastive learning on vast amounts of image-text pairs. Consequently, several studies (Thengane et al., 2022; Ding et al., 2022; Zheng et al., 2023; Zhou et al., 2022; Wang et al., 2023; Yu et al., 2024) have integrated CLIP into continual learning models to enhance performance. Continual-CLIP (Thengane et al., 2022) directly applies CLIP to continual learning without any finetuning, maintaining CLIP’s feature extraction capacity but potentially suffering from domain gaps between pre-trained datasets and downstream tasks. LwF-VR (Ding et al., 2022) and ZSCL (Zheng et al., 2023) finetune the entire model using traditional continual learning methods to adapt to specific tasks. This process is computationally expensive due to the large size of pre-trained models and may also lead to the forgetting of previously learned knowledge. Thus, the finetuning strategy significantly impacts model performance.
+
+**Continual Learning Methods Using Adapter Finetuning:** Adapters were initially introduced in natural language processing (Houlsby et al., 2019) to finetune pre-trained models for specific tasks by modifying a minimal set of weights. This approach has gained traction across various fields due to its notable efficiency (Chen et al., 2022; Dong et al., 2024). In the realm of continual learning, recent studies (Liu et al., 2023; Ermis et al., 2022b;a; Yu et al., 2024) have explored integrating adapters, placing them after the encoder or within the model’s blocks. These adapters enable learning new tasks with a limited number of trainable parameters while preserving the core feature extraction functions. AdaptFormer (Chen et al., 2022), known for its lightweight parameterization, enhances model efficiency but is limited by the number of adaptive connections it can establish. In this paper, we introduce a Multi-Adapter that expands the number of adaptive connections, thereby extending the model’s flexibility.
+
+## 3 THE SIME FRAMEWORK VIA VISION-LANGUAGE MODELS WITH ADAPTERS
+
+In this section, we first introduce the definition of the incremental learning (IL) task. Next, in Section 3.1, we present SimE, a framework that combines the image encoder in vision-language models with an adapter. Then, we introduce the formulation of the Multi-Adapter in Section 3.2. Finally, in Section 3.3, we describe implementations of SimE using the image encoder from CLIP and the adapters from AdaptFormer and Multi-Adapter. Incremental learning (IL) methods enable a model to learn new tasks while retaining knowledge from previous ones.
+
+Consider a sequence of tasks $\mathcal{D} = D_1, D_2, \dots, D_T$ , where the $t$ -th task is defined as $D_t = (\mathbf{x}_i^t, \mathbf{y}_i^t)_{i=1}^{m_t}$ . Here, $D_t$ contains $m_t$ samples $\mathbf{x}_i^t$ and their corresponding labels $\mathbf{y}_i^t$ . During the learning of task $D_t$ , we have access only to the data from $D_t$ ; the data from previous tasks $D_1, D_2, \dots, D_{t-1}$ are unavailable. Furthermore, we focus on task-agnostic class-incremental learning (class-IL), where historical data cannot be used for rehearsal, and the task ID is not known during inference. In this setting, the model must learn to classify samples from all classes seen so far without explicit information about which task a sample belongs to.
+
+{4}------------------------------------------------
+
+### 3.1 SiME FORMULATION
+
+SiME is structured into three primary phases: data pre-processing, feature extraction, and image classification. In the initial phase, raw image data are transformed into a format compatible with the model's requirements. This is followed by the feature extraction phase, where an encoder—specifically the image encoder from a pre-trained vision-language model equipped with an adapter and prototype extractors—processes the formatted images. The process culminates in the image classification phase, where a fully connected (FC) layer acts as the classifier. This classifier is intricately designed to support class-incremental learning (class-IL), facilitating the seamless incorporation of new classes.
+
+**The Encoder.** Image encoders are utilized to extract visual features from preprocessed images. Commonly used image encoder architectures include ResNet and ViT. Taking ViT as an example, the $i$ th block of basic transformer module can be described as follows: 1) self-attention $f_i : \mathcal{A}_i \rightarrow \mathcal{A}_i$ , which computes the attention among elements and learns global information through their interactions; 2) MLP $g_i : \mathcal{A}_i \rightarrow \mathcal{H}$ , which applies nonlinear transformations to the input sequence to enhance the model's expressive capacity. Formally, this can be represented as:
+
+$$i \text{ th Self-Attention: } \mathbf{a}_i = f_i(\theta_i, \mathbf{x}_i), \quad i \text{ th MLP: } \mathbf{h}_i = g_i(\phi_i, \mathbf{a}_i). \quad (1)$$
+
+Here, $\mathbf{h}_i$ contains the visual features of the original image $\mathbf{x}_i$ , Self-Attention and MLP are instantiated with the parameters $\theta_i$ and $\phi_i$ respectively. For the pre-trained encoder, both $\theta_i$ and $\phi_i$ are pre-trained weights that are frozen.
+
+**The Adapter.** An adapter is a lightweight module designed to finetune pre-trained models for downstream datasets with a minimal number of additional parameters. The parameters of adapters are trainable and will be updated during the finetuning process, while the weights of pre-trained models are frozen. The adapter in the $i$ th blocks extracts features as $d_i : \mathcal{A}_i \rightarrow \mathcal{H}_i$ ,
+
+$$i \text{ th Adapter: } \mathbf{h}_i = d_i(\tilde{\eta}_i, \mathbf{x}_i). \quad (2)$$
+
+Here, adapter $i$ is instantiated with parameters $\tilde{\eta}_i$ , where $\tilde{\eta}_i$ are trainable. The visual features extracted by the adapter are integrated into the pre-trained encoder, enhancing its ability to extract visual features of downstream datasets. It is noteworthy that, unlike the modules of the pre-trained encoder, both the number and positions of adapters are variable. By introducing adapter into pre-trained encoder, we get the general form of the encoder with adapter $E(\mathbf{x})$ :
+
+$$E(\mathbf{x}) = \sum_i^B (g_i(\phi_i, f_i(\theta_i, \mathbf{x}_i)) + d_i(\tilde{\eta}_i, \mathbf{x}_i)), \quad (3)$$
+
+where $B$ is the number of the block in the encoder. Especially, when $i = 0$ , the $\mathbf{x}_i$ is the reprocessed image $\mathbf{x}$ .
+
+**The Prototype extractor.** In image classification, we follow Snell et al. (2017), setting the average features of the classes as the weights of the classifier. For the $t$ -th task ( $t = 2, \dots, T$ ), we do not update the weights of $E(\mathbf{x})$ in Eq.3; instead, we use the $E(\mathbf{x})$ directly to calculate the average value of features and set it as prototypes in datasets $\{\mathbf{x}_1^t, \dots, \mathbf{x}_{n_t}^t\}_{i=1}^{n_t}$ :
+
+$$p_k = \frac{1}{K} \sum_{j=1}^{|D^t|} I(y_j = k) E(\mathbf{x}_j), \quad (4)$$
+
+where $p_k \in \mathbb{R}^d$ is the prototype of increment class $k$ in $t$ -th task, $K = \sum_{j=1}^{|D^t|} I(y_j = k)$ , $I(\cdot)$ is the indicator function. $p_k$ contains the average features of class $k$ , implying that the images of class $k$ should exhibit the greatest similarity with $p_k$ among all prototypes.
+
+**The Classifier.** In Class IL, the classifier is dynamic and can be implemented in various ways(Mai et al., 2021; Wang et al., 2023). In this paper, we use a FC layer as our classifier(Snell et al. (2017). For the $t$ -th task, the classifier is an FC layer $W_t \in \mathbb{R}^{D \times (N+M)}$ , where $D$ is the feature dimension, $N$ is the number of classes at $(t-1)$ -th task, $M$ is the number of increment classes in $t$ -th task. We use the training set data $\mathbf{x}_{\text{pro}} = \{\{\mathbf{x}_i^t, y_i^t\}_{i=1}^{n_t}\}$ from the $t$ -th task to calculate the prototype $W_{\text{pro}} = \text{mean}(E(\mathbf{x}_{\text{pro}}))$ , where $n_t$ is the number of samples in the training set of the $t$ -th task, then update the FC layer $W_t$ : $W_t = W_{t-1} + W_{\text{pro}}$ , where $W_{t-1} \in \mathbb{R}^{D \times N}$ and $W_{\text{pro}} \in \mathbb{R}^{D \times M}$ . The
+
+{5}------------------------------------------------
+
+cosine similarity for classification is then calculated as:
+
+$$f(\mathbf{x}) = \left( \frac{\mathbf{W}}{\|\mathbf{W}\|_2} \right)^\top \left( \frac{E(\mathbf{x})}{\|E(\mathbf{x})\|_2} \right) \quad (5)$$
+
+given that prototype $p_i$ is most similar to instances of class $i$ , it is expected that the classifier will assign a higher probability to the correct class label.
+
+### 3.2 MULTI-ADAPTER FORMULATION
+
+We propose the Multi-Adapter, which comprises three adapter sub-modules: AdaptAtten, AdaptMLP, and AdaptAll as shown in Fig.2. The sub-modules AdaptAtten, AdaptMLP, and AdaptAll share the same structure, each containing a down-projection, a non-linear activation function (e.g., ReLU) and an up-projection. Thus, we can derive a more specific form of the $i$ th adapter $r_i : \mathcal{C}_i \rightarrow \tilde{\mathcal{S}}$ ,
+
+$$\mathbf{s}_{ij} = r_{ij}(\tilde{\mathbf{h}}_{ij}, \mathbf{c}_{ij}), \text{ where } \mathbf{c}_{ij} = \begin{cases} \mathbf{a}_i & j = 1 \text{ and } \mathbf{s}_{ij} = \mathbf{h}_i; \mathbf{r}_{ij} \text{ is AdaptMLP} \\ \mathbf{x}_i & j = 2 \text{ and } \mathbf{s}_{ij} = \mathbf{a}_i; \mathbf{r}_{ij} \text{ is AdaptAtten} \\ \mathbf{h}_i & j = 3 \text{ and } \mathbf{s}_{ij} = \mathbf{h}_i; \mathbf{r}_{ij} \text{ is AdaptAll} \end{cases}, \quad (6)$$
+
+here $\mathbf{c}_{ij}$ can be equal to the initial input $\mathbf{x}_i$ or an intermediate variable $\mathbf{a}_i$ , and $j \in \{1, 2, 3\}$ , correspond to AdaptMLP, AdaptAtten, and AdaptAll, respectively. Thus, the $i$ th block in ViT can be represented as a combination of the pre-trained modules and the adapter sub-modules:
+
+$$E'(c) = \sum_i^B \sum_j^Z (f_{ij}(\theta_{ij}, g_{ij}(\phi_{ij}, \mathbf{c}_{ij})) + r_{ij}(\tilde{\mathbf{h}}_{ij}, \mathbf{c}_{ij})), \quad (7)$$
+
+where $B$ is the number of the block in the encoder and $Z$ is a subset of $\{1, 2, 3\}$ ( $Z \subseteq \{1, 2, 3\}$ ). Especially, when $i = 0$ , the $\mathbf{c}_{0j}$ is the reprocessed image $\mathbf{x}$ . By identifying the trainable parameters, the adapter can be instantiated. Lastly, the optimisation of adapter for domain adaptation can see in Appendix A.
+
+### 3.3 REALIZATIONS OF SIMES VIA CLIP WITH DIFFERENT ADAPTERS
+
+In SimE, there are numerous implementations for the encoder and adapter. Here, we first employ the CLIP visual encoder as the encoder and AdaptFormer or Multi-Adapter as the adapter to establish a toy model of SimE. Subsequently, we explore various specific implementations of SimE. **CLIP** (Radford et al., 2021) is a powerful visual-language contrastive learning model comprising an image encoder and a text encoder. It is trained on 400 million image-text pairs and possesses strong feature extraction capabilities. In this paper, we employ the CLIP pre-trained visual encoder as our backbone, i.e., we instantiate our encoder using the CLIP pre-trained weights $\theta$ and $\phi$ . Additionally, there exist CLIP models pre-trained on different datasets, corresponding to different encoder instances. It is noteworthy that during the continual learning process, the pre-trained weights of CLIP are frozen and do not participate in weight updates. **Adaptformer** Chen et al. (2022) containing a down-projection $W_{\text{down}} \in \mathbb{R}^{D \times K}$ to reduce the feature dimension, a non-linear activation function(ReLU) and an up-projection $W_{\text{up}} \in \mathbb{R}^{R \times D}$ to project the features back to their original dimension, where $D$ is the feature dimension and $R$ is the dimension of bottleneck. The specific form of the AdaptFormer is:
+
+$$d_t(\tilde{\mathbf{h}}_i, \mathbf{h}_i) = \alpha \text{ReLU}(\mathbf{h}_i \cdot W_{\text{down}}) \cdot W_{\text{up}} \quad (8)$$
+
+Here $\alpha$ is the scaling factor in the residual connection, which is set to 0.1 by default in AdaptFormer. **Multi-Adapter** is represented by Eq.7. The Adaptformer is a special case in **Multi-Adapter** and we employ the same down-up projects in Eq.8 to initialize the Multi-Adapter.
+
+## 4 EXPERIMENTAL RESULTS
+
+In this section, we begin by comparing the performance of the proposed SimE method with that of other Class-Incremental Learning (CIL) methods. Next, we evaluate the efficiency of these models by examining their number of trainable parameters, GPU usage, and memory bank size. Furthermore, we conduct ablation experiments to investigate the impact of various components within SimE. Lastly, the details of the experimental settings are provided in Appendix B.
+
+{6}------------------------------------------------
+
+
+
+Figure 3: Three line graphs showing the last accuracy of every task in 10 steps for different CIL methods. The left graph is for CIFAR100 with ViT-L/14 backbone, the middle graph is for CIFAR100 with ViT-L/16 backbone, and the right graph is for TinyImageNet with ViT-L/16 backbone. In all cases, the 'Ours' method (red line) maintains higher accuracy than other methods (iTAML, ARCLIP, DER, CoOp, Continual-CLIP, Fren-time, iCaRL, LwF) as tasks increase from 1 to 10.
+
+Figure 3: Last accuracy of every Task in 10 steps. The Last accuracy of Task $t$ , $t \in \{1, 2, \dots, 10\}$ is the Top-1 accuracy over all the previous Tasks (i.e., Tasks 1, 2, ..., $t$ ). The results in **left** and **middle** are conducted on CIFAR100. The result of "Ours" in **left** is based on ViT-L/14 and in **middle** and **right** are based on ViT-B/16.
+
+### 4.1 COMPARISON ON THE ACCURACY OF DIFFERENT CIL METHODS
+
+**SimE outperforms most Other CIL methods at various steps on both CIFAR-100 and Tiny-ImageNet datasets.** First, we compare the performance of our method with other CIL methods across all tasks and present the results in Tab.1, where the best results are highlighted in grey. The results, measured by the average accuracy across tasks, show that our method achieves the highest scores among recent state-of-the-art methods, demonstrating the significant effectiveness of incorporating adapters into a pre-trained model. Specifically, our method and other CLIP-based methods (CoOp(Zhou et al., 2022), Continual-CLIP(Thengane et al., 2022)) have a substantial advantage over traditional continual learning methods initially, reflecting the superior feature extraction capabilities of pre-trained models.
+
+However, the accuracy of other CLIP-based methods drops quickly as training progresses, indicating that they are severely affected by domain gaps or catastrophic forgetting. Our method not only outperforms CLIP-based methods at the start, showing that finetuning helps the model adapt to downstream tasks, but also exhibits a slower decline in performance because it retains the original feature extractor, thus preserving the pre-trained model’s prior knowledge. In addition to splitting CIFAR-100 into 10 tasks, we also experimented with 20 and 50 tasks and have listed the results in Tab.1. Our method consistently performs the best across all settings, outperforming current state-of-the-art methods by at least 3%. Furthermore, we conducted experiments on TinyImageNet, where we split the dataset into multiple tasks with 100 classes as base classes, and reported these results in Tab.1. Our method remains superior in most settings, further demonstrating its effectiveness.
+
+Table 1: Comparison on the accuracy of different CIL methods. The Average and Last accuracy of different CIL methods on CIFAR100 and TinyImageNet benchmark. Among them, UCIR(Hou et al., 2019), PASS(Zhu et al., 2021), DyTox(Douillard et al., 2022), and DER(Yan et al., 2021) train from scratch, while the remaining methods use CLIP ViT-B/16 as the backbone, where $\dagger$ indicates the result based on the CLIP ViT-L/14 pre-trained on Laion-2B. The 100 classes of TinyImageNet are used as base classes. The best results are coloured grey.
+
+| Methods | CIFAR100 | | | | | | TinyImageNet | | | | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | 10 Steps | | 20 Steps | | 50 Steps | | 5 Steps | | 10 Steps | | 20 Steps | |
+| | Avg | Last | Avg | Last | Avg | Last | Avg | Last | Avg | Last | Avg | Last |
+| UCIR(Hou et al., 2019) | 58.66 | 43.39 | 58.17 | 40.63 | 56.86 | 37.09 | 50.30 | 39.42 | 48.58 | 37.29 | 42.84 | 30.85 |
+| PASS(Zhu et al., 2021) | 65.46 | 53.23 | 59.69 | 43.13 | 39.23 | 18.89 | 61.54 | 46.66 | 57.05 | 41.54 | 54.62 | 44.55 |
+| DyTox(Douillard et al., 2022) | 67.33 | 51.68 | 67.30 | 48.45 | 64.39 | 43.47 | 55.58 | 47.23 | 52.26 | 42.79 | 46.18 | 36.21 |
+| DER(Yan et al., 2021) | 74.64 | 64.35 | 73.98 | 62.55 | 72.05 | 59.76 | - | - | - | - | - | - |
+| CLIP(Radford et al., 2021) | 74.47 | 65.92 | 75.20 | 65.74 | 73.67 | 65.94 | 69.62 | 65.30 | 69.55 | 65.59 | 69.49 | 65.30 |
+| Fren-time | 79.35 | 70.97 | 73.32 | 64.55 | 71.28 | 59.07 | 77.02 | 70.39 | 73.48 | 65.97 | 69.65 | 64.68 |
+| iCaRL(Rebuffi et al., 2017) | 65.86 | 48.04 | 60.64 | 40.56 | 47.69 | 32.90 | 60.97 | 48.77 | 57.60 | 44.00 | 54.79 | 42.26 |
+| LwF(Li & Hoiem, 2017) | 75.17 | 66.72 | 75.95 | 66.72 | 76.49 | 66.72 | 70.49 | 66.43 | 70.55 | 66.43 | 70.51 | 66.43 |
+| Continual-CLIP(Thengane et al., 2022) | 78.81 | 70.75 | 74.54 | 63.54 | 71.02 | 59.45 | 77.56 | 70.89 | 74.12 | 67.05 | 69.94 | 63.89 |
+| LwF-VKD(Ding et al., 2022) | 82.15 | 73.65 | 80.39 | 69.58 | 79.92 | 67.36 | 80.27 | 73.57 | 78.61 | 71.62 | 77.18 | 68.30 |
+| ZSCL(Zheng et al., 2023) | 85.94 | 77.10 | 85.67 | 76.61 | 84.16 | 73.88 | 79.35 | 75.37 | 79.32 | 75.37 | 79.29 | 75.37 |
+| SimE(Ours) | 91.66 | 86.03 | 92.27 | 86.64 | 91.64 | 85.35 | 86.47 | 83.33 | 86.41 | 83.33 | 86.39 | 83.33 |
+| SimE(Ours) $\dagger$ | | | | | | | | | | | | |
+
+We further compare the results of each task with traditional and CLIP-based CIL methods, as shown in Fig.3 & Tab.5, and our method consistently outperforms other methods across all tasks. Additionally, in Fig.3 & Fig.6, we compare the performance of each task on CIFAR100 and TinyImageNet, revealing differences in the generalization ability of the backbone across different datasets. Consequently,
+
+{7}------------------------------------------------
+
+
+
+Figure 4 consists of six subplots (a-f) comparing different CIL methods. Subplots (a), (b), and (c) compare methods: Lwf, Lwf-VR, ZSCL, Bwarp-CL, and Ours. Subplots (d) and (e) show the impact of bottleneck dimension and number of adapters for the proposed method. Subplot (f) compares Ours with ZSCL and Bwarp-CL across different numbers of steps.
+
+| Method | Training parameters (Milio) | Last accuracy (%) | Avg accuracy (%) |
+|-|-|-|-|
+| Lwf | ~100 | ~65 | ~75 |
+| Lwf-VR | ~100 | ~75 | ~80 |
+| ZSCL | ~100 | ~70 | ~78 |
+| Bwarp-CL | ~40 | ~70 | ~78 |
+| Ours | ~10 | ~80 | ~85 |
+
+| Method | GPU usage (GFP) | Last accuracy (%) | Avg accuracy (%) |
+|-|-|-|-|
+| Lwf | ~25 | ~65 | ~75 |
+| Lwf-VR | ~25 | ~75 | ~80 |
+| ZSCL | ~20 | ~70 | ~78 |
+| Bwarp-CL | ~15 | ~70 | ~78 |
+| Ours | ~10 | ~80 | ~85 |
+
+| Method | Memory bank size | Last accuracy (%) | Avg accuracy (%) |
+|-|-|-|-|
+| Lwf | ~2000 | ~65 | ~75 |
+| PCML | ~1000 | ~75 | ~80 |
+| CoGP | ~1000 | ~70 | ~78 |
+| ITAML | ~2000 | ~70 | ~78 |
+| ABL | ~2000 | ~70 | ~78 |
+| Ours | ~100 | ~80 | ~85 |
+
+| Bottleneck dimension | Training parameters (Milio) | Last accuracy (%) | Avg accuracy (%) |
+|-|-|-|-|
+| 1 | ~0.5 | ~80 | ~85 |
+| 2 | ~0.5 | ~75 | ~80 |
+| 3 | ~0.5 | ~75 | ~80 |
+| 4 | ~0.5 | ~75 | ~80 |
+| 5 | ~0.5 | ~75 | ~80 |
+| 6 | ~0.5 | ~75 | ~80 |
+| 7 | ~0.5 | ~75 | ~80 |
+| 8 | ~0.5 | ~75 | ~80 |
+
+| The number of adapters | Training parameters (Milio) | Last accuracy (%) | Avg accuracy (%) |
+|-|-|-|-|
+| 3 | ~0.5 | ~75 | ~80 |
+| 6 | ~0.5 | ~75 | ~80 |
+| 9 | ~0.5 | ~75 | ~80 |
+| 12 | ~0.5 | ~75 | ~80 |
+
+| The number of steps | Method | Training parameters (Milio) | Last accuracy (%) | Avg accuracy (%) |
+|-|-|-|-|-|
+| 10 | Ours | ~150 | ~80 | ~85 |
+| 10 | ZSCL | ~150 | ~75 | ~80 |
+| 10 | Bwarp-CL | ~150 | ~75 | ~80 |
+| 20 | Ours | ~150 | ~80 | ~85 |
+| 20 | ZSCL | ~150 | ~75 | ~80 |
+| 20 | Bwarp-CL | ~150 | ~75 | ~80 |
+| 50 | Ours | ~150 | ~80 | ~85 |
+| 50 | ZSCL | ~150 | ~75 | ~80 |
+| 50 | Bwarp-CL | ~150 | ~75 | ~80 |
+
+Figure 4: Comparison on the efficiency of different CIL methods. The figure consists of six subplots (a-f) showing various metrics for different CIL methods. (a) Training parameters (Milio), (b) GPU usage (GFP), (c) Memory bank size, (d) Training parameters (Milio) vs Bottleneck dimension, (e) Avg accuracy (%) vs The number of adapters, and (f) Training parameters (Milio) vs The number of steps. Dotted orange lines represent Last accuracy (%) and Avg accuracy (%).
+
+Figure 4: Comparison on the efficiency of different CIL methods. The dotted line and right axis coloured orange present the Last accuracy and Avg accuracy. (a)(b)(c) denote the Training parameters, GPU usage, Memory bank size and Last accuracy of different CIL methods respectively. (d)(e) is the Training parameters and Avg accuracy of Ours under different bottleneck dimensions and number of adapters. (f) show the comparison between Ours and other CIL methods in training parameters and Avg accuracy. All the experiments are conducted on CIFAR100, and (a)-(e) are conducted in 10steps.
+
+we conduct further experiments to identify the optimal backbone for different datasets, as detailed in Sec. 4.4.
+
+### 4.2 COMPARISON ON THE EFFICIENCY OF DIFFERENT CIL METHODS
+
+We compare the efficiency of our proposed SiME method with other Class-Incremental Learning (CIL) methods by examining the number of trainable parameters, GPU usage, and replay data size. The experimental settings are the same as those described in Appendix B and the results are shown in Fig. 4. As illustrated in Fig. 4(a) and Fig. 4, our method requires only thousands of trainable parameters while achieving competitive results compared to other CIL methods that utilize millions of parameters, significantly reducing training costs. Furthermore, as shown in Fig. 4(b) and Fig. 4(c), our method uses only one-third of the parameters and does not require a buffer to store replay data. We also study the influence of the bottleneck dimension and the number of adapters, as depicted in Figures Fig. 4(d) and Fig. 4(e). Despite varying these parameters, our method still achieves competitive performance with minimal trainable parameters. These results demonstrate that our method can achieve performance comparable to or even exceeding that of other CIL methods with minimal training costs, thereby strongly validating the efficiency of the proposed SiME method.
+
+### 4.3 ABLATION STUDY ON THE INFLUENCE OF ADAPTER COMPONENTS IN SiME
+
+**The influence of adapter connection between transformer blocks.** We investigated the impact of the position and number of adapters inserted between transformer blocks, presenting the results in Fig. 5 & Tab. 6 & Tab. 7. In our notation, "1-3" indicates that adapters are inserted only into the first three blocks of the feature extractor. From Fig. 5, it is evident that inserting the same number of adapters into the earlier blocks significantly improves model performance. This suggests that learning primary features plays a more crucial role in model finetuning. Additionally, we varied the number of adapters between transformer blocks from 0 to 12. Inserting adapters into every block (totaling 12 adapters) consistently yielded the best performance across all steps. Therefore, a larger number of adapters between transformer blocks leads to better model performance, indicating that increasing the number of adapter connections between transformer blocks positively impacts model outcomes.
+
+**The influence of adapter connection within transformer blocks.** We also tested different implementations of the Multi-Adapter by inserting adapters within all 12 transformer blocks. The results
+
+{8}------------------------------------------------
+
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+
+are reported in Tab.2 & Fig.7 & Tab.8 & Tab.9. Interestingly, we found that in smaller incremental steps, increasing the number of adaptive connections within transformer blocks does not improve model performance; in fact, it can even degrade it. The previously observed positive correlation only occurs in larger incremental steps. This suggests that a higher number of adapter connections within transformer blocks does not necessarily lead to better outcomes. In SimE, we explore the optimal implementation of adapters across various task configurations.
+
+
+
+Figure 5 consists of four subplots. Subplots (a) and (b) are line graphs showing accuracy (Avg and Last) versus the number and position of adapters (e.g., 1-3, 4-6, 7-9, 10-12, 1-6, 4-9, 7-12). Subplots (c) and (d) are bar charts showing averaged accuracy (Avg and Last) versus the number of adapters (3, 6, 9, 12) for different adapter positions (10, 20, 50 steps). In all plots, the 'Long' series (orange) generally outperforms the 'Short' series (blue).
+
+Figure 5: Influence of adapters' position and number between transformer blocks. (a) Avg accuracy on different numbers of adapters. (b) Last accuracy on different numbers of adapters. (c) Averaged Avg accuracy on different numbers of adapters. (d) Averaged Last accuracy on different numbers of adapters. All results are based on CIFAR100.
+
+Figure 5: Influence of adapters' position and number between transformer blocks. The x-axis represents the number of adapters in the encoder, with the numerical ranges indicating the positions of the adapters. For example, "1-3" signifies that adapters are inserted in the first 3 blocks. The accuracy shown in (c) and (d) represents the average results for different adapter positions with the same number of adapters. All results are based on CIFAR100.
+
+Table 2: The results of different implementations of Multi-Adapter. The structures of Adapter-MLP, Adapter-Atten and Adapt-All are shown in Fig.2. "Para" refers to trainable parameters, with "M" standing for million. All experiments are conducted on CIFAR100 and the best results are coloured grey
+
+| Adapt-MLP | Adapt-Atten | Adapt-All | Para(M) | 10 steps | | 20 steps | | 50 steps | |
+|-|-|-|-|-|-|-|-|-|-|
+| | | | | Avg | Last | Avg | Last | Avg | Last |
+| ✗ | ✗ | ✗ | 0 | 79.69 | 70.08 | 80.41 | 70.08 | 80.80 | 70.08 |
+| ✓ | ✗ | ✗ | 1.19 | 85.60 | 76.70 | 85.30 | 76.02 | 84.09 | 73.77 |
+| ✓ | ✓ | ✗ | 1.19 | 85.94 | 77.10 | 85.67 | 76.61 | 84.16 | 73.88 |
+| ✓ | ✗ | ✓ | 1.19 | 85.77 | 76.83 | 85.48 | 76.16 | 84.16 | 73.86 |
+| ✓ | ✓ | ✗ | 2.38 | 85.73 | 76.79 | 85.42 | 76.09 | 84.76 | 74.66 |
+| ✓ | ✓ | ✓ | 2.38 | 85.84 | 76.98 | 85.36 | 76.03 | 84.75 | 74.69 |
+| ✓ | ✗ | ✓ | 2.38 | 85.63 | 76.65 | 85.12 | 75.66 | 84.75 | 74.76 |
+| ✓ | ✓ | ✓ | 3.57 | 85.54 | 76.51 | 85.05 | 75.53 | 85.00 | 75.16 |
+
+### 4.4 ABLATION STUDIES ON THE INFLUENCE OF CLIP COMPONENTS IN SIMe
+
+**The influence of pre-trained datasets.** CLIP has attracted significant attention due to its powerful zero-shot capabilities, leading many studies to retrain CLIP from scratch on other image-text pair datasets, such as Datacomp (Gadre et al., 2024) and LAION (Schuhmann et al., 2022). These datasets are comparable in size to or even larger than the original pre-training dataset (WIT-400M). We evalu-
+
+{9}------------------------------------------------
+
+ated their performance on CIFAR-100 and TinyImageNet. As shown in Tab.3, pre-training models on larger datasets generally enhances their feature extraction capabilities, leading to better generalization. However, there are instances where smaller pre-trained datasets yield higher accuracy, indicating that dataset quality and preprocessing techniques also significantly impact model performance.
+
+Table 3: The influence of CLIP pre-trained datasets. WIT-400M is the closed-source dataset of OpenAI while others are from Open\_CLIP. All results are conducted on ViT-B/16 and the 100 classes of TinyImageNet are used as base classes. The best results are coloured grey.
+
+| Blocks | CIFAR100 | | | | | | TinyImageNet | | | | | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | 10 steps | | 20 steps | | 50 steps | | 10 steps | | 20 steps | | 50 steps | |
+| | Avg | Last | Avg | Last | Avg | Last | Avg | Last | Avg | Last | Avg | Last |
+| WIT-400M(Radford et al., 2021) | 85.60 | 76.70 | 85.30 | 76.02 | 84.09 | 73.77 | 79.35 | 75.37 | 79.32 | 75.37 | 79.29 | 75.37 |
+| Laion-400M(Schuhmann et al., 2022) | 87.14 | 79.54 | 86.86 | 78.82 | 85.95 | 77.63 | 80.62 | 78.01 | 80.46 | 77.48 | 81.06 | 79.22 |
+| Laion-2B(Schuhmann et al., 2022) | 88.34 | 81.33 | 88.47 | 80.89 | 87.91 | 80.09 | 81.98 | 79.99 | 81.83 | 79.77 | 82.78 | 81.63 |
+| DataComp-1B(Gadre et al., 2024) | 88.04 | 80.77 | 87.89 | 79.88 | 87.57 | 79.25 | 81.38 | 79.11 | 81.49 | 78.70 | 82.51 | 80.89 |
+| CommonPool-1B(Gadre et al., 2024) | 86.96 | 78.74 | 86.58 | 77.88 | 86.21 | 77.10 | 80.13 | 76.95 | 80.26 | 76.69 | 81.24 | 78.70 |
+
+**The influence of ViT backbone size.** In addition to examining pre-trained datasets, we investigated the impact of different ViT backbones in CLIP. Our default model uses ViT-B/16. As shown in Tab.4, increasing the backbone size significantly improves model performance. Specifically, the accuracy of ViT-L consistently surpasses that of ViT-B across various settings, demonstrating superior feature extraction capabilities. When the model size is held constant, the size of the image patches plays a crucial role in feature extraction, with smaller patch sizes better capturing semantic information. In contrast, the size of the images during pre-processing has a relatively minor impact on model performance.
+
+Table 4: The influence of CLIP ViT backbones size. The experiments use the corresponding data preprocessing while "336px" indicates the images are resized to 336. All experiments conducted on CIFAR100 and the best results are highlighted in grey.
+
+| Blocks | 10 steps | | 20 steps | | 50 steps | |
+|-|-|-|-|-|-|-|
+| | Avg | Last | Avg | Last | Avg | Last |
+| ViT-B/16 | 85.94 | 77.10 | 85.67 | 76.61 | 84.16 | 73.88 |
+| ViT-B/32 | 83.60 | 74.43 | 82.02 | 71.74 | 81.18 | 70.06 |
+| ViT-L/14-336px | 88.53 | 80.85 | 88.02 | 80.45 | 89.12 | 81.65 |
+| ViT-L/14 | 88.79 | 81.44 | 88.57 | 81.01 | 89.73 | 82.60 |
+
+## 5 CONCLUSION
+
+In this paper, we propose SimE, a simple yet efficient incremental learning (IL) framework. SimE utilizes a pre-trained model as the encoder and incorporates adapters for finetuning, thereby achieving robust feature extraction capabilities while adapting to IL tasks without the need to store replay data. Our experiments demonstrate that SimE achieves competitive results, validating its effectiveness. To explore better methods of adapter connections, we introduce the Multi-Adapter and observe a remarkable phenomenon: there is not always a direct positive correlation between the number of adaptive adapter connections and the model's IL capabilities. Specifically, while increasing the number of adapter connections between transformer blocks positively impacts model performance, adding more adaptive connections within transformer blocks during small incremental steps does not enhance, and may even degrade the model's IL ability. Such improvements occur only at more advanced incremental stages. We also conducted a systematic study on CLIP and identified the optimal CLIP model for CIFAR-100 and TinyImageNet. Based on our findings, we recommend that SimE's backbone encoder utilize the image encoder from CLIP models pre-trained on larger datasets like LAION-2B and larger architectures such as ViT-L/14 for CIL tasks. In future work, we will explore combining SimE with different pre-trained large models and various types of adapters for other tasks.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/tlH4vDii0E.txt b/papers/tlH4vDii0E.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f69c7998a8fcf80d92f45e6636b6d0d7d4b16d6b
--- /dev/null
+++ b/papers/tlH4vDii0E.txt
@@ -0,0 +1,420 @@
+**Primary Area:** unsupervised, self-supervised, semi-supervised, and supervised representation learning
+
+
+
+{0}------------------------------------------------
+
+# FINE-TUNING PRE-TRAINED LANGUAGE MODELS FOR ROBUST CAUSAL REPRESENTATION LEARNING
+
+Anonymous authors
+
+Paper under double-blind review
+
+## ABSTRACT
+
+The fine-tuning of pre-trained language models (PLMs) has been shown to be effective across various domains. By using domain-specific supervised data, the general-purpose representation derived from PLMs can be transformed into a domain-specific representation. However, these methods often fail to generalize to out-of-domain (OOD) data due to their reliance on *non-causal* representations, often described as spurious features. Existing methods either make use of adjustments with strong assumptions about lack of hidden common causes, or mitigate the effect of spurious features using multi-domain data. In this work, we investigate how fine-tuned pre-trained language models aid generalizability from single-domain scenarios under mild assumptions, targeting more general and practical real-world scenarios. We show that a robust representation can be derived through a so-called causal front-door adjustment, based on a *decomposition* assumption, using fine-tuned representations as a source of data augmentation. Comprehensive experiments in both synthetic and real-world settings demonstrate the superior generalizability of the proposed method compared to existing approaches. Our work thus sheds light on the domain generalization problem by introducing links between fine-tuning and causal mechanisms into representation learning1.
+
+## 1 INTRODUCTION
+
+Pre-trained language models (PLMs) like BERT (Kenton & Toutanova, 2019; Liu, 2019) are trained on large corpora to generate contextualized representations, performing well in various natural language understanding (NLU) tasks such as text classification (Minace et al., 2021). Fine-tuning these models, i.e., training them with supervised data to adapt to specific tasks, can lead to improved performance. However, models trained on specific domains tend to rely on non-causal representations that exploit spurious correlations present only in the training data, leading to poor generalization when tested on data with distribution shifts (Arjovsky et al., 2019; Ahuja et al., 2020; Heinze-Deml & Meinshausen, 2021). The issue arises from the assumption that training and test data are exchangeable samples (Lv et al., 2022; Qiao & Low, 2024). In practice, however, test data often come from out-of-domain (OOD) distributions that diverge from the training set. For example, “positive” sentiment might be strongly correlated with Amazon reviews due to bias in crowdsourced training data (Gururangan et al., 2018; Sagawa et al., 2019), but this correlation might not hold during testing. Ensuring the robustness of supervised fine-tuned models is crucial, especially in critical applications such as medical diagnosis and autonomous driving.
+
+Numerous studies have attempted to improve the robustness of PLMs in OOD scenarios from various perspectives (Hendrycks et al., 2020; Du et al., 2021; Yuan et al., 2023). One common approach is feature augmentation, which aims to enhance model generalizability by diversifying learned representations using models trained on data from multiple domains (Xie et al., 2020; Hendrycks et al., 2019; Zhang et al., 2020; Tu et al., 2020). These feature augmentation approaches could be interpreted as using expert knowledge to synthetically construct multi-domain data from a causal perspective (Ilse et al., 2021; Von Kügelgen et al., 2021). The availability of multi-domain data has spurred the rapid development of learning invariant predictors (Arjovsky et al., 2019; Ahuja et al., 2020; Heinze-Deml & Meinshausen, 2021). The goal of these approaches is to learn representations that minimize loss functions across all domains, conditionally or not on class labels, thereby
+
+1The code will be released upon acceptance, and is available in the supplementary material.
+
+{1}------------------------------------------------
+
+mitigating the impact of spurious features. Nonetheless, multi-domain data for natural language is often not readily available, and it is not straightforward to apply data augmentation, as in the case of image processing, due to the complexities inherent in language (Yuan et al., 2023). In this paper, we investigate how PLMs can be exploited as a natural additional source of domain data, to improve OOD generalization in single-domain scenarios under mild assumptions.
+
+Thus, we propose the following research question:
+
+*How can we leverage PLMs to learn robust causal representations that enhance OOD generalization?*
+
+In what follows, we first present an analysis through a causal perspective on why the standard supervised fine-tuning estimator $p(y | x)$ fails in OOD scenarios, and how this could be addressed by a causal estimator $p(y | \text{do}(x))$ instead (Section 3), where $\text{do}(x)$ denotes an intervention that fixes the value $X = x$ (Pearl, 2009). Next, we elaborate on the key assumptions that guarantee the identifiability of the causal estimator in Section 4. In light of these assumptions, we propose a novel method to construct the causal estimator $p(y | \text{do}(x))$ (Theorem 2) using single-domain data. This method is based on two key constructions: (1) leveraging PLMs for data augmentation to identify causal features (Theorem 1), and (2) learning a representation of spurious local features to enable what is known as causal front-door adjustments (Pearl (2009), Section 5.3).
+
+Our key contribution is a principled strategy to construct robust causal representation using PLMs during fine-tuning, with single-domain observational data. We validate this approach on two semi-synthetic datasets and one real-world benchmark datasets, comparing against strong baselines to evaluate generalizability, with a focus on text classification2. We find that our method provides significant resilience to changes in the distribution of spurious features and have a substantial impact on the deployment of text classifiers in real-world scenarios. This contribution advances the field of robust representation learning and demonstrates how understanding causal mechanisms could enhance model robustness.
+
+## 2 RELATED WORK
+
+**Causality and Domain Generalization** Causal mechanisms have been shown to be a reliable operational concept in Domain Generalization (DG). The goal is to address spurious correlations through causal inference, incorporating confounding adjustments under empirical observations. A common approach involves learning invariant predictors to minimize the impact of spurious features by training on supervised data from multiple domains (Arjovsky et al., 2019; Ahuja et al., 2020; Heinze-Deml & Meinshausen, 2021), and self-supervised learning (Von Kügelgen et al., 2021; Yue et al., 2021; Mitrovic et al., 2021; Kong et al., 2023). However, training data from multiple domains is often not readily available or easy to augment (Yuan et al., 2023). In order to perform causal inference with single domain data, other models exploit causal dependencies to eliminate spurious features through a so-called back-door adjustment, based on the assumption that no unobserved domain-specific confounders exist (Lu et al., 2022; Lv et al., 2022). However, confounders may not always be observed and can be difficult to model explicitly. Recent work seeks to address DG in a more practical setting by considering unobserved confounders and employing the front-door adjustment (Li et al., 2021; Mao et al., 2022; Nguyen et al., 2023). In this paper, we present a novel front-door adjustment construction for leveraging PLMs in a practical setting of NLU tasks.
+
+**Domain Generalization for Pre-trained Models** With pre-trained models achieving remarkable performance in both the computer vision (CV) (Chen et al., 2020; Bao et al., 2021; He et al., 2022) and natural language processing (NLP) (Devlin, 2018; Lan, 2019; Liu, 2019) communities, domain generalization on downstream tasks for these models has attracted increasing attention. Some studies aim to enhance generalizability by increasing the diversity of learned features with models trained on data from various domains (Hendrycks et al., 2019; Xie et al., 2020; Zhang et al., 2020; Tu et al., 2020). Other line of work suggests that conducting adversarial training (Salman et al., 2020; Hendrycks et al., 2020; Utrera et al., 2020; Yi et al., 2021) and developing advanced attention mechanisms (Dosovitskiy, 2020; Mao et al., 2021; Yang et al., 2021) can lead to more robust models. Motivated by recent work that utilize PLMs parameters as a way of performing regularization
+
+2Our method can be easily extended to other NLP tasks, such as natural language inference (NLI).
+
+{2}------------------------------------------------
+
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+
+
+
+(a) **$\sigma = \text{Train}$** and **$\sigma^* = \text{Test}$** environments. In $\sigma$ , Amazon reviews are positive and Yelp reviews are negative. In $\sigma^*$ , Amazon reviews are negative and Yelp reviews are positive. This illustrates a spurious correlation $U$ between source and sentiment.
+
+(b) Causal diagram showing intervention variable $\sigma$ (square) influencing $X$ (square) and $Y$ (circle). Hidden variable $U$ (dashed circle) is a confounder between $X$ and $Y$ . The edge between $U$ and $X$ is marked with a red cross, indicating it is removed by the intervention $\text{do}(x)$ .
+
+(c) Abstracted causal diagram. $X$ is broken into vectors $R^0$ and $R^1$ . $U$ is abstracted into vector $\Phi$ . $\sigma$ (square) influences $R^0$ and $R^1$ . $R^0$ and $R^1$ influence $\Phi$ . $\Phi$ influences $C$ (dashed circle), which in turn influences $Y$ (circle).
+
+Figure 1: (a) shows training (sigma) and test (sigma\*) environments with Amazon and Yelp reviews. (b) shows a causal diagram with intervention variable sigma. (c) shows the abstracted causal diagram with vectors R^0, R^1, and Phi.
+
+Figure 1: In the following, dashed vertices represent hidden variables and square vertices represent interventions or natural non-random external sources of variability. (a): An example of a practical real-world scenario: During training, there is a spurious correlation ( $U$ ), which indicates reviews from Amazon are more likely to express **positive** sentiment and reviews from Yelp are more likely to express **negative** sentiment. But this spurious information change in a new environment ( $\sigma^*$ ). A classifier might exploit the source of the text as a predictive feature rather than the actual content of the review. (b): Explicitly indicating that the mechanism into $X$ may change according to regimes indexed by an intervention variable $\sigma$ . When $\text{do}(x)$ operation performed, the edge between $U$ and $X$ is removed, indicated by a red cross. This is relevant, as it breaks the link between $Y$ and $\sigma$ conditioned on $X$ , making this predictor invariant to $\sigma$ . (c): Abstraction of the original causal diagram after decomposition, where $X$ is broken and abstracted into vectors $R^0$ , $R^1$ and $\Phi$ , as explained in the main text (Section 4).
+
+or as external knowledge source (Wortsman et al., 2022; Zhu et al., 2023; Wang et al., 2024). In this paper, we explore the possibility of using PLMs as another data domain for augmentation, which is later used to construct a robust causal representation for both ID and OOD scenarios.
+
+## 3 PRELIMINARIES
+
+**Motivation and Intuition** Consider a common NLP application in a practical scenario: given input features $x \in X$ , the task is to predict labels $y \in Y$ , with potentially some unobserved common confounder $U$ between $X$ and $Y$ . This could typically be solved by learning a classifier $p(y | x)$ directly using the empirical risk minimization (ERM) objective (VAPNIK, 1998) and choosing a class via $\arg \max_y p(y | x)$ during inference. The typical underlying assumption is that both the training and test environments3 contain data that are exchangeable. However, the ERM estimator will not work if the test environment does not follow the same distribution as the training data. We discuss how this can be resolved under invariance assumptions described by using the framework of structural causal models (SCMs) (Pearl, 2009) in a subsequent section. Empirically, our findings illustrate a case where the performance of the fine-tuning estimator drops from 93% in the in-distribution (ID)
+
+3In this work, we use “environment” and “domain” interchangeably.
+
+{3}------------------------------------------------
+
+setting to 49% in the OOD setting due to changes in spurious feature distribution, while the causal estimator maintains a performance level of 58% in the OOD scenario (Section 6).
+
+To accommodate for distribution shifts, we further assume that, in both training and test environments, an intervention (or some kind of perturbation, indicated by $\sigma$ within a square node) happens, altering the contribution of the unobserved confounder $U$ into $X$ (as shown in Figure 1 (b)). *Note that while we only observe the training environments, we assume that the test environments contain similar types of spurious information, although the distribution $p(U | X; \sigma)$ could vary arbitrarily.* Such changes could happen due to deploying algorithms in different population groups in hospitals (Caruana et al., 2015), testing on adversarial examples (Ilyas et al., 2019), evaluating on corrupted images (Hendrycks & Dietterich, 2019), or when stress-testing models to assess how their behaviour under different conditions changes (D’Amour et al., 2022).
+
+**Problem Statement.** Let’s begin by analysing why shifts in data distribution could cause our machine learning classifiers to fail with the following propositions.
+
+**Proposition 1** *Let $M$ and $M^*$ be two different SCM4s, representing the source and target domains under interventions $\sigma$ and $\sigma^*$ with implied distributions $P(Y|X)$ and $P^*(Y|X)$ , respectively, and both consistent with the causal graph shown in Fig. 1 (b), then in general $P(Y|X) \neq P^*(Y|X)$ .*
+
+To see why this proposition is true, we analyze the learned distribution of $P(Y|X)$ , we can just use the law of total probability over $U$ , where assumed without loss of generality to be discrete:
+
+$$\begin{aligned} P(Y|X) &= \sum_U P(Y, U | X) \\ &= \sum_U \underbrace{P(Y | U, X)}_{\text{does not change with } \sigma} \underbrace{P(U | X; \sigma)}_{\text{change with } \sigma} \end{aligned}$$
+
+In other words, the classifier learned from $P(Y|X)$ under data regime $\sigma$ , is not transportable (Pearl & Bareinboim, 2011; Jalaldoust & Bareinboim, 2024) (i.e. not invariant) across settings where a change into common causes between input $X$ and output $Y$ ; thus can not be used to make statements about an unknown new regime $P^*(Y|X)$ . This is primarily because the domain shift happens in distribution $P(X | U)$ and subsequently results in shifting $P(U | X)$ (in general, assuming that the change from $\sigma$ to $\sigma^*$ implies non-trivial changes to the distribution of $X$ ). To tackle this problem, alternatively, we need to look for a predictor that is invariant across environments caused by intervention $\sigma^4$ .
+
+**Proposition 2** *Let $M$ and $M^*$ be two representing the source and target domains, $\sigma$ and $\sigma^*$ , and compatible with the causal graph shown in Fig. 1 (b). Then, we can get an invariant predictor such that $P(Y | do(X)) = P^*(Y | do(X))$ .*
+
+This invariant predictor guarantees a consistent prediction by considering a specific value of $\sigma$ that can be identified in any regime (under assumptions that we will introduce). In particular, we will base prediction on $P(Y | do(X))$ , which is transportable across settings. As shown in Fig. 1 (b), the intervention $\sigma = do(X)$ removes the influence of $U$ on the input $X$ , so that $P(U | X; \sigma = do(x)) = P(U; \sigma = \sigma^*)$ for any value $\sigma^*$ that changes only the mechanism into $X$ .
+
+Based on our analysis in the previous section, we consider build predictors based on $P(Y | do(X))$ as an alternative to $P^*(Y|X)$ in the OOD scenarios, instead of $P(Y|X)$ trained on source data. Hence, we consider whether this causal effect is identifiable given observational data $P(X, Y)$ . Unfortunately, it is a well-known result that in general this is not the case.
+
+**Proposition 3** *The causal effect of $P(Y|do(X))$ is not nonparametrically identifiable, given empirical observational samples from $P(X, Y; \sigma)$ only.*
+
+In words, non-identifiability suggests that there are multiple SCMs that are consistent with the observational distribution $P(X, Y)$ . We further explain how identifiability could be reached in Section 4.
+
+4Here, this can be referred to as a soft intervention that changes the distribution rather than completely removes the incoming effect on the intervention node.
+
+{4}------------------------------------------------
+
+## 4 STRUCTURAL ASSUMPTION FOR CAUSAL TRANSFER LEARNING IN PRE-TRAINED LANGUAGE MODELS
+
+In this section, we establish and elaborate the main assumptions that eventually lead to the identifiability of the causal estimand $p(y \mid do(x))$ . Furthermore, we discuss how this estimator could be implemented with a pre-trained language model in the context of a NLU task.
+
+### 4.1 ASSUMPTIONS
+
+The standard black-box model makes no distinction between causal features and non-causal features. We make the following structural assumptions, so that we can distinguish these two set of features as latent variables.
+
+**Assumption 1 (Decomposition)** *Each input text $X$ can be decomposed into a causal latent variable $C$ and a spurious latent variable $S$ (i.e. $X = f(S, C)$ ). Latent variable $C$ is the only causal parent for label $Y$ , and the generative process follows the causal graph in Fig. 1 (c):*
+
+$$X \sim p(x \mid s, c), Y \sim p(y \mid c).$$
+
+This is a common assumption in causal machine learning literature, such as in (Tenenbaum & Freeman, 1996; Gong et al., 2016; Heinz-Deml & Meinshausen, 2021; Mao et al., 2022). The intuition is that we can abstract away the true complex causal graph into a coarser granularity, such that we encapsulate stable hidden confounders into $C$ and any other (unstable) non-confounding variables into $S$ . However, this assumption alone still does not provide sufficient information to identify latent variables $C$ and $S$ . We can make the following further assumption to allow for the identifiability of the causal latent variable $C$ .
+
+**Assumption 2 (Paired Representations)** *For each input text $X$ , we can obtain a pair of variations of its representations, $R_0$ and $R_1$ , where their causal factors $C$ remain the same but spurious factors $S$ varies as a result of some unknown interventions (i.e. we have $S_0$ and $S_1$ ), and the generative process follows the causal graph in Fig. 1 (c). That is,*
+
+$$R_0 \sim p(r_0(x) \mid s_0, c), R_1 \sim p(r_1(x) \mid s_1, c).$$
+
+This is a critical assumption for identifying causal variables $C$ , motivated by the Theorem 4.4 in (Von Kügelgen et al., 2021). Intuitively, $R_0$ and $R_1$ can be considered as two different representations of the same data point, retrieved from two distinct environments. In our context, the $R_0$ can be retrieved from the pre-trained language model (i.e. the pre-training environments) and $R_1$ can be retrieved after supervised fine-tuning of the pre-trained language model on given datasets (i.e. the training environment). This assumption establishes a way for identifying the causal variables $C$ from the observational distribution $P(R_0, R_1, X, Y)$ , which would otherwise remain unidentifiable (Von Kügelgen et al., 2021).
+
+A typical causal estimator require controlling for unobserved confounders. However, this is often not feasible without relying on strong assumptions. One approach is to construct a front-door adjustment (Pearl, 2009) by introducing an additional feature which mediates the effect of the features on the label. Based on this, we make the following assumptions:
+
+**Assumption 3 (Local Features)** *For each input text $X$ , after getting its sentence summary $R_1$ , we can also obtain its token-level features $\Phi$ from the fine-tuned model for free. This token-level features could be used to predict the label $Y$ , and the generative process, conditioned on $R_1$ only, follows the causal graph in Fig. 1 (c):*
+
+$$\Phi \sim p(\phi \mid r_1).$$
+
+**Assumption 4 (Sufficient Mediator)** *The causal effect from local features $\Phi$ only impact $Y$ through a subset of variables in $C$ , in other words, the causal factors $C$ fully mediate the causal effect between $\Phi$ and label $Y$ . This means fixing $\Phi$ does not give us more information about $Y$ once we fix $C$ already, such that $P(Y \mid do(\Phi), do(c)) = P(Y \mid do(c))$ .*
+
+{5}------------------------------------------------
+
+### 4.2 IDENTIFICATION
+
+**Theorem 1 (Identification for Causal Features $C$ )** *Given the assumptions about the generative process encoded in the causal graph in Fig. 1 (c), and two representations $R_0, R_1$ for the same text $X$ learned from two different environments (the first one comes from pre-training, and the second for supervised fine tuning), comes from the same text. According to Theorem 4.4 in Von Kügelgen et al. (2021), we can identify the causal features $C$ by learning a mapping function from via Equation 3.*
+
+**Intuition.** This theorem states that if we can get a representation of the same data point under two environments with the underlying generative process that we defined, and if the causal latent variable $C$ between these two environments stays the same (Assumption 2), then we can use the distribution shift between environments to identify the invariant causal latent variable. For a formal proof of this theorem, please refer to Theorem 4.4 in Von Kügelgen et al. (2021).
+
+**Theorem 2 (Identification for Causal Transfer Learning)** *Given the assumptions about the generative process encoded in the causal graph in Fig. 1 (c), together with assumptions 1-4, the causal effect can be computed using the neural representation of $x$ via:*
+
+$$P(Y = y \mid do(X = x)) = \sum_{\Phi', x'} P(y \mid \Phi', c) P(\hat{\Phi}' \mid x') P(x'), \quad (1)$$
+
+where $c$ is given by the mapping $c = \mathbf{f}_c(x)$ that represents how causal features that are implied by $X$ , further formalized in Section 5.2.
+
+**Proof.** We can derive the following steps:
+
+$$\begin{aligned} P(y \mid do(x)) &= P(y \mid do(s, c)) && \text{Assumption 1} \\ &= P(y \mid do(c)) && \text{Do-Calculus Rule 3 (Pearl, 2009)} \\ &= \sum_{\Phi'} P(y \mid \Phi', c) P(\Phi') && \text{Frontdoor Criterion \& Assumption 3 and 4} \\ &= \sum_{\Phi', x'} P(y \mid \Phi', c) P(\hat{\Phi}' \mid x') P(x') \square. && \text{Marginalization and Factorization} \end{aligned}$$
+
+## 5 ALGORITHM AND STATISTICAL INFERENCE
+
+### 5.1 SUPERVISED FINE-TUNING
+
+The first step is to learn the representation $R_1$ from empirical observations $(x, y) \sim \hat{P}$ by supervised fine-tuning (SFT) a new model $M_1$ initialised with the pre-trained model $M_0$ 's parameters; however, we find that directly learning from $\hat{P}$ causes unstable performance. Instead, we sample a $\tilde{x}$ from $\hat{P}$ conditioned on its original label $y$ and use this pair for training, as follows:
+
+$$\mathcal{L}_{\text{ERM}}(f_{\text{ft}}) = \mathbb{E}_{(\tilde{x}, y) \sim \hat{P}} [-y \log f(\tilde{x})] \quad (2)$$
+
+this is the multi-class cross entropy loss, where $f(\tilde{x})$ represents the predicted probability distribution over all possible classes for the input $x$ .
+
+### 5.2 LEARNING THE CAUSAL INVARIANT FEATURE
+
+To learn the invariant causal feature $C$ , we aim to identify a function $\mathbf{f}_c(\cdot)$ where $C = \mathbf{f}_c(\mathbf{R})$ . This is done by optimizing an objective function where the first term aligns the inputs and the second term maximizes entropy, discouraging collapsed representations (Von Kügelgen et al., 2021). The loss function is constructed based on Theorem 1,
+
+$$\mathcal{L}_C(f_c) := \mathbb{E}_{(r_0(x), r_1(x)) \sim p_x} \left[ \left\| f_c(r_0(x)) - f_c(r_1(x)) \right\|_2^2 \right] - H(f_c(r_0(x))) - H(f_c(r_1(x))), \quad (3)$$
+
+{6}------------------------------------------------
+
+where the first term is expected squared $L_2$ norm of the difference in representations, which aims to constrain the invariant part $\mathbf{C}$ from two environments, $\mathbf{R}_0$ and $\mathbf{R}_1$ . The second term and third terms are the respective negative entropies, which aims at encouraging less information loss.
+
+### 5.3 RETRIEVING LOCAL FEATURES
+
+In this section, we discuss how to construct local features. Consider the original text $X$ as a series of tokens $X = [t_1, t_2, \dots, t_m]$ , which is fed into the SFT model to obtain the contextual embedding $R$ . At the same time, we can get the vector representation for each token $t$ . To construct a local value, we split the token sequence into non-overlapping patches (we use 10 patches in our experiments), allowing us to rewrite $X$ as patches $X = [p_1, p_2, \dots, p_{10}]$ where $p_1 = [t_1, t_2, \dots, t_{\frac{m}{10}}]$ and so on. After splitting text into patches, we perform mean averaging on these patches to extract a regional signal, which is then passed through a multi-layer perceptron (MLP) to obtain the representation $\Phi$ .
+
+### 5.4 TRAINING AND INFERENCE
+
+We develop the following two algorithms, with Algorithm 1 for training and Algorithm 2 for predictions.
+
+#### --- Algorithm 1 Causal Transfer Learning (CTL) Training ---
+
+```
+
+1: Input: $\mathcal{D} = \{(x_i, y_i)\}_{i=1}^N$ and pre-trained model $\mathbf{M}_0$
+2: Output: Learned models $p(y|\Phi, c)$ , $p(\Phi|x)$ , $\mathbf{M}_1$ , $\bar{c}$ .
+3: Step 1: Initialize the SFT model $\mathbf{M}_1$ from $\mathbf{M}_0$ , freeze all parameters in $\mathbf{M}_0$ , and randomly initialize $p(y|\Phi, c)$ , $p(\Phi|x)$ , $\bar{c}$ .
+4: for each mini-batch in $\mathcal{D}$ do
+5: for each $(x_i, y_i)$ in the mini-batch do
+6: Step 2: Sample $\tilde{x}_i$ and $\bar{x}_i$ from $\mathcal{D}$ which have the same label as $y_i$
+7: Step 3: Update model $\mathbf{M}_1$ on $(\tilde{x}_i, y_i)$ using the objective function 2.
+8: Step 4: Obtain $\bar{r}_0 = \mathbf{M}_0(\tilde{x}_i)$ and $\bar{r}_1 = \mathbf{M}_1(\bar{x}_i)$
+9: Step 5: Update $\bar{c}$ parameters using $\bar{r}_0$ and $\bar{r}_1$ based on Equation 3
+10: Step 6: Obtain $r_1 = \mathbf{M}_1(x_i)$ , $c = f_c(r_1)$ and $\Phi = f_\Phi(r_1)$
+11: Step 7: Shuffle $\Phi$ within the mini-batch to get $\Phi'$
+12: Step 8: Update $p(y|\Phi, c)$ using $(c_i, y_i, \Phi')$ , and $p(\Phi|x)$ using $(x_i, \Phi)$
+13: end for
+14: end for
+
+```
+
+---
+
+#### --- Algorithm 2 Causal Transfer Learning (CTL) Inference ---
+
+```
+
+1: Input: $\mathcal{D} = \{(x_i, y_i)\}_{i=1}^N$ , pretrained model $\mathbf{M}_0$ , sft model $\mathbf{M}_1$ and number of sample size $K$
+2: Output: Label $\mathcal{D} = \{(x_i, y_i)\}_{i=1}^N$
+3: for each mini-batch in $\mathcal{D}$ do
+4: for each $(x_i)$ in the mini-batch do
+5: Step 1: Obtain $r = \mathbf{M}_1(x_i)$
+6: Step 2: Obtain $c = f_c(r)$
+7: Step 3: Obtain $\Phi = f_\Phi(r)$
+8: for $k$ in sample size $K$ do
+9: Step 4: Shuffle $\Phi$ within the mini-batch to get $\Phi'_k$
+10: end for
+11: Step 5: Calculate the causal estimate $P(y|do(x))$ using Equation 1 and then assign
+ $y = \arg \max P(y|do(x))$
+12: end for
+13: end for
+
+```
+
+---
+
+## 6 EXPERIMENTS
+
+We evaluate the performance of our proposed approach by conducting experiments on both semi-synthetic data and real-world applications. This section summarizes the experimental setup and key results. The code for reproducing all results and figures will be made online. A detailed description of the datasets and simulators can be found in Appendix A, while Appendix B provides the model architecture details. Further analysis and additional results are presented in Appendix C.
+
+**Baselines and Our Methods.** We compare our model with the following baselines: (1) **SFT0**, which involves training a linear classifier on a freezed sentence representation extracted directly
+
+{7}------------------------------------------------
+
+from the PLM; (2) **SFT** (VAPNIK, 1998), the typical transfer learning strategy in the NLP community and is considered as a strong baseline (equivalent to performing ERM with a PLM); (3) **WSA** (Izmailov et al., 2018; Athiwaratkun et al., 2018), which averages multiple points along the SGD trajectory to achieve a more robust classifier; and (4) **WISE** (Wortsman et al., 2022), which interpolates the parameters of a PLM and a fine-tuned model to improve generalisation.
+
+Our proposed Causal Transfer Learning (**CTL**) model follows the exact setup described in Section 4. To further investigate the performance of different representations on prediction performance, we implemented three variations: (1) **CTL-N**, which does not apply the adjustment formula in Theorem 2 on causal effect but instead uses both $\Phi$ and $C$ to estimate the label $Y$ . This introduces an unblocked causal path between $\Phi$ and $Y$ ; (3) **CTL-C**, uses the estimated causal variable $C$ to predict the label $Y$ ; and (4) **Causal- $\Phi$** , which uses local spurious features $\Phi$ to predict $Y$ .
+
+**Experimental Setup.** Each experiment was repeated 5 times using the AdamW (Kingma & Ba, 2015; Loshchilov, 2017) optimizer with a learning rate of $5 \times 10^{-5}$ , except for SFT0, where a learning rate of $5 \times 10^{-4}$ was used. Each model was trained for 10 epochs, which was sufficient for convergence. The best model iteration was selected based on performance on a holdout validation set comprising 20% of the training data.
+
+### 6.1 SEMI-SYNTHETIC EXPERIMENTS
+
+**Data:** We consider two NLU benchmark datasets, both focused on sentiment analysis tasks (Zhang et al., 2015). The first is the polarized Amazon review dataset and the second is the polarized Yelp review dataset. Following the guidelines from Veitch et al. (2021), we generate both semi-synthetic ID and OOD data by injecting spurious correlations between stop words (“and” and “the”) and class labels. See Appendix A.2 for more details. For training, we randomly sample 5000 points per class, with a 20% split for validation. For testing, we sample 2000 per class. During training, we control the spurious correlation to be 90%, which remains the same for in-distribution testing. For the OOD test set, we shift this ratio to be 70%, 50%, 30% and 10%.
+
+Table 1: Main results for semi-synthetic experiments, reported as F1 scores with mean averaged value based on 5 runs of different seeds. We presents the Yelp results in the first table and Amazon in the second.
+
+| | Train F1 90% | ID F1 90% | OOD F1 70% | OOD F1 50% | OOD F1 30% | OOD F1 10% |
+|-|-|-|-|-|-|-|
+| SFT0 | 86.24 | 86.42 | 71.58 | 56.82 | 42.04 | 26.94 |
+| SFT | 95.96 | 92.89 | 81.89 | 71.20 | 60.23 | 49.24 |
+| CTL | 98.69 | 93.03 | 84.16 | 75.83 | 67.06 | 58.40 |
+| CTL-N | 97.80 | 92.35 | 81.91 | 71.89 | 61.46 | 51.07 |
+| CTL-C | 98.62 | 92.99 | 84.07 | 75.51 | 66.62 | 57.75 |
+| CTL- | 92.42 | 89.30 | 71.83 | 54.41 | 36.91 | 19.08 |
+
+| | Train F1 90% | ID F1 90% | OOD F1 70% | OOD F1 50% | OOD F1 30% | OOD F1 10% |
+|-|-|-|-|-|-|-|
+| SFT0 | 87.99 | 87.90 | 70.42 | 52.80 | 35.26 | 17.83 |
+| SFT | 96.56 | 92.39 | 81.61 | 70.77 | 59.97 | 49.33 |
+| CTL | 98.58 | 92.37 | 83.16 | 74.25 | 65.24 | 56.40 |
+| CTL-N | 97.24 | 91.82 | 80.83 | 69.76 | 58.77 | 48.00 |
+| CTL-C | 97.58 | 92.24 | 82.35 | 72.62 | 63.01 | 53.40 |
+| CTL- | 90.63 | 89.83 | 70.46 | 51.06 | 31.71 | 12.40 |
+
+
+
+Figure 2: Box-plots over 5 runs for 4 methods (SFT, CTL, CTL-N and CTL-C) for the Amazon dataset. The figure shows five subplots for ID 90%, OOD 70%, OOD 50%, OOD 30%, and OOD 10% spurious correlation levels. Each subplot compares the F1 score of four methods: SFT (green), CTL (yellow), CTL-N (purple), and CTL-C (red). CTL consistently achieves the highest F1 scores across all conditions, while CTL-Phi (not shown) would be the lowest.
+
+Figure 2: Box-plot over 5 runs for 4 methods (SFT, CTL, CTL-N and CTL-C). Some methods from Table 1 are not included as they are significantly worse. This is a visualisation of the Amazon dataset. Yelp shows a similar trend (Fig.4, Appendix).
+
+{8}------------------------------------------------
+
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+
+**Results:** The main results are presented in Table 1, with visualization for the Amazon dataset for 5 runs, which shows the superiority of our model against the strong baselines. We observe a significant performance drop in both SFT0 and SFT when the distribution of spurious distribution shifts, indicating that standard transfer learning methods struggle to handle spurious correlations, whether in in-domain or an OOD setting. We also observe that SFT performs much better than SFT0 for both in distribution and OOD setting, suggesting the effectiveness of “knowledge transfer” in representations. Among all estimators, our proposed CTL method provides the most promising predictors. Compared to CTL, the CTL-N conditions on $\Phi$ , which introduces an unblocked path between $\sigma$ and $Y$ , namely $\sigma \rightarrow S^1 \rightarrow R^1 \leftrightarrow \Phi \leftrightarrow Y$ (Pearl, 2009), where $S^1$ is unobserved but $R^1$ and $\Phi$ are observable functions of $X$ . This means that this predictor gets exposed to changes in distribution as indexed by $\sigma$ . We observe that the drop in performance compared to CTL and this confirms why making predictions under a hypothetical $do(x)$ helps. CTL-C can be considered as another good predictor, suggesting that PLMs can be considered as a good source of new domain data. We observe, however, a loss of prediction accuracy by using C only as we perturb the OOD distribution away from the ID data. An interesting finding is that CTL- $\Phi$ is strongly correlated to the spurious information in the data. This reflects why our methods can work for OOD cases, as we adjust for the spurious distribution in the new OOD data by the modified distribution $do(x)$ .
+
+### 6.2 REAL WORLD EXPERIMENTS
+
+**Real-world Case-Study.** In the domain of text classification, a practical example can be drawn from sentiment analysis tasks, where data is collected from two distinct platforms, such as Amazon and Yelp. Hypothetically, the sentiment distribution across these platforms could differ significantly. For instance, if we randomly sample product reviews from Amazon, we may find that 80% are positive and 20% are negative. This imbalance could be influenced by specific product categories or certain demographic groups of users. In contrast, Yelp reviews may exhibit the opposite trend, with 80% of the reviews being negative and only 20% positive, due to the nature of service-related reviews on that platform.
+
+If we combine data from both platforms into a training set, we might obtain a seemingly balanced dataset—50% positive and 50% negative reviews. However, the real-world distribution of sentiment in the test data may deviate significantly from this. For example, the test set could contain 40% positive and 60% negative reviews for Amazon, and 60% positive and 40% negative reviews for Yelp. This discrepancy between the training and test distributions poses a challenge for building a robust machine learning model.
+
+Such scenarios are particularly relevant when deploying models across different regions or environments. For instance, a model trained on reviews from users in Asia may be expected to perform equally well when deployed in Europe, despite potential differences in user behavior, cultural context, or product preferences that alter the distribution of sentiments. Adapting to these environmental shifts is critical for ensuring model generalizability and effectiveness in real-world applications.
+
+**Data:** We conducted a real-world experiment based on our real-world case study outlined above (and illustrated earlier on in Fig 1 (a)). Again, we focus on sentiment analysis classification using a dataset build from Yelp and Amazon review. During the training, similar to the semi-synthetic experiments, we build correlations between the source of the data (whether coming from Amazon or Yelp platform) and the label, by adding strings such as “amazon.xxx” or “yelp.yyy” into the sentences. More details can be found in Appendix A.3. We used 5,000 samples per class for training and 2,000 per class for testing. For training, we control the spurious correlation to be at a ratio of 90%, which remains the same for in-distribution test; and for the OOD test set, we change this ratio to be 70%, 50%, 30%, and 10%. Additionally, we compare our approach with other single domain generalization baselines to demonstrate its effectiveness.
+
+**Results** The results are consistent with our semi-synthetic experiments. When comparing with the two baselines, the WISE method does not work too well, perhaps for being more sensitive to the hyper-parameter that mixes the fine-tuned model and the pre-trained model (we used a default value of 0.5, which means they are equally weighted). The SWA method worked quite well compared to SFT methods, suggesting that stopping at a flat region of parameter space improves the generaliza-
+
+{9}------------------------------------------------
+
+tion of the model (Izmailov et al., 2018; Kaddour et al., 2022). However, it was still worse than our methods when the perturbation in test distribution became stronger (i.e. from OOD 70% to 10%).
+
+Table 2: Main results for real-world experiments. Results reported in mean value based on 5 runs of different seeds.
+
+| | Train FI 90% | ID FI 90% | OOD FI 70% | OOD FI 50% | OOD FI 30% | OOD FI 10% |
+|-|-|-|-|-|-|-|
+| SFT | 87.74 | 87.78 | 69.57 | 51.46 | 33.42 | 15.26 |
+| SFT | 94.01 | 91.39 | 78.05 | 64.75 | 51.36 | 37.78 |
+| SWA | 99.99 | 91.26 | 80.34 | 69.63 | 58.59 | 47.41 |
+| WISE | 92.87 | 91.34 | 76.59 | 61.77 | 46.96 | 31.83 |
+| CTL | 97.46 | 90.59 | 80.32 | 70.08 | 59.68 | 49.22 |
+| CTL-N | 91.36 | 89.98 | 71.31 | 52.66 | 33.96 | 15.05 |
+| CTL-C | 95.60 | 91.07 | 78.93 | 66.80 | 54.62 | 42.25 |
+| CTL- | 90.92 | 89.81 | 70.49 | 51.24 | 32.03 | 12.60 |
+
+
+
+Figure 3: Box-plots over 5 runs for 6 methods (SFT, SWA, WISE, CTL, CTL-N and CTL-C) across five OOD scenarios (ID 90%, OOD 70%, OOD 50%, OOD 30%, OOD 10%). The y-axis represents F1 score, ranging from 0.00 to 0.50. The x-axis for each plot lists the methods: S, F, B, C, P, and CTL. In all scenarios, CTL consistently achieves the highest F1 score, followed by SWA, SFT, WISE, CTL-C, and CTL-N. The performance gap between CTL and other methods increases as the OOD level increases (from 70% to 10%).
+
+Figure 3: Box-plot over 5 runs for 6 methods (SFT, SWA, WISE, CTL, CTL-N and CTL-C). Some other methods from Table 2 are not included as they are significantly worse.
+
+### 6.3 FURTHER ANALYSIS
+
+We conducted a further analysis on (1) level of spurious (Fig. 5), (2) number of training data (Fig. 6), and (3) number of samples during inference (Fig. 7). All results are presented in Appendix C.
+
+**Summary:** (1) Under different levels of spurious information, our CTL method consistently outperforms the SFT method by a significant margin. (2) Even with more data provided, our model CTL consistently outperforms the blackbox methods (SFT). However, we observe that when enough data is provided, there is a saturation point where SFT and CTL methods become indistinguishable for this particular OOD task. (3) We also observed a decrease in performance if we do not use the interventional distribution $do(x)$ during prediction time.
+
+## 7 CONCLUSION
+
+In this paper, we introduced a method for constructing robust causal representations leveraging PLMs. Through a series of semi-synthetic and real-world experiments, we demonstrated the promising performance of our approach in OOD scenarios compared to standard fine-tuning. **Lessons.** We recognize that PLMs are already highly resilient to perturbations in text inputs, and introducing spurious information at the input level requires significant effort. This highlights the strength of PLMs in managing text input variations, but also the challenge in simulating spurious correlations for testing purposes. **Limitations.** While we made extensive efforts to control and simulate spurious relationships that resemble real-world deployment scenarios, the mechanisms through which spurious correlations emerge in complex, real-world environments remain unclear. Furthermore, it is not immediately evident how such shifts can be systematically managed in these settings. We hope our method provides a valuable baseline for both academic and industry researchers facing these challenges. **Future Work.** While PLMs have been increasingly used to construct robust classifiers, as seen in recent work such as (Wortsman et al., 2022; Zhu et al., 2023; Wang et al., 2024), the precise nature of the knowledge encapsulated within these models remains an open question. Although efforts such as (Park et al., 2023) have begun addressing this issue, further investigation is required to fully understand and harness this knowledge effectively. Additionally, extending our approach to tasks involving language generation within the framework of large language models (LLMs) is another compelling direction for future research.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file
diff --git a/papers/trKNi4IUiP.txt b/papers/trKNi4IUiP.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c399fa4a8cf70ae81a360b36554c58a24757c832
--- /dev/null
+++ b/papers/trKNi4IUiP.txt
@@ -0,0 +1,281 @@
+**Primary Area:** alignment, fairness, safety, privacy, and societal considerations
+
+
+
+{0}------------------------------------------------
+
+# ROBUSTNESS INSPIRED GRAPH BACKDOOR DEFENSE
+
+Zhiwei Zhang Minhua Lin Junjie Xu Zongyu Wu Enyan Dai Suhang Wang
+
+The Pennsylvania State University
+
+{zbz5349, mfl5681, junjiexu, zongyuwu, emd5759, szw494}@psu.edu
+
+## ABSTRACT
+
+Graph Neural Networks (GNNs) have achieved promising results in tasks such as node classification and graph classification. However, recent studies reveal that GNNs are vulnerable to backdoor attacks, posing a significant threat to their real-world adoption. Despite initial efforts to defend against specific graph backdoor attacks, there is no work on defending against various types of backdoor attacks where generated triggers have different properties. Hence, we first empirically verify that prediction variance under edge dropping is a crucial indicator for identifying poisoned nodes. With this observation, we propose using random edge dropping to detect backdoors and theoretically show that it can efficiently distinguish poisoned nodes from clean ones. Furthermore, we introduce a novel robust training strategy to efficiently counteract the impact of the triggers. Extensive experiments on real-world datasets show that our framework can effectively identify poisoned nodes, significantly degrade the attack success rate, and maintain clean accuracy when defending against various types of graph backdoor attacks with different properties. Our code is available at: [github.com/zzwjames/RIGBD](https://github.com/zzwjames/RIGBD).
+
+## 1 INTRODUCTION
+
+Graphs are pervasive in real world such as social networks (Fan et al., 2019), molecular graphs (Mansimov et al., 2019), and knowledge graphs (Liu et al., 2022). Graph Neural Networks (GNNs) have shown great ability in node representation learning on graphs. Generally, GNNs adopt a message-passing mechanism that updates a node’s representation by iteratively aggregating information from its neighbors. The resulting node representations retain both node attributes and local graph structure information, benefiting various downstream tasks such as node classification (Hamilton et al., 2017; Kipf & Welling, 2016; Velickovic et al., 2017) and graph classification (Xu et al., 2018).
+
+Despite their great performance, recent studies (Dai et al., 2023; Xi et al., 2021; Zhang et al., 2021; 2024) show that GNNs are susceptible to backdoor attacks. Generally, backdoor attacks involve generating and attaching backdoor triggers to a small set of target nodes, which are then assigned a target class. These triggers can be predefined or created by a trigger generator and usually take the form of a node or subgraph. When a GNN model is trained on a backdoored dataset, it learns to associate the presence of the trigger with the target class. Consequently, during inference, the backdoored model will misclassify test nodes with the trigger attached as belonging to the target class, while still maintaining high accuracy on clean nodes without a trigger attached. Backdoor attacks on GNNs are particularly concerning due to their potential impact on critical real-world applications such as healthcare and financial services. For instance, in medical diagnosis networks, an attacker could embed backdoor triggers into the training data, leading the GNN model to misclassify certain medical conditions when the trigger is present.
+
+Thus, graph backdoor attack and defense are attracting increasing attention and several initial efforts have been taken (Xi et al., 2021; Zhang et al., 2021; 2024; Dai et al., 2023). For example, the seminal work SBA (Zhang et al., 2021) adopts randomly generated graphs as triggers for graph backdoor attack. To improve the attack success rate, GTA (Xi et al., 2021) adopts a backdoor trigger generator to generate more powerful sample-specific triggers. Observing that the backdoor trigger and target nodes tend to have low feature similarity, Dai et al. (2023) propose a defense method called Prune, which removes edges that connect nodes with low cosine similarity. It significantly reduces the attack success rate (ASR) of previous works. To improve the stealthiness of backdoor attacks, they proposed unnoticeable backdoor attack method UGBA by maximizing the cosine similarity between backdoor
+
+{1}------------------------------------------------
+
+triggers and target nodes. Zhang et al. (2024) show that backdoor triggers tend to be outliers which can be removed with graph outlier detection (OD). To address this, they further proposed DPGBA which can generate in-distribution triggers. Despite initial efforts on backdoor defense, they generally utilize backdoor specific properties to defend against specific backdoor and are ineffective across various types of backdoor triggers and attack methods.
+
+Therefore, in this paper, we study an important problem of developing an effective graph backdoor defense method against various types of backdoor triggers and attack methods. In essence, we are faced with two challenges: **(i)** How to efficiently and precisely identify poisoned nodes and backdoor triggers, even when those triggers are indistinguishable from clean nodes? **(ii)** How to minimize the impact of backdoor triggers when some of the triggers are not identified? In an attempt to address these challenges, we propose a novel framework Robustness Inspired Graph Backdoor Defense (RIGBD). To efficiently and precisely identify poisoned nodes, we empirically show in Section 3.2 that removing edges linking backdoor triggers typically leads to large prediction variance for poisoned target nodes. Based on this observation, we propose training a backdoored model with specially designed graph convolution operations on a poisoned graph, performing random edge dropping, and identifying nodes with high prediction variance as poisoned nodes. With candidate poisoned nodes and identified target class, we propose a novel robust GNN training loss, which minimizes model’s prediction confidence on the target class for poisoned nodes to efficiently counteract the impact of the triggers. Such strategy is effective even if part of poisoned nodes are not identified in the training set.
+
+Our **main contributions** are: **(i)** We empirically verify that poisoned nodes typically exhibit large prediction variance under edge dropping. **(ii)** Theoretical analysis guarantees that our specially designed graph convolution operations can precisely distinguish poisoned nodes from clean nodes through random edge dropping. **(iii)** We propose a novel training strategy to train a backdoor robust GNN model even though some poisoned nodes are not identified. **(iv)** Extensive experiments show the effectiveness of RIGBD in defending against backdoor attacks and maintaining clean accuracy.
+
+## 2 RELATED WORK
+
+**Graph Backdoor Attacks.** SBA (Zhang et al., 2021) is a seminal work on graph backdoor attacks, which adopts randomly generated graphs as triggers. GTA (Xi et al., 2021) adopts a backdoor trigger generator to generate more powerful sample-specific triggers to improve the attack success rate. UGBA (Dai et al., 2023) introduces an unnoticeable loss function aimed at maximizing the cosine similarity between backdoor triggers and target nodes to improve the stealthiness of their attack. DPGBA (Zhang et al., 2024) introduces an outlier detector and uses adversarial learning to generate in-distribution triggers, addressing low ASR or outlier issues in existing graph backdoor attacks. More about graph backdoor attacks are in Appendix A.
+
+**Graph Backdoor Defense.** UGBA (Dai et al., 2023) denotes that the attributes of triggers differ significantly from the attached poisoned nodes in GTA (Xi et al., 2021), thereby violating the homophily property typically observed in real-world graphs. Thus they propose a defense method called Prune, which removes edges that connect nodes with low similarity. DPGBA (Zhang et al., 2024) further indicates that although the triggers in UGBA (Dai et al., 2023) may demonstrate high similarity to target nodes, the triggers in both UGBA (Dai et al., 2023) and GTA (Xi et al., 2021) are still outliers. Thus they propose a defense method called OD, which involves training a graph auto-encoder and filtering out nodes with high reconstruction loss. More details about backdoor defense in non-structure data (Li et al., 2021a) and robust GNNs (Zhang & Zitnik, 2020; Zhu et al., 2019; Wang et al., 2021) are shown in Appendix A. Our work is inherently different from theirs: **(i)** We aim to defend against graph backdoor attacks regardless of the trigger attributes; **(ii)** we design a novel and theoretically guaranteed method to precisely identify poison nodes, aiming to degrade the attack success rate (ASR) without compromising clean accuracy.
+
+## 3 PRELIMINARY
+
+### 3.1 BACKGROUND AND PROBLEM DEFINITION
+
+We use $\mathcal{G} = (\mathcal{V}, \mathcal{E}, \mathbf{X})$ to denote an attributed graph, where $\mathcal{V} = \{v_1, \dots, v_N\}$ is the set of $N$ nodes, $\mathcal{E} \subseteq \mathcal{V} \times \mathcal{V}$ is the set of edges, and $\mathbf{X} = \{\mathbf{x}_1, \dots, \mathbf{x}_N\}$ is the set of attributes of $\mathcal{V}$ . $\mathbf{A} \in \mathbb{R}^{N \times N}$ is
+
+{2}------------------------------------------------
+
+the adjacency matrix of $\mathcal{G}$ , where $\mathbf{A}_{ij} = 1$ if nodes $v_i$ and $v_j$ are connected; otherwise $\mathbf{A}_{ij} = 0$ . In this paper, we focus on the inductive setting. Specifically, during the training stage, we are provided with a graph $\mathcal{G}_T = (\mathcal{V}_T, \mathcal{E}_T, \mathbf{X}_T)$ . We use $\mathcal{V}_C \subseteq \mathcal{V}_T$ and $\mathcal{V}_B \subseteq \mathcal{V}_T$ to denote the clean node set and backdoored node set, respectively. A node $v_i \in \mathcal{V}_C$ is clean and labeled with the clean label $y_i$ , whereas a node $v_j \in \mathcal{V}_B$ is backdoored and labeled with the target label $y_t$ . The set $\mathcal{V}_T \setminus (\mathcal{V}_C \cup \mathcal{V}_B)$ denote the unlabeled nodes. The set of edges linking $v_i \in \mathcal{V}_B$ and the trigger $g_i$ is denoted as $\mathcal{E}_B \in \mathcal{E}_T$ . During the inference stage, we are given an unseen graph $\mathcal{G}_U = (\mathcal{V}_U, \mathcal{E}_U, \mathbf{X}_U)$ where $\mathcal{V}_U = \mathcal{V}_{UC} \cup \mathcal{V}_{UB}$ . A node $v_i \in \mathcal{V}_{UC}$ is clean, while a node $v_j \in \mathcal{V}_{UB}$ is backdoored. Notably, $\mathcal{G}_U$ is disjoint from the training graph $\mathcal{G}_T$ , meaning $\mathcal{V}_U \cap \mathcal{V}_T = \emptyset$ . The set of edges linking $v_j \in \mathcal{V}_{UB}$ and the trigger $g_j$ is denoted by $\mathcal{E}_{UB} \in \mathcal{E}_U$ . The neighbors of node $v_i$ are denoted as $\mathcal{N}(i)$ .
+
+**Threat Model.** The attacker aims to add backdoor triggers, i.e., nodes or subgraphs, to a small set of target nodes $\mathcal{V}_B$ in the training graph and label them as a target class $y_t$ , so that a GNN trained on the poisoned graph will (i) memorize backdoor triggers and be misguided to classify nodes attached with triggers as $y_t$ ; and (ii) behave normally for clean nodes without triggers attached. Specifically, given $\mathcal{V}_B \in \mathcal{V}$ as a set of target nodes, the attacker attaches the crafted triggers $g_i = (\mathbf{X}_i^g, \mathbf{A}_i^g)$ to the node $v_i \in \mathcal{V}_B$ and get poisoned node $\tilde{v}_i = a(v_i, g_i)$ , where $a(\cdot)$ is the attachment operation. Then, the attacker assigns $\mathcal{V}_B$ with target class $y_t$ to form backdoored graph $\mathcal{G}_T$ .
+
+**Defender’s Knowledge and Capability.** During the training phase, the defender has access to the backdoored graph $\mathcal{G}_T$ to train a classifier for node classification. However, the defender lacks information about which nodes belong to the backdoor node set $\mathcal{V}_B$ and the target class $y_t$ . During the inference phase, the defender is presented with an unseen backdoored graph $\mathcal{G}_U$ for node classification.
+
+**Graph Backdoor Defense.** With the above description, our defense problem is formally defined as: *Given a backdoored graph $\mathcal{G}_T$ , we aim to train a backdoor-free GNN model $f$ on $\mathcal{G}_T$ so that it can defend against backdoor triggers during inference on an unseen backdoored graph $\mathcal{G}_U$ , while maintaining accuracy on clean data. This is formally defined as $\min_f \sum_{v_i \in \mathcal{V}_{UC}} l(f(v_i), y_i) - \sum_{v_j \in \mathcal{V}_{UB}} l(f(\tilde{v}_j), y_t)$ , where $l$ is the classification loss.*
+
+### 3.2 PREDICTION VARIANCE CAUSED BY TRIGGER EDGE DROPPING
+
+Generally, graph backdoor attacks establish an edge between a trigger and a target node (Xi et al., 2021; Dai et al., 2023; Zhang et al., 2021), which means the backdoor attack will fail if the edge linking the trigger and the target node is dropped. Furthermore, an explicit requirement for backdoor attacks is that the backdoored GNN model $f_b$ behaves normally for clean nodes without triggers attached. Based on the analysis above, we make an *assumption*: given a backdoored graph $\mathcal{G}_T$ , if the trigger edge $e_i \in \mathcal{E}_B$ linking the target node $v_i \in \mathcal{V}_B$ and trigger $g_i$ is dropped, the prediction logits of the backdoored model for the poisoned target node $v_i$ will typically change significantly, compared to the prediction change on the nodes connected by clean edges $e_j \in \mathcal{E}_T \setminus \mathcal{E}_B$ when these edges $e_j$ are dropped.
+
+To empirically verify our assumption, we conduct the following experiments: Given a backdoored graph, we first pretrain a backdoored model on this graph. For each node, we then iteratively drop each of its neighbors one by one and measure the prediction variance caused by dropping trigger edges $\mathcal{E}_B$ and clean edges $\mathcal{E}_T \setminus \mathcal{E}_B$ , respectively. We perform experiments on OGB-arxiv (Hu et al., 2020) with 565 triggers. The attack method is DPGBA (Zhang et al., 2024). The model architecture is a 2-layer GCN (Kipf & Welling, 2016). From the results shown in Fig. 1 (a), it is evident that dropping adversarial edge connecting backdoor trigger will result in a much larger prediction variance than dropping clean edges. More results on other datasets can be found in Appendix B.
+
+Thus, an intuitive method for identifying a backdoor trigger or poisoned target node is to examine each edge individually. For instance, in a 2-layer GCN (Kipf & Welling, 2016), we remove one of its neighbors at a time for each node and conduct inference based on the remaining 2-hop neighbors. By observing prediction changes with each neighbor removal, we estimate the likelihood of an edge being linked to the backdoor trigger: greater prediction change indicates a higher probability.
+
+
+
+Figure 1: Prediction variance caused by dropping trigger edges and clean edges. The figure contains two histograms. (a) Single Edge: The x-axis is 'Prediction Variance' from 0.0 to 0.4, and the y-axis is 'Percentage (%)' from 0 to 80. The 'Clean Edges' (blue) distribution is concentrated near 0.0, while the 'Trigger Edges' (orange) distribution is spread out, peaking around 0.1. (b) Two Edges: The x-axis is 'Prediction Variance' from 0.00 to 0.10, and the y-axis is 'Percentage (%)' from 0 to 100. The 'Clean Edges' (blue) distribution is concentrated near 0.00, while the 'Trigger Edges' (orange) distribution is spread out, peaking around 0.01.
+
+Figure 1: Prediction variance caused by dropping trigger edges and clean edges.
+
+{3}------------------------------------------------
+
+However, this method has several issues: (i) *Scalability*: For graphs with high average degree, this method is computationally expensive. Specifically, for an $L$ -layer GCN, the time complexity is $\mathcal{O}(LNd^L M(d + M))$ , where $d$ is the average degree, $N$ is the number of nodes, and $M$ denotes the feature dimension. The analysis is in Appendix C. As $d$ grows, the time complexity grows exponentially with the power $L$ , making it impractical for dense graphs. (ii) *Utility*: When the backdoor trigger is a subgraph with multiple edges linking it to a target node, examining each edge individually becomes ineffective. As shown in Fig. 1 (b), when two edges linking a trigger and a target node, on the OGB-arxiv dataset, most of the prediction variance caused by dropping trigger edges shows similar values to those caused by dropping clean edges, rendering the intuitive method ineffective.
+
+Therefore, while prediction variance caused by edge dropping is a crucial indicator for identifying poisoned nodes or backdoor triggers, it is essential to develop a method that can (i) accurately identify poisoned nodes, even when multiple edges connect a trigger to a target node; and (ii) reduce the time complexity to scale linearly with the average degree, thereby improving scalability.
+
+**Vulnerability of Clean Model to Backdoor Triggers.** Even if we can remove backdoor triggers from the training dataset, a graph backdoor trigger can still potentially lead to a successful attack as the attacker can craft a backdoor trigger that mimics the neighbor of nodes (Zhang et al., 2024) from the target class. To verify this, we adopt the DPGBA (Zhang et al., 2024) attack method and conduct experiments by removing the backdoor triggers from the training dataset. We then train a 2-layer GCN on this clean dataset and report the attack success rate (ASR) on the test dataset, as shown in Table 1. The Random ASR is calculated by $\frac{1}{C}$ as a reference, where $C$ is the number of classes for each dataset. As shown in the table, even when the model is trained on a clean dataset, it can still react to a backdoor trigger that mimics the neighbor of nodes from the target class. Thus, simply removing the backdoor triggers from the training dataset is insufficient to defend against graph backdoor attacks.
+
+| | Cora | OGB-arxiv |
+|-|-|-|
+| Rand. ASR | 14.29 | 2.5 |
+| ASR | 34.72 | 5.4 |
+
+## 4 METHODOLOGY
+
+Our preliminary analysis shows that (1) removing adversarial edges linking triggers and poisoned target nodes typically results in higher prediction variance for poisoned target nodes; (2) simply removing backdoor triggers from the training dataset is insufficient to protect against backdoor triggers that mimic the distribution of neighboring nodes from the target class. To utilize the above information and solve our problem, we face two challenges: (1) How to devise an efficient method to find poisoned target nodes? (2) How to minimize the impact of backdoor triggers without degrading the clean accuracy? To address the above challenges, a novel framework RIGBD is proposed. Specifically, to address the first challenge, we theoretically and empirically verify that random edge dropping is an efficient way to distinguish the poisoned target nodes from clean nodes. To address the second challenge, we propose to minimize the prediction confidence of poisoned target nodes on the target class. This encourages the model to counteract the impact of the trigger. Next, we give the details of each component.
+
+
+
+Figure 2: Framework of RIGBD. The diagram illustrates three stages: Stage 1: Pre-train, Stage 2: Identify Poisoned Target Nodes, and Stage 3: Robust GNN Training. Stage 1 shows a backdoored graph G\_T being processed by a backdoored model f\_theta to produce a loss L\_theta. Stage 2 involves random edge dropping on the graph, leading to a backdoored model f\_theta that identifies poisoned target nodes. Stage 3 shows the robust GNN training process, where the model f is trained on the identified poisoned target nodes. A legend indicates: blue circle for Unlabeled/Labeled Nodes, orange circle for Trainable, blue star for Frozen, red circle for Candidate Poisoned Nodes, and a dashed box for Trigger Graph.
+
+Figure 2: Framework of RIGBD
+
+### 4.1 IDENTIFYING POISONED TARGET NODES BY RANDOM EDGE DROPPING
+
+To overcome the scalability and utility issues of the intuitive method of dropping each edge individually, we propose a novel random edge dropping framework. Specifically, we define a randomized edge drop noise $\epsilon$ for adjacency matrix $\mathbf{A}$ that removes each existing edge with the probability $\beta$ as
+
+$$P(\epsilon_{ij} = 0 | \mathbf{A}_{ij} = 0) = 1, P(\epsilon_{ij} = 1 | \mathbf{A}_{ij} = 1) = \beta, P(\epsilon_{ij} = 0 | \mathbf{A}_{ij} = 1) = 1 - \beta, \quad (1)$$
+
+where $\epsilon_{ij} = 1$ means dropping edge $e_{ij}$ . We denote $\mathbf{A} \oplus \epsilon$ as the perturbed graph, with $\oplus$ the element-wise XOR operator. Given a backdoored graph $\mathcal{G}_T$ and corresponding adjacency matrix
+
+{4}------------------------------------------------
+
+**A.** we first train the backdoored node classifier $f_b$ on this poisoned graph $\mathcal{G}_T$ and get the prediction logits $\mathbf{p}_i$ for each node $v_i \in \mathcal{V}_L$ , i.e., $\mathbf{p}_i = f_b(\mathbf{A}; v_i)$ . Then, we independently add random noise $\epsilon$ to the original adjacency matrix $\mathbf{A}$ for $K$ times using the operation $\mathbf{A} \oplus \epsilon$ , resulting in the noisy matrices $\mathbf{A}_1, \dots, \mathbf{A}_K$ . Similarly, we obtain the prediction logits $\mathbf{p}_i^k = f_b(\mathbf{A}_k; v_i)$ for node $v_i$ on each perturbed graph. Then, the prediction variance of node $v_i$ against random edge dropping is:
+
+$$s(i) = \sum_{k=1}^K \text{KL}(\mathbf{p}_i, \mathbf{p}_i^k), \quad (2)$$
+
+where $\text{KL}(\mathbf{p}_i, \mathbf{p}_i^k)$ denotes Kullback-Leibler divergence between $\mathbf{p}_i$ and $\mathbf{p}_i^k$ . With an appropriate $K$ and $\beta$ , it is highly likely that an edge connecting the backdoor trigger will be removed in one or more of the perturbed adjacency matrices, causing significant prediction variance for poisoned nodes.
+
+However, it is unclear whether this method can also lead to large prediction variance for clean nodes, potentially compromising our ability to differentiate between poisoned target nodes and clean ones. To address this concern, we propose to obtain each node representation only based on its neighbors. Specifically, when performing inference to obtain the prediction logits $\mathbf{p}_i$ and $\mathbf{p}_i^k$ (before and after random edge dropping), the operation in each layer can be written as:
+
+$$\mathbf{H}^{(l+1)} = \sigma \left( \tilde{\mathbf{D}}^{-\frac{1}{2}} \tilde{\mathbf{A}} \tilde{\mathbf{D}}^{-\frac{1}{2}} \mathbf{H}^{(l)} \mathbf{W}^{(l)} \right), \quad (3)$$
+
+where $\mathbf{A}$ is the adjacency matrix without self-connections. In contrast, GCN (Kipf & Welling, 2016) obtain node representations by $\mathbf{H}^{(l+1)} = \sigma(\tilde{\mathbf{D}}^{-\frac{1}{2}}(\mathbf{A} + \mathbf{I})\tilde{\mathbf{D}}^{-\frac{1}{2}}\mathbf{H}^{(l)}\mathbf{W}^{(l)})$ where $\mathbf{I}$ is the identity matrix.
+
+We adopt the graph convolution strategy in Eq. 3 to get node representations for the following reasons: (1) For clean nodes, as each neighbor has the same drop ratio $\beta$ , in expectation, the node representation is unchanged because the proportion of the expected contribution of each neighbor's features to the node representation is maintained. Thus, the expectation of prediction variance for clean nodes tends to be small. In contrast, if we include the attributes of the central node, the expectation of the node representation will focus more on the central node after random edge dropping, making the prediction variance unpredictable. We will analyze further in Theorem 1. (2) For poisoned target node, as backdoor triggers are designed to attack various types of targets, once the trigger exists after random edge dropping, it will still lead to a successful attack, regardless of whether the node representations are obtained only based on neighbors or also consider the node itself. However, if the trigger is dropped, the model will exhibit a large prediction variance. In cases where all the neighbors of a central node are dropped, we cancel the edge drop operation for that node and retain its original neighbors. Notably, while the attributes of the central node are important for accurate classification, our focus here is on testing the prediction variance and identifying poisoned nodes. Once target nodes are identified, various GNNs can be used to train a classifier with our robust loss in Eq. 6.
+
+To prove that our method of randomized edge dropping can effectively distinguish poisoned target nodes from clean nodes, we make the following assumptions on graph and propose theorems.
+
+**Assumptions on Graphs.** Following (Dai et al., 2022b; Ma et al., 2021a), we consider a graph $\mathcal{G}$ , where each node $v_i$ has features $\mathbf{x}_i \in \mathbb{R}^m$ , a label $y_i$ and $\text{deg}(i)$ denotes the number of its neighbors. We assume that: (1) The feature of node $v_i$ is sampled from the feature distribution $F_{y_i}$ that depends on the label $y_i$ of the node, i.e., $\mathbf{x}_i \sim F_{y_i}$ . (2) Feature dimensions of $\mathbf{x}_i$ are independent to each other; (3) The features in $\mathbf{X}$ are bounded by a positive scalar $B$ , i.e., $\max_{i,j} |\mathbf{X}[i,j]| \leq B$ .
+
+**Theorem 1.** Consider a graph $\mathcal{G} = \{\mathcal{V}, \mathcal{E}, \mathbf{X}\}$ following Assumptions (1)-(3). For clean node $v_i \in \mathcal{V}$ and its neighbors $\mathcal{N}(i)$ , the expectation of the pre-activation output of a single operation defined in Eq. 3 is given by $\mathbb{E}[\mathbf{h}_i]$ . Then the expectation of the pre-activation output of a single operation defined in Eq. 3 after random edge dropping is given by $\mathbb{E}[\mathbf{h}_i^k] = \mathbb{E}[\mathbf{h}_i]$ .
+
+The proof is in Appendix D.1. Theorem 1 shows that, in expectation, the output embedding of a node remains unchanged before and after random edge dropping when applying the layer operation defined in Eq. 3, regardless of the drop ratio. However, in practice, conducting numerous experiments is not feasible. Thus, we analyze the distance between the observed node embeddings after random edge dropping and the expectation of node embeddings without perturbation.
+
+**Theorem 2.** Consider a graph $\mathcal{G} = \{\mathcal{V}, \mathcal{E}, \mathbf{X}\}$ following Assumptions (1)-(3). Let $\mathbf{h}_i$ and $\mathbf{h}_i^k$ denote the clean node embedding before and after the $k$ -th random edge dropping, respectively, and
+
+{5}------------------------------------------------
+
+$\deg(i)_k$ represent the corresponding degree of node $v_i$ . The probability that the distance between the observation $\mathbf{h}_i^k$ and the expectation of $\mathbf{h}_i$ is larger than $t$ is bounded by:
+
+$$\mathbb{P} \left( \left\| \mathbf{h}_i^k - \mathbb{E}[\mathbf{h}_i] \right\|_2 \geq t \right) \leq 2 \cdot M \cdot \exp \left( - \frac{\deg(i)_k t^2}{2\rho^2(\mathbf{W})B^2M} \right), \quad (4)$$
+
+where $M$ denotes the feature dimension and $\rho^2(\mathbf{W})$ denotes the largest singular value of $\mathbf{W}$ .
+
+The proof is in Appendix D.2. Theorem 2 shows that the distance between the observed node embeddings after random edge dropping and the expectation of node embeddings without perturbation is small with a high probability. Furthermore, nodes with higher degrees are more likely to exhibit less variation in their embeddings. This highlights the effectiveness of our method of random edge dropping, particularly in dense graphs, compared to the method that drops each edge individually.
+
+Based on the above analysis, we theoretically demonstrate that our method, which involves random edge dropping and obtaining node representations through graph convolution as defined in Eq. 3, results in small changes to node representations. Thus, for **clean nodes**, this stability ensures that the prediction output is consistent as the backdoored model does not exhibit sensitivity towards any particular clean neighbors. However, for **poisoned target nodes**, the scenario differs. Despite the stability in their node representations after random edge dropping, the last-layer classifier's sensitivity (Chen et al., 2018) to the presence or absence of the backdoor trigger leads to a significant variance in prediction outcomes compared to clean nodes. This is verified in Sec. 3.2.
+
+Next, we analyze the expected number of times the backdoor trigger $g_i$ can be removed from the neighbor of a poisoned node $v_i$ after $K$ iterations of random edge dropping. This also indicates the expected number of times the poisoned node $v_i$ demonstrates a larger prediction variance.
+
+**Theorem 3.** *Without loss of generality, we consider the case where there is only one edge connecting a backdoor trigger to a target node. Let $\beta$ denote the random edge dropping ratio, and $K$ be the total number of iterations for random edge dropping and conducting inference on the perturbed graph. For a poisoned node $v_i$ and a trigger $g_i$ , the expected number of times the poisoned node $v_i$ demonstrates large prediction variance is given as $\mathbb{E}(g_i)_d = K \cdot \beta$ .*
+
+Theorem 3 demonstrates that this expected number grows fast with a certain drop ratio. Since Theorem 1 indicates that, in expectation, the output embedding of a clean node remains unchanged before and after perturbation, regardless of the drop ratio, we can use a high drop ratio, e.g. $\beta = 0.5$ , to achieve a fast increase in the expected number of times the poisoned node $v_i$ demonstrates large prediction variance. Our experimental results in Section 5.4 show that with $\beta = 0.5$ , even a small value of $K$ , e.g. $K = 5$ , can already identify most of the poisoned target nodes from the clean ones.
+
+To empirically verify that our method of random edge dropping can efficiently distinguish poisoned nodes from clean nodes, we adopt the attack method DPGBA and conduct experiments on Cora and OGB-arxiv to show the prediction variance of poisoned nodes and clean nodes after random edge dropping. The details of the experiment settings and the results are in Appendix E. From the results, we observe that: **(i)** Our method consistently results in higher prediction variance for poisoned nodes, enabling the distinction between poisoned and clean nodes. **(ii)** Even when two edges link a backdoor trigger to a poisoned node, our method maintains high prediction variance for most poisoned nodes. This showcases the superior performance of our method compared to the intuitive approach of dropping each edge individually. Furthermore, the time complexity of our method scales linearly with $K$ , which is typically small, whereas the intuitive method scales exponentially with $d^L$ , leading to significantly higher computational costs as $d$ increases. We also compare the prediction variance of low-degree nodes from both homophilic and heterophilic graphs against poisoned nodes in Appendix F.
+
+**Identify Target Nodes and Target Class.** Next, we give details of how we determine the target class $y_t$ and identify the candidate poisoned target node set $\mathcal{V}_s$ . Given $s(i)$ as the prediction variance for each node $v_i \in \mathcal{V}_T$ with label $y_i$ , we sort nodes by $s(i)$ in descending order and form the set $\mathcal{D}' = \{(s_{\sigma(1)}, y_{\sigma(1)}), (s_{\sigma(2)}, y_{\sigma(2)}), \dots, (s_{\sigma(n)}, y_{\sigma(n)})\}$ , where $\sigma$ is a permutation of $\{1, 2, \dots, n\}$ such that the sorted values satisfy $s_{\sigma}(1) > s_{\sigma}(2) > \dots > s_{\sigma}(n)$ . Then we determine the target class as the label of the node with the largest prediction variance, i.e., $y_t = y_{\sigma(1)}$ . Let $j$ be the index of the first entry in $\mathcal{D}'$ such that $y_{\sigma(j)} \neq y_t$ and $y_{\sigma(j+1)} \neq y_t$ . The threshold of prediction variance to select candidate poisoned target nodes is defined as:
+
+$$\tau = s_{\sigma(j)} \quad \text{where} \quad j = \min \{k \mid y_{\sigma(k)} \neq y_t \text{ and } y_{\sigma(k+1)} \neq y_t, k = 1, 2, 3, \dots, n\}. \quad (5)$$
+
+{6}------------------------------------------------
+
+Then, we select nodes with prediction variance larger than the threshold $\tau$ as candidates for poisoned target nodes, denoted as $\mathcal{V}_s$ .
+
+### 4.2 BACKDOOR ROBUST GNN MODEL TRAINING
+
+Though random edge dropping can help identify the most poisoned target nodes, there are still some concerns. *First*, a small amount of poisoned target nodes might exhibit prediction variances similar to those of clean nodes, inevitably remaining within the graph. *Second*, as discussed in Section 3.2, merely eliminating backdoor triggers from the training set is insufficient to defend against backdoor triggers that mimic the neighbor distribution of nodes from the target class.
+
+An intuitive solution is to train a trigger detector capable of distinguishing clean nodes and backdoor triggers. Then, during inference on an unseen graph $\mathcal{G}_U$ , the trigger detector is adopted to remove potential triggers. However, when the trigger is a subgraph, multiple nodes, and their interactions need to be considered simultaneously during training, complicating the process of training the trigger detector. Additionally, each time we are given an unseen graph, we need to run the trigger generator to perform inference on the entire graph first, increasing the computational cost.
+
+Thus, in our RIGBD, we propose directly training a backdoor robust GNN node classifier $f$ on the training dataset $\mathcal{V}_L$ by minimizing its prediction confidence on the target class $y_t$ for poisoned nodes, thereby encouraging the model to counteract the impact of the backdoor triggers and be robust against backdoor attack. Specifically, given the selected poisoned target nodes $\mathcal{V}_s \in \mathcal{V}_T$ , the objective function to train a backdoor robust GNN node classifier $f$ is:
+
+$$\min_f \mathcal{L}_f = \sum_{v_i \in \mathcal{V}_s} \log f(v_i)_{y_t} + \sum_{v_j \in \mathcal{V}_L \setminus \mathcal{V}_s} \mathcal{L}(f(v_j), y_j), \quad (6)$$
+
+where $f(v_i)_{y_t}$ denotes the prediction confidence of $f$ for $v_i$ on target class $y_t$ and $\mathcal{L}(f(v_j), y_j)$ is the cross entropy loss. The resulting classifier is robust against triggers as (i) We explicitly countermeasure the detected backdoors, making our model robust to backdoor. Though there might be target nodes not detected, they generally have smaller prediction variance, meaning that they have less impact on the training of $f$ . As these triggers more or less have patterns similar to the detected ones, our training strategy implicitly mitigates their effects. (ii) For triggers that mimic the neighbor distribution of nodes from the target class, our model $f$ is encouraged to explore the subtle differences between clean nodes from the target class and poisoned target nodes, thereby ensuring its clean accuracy. The training algorithm is in Appendix G.
+
+## 5 EXPERIMENTS
+
+In this section, we conduct experiments to answer the following research questions: **(Q1)** How effective is RIGBD in defending against graph backdoor attacks? **(Q2)** How is the performance of RIGBD in detecting poisoned nodes? **(Q3)** How do different drop ratios and different numbers of iterations of random edge dropping impact the performance of RIGBD?
+
+### 5.1 EXPERIMENTAL SETUP
+
+**Datasets.** We conduct experiments on three benchmark datasets widely used for node classification, i.e., Cora, Citeseer, Pubmed (Sen et al., 2008), Physics (Sinha et al., 2015), Flickr (Zeng et al., 2019) and OGB-arxiv (Hu et al., 2020). More details of the datasets are summarized in Appendix H.1.
+
+**Attack Methods.** To demonstrate the defense ability of our RIGBD, we evaluate RIGBD on 3 state-of-the-art graph backdoor attack methods, i.e., GTA (Xi et al., 2021), UGBA (Dai et al., 2023) and DPGBA (Zhang et al., 2024). The details of these attacks are given in Appendix H.2.
+
+**Compared Methods.** We implement the backdoor defense strategies Prune (Dai et al., 2023) and OD (Zhang et al., 2024). Additionally, three representative robust GNNs, i.e. RobustGCN (Zhu et al., 2019), GNNGuard (Zhang & Zitnik, 2020) and randomized smoothing (RS) (Wang et al., 2021) with various drop ratios are also selected. We also include ABL (Li et al., 2021a), which is a popular backdoor defense method in the image domain and aims to train clean models given backdoor-poisoned data. More details of these defense methods are given in Appendix H.3.
+
+**Evaluation Protocol.** Following existing representative graph backdoor attacks (Dai et al., 2023; Zhang et al., 2024), we split the graph into two disjoint subgraphs, $\mathcal{G}_T$ and $\mathcal{G}_U$ , with an 80 : 20 ratio.
+
+{7}------------------------------------------------
+
+Table 2: Results of backdoor defense.
+
+| Attacks | Defense | Cora | | Citeseer | | PubMed | | Physics | | Flickr | | OGB-arxiv | |
+|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
+| | | ASR(%)↓ | ACC(%)↑ | ASR(%)↓ | ACC(%)↑ | ASR(%)↓ | ACC(%)↑ | ASR(%)↓ | ACC(%)↑ | ASR(%)↓ | ACC(%)↑ | ASR(%)↓ | ACC(%)↑ |
+| GTA | GCN | 98.98 | 82.58 | 100.00 | 73.70 | 93.09 | 85.18 | 96.42 | 89.30 | 88.45 | 41.23 | 75.34 | 65.76 |
+| | GCNGuard | 40.22 | 78.52 | 55.23 | 63.55 | 26.93 | 81.68 | 43.87 | 78.72 | 0.00 | 40.40 | 0.04 | 62.58 |
+| | RobustGCN | 90.46 | 80.37 | 95.31 | 73.79 | 93.12 | 81.68 | 95.47 | 94.84 | 85.42 | 42.26 | 70.95 | 56.08 |
+| | Prune | 17.63 | 83.06 | 12.24 | 72.46 | 28.10 | 85.05 | 8.34 | 88.45 | 12.56 | 41.27 | 0.01 | 63.97 |
+| | OD | 0.04 | 83.47 | 0.04 | 72.84 | 0.03 | 85.27 | 0.12 | 90.24 | 2.12 | 41.42 | 0.01 | 65.23 |
+| | RS | 53.14 | 73.33 | 52.86 | 65.66 | 42.28 | 84.58 | 57.70 | 92.52 | 52.85 | 42.31 | 42.72 | 58.48 |
+| | ABL | 19.93 | 81.85 | 13.09 | 73.19 | 16.18 | 83.92 | 16.82 | 92.06 | 17.54 | 41.46 | 11.28 | 64.24 |
+| | RIGBD | 0.00 | 83.70 | 0.34 | 74.10 | 0.01 | 84.32 | 0.32 | 95.10 | 0.00 | 44.21 | 0.01 | 66.51 |
+| UGBA | GCN | 98.76 | 83.42 | 100.00 | 74.70 | 96.42 | 84.64 | 100.00 | 95.94 | 93.14 | 44.71 | 98.82 | 63.95 |
+| | GCNGuard | 43.17 | 78.15 | 94.53 | 64.76 | 98.97 | 81.48 | 95.26 | 87.54 | 96.93 | 42.15 | 95.21 | 56.61 |
+| | RobustGCN | 97.67 | 80.00 | 71.69 | 69.90 | 92.85 | 82.85 | 99.04 | 92.17 | 90.35 | 56.18 | 90.35 | 56.18 |
+| | Prune | 98.89 | 82.66 | 97.68 | 74.35 | 92.87 | 85.09 | 94.67 | 93.87 | 91.43 | 43.65 | 93.07 | 62.58 |
+| | OD | 0.03 | 83.65 | 0.06 | 73.80 | 0.01 | 85.19 | 0.02 | 95.36 | 0.15 | 43.57 | 0.01 | 65.35 |
+| | RS | 54.24 | 70.37 | 50.34 | 69.88 | 44.41 | 84.68 | 47.77 | 94.29 | 20.69 | 42.18 | 40.30 | 58.76 |
+| | ABL | 15.13 | 81.48 | 12.08 | 73.19 | 28.60 | 84.37 | 14.87 | 94.69 | 15.32 | 41.66 | 34.26 | 64.93 |
+| | RIGBD | 0.01 | 84.81 | 0.00 | 73.80 | 0.01 | 85.13 | 0.12 | 95.71 | 0.00 | 43.66 | 0.01 | 65.21 |
+| DPGBA | GCN | 97.72 | 83.34 | 100.00 | 74.09 | 98.63 | 85.22 | 100.00 | 95.59 | 90.79 | 44.87 | 95.63 | 65.72 |
+| | GCNGuard | 85.61 | 78.52 | 46.98 | 60.84 | 44.12 | 80.82 | 88.72 | 88.76 | 95.85 | 43.52 | 94.66 | 62.29 |
+| | RobustGCN | 96.68 | 81.11 | 91.64 | 71.08 | 94.88 | 82.54 | 91.25 | 94.87 | 24.60 | 41.69 | 90.09 | 60.38 |
+| | Prune | 91.82 | 85.28 | 94.80 | 73.21 | 88.64 | 85.13 | 94.27 | 94.73 | 88.96 | 44.75 | 90.47 | 65.53 |
+| | OD | 94.33 | 83.58 | 98.42 | 73.66 | 91.32 | 85.12 | 98.72 | 95.48 | 90.42 | 43.63 | 93.30 | 65.47 |
+| | RS | 51.29 | 69.63 | 50.34 | 71.08 | 45.43 | 85.40 | 48.19 | 95.30 | 27.94 | 42.21 | 41.18 | 58.44 |
+| | ABL | 86.72 | 79.26 | 11.41 | 73.49 | 48.58 | 79.45 | 11.74 | 95.30 | 30.42 | 41.71 | 52.56 | 63.88 |
+| | RIGBD | 0.01 | 85.19 | 0.33 | 73.79 | 0.03 | 84.56 | 0.21 | 95.79 | 0.00 | 43.78 | 0.00 | 65.24 |
+
+The graph $\mathcal{G}_T$ is used to train the attacker. Then, the attacker selects target nodes $\mathcal{V}_B$ and attaches triggers to these target nodes to form the backdoored graph $\mathcal{G}_T$ . The number of triggers $|\mathcal{V}_B|$ is set as 40, 80, 160, 160, 160 and 565 for Cora, Citeseer, PubMed, Physics, Flickr, and OGB-arxiv, respectively. The trigger size is limited to three nodes in all experiments. The defender trains a model on poisoned graph $\mathcal{G}_T$ . Next, half of the nodes in $\mathcal{G}_U$ are selected as poisoned nodes and are attached with backdoor triggers to test the attack success rate (ASR). The remaining nodes in $\mathcal{G}_U$ are kept clean and used to test the clean accuracy (ACC). We also report the Recall and Precision of our method in identifying poisoned nodes. Recall is defined as the percentage of poisoned nodes among the candidate nodes identified, relative to all poisoned nodes. Precision is defined as the percentage of poisoned nodes among the candidate nodes identified. Our RIGBD deploys a 2-layer GCN as the model architecture. Each experiment is conducted 5 times and the average results are reported.
+
+### 5.2 PERFORMANCE OF DEFENSE
+
+To answer **Q1**, we compare RIGBD with the baseline defense methods across three datasets. The number of iterations for random edge dropping is set to $K = 20$ , with a drop ratio of $\beta = 0.5$ . We report ASR and ACC in Table 2. From the table, we observe: **(i)** Across all datasets and attack methods, RIGBD consistently achieves the lowest ASR score, typically close to 0%. Although defense methods such as Prune and OD perform well against GTA and UGBA attacks, they fail to defend against DPGBA, which generates in-distribution triggers. This indicates that RIGBD is highly effective in defending against various types of backdoor triggers and backdoor attacks. **(ii)** Our RIGBD achieves comparable or slightly better clean accuracy compared to the vanilla GCN. This indicates that our approach of random edge dropping typically leads to higher prediction variance for poisoned nodes, effectively identifying backdoor triggers. In cooperation with this precise identification of poisoned nodes, our strategy to train a backdoor robust model using Eq. 6 can significantly reduce the ASR while maintaining clean accuracy. Additional results on RS with varying drop ratios and RIGBD using different GNN architectures can be found in Appendix J.
+
+### 5.3 ABILITY TO DETECT POISONED NODES
+
+To answer **Q2**, we present the recall and precision of RIGBD in identifying poisoned nodes. Using the same setting as in Sec. 5.2, the results on OGB-arxiv are shown in Table 3. We also include
+
+Table 3: Results for the ability to detect poisoned nodes.
+
+| Attacks | Clean ACC | ASR | ACC | Recall | Precision |
+|-|-|-|-|-|-|
+| GTA | 65.8 | 0.01 | 66.51 | 84.9 | 90.3 |
+| UGBA | 65.8 | 0.01 | 65.21 | 95.6 | 96.3 |
+| DPGBA | 65.8 | 0.00 | 65.24 | 90.5 | 93.9 |
+
+the corresponding ASR and ACC to illustrate the correlation between detection ability and defense performance. Clean accuracy (Clean ACC), obtained from a model trained on the clean graph, is provided as a reference to evaluate the model’s performance on clean nodes. From the table, we observe the following: **(i)** Our RIGBD demonstrates consistently high precision, always over 90%, in detecting poisoned nodes across three attack methods, with detection recall always exceeding 80%. This indicates that our strategy of random edge dropping typically leads to higher prediction variance
+
+{8}------------------------------------------------
+
+
+
+Figure 3 consists of four subplots. Subplots (a), (b), and (c) are heatmaps showing ASR, Recall, and Precision respectively, for different values of $K$ (2, 5, 25, 50, 100) on the x-axis and $\beta$ (0.1, 0.3, 0.5, 0.7, 0.9) on the y-axis. Subplot (d) is a bar chart comparing ASR and ACC for three methods: RIGBD (blue), RIGBDRE (orange), and RIGBDAR (green) for ASR, and RIGBD (blue), RIGBDRE (orange), and RIGBD (red) for ACC.
+
+Figure 3: Hyperparameter Sensitivity Analysis and Ablation Study. (a) Heatmap of ASR, (b) Heatmap of Recall, (c) Heatmap of Precision, (d) Bar chart comparing ASR and ACC for RIGBD, RIGBDRE, and RIGBDAR.
+
+Figure 3: Hyperparameter Sensitivity Analysis and Ablation Study.
+
+for poisoned nodes. **(ii)** Although the recall for the GTA attack method is 84.9%, we still achieve an ASR close to 0% while maintaining ACC. This verifies the stability of our strategy to train a robust node classifier using Eq. 6. Even when some poisoned nodes are not identified, it still efficiently helps the model unlearn the triggers. More results on other datasets are in Appendix L.
+
+### 5.4 HYPERPARAMETER ANALYSIS AND ABLATION STUDY
+
+**Hyperparameter Analysis.** To answer Q3, we conduct experiments to show how different drop ratios $\beta$ and different numbers of iterations of random edge dropping $K$ impact the performance of RIGBD. Specifically, we vary the value of $K$ as $\{2, 5, 25, 50, 100\}$ , and the values of $\beta$ as $\{0.1, 0.3, 0.5, 0.7, 0.9\}$ . The attack method used is DPGBA. The other settings are the same as the evaluation protocol in Sec. 5.1. The results on OGB-arxiv are shown in Fig. 3. From the figure, we observe: **(i)** Our RIGBD is stable in terms of ASR and Precision. Notably, when the drop ratio $\beta = 0.1$ and $K = 2$ , the recall of poisoned node detection is around 17.4%. However, we still achieve robust defense performance with 1.86% ASR. This is because our framework identifies the most efficient triggers that lead to large prediction variance and focuses on minimizing their impact. By doing so, the influence of less efficient triggers is inherently counteracted. In contrast, when we simply remove those 17.4% triggers from the dataset and train a normal GNN on the remaining dataset, the ASR is around 80%. **(ii)** As $K$ increases, the recall also increases, empirically verifying our theorems that the clean nodes will have stable node embeddings and predictions. As $\beta$ increases from 0.1 to 0.7, the recall also increases without a decrease in precision. When $\beta = 0.9$ , only about 10% of edges remain in each iteration. Although the recall decreases slightly, we still achieve consistently high precision. This further shows the robustness of RIGBD against various chosen hyperparameters. More results on the hyperparameter analysis for ACC are in Appendix M.
+
+**Ablation Study.** To evaluate the effectiveness of random edge dropping, we replace it with the intuitive method of dropping edges individually, as described in Section 3.2, and obtain a variant named as RIGBDRE. We then conduct experiments focusing on scenarios where a backdoor trigger (subgraph) is linked to a poisoned node by two edges. To demonstrate the effectiveness of our robust training strategy, we implement a variant of our model, named RIGBDAR, which simply removes identified candidate poisoned nodes from the dataset and trains a GNN classifier with cross-entropy. We also implement a variant called RIGBDARE, which involves individually dropping each edge and eliminating candidate poisoned nodes. The number of iterations for random edge dropping is set to $K = 20$ , with a drop ratio of $\beta = 0.5$ . The attack method used is DPGBA. The dataset is OGB-arxiv. We report the ASR and ACC in Fig. 3. From the figure, we observe: **(i)** When two edges link a backdoor trigger to a target node, the intuitive method of dropping each edge individually fails to defend against this attack. Notably, RIGBDAR achieves an ASR almost 40% lower than RIGBDARE, highlighting that our random edge dropping is more efficient than dropping edges individually in identifying poisoned nodes. **(ii)** In cooperation with a robust training strategy, our RIGBD further achieves an ASR close to 0%. This underscores the superiority of our method in defending against various types of backdoor attacks. Additional results on the ablation study for the case where one edge links a trigger and a target node can be found in Appendix N.
+
+**Impact of Various Numbers of Triggers and Trigger Sizes.** The performance and analysis of RIGBD against various attack budgets and trigger sizes are provided in Appendix O and P.
+
+## 6 CONCLUSION
+
+In this paper, we first empirically show that poisoned nodes exhibit high prediction variance with edge dropping. We then propose random edge dropping, supported by theoretical analysis, to efficiently
+
+{9}------------------------------------------------
+
+and precisely identify poisoned nodes. Additionally, we introduce a robust training strategy to develop a backdoor-robust GNN model, even if some poisoned nodes remain unidentified. Extensive experiments demonstrate that our method accurately detects poisoned nodes, significantly reduces the attack success rate, and maintains clean accuracy against various graph backdoor attacks.
+
+## ACKNOWLEDGMENT
+
+This material is based upon work supported by, or in part by the Army Research Office (ARO) under grant number W911NF-21-10198, the Department of Homeland Security (DHS) under grant number 17STCIN00001-05-00, and Cisco Faculty Research Award. The views and conclusions contained in this material are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of the funding agencies.
+
+## REFERENCES
+
+- Derrick Blakely, Jack Lanchantin, and Yanjun Qi. Time and space complexity of graph convolutional networks. *Accessed on: Dec, 31:2021*, 2021.
+- Bryant Chen, Wilka Carvalho, Nathalie Baracaldo, Heiko Ludwig, Benjamin Edwards, Taesung Lee, Ian Molloy, and Biplav Srivastava. Detecting backdoor attacks on deep neural networks by activation clustering. *arXiv preprint arXiv:1811.03728*, 2018.
+- Huili Chen, Cheng Fu, Jishen Zhao, and Farinaz Koushanfar. Profip: Targeted trojan attack with progressive bit flips. In *Proceedings of the IEEE/CVF International Conference on Computer Vision*, pp. 7718–7727, 2021.
+- Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted backdoor attacks on deep learning systems using data poisoning. *arXiv preprint arXiv:1712.05526*, 2017.
+- Enyan Dai, Wei Jin, Hui Liu, and Suhang Wang. Towards robust graph neural networks for noisy graphs with sparse labels. In *Proceedings of the fifteenth ACM international conference on web search and data mining*, pp. 181–191, 2022a.
+- Enyan Dai, Shijie Zhou, Zhimeng Guo, and Suhang Wang. Label-wise graph convolutional network for heterophilic graphs. In *Learning on Graphs Conference*, pp. 26–1. PMLR, 2022b.
+- Enyan Dai, Minhua Lin, Xiang Zhang, and Suhang Wang. Unnoticeable backdoor attacks on graph neural networks. In *Proceedings of the ACM Web Conference 2023, WWW '23*. ACM, April 2023. doi: 10.1145/3543507.3583392. URL .
+- Enyan Dai, Tianxiang Zhao, Huais heng Zhu, Junjie Xu, Zhimeng Guo, Hui Liu, Jiliang Tang, and Suhang Wang. A comprehensive survey on trustworthy graph neural networks: Privacy, robustness, fairness, and explainability. *Machine Intelligence Research*, 21(6):1011–1061, 2024.
+- Khoa Doan, Yingjie Lao, and Ping Li. Backdoor attack with imperceptible input and latent modification. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan (eds.), *Advances in Neural Information Processing Systems*, volume 34, pp. 18944–18957. Curran Associates, Inc., 2021. URL [https://proceedings.neurips.cc/paper\\_files/paper/2021/file/9d99197e2ebf03fc388d09f1e94af89b-Paper.pdf](https://proceedings.neurips.cc/paper_files/paper/2021/file/9d99197e2ebf03fc388d09f1e94af89b-Paper.pdf).
+- Wenqi Fan, Yao Ma, Qing Li, Yuan He, Eric Zhao, Jiliang Tang, and Dawei Yin. Graph neural networks for social recommendation. In *The world wide web conference*, pp. 417–426, 2019.
+- Tianyu Gu, Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Evaluating backdooring attacks on deep neural networks. *IEEE Access*, 7:47230–47244, 2019.
+- Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. *Advances in neural information processing systems*, 30, 2017.
+
+ Rest of paper (reference and Appendix) is removed.
\ No newline at end of file